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 <memory>
32 
33 #include "WP1Listener.h"
34 #include "WPXContentListener.h"
35 
36 class WP1SubDocument;
37 
39 {
42  librevenge::RVNGString m_textBuffer;
45 private:
48 };
49 
51 {
52 public:
53  WP1ContentListener(std::list<WPXPageSpan> &pageList, librevenge::RVNGTextInterface *documentInterface);
54  ~WP1ContentListener() override;
55 
56  void startDocument() override
57  {
59  }
60  void startSubDocument() override
61  {
63  }
64  void insertCharacter(unsigned character) override;
65  void insertExtendedCharacter(unsigned char extendedCharacter) override;
66  void insertTab() override;
67  void insertBreak(unsigned char breakType) override
68  {
70  }
71  void insertEOL() override;
72  void insertNote(WPXNoteType noteType, WP1SubDocument *subDocument) override;
73  void attributeChange(bool isOn, unsigned char attribute) override;
74  void fontPointSize(unsigned char pointSize) override;
75  void fontId(unsigned short id) override;
76  void marginReset(unsigned short leftMargin, unsigned short rightMargin) override;
77  void topMarginSet(unsigned short /* topMargin */) override {}
78  void bottomMarginSet(unsigned short /* bottomMargin */) override {}
79  void leftIndent(unsigned short leftMarginOffset) override;
80  void leftRightIndent(unsigned short leftRightMarginOffset) override;
81  void leftMarginRelease(unsigned short release) override;
82  void setTabs(const std::vector<WPXTabStop> &tabStops) override;
83  void headerFooterGroup(unsigned char headerFooterDefinition, const std::shared_ptr<WP1SubDocument> &subDocument) override;
84  void suppressPageCharacteristics(unsigned char /* suppressCode */) override {}
85  void justificationChange(unsigned char justification) override;
86  void lineSpacingChange(unsigned char spacing) override
87  {
88  WPXContentListener::lineSpacingChange((double)((double)spacing/2.0));
89  }
90  void flushRightOn() override;
91  void flushRightOff() override {}
92  void centerOn() override;
93  void centerOff() override {}
94  void endDocument() override
95  {
97  }
98  void endSubDocument() override
99  {
101  }
102  void insertPicture(unsigned short width, unsigned short height, const librevenge::RVNGBinaryData &binaryData) override;
103 
104 protected:
106  void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, unsigned nextTableIndice = 0) override;
107 
108  void _flushText() override;
109  void _changeList() override {}
110 
111 private:
112  std::unique_ptr<WP1ContentParsingState> m_parseState;
115 };
116 
117 #endif /* WP1LISTENER_H */
118 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
Definition: WP1ContentListener.h:51
void attributeChange(bool isOn, unsigned char attribute) override
Definition: WP1ContentListener.cpp:170
void justificationChange(unsigned char justification) override
Definition: WP1ContentListener.cpp:470
void flushRightOff() override
Definition: WP1ContentListener.h:91
void suppressPageCharacteristics(unsigned char) override
Definition: WP1ContentListener.h:84
void lineSpacingChange(unsigned char spacing) override
Definition: WP1ContentListener.h:86
void insertPicture(unsigned short width, unsigned short height, const librevenge::RVNGBinaryData &binaryData) override
Definition: WP1ContentListener.cpp:533
void endSubDocument() override
Definition: WP1ContentListener.h:98
void leftIndent(unsigned short leftMarginOffset) override
Definition: WP1ContentListener.cpp:411
void leftRightIndent(unsigned short leftRightMarginOffset) override
Definition: WP1ContentListener.cpp:429
void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, unsigned nextTableIndice=0) override
Definition: WP1ContentListener.cpp:555
void insertExtendedCharacter(unsigned char extendedCharacter) override
Definition: WP1ContentListener.cpp:78
void endDocument() override
Definition: WP1ContentListener.h:94
void _changeList() override
Definition: WP1ContentListener.h:109
void marginReset(unsigned short leftMargin, unsigned short rightMargin) override
Definition: WP1ContentListener.cpp:386
void insertTab() override
Definition: WP1ContentListener.cpp:95
void centerOn() override
Definition: WP1ContentListener.cpp:519
void insertCharacter(unsigned character) override
Definition: WP1ContentListener.cpp:62
WP1ContentListener(const WP1ContentListener &)
void bottomMarginSet(unsigned short) override
Definition: WP1ContentListener.h:78
void fontPointSize(unsigned char pointSize) override
Definition: WP1ContentListener.cpp:215
void insertNote(WPXNoteType noteType, WP1SubDocument *subDocument) override
Definition: WP1ContentListener.cpp:131
void flushRightOn() override
Definition: WP1ContentListener.cpp:505
std::unique_ptr< WP1ContentParsingState > m_parseState
Definition: WP1ContentListener.h:112
WP1ContentListener & operator=(WP1ContentListener &)
void startSubDocument() override
Definition: WP1ContentListener.h:60
void topMarginSet(unsigned short) override
Definition: WP1ContentListener.h:77
void setTabs(const std::vector< WPXTabStop > &tabStops) override
Definition: WP1ContentListener.cpp:496
void fontId(unsigned short id) override
Definition: WP1ContentListener.cpp:225
void insertBreak(unsigned char breakType) override
Definition: WP1ContentListener.h:67
void headerFooterGroup(unsigned char headerFooterDefinition, const std::shared_ptr< WP1SubDocument > &subDocument) override
Definition: WP1ContentListener.cpp:492
void startDocument() override
Definition: WP1ContentListener.h:56
~WP1ContentListener() override
Definition: WP1ContentListener.cpp:57
void centerOff() override
Definition: WP1ContentListener.h:93
void insertEOL() override
Definition: WP1ContentListener.cpp:113
void _flushText() override
Definition: WP1ContentListener.cpp:589
WP1ContentListener(std::list< WPXPageSpan > &pageList, librevenge::RVNGTextInterface *documentInterface)
Definition: WP1ContentListener.cpp:48
void leftMarginRelease(unsigned short release) override
Definition: WP1ContentListener.cpp:451
Definition: WP1Listener.h:39
Definition: WP1SubDocument.h:34
Definition: WPXContentListener.h:148
void lineSpacingChange(const double lineSpacing)
Definition: WPXContentListener.cpp:1297
void endSubDocument()
Definition: WPXContentListener.cpp:181
void endDocument()
Definition: WPXContentListener.cpp:160
void insertBreak(const unsigned char breakType)
Definition: WPXContentListener.cpp:1243
void startSubDocument()
Definition: WPXContentListener.cpp:154
void startDocument()
Definition: WPXContentListener.cpp:139
Definition: WPXSubDocument.h:37
Definition: WPXTableList.h:36
WPXSubDocumentType
Definition: libwpd_internal.h:111
WPXNoteType
Definition: libwpd_internal.h:93
Definition: WP1ContentListener.h:39
int m_numDeferredTabs
Definition: WP1ContentListener.h:43
WP1ContentParsingState & operator=(const WP1ContentParsingState &)
~WP1ContentParsingState()
Definition: WP1ContentListener.cpp:43
int m_footNoteNumber
Definition: WP1ContentListener.h:44
WP1ContentParsingState(const WP1ContentParsingState &)
int m_endNoteNumber
Definition: WP1ContentListener.h:44
WP1ContentParsingState()
Definition: WP1ContentListener.cpp:35
librevenge::RVNGString m_textBuffer
Definition: WP1ContentListener.h:42

Generated for libwpd by doxygen 1.9.1