WP3ContentListener.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) 2005-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 WP3CONTENTLISTENER_H
28 #define WP3CONTENTLISTENER_H
29 
30 #include "WP3Listener.h"
31 #include "WPXContentListener.h"
32 #include "WP3SubDocument.h"
33 
35 {
38  unsigned short m_colSpan;
39  unsigned short m_rowSpan;
40  librevenge::RVNGString m_textBuffer;
42  librevenge::RVNGString m_noteReference;
43 
45 private:
48 };
49 
51 {
52 public:
53  WP3ContentListener(std::list<WPXPageSpan> &pageList, std::vector<WP3SubDocument *> &subDocuments, librevenge::RVNGTextInterface *documentInterface);
55 
57  {
59  }
61  {
63  }
64  void insertCharacter(unsigned character);
65  void insertTab();
66  void insertTab(unsigned char tabType, double tabPosition);
67  void insertBreak(unsigned char breakType)
68  {
70  }
71  void insertEOL();
72  void attributeChange(bool isOn, unsigned char attribute);
73  void lineSpacingChange(double lineSpacing)
74  {
76  }
77  void pageMarginChange(unsigned char /* side */, unsigned short /* margin */) {}
78  void pageFormChange(unsigned short /* length */, unsigned short /* width */, WPXFormOrientation /* orientation */) {}
79  void marginChange(unsigned char side, unsigned short margin);
80  void indentFirstLineChange(double offset);
81  void setTabs(bool isRelative, const std::vector<WPXTabStop> tabStops);
82  void columnChange(WPXTextColumnType columnType, unsigned char numColumns, const std::vector<double> &columnWidth,
83  const std::vector<bool> &isFixedWidth);
84  void endDocument()
85  {
87  }
89  {
91  }
92 
93  void defineTable(unsigned char position, unsigned short leftOffset);
94  void addTableColumnDefinition(unsigned width, unsigned leftGutter, unsigned rightGutter,
95  unsigned attributes, unsigned char alignment);
96  void startTable();
97  void insertRow();
98  void insertCell();
99  void closeCell();
100  void closeRow();
101  void setTableCellSpan(unsigned short colSpan, unsigned short rowSpan);
102  void setTableCellFillColor(const RGBSColor *cellFillColor);
103  void endTable();
104  void undoChange(unsigned char undoType, unsigned short undoLevel);
105  void justificationChange(unsigned char justification);
106  void setTextColor(const RGBSColor *fontColor);
107  void setTextFont(const librevenge::RVNGString &fontName);
108  void setFontSize(unsigned short fontSize);
109  void insertPageNumber(const librevenge::RVNGString &pageNumber);
110  void insertNoteReference(const librevenge::RVNGString &noteReference);
111  void insertNote(WPXNoteType noteType, const WP3SubDocument *subDocument);
112  void headerFooterGroup(unsigned char headerFooterType, unsigned char occurrenceBits, WP3SubDocument *subDocument);
113  void suppressPage(unsigned short /* suppressCode */) {}
114  void backTab();
115  void leftIndent();
116  void leftIndent(double offset);
117  void leftRightIndent();
118  void leftRightIndent(double offset);
119  void insertPicture(double height, double width, double verticalOffset, double horizontalOffset, unsigned char leftColumn, unsigned char rightColumn,
120  unsigned short figureFlags, const librevenge::RVNGBinaryData &binaryData);
121  void insertTextBox(double height, double width, double verticalOffset, double horizontalOffset, unsigned char leftColumn, unsigned char rightColumn,
122  unsigned short figureFlags, const WP3SubDocument *subDocument, const WP3SubDocument *caption);
123  void insertWP51Table(double height, double width, double verticalOffset, double horizontalOffset, unsigned char leftColumn, unsigned char rightColumn,
124  unsigned short figureFlags, const WP3SubDocument *subDocument, const WP3SubDocument *caption);
125 
126 protected:
127  void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, unsigned nextTableIndice = 0);
128  void _openParagraph();
129 
130  void _flushText();
131  void _changeList() {}
132 
133  void _handleFrameParameters(librevenge::RVNGPropertyList &propList, double height, double width, double verticalOffset, double horizontalOffset, unsigned char leftColumn, unsigned char rightColumn,
134  unsigned short figureFlags);
135 
136 private:
140  std::vector<WP3SubDocument *> &m_subDocuments;
141 };
142 
143 #endif /* WP3CONTENTLISTENER_H */
144 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
Definition: WP3Listener.h:37
WP3ContentParsingState()
Definition: WP3ContentListener.cpp:37
void startSubDocument()
Definition: WPXContentListener.cpp:157
void endDocument()
Definition: WPXContentListener.cpp:163
void startSubDocument()
Definition: WP3ContentListener.h:60
WPXTextColumnType
Definition: libwpd_internal.h:103
Definition: WP3ContentListener.h:34
librevenge::RVNGString m_textBuffer
Definition: WP3ContentListener.h:40
librevenge::RVNGString m_noteReference
Definition: WP3ContentListener.h:42
void insertBreak(const unsigned char breakType)
Definition: WPXContentListener.cpp:1247
void lineSpacingChange(double lineSpacing)
Definition: WP3ContentListener.h:73
WPXSubDocumentType
Definition: libwpd_internal.h:105
~WP3ContentParsingState()
Definition: WP3ContentListener.cpp:47
void endSubDocument()
Definition: WP3ContentListener.h:88
std::vector< WP3SubDocument * > & m_subDocuments
Definition: WP3ContentListener.h:140
void pageMarginChange(unsigned char, unsigned short)
Definition: WP3ContentListener.h:77
Definition: WPXContentListener.h:145
Definition: WPXTable.h:79
unsigned short m_colSpan
Definition: WP3ContentListener.h:38
void insertBreak(unsigned char breakType)
Definition: WP3ContentListener.h:67
void startDocument()
Definition: WP3ContentListener.h:56
RGBSColor * m_cellFillColor
Definition: WP3ContentListener.h:41
WPXFormOrientation
Definition: libwpd_internal.h:99
Definition: WPXSubDocument.h:34
void pageFormChange(unsigned short, unsigned short, WPXFormOrientation)
Definition: WP3ContentListener.h:78
Definition: WP3ContentListener.h:50
void endSubDocument()
Definition: WPXContentListener.cpp:184
Definition: libwpd_internal.h:160
WPXTableList m_tableList
Definition: WP3ContentListener.h:44
WP3ContentParsingState & operator=(const WP3ContentParsingState &)
unsigned short m_rowSpan
Definition: WP3ContentListener.h:39
void startDocument()
Definition: WPXContentListener.cpp:142
void _changeList()
Definition: WP3ContentListener.h:131
WP3ContentParsingState * m_parseState
Definition: WP3ContentListener.h:139
void lineSpacingChange(const double lineSpacing)
Definition: WPXContentListener.cpp:1301
Definition: WP3SubDocument.h:33
void suppressPage(unsigned short)
Definition: WP3ContentListener.h:113
void endDocument()
Definition: WP3ContentListener.h:84
WPXNoteType
Definition: libwpd_internal.h:87

Generated for libwpd by doxygen 1.8.11