WP6StylesListener.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* libwpd
3  * Version: MPL 2.0 / LGPLv2.1+
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * Major Contributor(s):
10  * Copyright (C) 2003 William Lachance (wrlach@gmail.com)
11  * Copyright (C) 2003 Marc Maurer (uwog@uwog.net)
12  *
13  * For minor contributions see the git repository.
14  *
15  * Alternatively, the contents of this file may be used under the terms
16  * of the GNU Lesser General Public License Version 2.1 or later
17  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
18  * applicable instead of those above.
19  *
20  * For further information visit http://libwpd.sourceforge.net
21  */
22 
23 /* "This product is not manufactured, approved, or supported by
24  * Corel Corporation or Corel Corporation Limited."
25  */
26 
27 // WP6StylesListener: creates an intermediate table representation, given a
28 // sequence of messages passed to it by the parser.
29 
30 #ifndef WP6STYLESLISTENER_H
31 #define WP6STYLESLISTENER_H
32 
33 #include "WP6Listener.h"
34 #include "WPXStylesListener.h"
35 #include <vector>
36 #include <set>
37 #include <list>
38 #include "WPXPageSpan.h"
39 #include "WPXTable.h"
40 
41 class WPXSubDocument;
42 
44 {
45 public:
46  WP6StylesListener(std::list<WPXPageSpan> &pageList, WPXTableList tableList);
47 
48  void setDate(const unsigned short /* type */, const unsigned short /* year */,
49  const unsigned char /* month */, const unsigned char /* day */,
50  const unsigned char /* hour */, const unsigned char /* minute */,
51  const unsigned char /* second */, const unsigned char /* dayOfWeek */,
52  const unsigned char /* timeZone */, const unsigned char /* unused */) {}
53  void setExtendedInformation(const unsigned short /* type */, const librevenge::RVNGString & /*data*/) {}
54  void startDocument() {}
55  void startSubDocument() {}
56  void setAlignmentCharacter(const unsigned /* character */) {}
57  void setLeaderCharacter(const unsigned /* character */, const unsigned char /* numberOfSpaces */) {}
58  void defineTabStops(const bool /* isRelative */, const std::vector<WPXTabStop> & /* tabStops */,
59  const std::vector<bool> & /* usePreWP9LeaderMethods */) {}
60  void insertCharacter(unsigned /* character */)
61  {
62  if (!isUndoOn()) m_currentPageHasContent = true;
63  }
64  void insertTab(const unsigned char /* tabType */, double /* tabPosition */)
65  {
66  if (!isUndoOn()) m_currentPageHasContent = true;
67  }
69  {
70  if (!isUndoOn()) m_currentPageHasContent = true;
71  }
72  void insertEOL()
73  {
74  if (!isUndoOn()) m_currentPageHasContent = true;
75  }
76  void insertBreak(const unsigned char breakType);
77  void characterColorChange(const unsigned char /* red */, const unsigned char /* green */, const unsigned char /* blue */) {}
78  void characterShadingChange(const unsigned char /* shading */) {}
79  void highlightChange(const bool /* isOn */, const RGBSColor & /* color */) {}
80  void fontChange(const unsigned short /* matchedFontPointSize */, const unsigned short /* fontPID */, const librevenge::RVNGString & /* fontName */) {}
81  void attributeChange(const bool /* isOn */, const unsigned char /* attribute */) {}
82  void lineSpacingChange(const double /* lineSpacing */) {}
83  void spacingAfterParagraphChange(const double /* spacingRelative */, const double /* spacingAbsolute */) {}
84  void justificationChange(const unsigned char /* justification */) {}
85  void pageNumberingChange(const WPXPageNumberPosition /* page numbering position */, const unsigned short /* matchedFontPointSize */, const unsigned short /* fontPID */);
86  void pageMarginChange(const unsigned char side, const unsigned short margin);
87  void pageFormChange(const unsigned short length, const unsigned short width, const WPXFormOrientation orientation);
88  void marginChange(const unsigned char side, const unsigned short margin);
89  void paragraphMarginChange(const unsigned char /* side */, const signed short /* margin */) {}
90  void indentFirstLineChange(const signed short /* offset */) {}
91  void columnChange(const WPXTextColumnType /* columnType */, const unsigned char /* numColumns */,
92  const std::vector<double> & /* columnWidth */, const std::vector<bool> & /* isFixedWidth */) {}
93  void updateOutlineDefinition(const unsigned short /* outlineHash */, const unsigned char * /* numberingMethods */, const unsigned char /* tabBehaviourFlag */) {}
94 
95  void paragraphNumberOn(const unsigned short /* outlineHash */, const unsigned char /* level */, const unsigned char /* flag */) {}
97  {
98  if (!isUndoOn()) m_currentPageHasContent = true;
99  }
100  void displayNumberReferenceGroupOn(const unsigned char /* subGroup */, const unsigned char /* level */) {}
101  void displayNumberReferenceGroupOff(const unsigned char /* subGroup */)
102  {
103  if (!isUndoOn()) m_currentPageHasContent = true;
104  }
105  void styleGroupOn(const unsigned char /* subGroup */) {}
106  void styleGroupOff(const unsigned char /* subGroup */) {}
107  void globalOn(const unsigned char /* systemStyle */) {}
108  void globalOff() {}
109  void noteOn(const unsigned short textPID);
110  void noteOff(const WPXNoteType /* noteType */) {}
111  void headerFooterGroup(const unsigned char headerFooterType, const unsigned char occurrenceBits, const unsigned short textPID);
112  void suppressPageCharacteristics(const unsigned char suppressCode);
113  void setPageNumber(const unsigned short pageNumber);
114  void setPageNumberingType(const WPXNumberingType pageNumberingType);
115 
116  void endDocument();
117  void endSubDocument();
118 
119  void defineTable(const unsigned char position, const unsigned short leftOffset);
120  void addTableColumnDefinition(const unsigned /* width */, const unsigned /* leftGutter */, const unsigned /* rightGutter */,
121  const unsigned /* attributes */, const unsigned char /* alignment */) {}
122  void startTable();
123  void insertRow(const unsigned short rowHeight, const bool isMinimumHeight, const bool isHeaderRow);
124  void insertCell(const unsigned char colSpan, const unsigned char rowSpan, const unsigned char borderBits,
125  const RGBSColor *cellFgColor, const RGBSColor *cellBgColor,
126  const RGBSColor *cellBorderColor, const WPXVerticalAlignment cellVerticalAlignment,
127  const bool useCellAttributes, const unsigned cellAttributes);
128  void endTable();
129  void boxOn(const unsigned char /* anchoringType */, const unsigned char /* generalPositioningFlags */, const unsigned char /* horizontalPositioningFlags */,
130  const signed short /* horizontalOffset */, const unsigned char /* leftColumn */, const unsigned char /* rightColumn */,
131  const unsigned char /* verticalPositioningFlags */, const signed short /* verticalOffset */, const unsigned char /* widthFlags */,
132  const unsigned short /* width */, const unsigned char /* heightFlags */, const unsigned short /* height */, const unsigned char /* boxContentType */,
133  const unsigned short /* nativeWidth */, const unsigned short /* nativeHeight */) {}
134  void boxOff() {}
135  void insertGraphicsData(const unsigned short /* packetId */) {}
136  void insertTextBox(const WP6SubDocument *subDocument);
137  void commentAnnotation(const unsigned short textPID);
138 
139  void undoChange(const unsigned char undoType, const unsigned short undoLevel);
140 
141 protected:
142  void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, int nextTableIndice = 0);
143 
144  void _flushText() {}
145  void _changeList() {}
146 
147 private:
151 
158  std::set <const WPXSubDocument *> m_subDocuments;
159  std::list<WPXPageSpan>::iterator m_pageListHardPageMark;
160 };
161 
162 #endif /* WP6STYLESLISTENER_H */
163 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */

Generated for libwpd by doxygen 1.8.4