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

Generated for libwpd by doxygen 1.8.11