WP5StylesListener.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) 2004 Marc Maurer (uwog@uwog.net)
12  * Copyright (C) 2006-2007 Fridrich Strba (fridrich.strba@bluewin.ch)
13  *
14  * For minor contributions see the git repository.
15  *
16  * Alternatively, the contents of this file may be used under the terms
17  * of the GNU Lesser General Public License Version 2.1 or later
18  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
19  * applicable instead of those above.
20  *
21  * For further information visit http://libwpd.sourceforge.net
22  */
23 
24 /* "This product is not manufactured, approved, or supported by
25  * Corel Corporation or Corel Corporation Limited."
26  */
27 
28 #ifndef WP5STYLESLISTENER_H
29 #define WP5STYLESLISTENER_H
30 
31 #include "WP5Listener.h"
32 #include "WPXStylesListener.h"
33 #include <vector>
34 #include <list>
35 #include "WPXPageSpan.h"
36 #include "WPXTable.h"
37 #include "WP5SubDocument.h"
38 
40 {
41 public:
42  WP5StylesListener(std::list<WPXPageSpan> &pageList, WPXTableList tableList, std::vector<WP5SubDocument *> &subDocuments);
43 
44  void startDocument() {}
45  void startSubDocument() {}
46  void setFont(const WPXString & /* fontName */, double /* fontSize */) {}
47  void setTabs(const std::vector<WPXTabStop> & /* tabStops */, uint16_t /* tabOffset */) {}
48  void insertCharacter(uint32_t /* character */)
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  virtual void insertIndent(uint8_t /* indentType */, double /* indentPosition */)
57  {
58  /*if (!isUndoOn())*/ m_currentPageHasContent = true;
59  }
60  void characterColorChange(uint8_t /* red */, uint8_t /* green */, uint8_t /* blue */) {}
61  void insertEOL()
62  {
63  /*if (!isUndoOn())*/ m_currentPageHasContent = true;
64  }
65  void insertBreak(uint8_t breakType);
66  void attributeChange(bool /* isOn */, uint8_t /* attribute */) {}
67  void lineSpacingChange(double /* lineSpacing */) {}
68  void justificationChange(uint8_t /* justification */) {}
69  void pageMarginChange(uint8_t side, uint16_t margin);
70  void pageFormChange(uint16_t length, uint16_t width, WPXFormOrientation orientation);
71  void marginChange(uint8_t side, uint16_t margin);
72  void endDocument();
73  void endSubDocument();
74 
75  void defineTable(uint8_t /* position */, uint16_t /* leftOffset */) {}
76  void addTableColumnDefinition(uint32_t /* width */, uint32_t /* leftGutter */, uint32_t /* rightGutter */,
77  uint32_t /* attributes */, uint8_t /* alignment */) {}
78  void startTable();
79  void insertRow(uint16_t rowHeight, bool isMinimumHeight, bool isHeaderRow);
80  void insertCell(uint8_t colSpan, uint8_t rowSpan, uint8_t borderBits,
81  const RGBSColor *cellFgColor, const RGBSColor *cellBgColor,
82  const RGBSColor *cellBorderColor, WPXVerticalAlignment cellVerticalAlignment,
83  bool useCellAttributes, uint32_t cellAttributes);
84  void endTable() {}
85 
86  void insertNoteReference(const WPXString & /* noteReference */) {}
87  void insertNote(WPXNoteType /* noteType */, const WP5SubDocument * /* subDocument */) {}
88  void headerFooterGroup(uint8_t headerFooterType, uint8_t occurenceBits, WP5SubDocument *subDocument);
89  void suppressPageCharacteristics(uint8_t suppressCode);
90 
91  void boxOn(uint8_t /* positionAndType */, uint8_t /* alignment */, uint16_t /* width */, uint16_t /* height */, uint16_t /* x */, uint16_t /* y */) {}
92  virtual void boxOff() {}
93  virtual void insertGraphicsData(const WPXBinaryData * /* data */) {}
94 
95 protected:
96  void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, int nextTableIndice = 0);
97 
98 private:
102 
108  std::vector<WP5SubDocument *> &m_subDocuments;
109  std::list<WPXPageSpan>::iterator m_pageListHardPageMark;
110 };
111 
112 #endif /* WP5STYLESLISTENER_H */
113 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */

Generated for libwpd by doxygen 1.8.3.1