WP1ContentListener.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-2006 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 WP1CONTENTLISTENER_H
29 #define WP1CONTENTLISTENER_H
30 
31 #include "WP1Listener.h"
32 #include "WPXContentListener.h"
33 
34 class WP1SubDocument;
35 
37 {
40  librevenge::RVNGString m_textBuffer;
43 private:
46 };
47 
49 {
50 public:
51  WP1ContentListener(std::list<WPXPageSpan> &pageList, std::vector<WP1SubDocument *> &subDocuments, librevenge::RVNGTextInterface *documentInterface);
53 
55  {
57  }
59  {
61  }
62  void insertCharacter(unsigned character);
63  void insertExtendedCharacter(unsigned char extendedCharacter);
64  void insertTab();
65  void insertBreak(unsigned char breakType)
66  {
68  }
69  void insertEOL();
70  void insertNote(WPXNoteType noteType, WP1SubDocument *subDocument);
71  void attributeChange(bool isOn, unsigned char attribute);
72  void fontPointSize(unsigned char pointSize);
73  void fontId(unsigned short id);
74  void marginReset(unsigned short leftMargin, unsigned short rightMargin);
75  void topMarginSet(unsigned short /* topMargin */) {}
76  void bottomMarginSet(unsigned short /* bottomMargin */) {}
77  void leftIndent(unsigned short leftMarginOffset);
78  void leftRightIndent(unsigned short leftRightMarginOffset);
79  void leftMarginRelease(unsigned short release);
80  void setTabs(const std::vector<WPXTabStop> &tabStops);
81  void headerFooterGroup(unsigned char headerFooterDefinition, WP1SubDocument *subDocument);
82  void suppressPageCharacteristics(unsigned char /* suppressCode */) {}
83  void justificationChange(unsigned char justification);
84  void lineSpacingChange(unsigned char spacing)
85  {
86  WPXContentListener::lineSpacingChange((double)((double)spacing/2.0));
87  }
88  void flushRightOn();
89  void flushRightOff() {}
90  void centerOn();
91  void centerOff() {}
92  void endDocument()
93  {
95  }
97  {
99  }
100  void insertPicture(unsigned short width, unsigned short height, const librevenge::RVNGBinaryData &binaryData);
101 
102 protected:
104  void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, unsigned nextTableIndice = 0);
105 
106  void _flushText();
107  void _changeList() {}
108 
109 private:
111  std::vector<WP1SubDocument *> &m_subDocuments;
114 };
115 
116 #endif /* WP1LISTENER_H */
117 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
void endSubDocument()
Definition: WP1ContentListener.h:96
void startSubDocument()
Definition: WP1ContentListener.h:58
void startDocument()
Definition: WP1ContentListener.h:54
Definition: WP1Listener.h:37
void insertBreak(unsigned char breakType)
Definition: WP1ContentListener.h:65
Definition: WP1ContentListener.h:36
int m_endNoteNumber
Definition: WP1ContentListener.h:42
WP1ContentParsingState()
Definition: WP1ContentListener.cpp:35
void startSubDocument()
Definition: WPXContentListener.cpp:157
void endDocument()
Definition: WPXContentListener.cpp:163
Definition: WP1SubDocument.h:33
void insertBreak(const unsigned char breakType)
Definition: WPXContentListener.cpp:1247
void bottomMarginSet(unsigned short)
Definition: WP1ContentListener.h:76
WPXSubDocumentType
Definition: libwpd_internal.h:105
void suppressPageCharacteristics(unsigned char)
Definition: WP1ContentListener.h:82
WP1ContentParsingState * m_parseState
Definition: WP1ContentListener.h:110
Definition: WPXContentListener.h:145
Definition: WPXTable.h:79
~WP1ContentParsingState()
Definition: WP1ContentListener.cpp:43
Definition: WP1ContentListener.h:48
Definition: WPXSubDocument.h:34
WP1ContentParsingState & operator=(const WP1ContentParsingState &)
void centerOff()
Definition: WP1ContentListener.h:91
void endDocument()
Definition: WP1ContentListener.h:92
void topMarginSet(unsigned short)
Definition: WP1ContentListener.h:75
void _changeList()
Definition: WP1ContentListener.h:107
void endSubDocument()
Definition: WPXContentListener.cpp:184
int m_footNoteNumber
Definition: WP1ContentListener.h:42
std::vector< WP1SubDocument * > & m_subDocuments
Definition: WP1ContentListener.h:111
librevenge::RVNGString m_textBuffer
Definition: WP1ContentListener.h:40
int m_numDeferredTabs
Definition: WP1ContentListener.h:41
void lineSpacingChange(unsigned char spacing)
Definition: WP1ContentListener.h:84
void startDocument()
Definition: WPXContentListener.cpp:142
void lineSpacingChange(const double lineSpacing)
Definition: WPXContentListener.cpp:1301
WPXNoteType
Definition: libwpd_internal.h:87
void flushRightOff()
Definition: WP1ContentListener.h:89

Generated for libwpd by doxygen 1.8.12