WP3StylesListener.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) 2004 Marc Maurer (uwog@uwog.net)
11  * Copyright (C) 2006 Fridrich Strba (fridrich.strba@bluewin.ch)
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 #ifndef WP3STYLESLISTENER_H
28 #define WP3STYLESLISTENER_H
29 
30 #include "WP3Listener.h"
31 #include "WPXStylesListener.h"
32 #include <vector>
33 #include <set>
34 #include "WPXPageSpan.h"
35 #include "WPXTable.h"
36 
38 {
39 public:
40  WP3StylesListener(std::list<WPXPageSpan> &pageList, WPXTableList tableList, std::vector<WP3SubDocument *> &subDocuments);
41 
42  void startDocument() {}
43  void startSubDocument() {}
44  void insertCharacter(uint32_t /* character */)
45  {
46  if (!isUndoOn()) m_currentPageHasContent = true;
47  }
48  void insertTab()
49  {
50  if (!isUndoOn()) m_currentPageHasContent = true;
51  }
52  void insertTab(uint8_t /* tabType */, double /* tabPosition */)
53  {
54  if (!isUndoOn()) m_currentPageHasContent = true;
55  }
56  void insertEOL()
57  {
58  if (!isUndoOn()) m_currentPageHasContent = true;
59  }
60  void insertBreak(uint8_t breakType);
61  void attributeChange(bool /* isOn */, uint8_t /* attribute */) {}
62  void lineSpacingChange(double /* lineSpacing */) {}
63  void justificationChange(uint8_t /* justification */) {}
64  void pageMarginChange(uint8_t side, uint16_t margin);
65  void pageFormChange(uint16_t length, uint16_t width, WPXFormOrientation orientation);
66  void marginChange(uint8_t side, uint16_t margin);
67  void indentFirstLineChange(double /* offset */) {}
68  void setTabs(bool /* isRelative */, const std::vector<WPXTabStop> /* tabStops */) {}
69  void columnChange(WPXTextColumnType /* columnType */, uint8_t /* numColumns */,
70  const std::vector<double> & /* columnWidth */, const std::vector<bool> & /* isFixedWidth */) {}
71  void endDocument();
72  void endSubDocument();
73 
74  void defineTable(uint8_t /* position */, uint16_t /* leftOffset */) {}
75  void addTableColumnDefinition(uint32_t /* width */, uint32_t /* leftGutter */, uint32_t /* rightGutter */,
76  uint32_t /* attributes */, uint8_t /* alignment */) {}
77  void startTable();
78  void insertRow();
79  void insertCell();
80  void closeCell() {}
81  void closeRow() {}
82  void setTableCellSpan(uint16_t /* colSpan */, uint16_t /* rowSpan */) {}
83  void setTableCellFillColor(const RGBSColor * /* cellFillColor */) {}
84  void endTable() {}
85  void undoChange(uint8_t undoType, uint16_t undoLevel);
86  void setTextColor(const RGBSColor * /* fontColor */) {}
87  void setTextFont(const WPXString & /* fontName */) {}
88  void setFontSize(uint16_t /* fontSize */) {}
89  void insertPageNumber(const WPXString & /* pageNumber */) {}
90  void insertNoteReference(const WPXString & /* noteReference */) {}
91  void insertNote(WPXNoteType /* noteType */, const WP3SubDocument * /* subDocument */)
92  {
93  if (!isUndoOn()) m_currentPageHasContent = true;
94  }
95  void headerFooterGroup(uint8_t headerFooterType, uint8_t occurenceBits, WP3SubDocument *subDocument);
96  void suppressPage(uint16_t suppressCode);
97  void backTab()
98  {
99  if (!isUndoOn()) m_currentPageHasContent = true;
100  }
101  void leftIndent() {}
102  void leftIndent(double /* offset */) {}
103  void leftRightIndent() {}
104  void leftRightIndent(double /* offset */) {}
105  void insertPicture(double /* height */, double /* width */, double /* verticalOffset */, double /* horizontalOffset */, uint8_t /* leftColumn */, uint8_t /* rightColumn */,
106  uint16_t /* figureFlags */, const WPXBinaryData & /* binaryData */) {}
107  void insertTextBox(double /* height */, double /* width */, double /* verticalOffset */, double /* horizontalOffset */, uint8_t /* leftColumn */, uint8_t /* rightColumn */,
108  uint16_t /* figureFlags */, const WP3SubDocument * /* subDocument */, const WP3SubDocument * /* caption */) {}
109  void insertWP51Table(double /* height */, double /* width */, double /* verticalOffset */, double /* horizontalOffset */, uint8_t /* leftColumn */, uint8_t /* rightColumn */,
110  uint16_t /* figureFlags */, const WP3SubDocument * /* subDocument */, const WP3SubDocument * /* caption */) {}
111 
112 protected:
113  void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, int nextTableIndice = 0);
114 
115 private:
119 
125  std::vector<WP3SubDocument *> &m_subDocuments;
126  std::list<WPXPageSpan>::iterator m_pageListHardPageMark;
127 };
128 
129 #endif /* WP3STYLESLISTENER_H */
130 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */

Generated for libwpd by doxygen 1.8.4