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(unsigned /* character */)
45  {
46  if (!isUndoOn()) m_currentPageHasContent = true;
47  }
48  void insertTab()
49  {
50  if (!isUndoOn()) m_currentPageHasContent = true;
51  }
52  void insertTab(unsigned char /* 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(unsigned char breakType);
61  void attributeChange(bool /* isOn */, unsigned char /* attribute */) {}
62  void lineSpacingChange(double /* lineSpacing */) {}
63  void justificationChange(unsigned char /* justification */) {}
64  void pageMarginChange(unsigned char side, unsigned short margin);
65  void pageFormChange(unsigned short length, unsigned short width, WPXFormOrientation orientation);
66  void marginChange(unsigned char side, unsigned short margin);
67  void indentFirstLineChange(double /* offset */) {}
68  void setTabs(bool /* isRelative */, const std::vector<WPXTabStop> /* tabStops */) {}
69  void columnChange(WPXTextColumnType /* columnType */, unsigned char /* numColumns */,
70  const std::vector<double> & /* columnWidth */, const std::vector<bool> & /* isFixedWidth */) {}
71  void endDocument();
72  void endSubDocument();
73 
74  void defineTable(unsigned char /* position */, unsigned short /* leftOffset */) {}
75  void addTableColumnDefinition(unsigned /* width */, unsigned /* leftGutter */, unsigned /* rightGutter */,
76  unsigned /* attributes */, unsigned char /* alignment */) {}
77  void startTable();
78  void closeCell() {}
79  void closeRow() {}
80  void setTableCellSpan(unsigned short /* colSpan */, unsigned short /* rowSpan */) {}
81  void setTableCellFillColor(const RGBSColor * /* cellFillColor */) {}
82  void endTable() {}
83  void undoChange(unsigned char undoType, unsigned short undoLevel);
84  void setTextColor(const RGBSColor * /* fontColor */) {}
85  void setTextFont(const librevenge::RVNGString & /* fontName */) {}
86  void setFontSize(unsigned short /* fontSize */) {}
87  void insertPageNumber(const librevenge::RVNGString & /* pageNumber */) {}
88  void insertNoteReference(const librevenge::RVNGString & /* noteReference */) {}
89  void insertNote(WPXNoteType /* noteType */, const WP3SubDocument * /* subDocument */)
90  {
91  if (!isUndoOn()) m_currentPageHasContent = true;
92  }
93  void headerFooterGroup(unsigned char headerFooterType, unsigned char occurrenceBits, WP3SubDocument *subDocument);
94  void suppressPage(unsigned short suppressCode);
95  void backTab()
96  {
97  if (!isUndoOn()) m_currentPageHasContent = true;
98  }
99  void leftIndent() {}
100  void leftIndent(double /* offset */) {}
101  void leftRightIndent() {}
102  void leftRightIndent(double /* offset */) {}
103  void insertPicture(double /* height */, double /* width */, double /* verticalOffset */, double /* horizontalOffset */, unsigned char /* leftColumn */, unsigned char /* rightColumn */,
104  unsigned short /* figureFlags */, const librevenge::RVNGBinaryData & /* binaryData */) {}
105  void insertTextBox(double /* height */, double /* width */, double /* verticalOffset */, double /* horizontalOffset */, unsigned char /* leftColumn */, unsigned char /* rightColumn */,
106  unsigned short /* figureFlags */, const WP3SubDocument * /* subDocument */, const WP3SubDocument * /* caption */) {}
107  void insertWP51Table(double /* height */, double /* width */, double /* verticalOffset */, double /* horizontalOffset */, unsigned char /* leftColumn */, unsigned char /* rightColumn */,
108  unsigned short /* figureFlags */, const WP3SubDocument * /* subDocument */, const WP3SubDocument * /* caption */) {}
109 
110 protected:
111  void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, int nextTableIndice = 0);
112 
113 private:
117 
123  std::vector<WP3SubDocument *> &m_subDocuments;
124  std::list<WPXPageSpan>::iterator m_pageListHardPageMark;
125 };
126 
127 #endif /* WP3STYLESLISTENER_H */
128 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */

Generated for libwpd by doxygen 1.8.4