WP42StylesListener.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) 2004 Marc Maurer (uwog@uwog.net)
12  * Copyright (C) 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 WP42STYLESLISTENER_H
29 #define WP42STYLESLISTENER_H
30 
31 #include "WP42Listener.h"
32 #include "WP42SubDocument.h"
33 #include "WPXStylesListener.h"
34 #include <vector>
35 #include "WPXPageSpan.h"
36 #include "WPXTable.h"
37 #include "WPXTableList.h"
38 
40 {
41 public:
42  explicit WP42StylesListener(std::list<WPXPageSpan> &pageList);
43 
44  void startDocument() override {}
45  void startSubDocument() override {}
46  void insertCharacter(unsigned /* character */) override
47  {
48  if (!isUndoOn()) m_currentPageHasContent = true;
49  }
50  void insertTab(unsigned char /* tabType */, double /* tabPosition */) override
51  {
52  if (!isUndoOn()) m_currentPageHasContent = true;
53  }
54  void insertEOL() override
55  {
56  if (!isUndoOn()) m_currentPageHasContent = true;
57  }
58  void insertBreak(unsigned char breakType) override;
59  void attributeChange(bool /* isOn */, unsigned char /* attribute */) override {}
60  void marginReset(unsigned char /* leftMargin */, unsigned char /* rightMargin */) override {}
61  void headerFooterGroup(unsigned char headerFooterDefinition, const std::shared_ptr<WP42SubDocument> &subDocument) override;
62  void suppressPageCharacteristics(unsigned char suppressCode) override;
63  void endDocument() override;
64  void endSubDocument() override;
65 
66 protected:
67  void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, int nextTableIndice = 0);
68 
69 private:
74  std::list<WPXPageSpan>::iterator m_pageListHardPageMark;
75 };
76 
77 #endif /* WP42STYLESLISTENER_H */
78 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
Definition: WP42Listener.h:36
Definition: WP42StylesListener.h:40
double m_tempMarginRight
Definition: WP42StylesListener.h:71
void insertEOL() override
Definition: WP42StylesListener.h:54
void attributeChange(bool, unsigned char) override
Definition: WP42StylesListener.h:59
void startDocument() override
Definition: WP42StylesListener.h:44
WPXPageSpan m_currentPage
Definition: WP42StylesListener.h:70
std::list< WPXPageSpan >::iterator m_pageListHardPageMark
Definition: WP42StylesListener.h:74
void insertBreak(unsigned char breakType) override
Definition: WP42StylesListener.cpp:57
double m_tempMarginLeft
Definition: WP42StylesListener.h:71
void insertTab(unsigned char, double) override
Definition: WP42StylesListener.h:50
void startSubDocument() override
Definition: WP42StylesListener.h:45
void endDocument() override
Definition: WP42StylesListener.cpp:47
bool m_isSubDocument
Definition: WP42StylesListener.h:73
WP42StylesListener(std::list< WPXPageSpan > &pageList)
Definition: WP42StylesListener.cpp:34
void endSubDocument() override
Definition: WP42StylesListener.cpp:52
void insertCharacter(unsigned) override
Definition: WP42StylesListener.h:46
WPXPageSpan m_nextPage
Definition: WP42StylesListener.h:70
void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, int nextTableIndice=0)
Definition: WP42StylesListener.cpp:188
bool m_currentPageHasContent
Definition: WP42StylesListener.h:72
void marginReset(unsigned char, unsigned char) override
Definition: WP42StylesListener.h:60
void headerFooterGroup(unsigned char headerFooterDefinition, const std::shared_ptr< WP42SubDocument > &subDocument) override
Definition: WP42StylesListener.cpp:118
void suppressPageCharacteristics(unsigned char suppressCode) override
Definition: WP42StylesListener.cpp:161
bool isUndoOn()
Definition: WPXListener.h:40
Definition: WPXPageSpan.h:43
Definition: WPXStylesListener.h:34
Definition: WPXSubDocument.h:37
Definition: WPXTableList.h:36
WPXSubDocumentType
Definition: libwpd_internal.h:111

Generated for libwpd by doxygen 1.9.1