WP5ContentListener.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  * Copyright (C) 2005-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 WP5CONTENTLISTENER_H
29 #define WP5CONTENTLISTENER_H
30 
31 #include "WP5Listener.h"
32 #include "WPXContentListener.h"
33 #include "WP5SubDocument.h"
34 #include "libwpd_internal.h"
35 #include <vector>
36 
39 {
42  WPXString m_textBuffer;
43  WPXString m_noteReference;
44 
46 
48 };
49 
51 {
52 public:
53  WP5ContentListener(std::list<WPXPageSpan> &pageList, std::vector<WP5SubDocument *> &subDocuments, WPXDocumentInterface *documentInterface);
55 
57  {
59  }
61  {
63  }
64  void setFont(const WPXString &fontName, double fontSize);
65  void setTabs(const std::vector<WPXTabStop> &tabStops, uint16_t tabOffset);
66  void insertCharacter(uint32_t character);
67  void insertTab(uint8_t tabType, double tabPosition);
68  void insertIndent(uint8_t indentType, double indentPosition);
69  void insertEOL();
70  void insertBreak(uint8_t breakType)
71  {
73  }
74  void lineSpacingChange(double lineSpacing)
75  {
77  }
78  void justificationChange(uint8_t justification)
79  {
81  }
82  void characterColorChange(uint8_t red, uint8_t green, uint8_t blue);
83  void attributeChange(bool isOn, uint8_t attribute);
84  void pageMarginChange(uint8_t /* side */, uint16_t /* margin */) {}
85  void pageFormChange(uint16_t /* length */, uint16_t /* width */, WPXFormOrientation /* orientation */) {}
86  void marginChange(uint8_t side, uint16_t margin);
87  void paragraphMarginChange(uint8_t /* side */, int16_t /* margin */) {}
88  void endDocument()
89  {
91  }
93  {
95  }
96 
97  void defineTable(uint8_t position, uint16_t leftOffset);
98  void addTableColumnDefinition(uint32_t width, uint32_t leftGutter, uint32_t rightGutter,
99  uint32_t attributes, uint8_t alignment);
100  void startTable();
101  void insertRow(uint16_t rowHeight, bool isMinimumHeight, bool isHeaderRow);
102  void insertCell(uint8_t colSpan, uint8_t rowSpan, uint8_t borderBits,
103  const RGBSColor *cellFgColor, const RGBSColor *cellBgColor,
104  const RGBSColor *cellBorderColor, WPXVerticalAlignment cellVerticalAlignment,
105  bool useCellAttributes, uint32_t cellAttributes);
106  void endTable();
107 
108  void insertNoteReference(const WPXString &noteReference);
109  void insertNote(WPXNoteType noteType, const WP5SubDocument *subDocument);
110  void headerFooterGroup(uint8_t headerFooterType, uint8_t occurenceBits, WP5SubDocument *subDocument);
111  void suppressPageCharacteristics(uint8_t /* suppressCode */) {}
112 
113  void setDefaultFont(const WPXString &fontName, double fontSize);
114 
115  void boxOn(uint8_t positionAndType, uint8_t alignment, uint16_t width, uint16_t height, uint16_t x, uint16_t y);
116  virtual void boxOff();
117  virtual void insertGraphicsData(const WPXBinaryData *data);
118 
119 protected:
120  void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, unsigned nextTableIndice = 0);
121 
122  void _flushText();
123  void _changeList() {}
124 
125 private:
129  std::vector<WP5SubDocument *> &m_subDocuments;
131  WPXString m_defaultFontName;
132 };
133 
134 #endif /* WP5CONTENTLISTENER_H */
135 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */

Generated for libwpd by doxygen 1.8.1.2