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 
39 {
42  librevenge::RVNGString m_textBuffer;
43 };
44 
46 {
47 public:
48  WP42ContentListener(std::list<WPXPageSpan> &pageList, librevenge::RVNGTextInterface *documentInterface);
49  ~WP42ContentListener() override;
50 
51  void startDocument() override
52  {
54  }
55  void startSubDocument() override
56  {
58  }
59  void insertCharacter(unsigned character) override;
60  void insertTab(unsigned char tabType, double tabPosition) override;
61  void insertBreak(unsigned char breakType) override
62  {
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  {
73  }
74  void endSubDocument() override
75  {
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:
88  std::unique_ptr<WP42ContentParsingState> m_parseState;
89 };
90 
91 #endif /* WP42LISTENER_H */
92 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
Definition: WP42ContentListener.h:46
WP42ContentListener(std::list< WPXPageSpan > &pageList, librevenge::RVNGTextInterface *documentInterface)
Definition: WP42ContentListener.cpp:44
void startSubDocument() override
Definition: WP42ContentListener.h:55
void attributeChange(bool isOn, unsigned char attribute) override
Definition: WP42ContentListener.cpp:97
void marginReset(unsigned char leftMargin, unsigned char rightMargin) override
Definition: WP42ContentListener.cpp:146
void startDocument() override
Definition: WP42ContentListener.h:51
void headerFooterGroup(unsigned char headerFooterDefinition, const std::shared_ptr< WP42SubDocument > &subDocument) override
Definition: WP42ContentListener.cpp:159
void endSubDocument() override
Definition: WP42ContentListener.h:74
void _flushText() override
Definition: WP42ContentListener.cpp:197
WP42ContentListener(const WP42ContentListener &)
void insertTab(unsigned char tabType, double tabPosition) override
Definition: WP42ContentListener.cpp:70
std::unique_ptr< WP42ContentParsingState > m_parseState
Definition: WP42ContentListener.h:88
void suppressPageCharacteristics(unsigned char) override
Definition: WP42ContentListener.h:69
~WP42ContentListener() override
Definition: WP42ContentListener.cpp:54
void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, unsigned nextTableIndice=0) override
Definition: WP42ContentListener.cpp:163
WP42ContentListener & operator=(const WP42ContentListener &)
void _changeList() override
Definition: WP42ContentListener.h:83
void insertCharacter(unsigned character) override
Definition: WP42ContentListener.cpp:59
void endDocument() override
Definition: WP42ContentListener.h:70
void insertBreak(unsigned char breakType) override
Definition: WP42ContentListener.h:61
void insertEOL() override
Definition: WP42ContentListener.cpp:83
Definition: WP42Listener.h:36
Definition: WPXContentListener.h:148
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
Definition: WP42ContentListener.h:39
~WP42ContentParsingState()
Definition: WP42ContentListener.cpp:39
WP42ContentParsingState()
Definition: WP42ContentListener.cpp:34
librevenge::RVNGString m_textBuffer
Definition: WP42ContentListener.h:42

Generated for libwpd by doxygen 1.9.1