WP42ContentListener.h Source File documentation

WP42ContentListener.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 WP42CONTENTLISTENER_H
29 #define WP42CONTENTLISTENER_H
30
31 #include <memory>
32
33 #include "WP42Listener.h"
34 #include "WP42SubDocument.h"
35 #include "WPXContentListener.h"
36 #include <libwpd/libwpd.h>
37
38 struct WP42ContentParsingState
39 {
40 WP42ContentParsingState();
41 ~WP42ContentParsingState();
42 librevenge::RVNGString m_textBuffer;
43 };
44
45 class WP42ContentListener : public WP42Listener, protected WPXContentListener
46 {
47 public:
48 WP42ContentListener(std::list<WPXPageSpan> &pageList, librevenge::RVNGTextInterface *documentInterface);
49 ~WP42ContentListener() override;
50
51 void startDocument() override
52 {
53 WPXContentListener::startDocument();
54 }
55 void startSubDocument() override
56 {
57 WPXContentListener::startSubDocument();
58 }
59 void insertCharacter(unsigned character) override;
60 void insertTab(unsigned char tabType, double tabPosition) override;
61 void insertBreak(unsigned char breakType) override
62 {
63 WPXContentListener::insertBreak(breakType);
64 }
65 void insertEOL() override;
66 void attributeChange(bool isOn, unsigned char attribute) override;
67 void marginReset(unsigned char leftMargin, unsigned char rightMargin) override;
68 void headerFooterGroup(unsigned char headerFooterDefinition, const std::shared_ptr<WP42SubDocument> &subDocument) override;
69 void suppressPageCharacteristics(unsigned char /* suppressCode */) override {}
70 void endDocument() override
71 {
72 WPXContentListener::endDocument();
73 }
74 void endSubDocument() override
75 {
76 WPXContentListener::endSubDocument();
77 }
78
79 protected:
80 void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, unsigned nextTableIndice = 0) override;
81
82 void _flushText() override;
83 void _changeList() override {}
84
85 private:
86 WP42ContentListener(const WP42ContentListener &);
87 WP42ContentListener &operator=(const WP42ContentListener &);
88 std::unique_ptr<WP42ContentParsingState> m_parseState;
89 };
90
91 #endif /* WP42LISTENER_H */
92 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WPXContentListener::_closeSpan
void _closeSpan()
Definition: WPXContentListener.cpp:899
WP42ContentListener::attributeChange
void attributeChange(bool isOn, unsigned char attribute) override
Definition: WP42ContentListener.cpp:97
WPXContentListener::endDocument
void endDocument()
Definition: WPXContentListener.cpp:159
WP42_ATTRIBUTE_SHADOW
#define WP42_ATTRIBUTE_SHADOW
Definition: WP42FileStructure.h:38
WP42ContentListener::m_parseState
std::unique_ptr< WP42ContentParsingState > m_parseState
Definition: WP42ContentListener.h:88
WP42_ATTRIBUTE_STRIKE_OUT
#define WP42_ATTRIBUTE_STRIKE_OUT
Definition: WP42FileStructure.h:37
WPXContentListener::_closeListElement
void _closeListElement()
Definition: WPXContentListener.cpp:772
WP42ContentListener::startSubDocument
void startSubDocument() override
Definition: WP42ContentListener.h:55
WP42ContentListener::endSubDocument
void endSubDocument() override
Definition: WP42ContentListener.h:74
WPXContentListener::_openSpan
void _openSpan()
Definition: WPXContentListener.cpp:791
WPX_REDLINE_BIT
#define WPX_REDLINE_BIT
Definition: libwpd_internal.h:124
WPX_UNDERLINE_BIT
#define WPX_UNDERLINE_BIT
Definition: libwpd_internal.h:128
WP42_ATTRIBUTE_REDLINE
#define WP42_ATTRIBUTE_REDLINE
Definition: WP42FileStructure.h:39
WP42ContentListener::_flushText
void _flushText() override
Definition: WP42ContentListener.cpp:197
WP42ContentParsingState
Definition: WP42ContentListener.h:39
WP42ContentListener::_handleSubDocument
void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, unsigned nextTableIndice=0) override
Definition: WP42ContentListener.cpp:163
WP42ContentListener::_changeList
void _changeList() override
Definition: WP42ContentListener.h:83
WPX_SHADOW_BIT
#define WPX_SHADOW_BIT
Definition: libwpd_internal.h:123
WPXContentListener::endSubDocument
void endSubDocument()
Definition: WPXContentListener.cpp:180
WP42ContentListener::insertCharacter
void insertCharacter(unsigned character) override
Definition: WP42ContentListener.cpp:59
WPXSubDocument
Definition: WPXSubDocument.h:37
WPXContentListener::_closeParagraph
void _closeParagraph()
Definition: WPXContentListener.cpp:725
WP42_NUM_TEXT_COLUMS_PER_INCH
#define WP42_NUM_TEXT_COLUMS_PER_INCH
Definition: WP42ContentListener.cpp:32
WP42ContentListener::WP42ContentListener
WP42ContentListener(std::list< WPXPageSpan > &pageList, librevenge::RVNGTextInterface *documentInterface)
Definition: WP42ContentListener.cpp:44
WP42FileStructure.h
WPXContentListener::m_ps
std::unique_ptr< WPXContentParsingState > m_ps
Definition: WPXContentListener.h:162
libwpd_internal.h
WP42_ATTRIBUTE_UNDERLINE
#define WP42_ATTRIBUTE_UNDERLINE
Definition: WP42FileStructure.h:36
WP42_ATTRIBUTE_ITALICS
#define WP42_ATTRIBUTE_ITALICS
Definition: WP42FileStructure.h:35
WPXContentListener::startDocument
void startDocument()
Definition: WPXContentListener.cpp:138
WP42ContentListener.h
WPX_BOLD_BIT
#define WPX_BOLD_BIT
Definition: libwpd_internal.h:126
WPXContentListener
Definition: WPXContentListener.h:148
WP42SubDocument.h
WPXContentListener::insertBreak
void insertBreak(const unsigned char breakType)
Definition: WPXContentListener.cpp:1242
WP42ContentListener
Definition: WP42ContentListener.h:46
WPXContentListener::m_documentInterface
librevenge::RVNGTextInterface * m_documentInterface
Definition: WPXContentListener.h:163
WPXContentListener::_mapNonUnicodeCharacter
unsigned _mapNonUnicodeCharacter(unsigned character)
Definition: WPXContentListener.cpp:1450
WP42ContentParsingState::WP42ContentParsingState
WP42ContentParsingState()
Definition: WP42ContentListener.cpp:34
WP42ContentListener::endDocument
void endDocument() override
Definition: WP42ContentListener.h:70
WP42ContentListener::marginReset
void marginReset(unsigned char leftMargin, unsigned char rightMargin) override
Definition: WP42ContentListener.cpp:146
WP42ContentListener::insertBreak
void insertBreak(unsigned char breakType) override
Definition: WP42ContentListener.h:61
WPXTableList
Definition: WPXTableList.h:36
WPX_ITALICS_BIT
#define WPX_ITALICS_BIT
Definition: libwpd_internal.h:122
WP42Listener.h
WP42ContentListener::insertTab
void insertTab(unsigned char tabType, double tabPosition) override
Definition: WP42ContentListener.cpp:70
WPXContentListener::startSubDocument
void startSubDocument()
Definition: WPXContentListener.cpp:153
WPXContentListener::_closeSection
void _closeSection()
Definition: WPXContentListener.cpp:233
WP42ContentListener::WP42ContentListener
WP42ContentListener(const WP42ContentListener &)
WPXListener::isUndoOn
bool isUndoOn()
Definition: WPXListener.h:40
WP42ContentListener::insertEOL
void insertEOL() override
Definition: WP42ContentListener.cpp:83
WP42ContentListener::operator=
WP42ContentListener & operator=(const WP42ContentListener &)
WP42ContentListener::suppressPageCharacteristics
void suppressPageCharacteristics(unsigned char) override
Definition: WP42ContentListener.h:69
WP42_ATTRIBUTE_BOLD
#define WP42_ATTRIBUTE_BOLD
Definition: WP42FileStructure.h:34
WPX_STRIKEOUT_BIT
#define WPX_STRIKEOUT_BIT
Definition: libwpd_internal.h:127
WPXSubDocumentType
WPXSubDocumentType
Definition: libwpd_internal.h:111
WP42Listener
Definition: WP42Listener.h:36
appendUCS4
void appendUCS4(librevenge::RVNGString &str, unsigned ucs4)
Definition: libwpd_internal.cpp:154
libwpd.h
WPXContentListener::_insertText
void _insertText(const librevenge::RVNGString &textBuffer)
Definition: WPXContentListener.cpp:624
WP42ContentListener::~WP42ContentListener
~WP42ContentListener() override
Definition: WP42ContentListener.cpp:54
WP42ContentListener::headerFooterGroup
void headerFooterGroup(unsigned char headerFooterDefinition, const std::shared_ptr< WP42SubDocument > &subDocument) override
Definition: WP42ContentListener.cpp:159
WP42ContentParsingState::~WP42ContentParsingState
~WP42ContentParsingState()
Definition: WP42ContentListener.cpp:39
WP42ContentParsingState::m_textBuffer
librevenge::RVNGString m_textBuffer
Definition: WP42ContentListener.h:42
WPXContentListener.h
WP42SubDocument
Definition: WP42SubDocument.h:34
WP42ContentListener::startDocument
void startDocument() override
Definition: WP42ContentListener.h:51