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 
38 {
41  librevenge::RVNGString m_textBuffer;
42  librevenge::RVNGString m_noteReference;
43 
45 
47 };
48 
50 {
51 public:
52  WP5ContentListener(std::list<WPXPageSpan> &pageList, std::vector<WP5SubDocument *> &subDocuments, librevenge::RVNGTextInterface *documentInterface);
54 
56  {
58  }
60  {
62  }
63  void setFont(const librevenge::RVNGString &fontName, double fontSize);
64  void setTabs(const std::vector<WPXTabStop> &tabStops, unsigned short tabOffset);
65  void insertCharacter(unsigned character);
66  void insertTab(unsigned char tabType, double tabPosition);
67  void insertIndent(unsigned char indentType, double indentPosition);
68  void insertEOL();
69  void insertBreak(unsigned char breakType)
70  {
72  }
73  void lineSpacingChange(double lineSpacing)
74  {
76  }
77  void justificationChange(unsigned char justification)
78  {
80  }
81  void characterColorChange(unsigned char red, unsigned char green, unsigned char blue);
82  void attributeChange(bool isOn, unsigned char attribute);
83  void pageMarginChange(unsigned char /* side */, unsigned short /* margin */) {}
84  void pageFormChange(unsigned short /* length */, unsigned short /* width */, WPXFormOrientation /* orientation */) {}
85  void marginChange(unsigned char side, unsigned short margin);
86  void paragraphMarginChange(unsigned char /* side */, signed short /* margin */) {}
87  void endDocument()
88  {
90  }
92  {
94  }
95 
96  void defineTable(unsigned char position, unsigned short leftOffset);
97  void addTableColumnDefinition(unsigned width, unsigned leftGutter, unsigned rightGutter,
98  unsigned attributes, unsigned char alignment);
99  void startTable();
100  void insertRow(unsigned short rowHeight, bool isMinimumHeight, bool isHeaderRow);
101  void insertCell(unsigned char colSpan, unsigned char rowSpan, unsigned char borderBits,
102  const RGBSColor *cellFgColor, const RGBSColor *cellBgColor,
103  const RGBSColor *cellBorderColor, WPXVerticalAlignment cellVerticalAlignment,
104  bool useCellAttributes, unsigned cellAttributes);
105  void endTable();
106 
107  void insertNoteReference(const librevenge::RVNGString &noteReference);
108  void insertNote(WPXNoteType noteType, const WP5SubDocument *subDocument);
109  void headerFooterGroup(unsigned char headerFooterType, unsigned char occurrenceBits, WP5SubDocument *subDocument);
110  void suppressPageCharacteristics(unsigned char /* suppressCode */) {}
111 
112  void setDefaultFont(const librevenge::RVNGString &fontName, double fontSize);
113 
114  void boxOn(unsigned char positionAndType, unsigned char alignment, unsigned short width, unsigned short height, unsigned short x, unsigned short y);
115  virtual void boxOff();
116  virtual void insertGraphicsData(const librevenge::RVNGBinaryData *data);
117 
118 protected:
119  void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, unsigned nextTableIndice = 0);
120 
121  void _flushText();
122  void _changeList() {}
123 
124 private:
126  WP5ContentListener &operator=(const WP5ContentListener &);
128  std::vector<WP5SubDocument *> &m_subDocuments;
130  librevenge::RVNGString m_defaultFontName;
131 };
132 
133 #endif /* WP5CONTENTLISTENER_H */
134 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
~WP5ContentParsingState()
Definition: WP5ContentListener.cpp:42
void endSubDocument()
Definition: WP5ContentListener.h:91
void paragraphMarginChange(unsigned char, signed short)
Definition: WP5ContentListener.h:86
Definition: WP5SubDocument.h:33
std::vector< WP5SubDocument * > & m_subDocuments
Definition: WP5ContentListener.h:128
Definition: WP5Listener.h:39
void startDocument()
Definition: WP5ContentListener.h:55
void justificationChange(const unsigned char justification)
Definition: WPXContentListener.cpp:1309
void startSubDocument()
Definition: WPXContentListener.cpp:157
void endDocument()
Definition: WPXContentListener.cpp:163
void startSubDocument()
Definition: WP5ContentListener.h:59
void insertBreak(unsigned char breakType)
Definition: WP5ContentListener.h:69
WPXTableList m_tableList
Definition: WP5ContentListener.h:44
void insertBreak(const unsigned char breakType)
Definition: WPXContentListener.cpp:1247
librevenge::RVNGString m_textBuffer
Definition: WP5ContentListener.h:41
WPXSubDocumentType
Definition: libwpd_internal.h:105
void justificationChange(unsigned char justification)
Definition: WP5ContentListener.h:77
Definition: WPXContentListener.h:145
void suppressPageCharacteristics(unsigned char)
Definition: WP5ContentListener.h:110
Definition: WPXTable.h:79
void pageFormChange(unsigned short, unsigned short, WPXFormOrientation)
Definition: WP5ContentListener.h:84
Definition: WP5ContentListener.h:37
void lineSpacingChange(double lineSpacing)
Definition: WP5ContentListener.h:73
WPXFormOrientation
Definition: libwpd_internal.h:99
WP5ContentParsingState()
Definition: WP5ContentListener.cpp:34
bool m_isFrameOpened
Definition: WP5ContentListener.h:46
Definition: WPXSubDocument.h:34
WPXVerticalAlignment
Definition: libwpd_internal.h:101
void _changeList()
Definition: WP5ContentListener.h:122
librevenge::RVNGString m_defaultFontName
Definition: WP5ContentListener.h:130
librevenge::RVNGString m_noteReference
Definition: WP5ContentListener.h:42
void endSubDocument()
Definition: WPXContentListener.cpp:184
void endDocument()
Definition: WP5ContentListener.h:87
Definition: libwpd_internal.h:160
void pageMarginChange(unsigned char, unsigned short)
Definition: WP5ContentListener.h:83
Definition: WP5ContentListener.h:49
void startDocument()
Definition: WPXContentListener.cpp:142
void lineSpacingChange(const double lineSpacing)
Definition: WPXContentListener.cpp:1301
WP5ContentParsingState * m_parseState
Definition: WP5ContentListener.h:127
double m_defaultFontSize
Definition: WP5ContentListener.h:129
WPXNoteType
Definition: libwpd_internal.h:87

Generated for libwpd by doxygen 1.8.11