WP42StylesListener.h Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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