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  * Copyright (C) 2003 William Lachance (wrlach@gmail.com)
4  * Copyright (C) 2003 Marc Maurer (uwog@uwog.net)
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
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 uint16_t /* type */, const uint16_t /* year */,
49  const uint8_t /* month */, const uint8_t /* day */,
50  const uint8_t /* hour */, const uint8_t /* minute */,
51  const uint8_t /* second */, const uint8_t /* dayOfWeek */,
52  const uint8_t /* timeZone */, const uint8_t /* unused */) {}
53  void setExtendedInformation(const uint16_t /* type */, const WPXString & /*data*/) {}
54  void startDocument() {}
55  void startSubDocument() {}
56  void setAlignmentCharacter(const uint16_t /* character */) {}
57  void setLeaderCharacter(const uint16_t /* character */, const uint8_t /* numberOfSpaces */) {}
58  void defineTabStops(const bool /* isRelative */, const std::vector<WPXTabStop> & /* tabStops */,
59  const std::vector<bool> & /* usePreWP9LeaderMethods */) {}
60  void insertCharacter(uint32_t /* character */)
61  {
62  if (!isUndoOn()) m_currentPageHasContent = true;
63  }
64  void insertTab(const uint8_t /* 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 uint8_t breakType);
77  void characterColorChange(const uint8_t /* red */, const uint8_t /* green */, const uint8_t /* blue */) {}
78  void characterShadingChange(const uint8_t /* shading */) {}
79  void highlightChange(const bool /* isOn */, const RGBSColor /* color */) {}
80  void fontChange(const uint16_t /* matchedFontPointSize */, const uint16_t /* fontPID */, const WPXString & /* fontName */) {}
81  void attributeChange(const bool /* isOn */, const uint8_t /* attribute */) {}
82  void lineSpacingChange(const double /* lineSpacing */) {}
83  void spacingAfterParagraphChange(const double /* spacingRelative */, const double /* spacingAbsolute */) {}
84  void justificationChange(const uint8_t /* justification */) {}
85  void pageNumberingChange(const WPXPageNumberPosition /* page numbering position */, const uint16_t /* matchedFontPointSize */, const uint16_t /* fontPID */);
86  void pageMarginChange(const uint8_t side, const uint16_t margin);
87  void pageFormChange(const uint16_t length, const uint16_t width, const WPXFormOrientation orientation);
88  void marginChange(const uint8_t side, const uint16_t margin);
89  void paragraphMarginChange(const uint8_t /* side */, const int16_t /* margin */) {}
90  void indentFirstLineChange(const int16_t /* offset */) {}
91  void columnChange(const WPXTextColumnType /* columnType */, const uint8_t /* numColumns */,
92  const std::vector<double> & /* columnWidth */, const std::vector<bool> & /* isFixedWidth */) {}
93  void updateOutlineDefinition(const WP6OutlineLocation /* outlineLocation */, const uint16_t /* outlineHash */,
94  const uint8_t * /* numberingMethods */, const uint8_t /* tabBehaviourFlag */) {}
95 
96  void paragraphNumberOn(const uint16_t /* outlineHash */, const uint8_t /* level */, const uint8_t /* flag */) {}
98  {
99  if (!isUndoOn()) m_currentPageHasContent = true;
100  }
101  void displayNumberReferenceGroupOn(const uint8_t /* subGroup */, const uint8_t /* level */) {}
102  void displayNumberReferenceGroupOff(const uint8_t /* subGroup */)
103  {
104  if (!isUndoOn()) m_currentPageHasContent = true;
105  }
106  void styleGroupOn(const uint8_t /* subGroup */) {}
107  void styleGroupOff(const uint8_t /* subGroup */) {}
108  void globalOn(const uint8_t /* systemStyle */) {}
109  void globalOff() {}
110  void noteOn(const uint16_t textPID);
111  void noteOff(const WPXNoteType /* noteType */) {}
112  void headerFooterGroup(const uint8_t headerFooterType, const uint8_t occurenceBits, const uint16_t textPID);
113  void suppressPageCharacteristics(const uint8_t suppressCode);
114  void setPageNumber(const uint16_t pageNumber);
115  void setPageNumberingType(const WPXNumberingType pageNumberingType);
116 
117  void endDocument();
118  void endSubDocument();
119 
120  void defineTable(const uint8_t position, const uint16_t leftOffset);
121  void addTableColumnDefinition(const uint32_t /* width */, const uint32_t /* leftGutter */, const uint32_t /* rightGutter */,
122  const uint32_t /* attributes */, const uint8_t /* alignment */) {}
123  void startTable();
124  void insertRow(const uint16_t rowHeight, const bool isMinimumHeight, const bool isHeaderRow);
125  void insertCell(const uint8_t colSpan, const uint8_t rowSpan, const uint8_t borderBits,
126  const RGBSColor *cellFgColor, const RGBSColor *cellBgColor,
127  const RGBSColor *cellBorderColor, const WPXVerticalAlignment cellVerticalAlignment,
128  const bool useCellAttributes, const uint32_t cellAttributes);
129  void endTable();
130  void boxOn(const uint8_t /* anchoringType */, const uint8_t /* generalPositioningFlags */, const uint8_t /* horizontalPositioningFlags */,
131  const int16_t /* horizontalOffset */, const uint8_t /* leftColumn */, const uint8_t /* rightColumn */,
132  const uint8_t /* verticalPositioningFlags */, const int16_t /* verticalOffset */, const uint8_t /* widthFlags */,
133  const uint16_t /* width */, const uint8_t /* heightFlags */, const uint16_t /* height */, const uint8_t /* boxContentType */,
134  const uint16_t /* nativeWidth */, const uint16_t /* nativeHeight */) {}
135  void boxOff() {}
136  void insertGraphicsData(const uint16_t /* packetId */) {}
137  void insertTextBox(const WP6SubDocument *subDocument);
138  void commentAnnotation(const uint16_t textPID);
139 
140  void undoChange(const uint8_t undoType, const uint16_t undoLevel);
141 
142 protected:
143  void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, int nextTableIndice = 0);
144 
145  void _flushText() {}
146  void _changeList() {}
147 
148 private:
152 
159  std::set <const WPXSubDocument *> m_subDocuments;
160  std::list<WPXPageSpan>::iterator m_pageListHardPageMark;
161 };
162 
163 #endif /* WP6STYLESLISTENER_H */
164 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */

Generated for libwpd by doxygen 1.8.3