- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

WP1StylesListener.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 WP1STYLESLISTENER_H
29 #define WP1STYLESLISTENER_H
30
31 #include "WP1Listener.h"
32 #include "WP1SubDocument.h"
33 #include "WPXStylesListener.h"
34 #include <vector>
35 #include "WPXPageSpan.h"
36 #include "WPXTable.h"
37
38 class WP1StylesListener : public WP1Listener, protected WPXStylesListener
39 {
40 public:
41 WP1StylesListener(std::list<WPXPageSpan> &pageList, std::vector<WP1SubDocument *> &subDocuments);
42 ~WP1StylesListener() {}
43
44 void startDocument() {}
45 void startSubDocument() {}
46 void insertCharacter(unsigned /* character */)
47 {
48 if (!isUndoOn()) m_currentPageHasContent = true;
49 }
50 void insertExtendedCharacter(unsigned char /* extendedCharacter */)
51 {
52 if (!isUndoOn()) m_currentPageHasContent = true;
53 }
54 void insertTab()
55 {
56 if (!isUndoOn()) m_currentPageHasContent = true;
57 }
58 void insertEOL()
59 {
60 if (!isUndoOn()) m_currentPageHasContent = true;
61 }
62 void insertBreak(unsigned char breakType);
63 void insertNote(WPXNoteType /* noteType */, WP1SubDocument * /* subDocument */) {}
64 void attributeChange(bool /* isOn */, unsigned char /* attribute */) {}
65 void fontPointSize(unsigned char /* pointSize */) {}
66 void fontId(unsigned short /* id */) {}
67 void marginReset(unsigned short leftMargin, unsigned short rightMargin);
68 void topMarginSet(unsigned short topMargin);
69 void bottomMarginSet(unsigned short bottomMargin);
70 void leftIndent(unsigned short /* leftMarginOffset */)
71 {
72 if (!isUndoOn()) m_currentPageHasContent = true;
73 }
74 void leftRightIndent(unsigned short /* leftRightMarginOffset */)
75 {
76 if (!isUndoOn()) m_currentPageHasContent = true;
77 }
78 void leftMarginRelease(unsigned short /* release */) {}
79 void setTabs(const std::vector<WPXTabStop> & /* tabStops */) {}
80 void headerFooterGroup(unsigned char headerFooterDefinition, WP1SubDocument *subDocument);
81 void suppressPageCharacteristics(unsigned char suppressCode);
82 void justificationChange(unsigned char /* justification */) {}
83 void lineSpacingChange(unsigned char /* spacing */) {}
84 void flushRightOn() {}
85 void flushRightOff() {}
86 void centerOn() {}
87 void centerOff() {}
88 void endDocument();
89 void endSubDocument();
90 void insertPicture(unsigned short /* width */, unsigned short /* height */, const librevenge::RVNGBinaryData & /* binaryData */) {}
91
92 protected:
93 void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, int nextTableIndice = 0);
94
95 private:
96 WPXPageSpan m_currentPage, m_nextPage;
97 std::vector<WP1SubDocument *> &m_subDocuments;
98 double m_tempMarginLeft, m_tempMarginRight;
99 bool m_currentPageHasContent;
100 bool m_isSubDocument;
101 std::list<WPXPageSpan>::iterator m_pageListHardPageMark;
102 };
103
104 #endif /* WP1STYLESLISTENER_H */
105 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WP1StylesListener::fontId
void fontId(unsigned short)
Definition: WP1StylesListener.h:66
WP1StylesListener::fontPointSize
void fontPointSize(unsigned char)
Definition: WP1StylesListener.h:65
WPXStylesListener.h
WP1Listener
Definition: WP1Listener.h:37
WP1StylesListener::insertTab
void insertTab()
Definition: WP1StylesListener.h:54
WP1SubDocument.h
WP1StylesListener::endDocument
void endDocument()
Definition: WP1StylesListener.cpp:47
WP1StylesListener::bottomMarginSet
void bottomMarginSet(unsigned short bottomMargin)
Definition: WP1StylesListener.cpp:175
WP1StylesListener::startSubDocument
void startSubDocument()
Definition: WP1StylesListener.h:45
WP1StylesListener::~WP1StylesListener
~WP1StylesListener()
Definition: WP1StylesListener.h:42
WPXTable.h
WP1StylesListener::m_currentPage
WPXPageSpan m_currentPage
Definition: WP1StylesListener.h:96
WPXPageSpan.h
WP1StylesListener::centerOff
void centerOff()
Definition: WP1StylesListener.h:87
WP1StylesListener::leftIndent
void leftIndent(unsigned short)
Definition: WP1StylesListener.h:70
WP1SubDocument
Definition: WP1SubDocument.h:33
WP1Listener.h
WP1StylesListener::leftRightIndent
void leftRightIndent(unsigned short)
Definition: WP1StylesListener.h:74
WP1StylesListener::justificationChange
void justificationChange(unsigned char)
Definition: WP1StylesListener.h:82
WP1StylesListener::startDocument
void startDocument()
Definition: WP1StylesListener.h:44
WPXSubDocumentType
WPXSubDocumentType
Definition: libwpd_internal.h:111
WP1StylesListener::centerOn
void centerOn()
Definition: WP1StylesListener.h:86
WP1StylesListener::flushRightOff
void flushRightOff()
Definition: WP1StylesListener.h:85
WP1StylesListener::marginReset
void marginReset(unsigned short leftMargin, unsigned short rightMargin)
Definition: WP1StylesListener.cpp:117
WP1StylesListener::suppressPageCharacteristics
void suppressPageCharacteristics(unsigned char suppressCode)
Definition: WP1StylesListener.cpp:231
WP1StylesListener::m_tempMarginRight
double m_tempMarginRight
Definition: WP1StylesListener.h:98
WPXTableList
Definition: WPXTable.h:81
WP1StylesListener::m_subDocuments
std::vector< WP1SubDocument * > & m_subDocuments
Definition: WP1StylesListener.h:97
WP1StylesListener::setTabs
void setTabs(const std::vector< WPXTabStop > &)
Definition: WP1StylesListener.h:79
WP1StylesListener::m_isSubDocument
bool m_isSubDocument
Definition: WP1StylesListener.h:100
WP1StylesListener::attributeChange
void attributeChange(bool, unsigned char)
Definition: WP1StylesListener.h:64
WPXSubDocument
Definition: WPXSubDocument.h:34
WP1StylesListener::insertPicture
void insertPicture(unsigned short, unsigned short, const librevenge::RVNGBinaryData &)
Definition: WP1StylesListener.h:90
WP1StylesListener::WP1StylesListener
WP1StylesListener(std::list< WPXPageSpan > &pageList, std::vector< WP1SubDocument * > &subDocuments)
Definition: WP1StylesListener.cpp:33
WP1StylesListener::topMarginSet
void topMarginSet(unsigned short topMargin)
Definition: WP1StylesListener.cpp:165
WP1StylesListener::insertCharacter
void insertCharacter(unsigned)
Definition: WP1StylesListener.h:46
WP1StylesListener::insertNote
void insertNote(WPXNoteType, WP1SubDocument *)
Definition: WP1StylesListener.h:63
WP1StylesListener::m_pageListHardPageMark
std::list< WPXPageSpan >::iterator m_pageListHardPageMark
Definition: WP1StylesListener.h:101
WPXPageSpan
Definition: WPXPageSpan.h:77
WP1StylesListener::insertBreak
void insertBreak(unsigned char breakType)
Definition: WP1StylesListener.cpp:57
WP1StylesListener::m_currentPageHasContent
bool m_currentPageHasContent
Definition: WP1StylesListener.h:99
WP1StylesListener::lineSpacingChange
void lineSpacingChange(unsigned char)
Definition: WP1StylesListener.h:83
WPXListener::isUndoOn
bool isUndoOn()
Definition: WPXListener.h:40
WP1StylesListener::leftMarginRelease
void leftMarginRelease(unsigned short)
Definition: WP1StylesListener.h:78
WPXStylesListener
Definition: WPXStylesListener.h:33
WP1StylesListener::insertEOL
void insertEOL()
Definition: WP1StylesListener.h:58
WP1StylesListener::flushRightOn
void flushRightOn()
Definition: WP1StylesListener.h:84
WP1StylesListener::_handleSubDocument
void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, int nextTableIndice=0)
Definition: WP1StylesListener.cpp:253
WP1StylesListener
Definition: WP1StylesListener.h:38
WP1StylesListener::headerFooterGroup
void headerFooterGroup(unsigned char headerFooterDefinition, WP1SubDocument *subDocument)
Definition: WP1StylesListener.cpp:185
WP1StylesListener::endSubDocument
void endSubDocument()
Definition: WP1StylesListener.cpp:52
WPXNoteType
WPXNoteType
Definition: libwpd_internal.h:93
WP1StylesListener::m_tempMarginLeft
double m_tempMarginLeft
Definition: WP1StylesListener.h:98
WP1StylesListener::m_nextPage
WPXPageSpan m_nextPage
Definition: WP1StylesListener.h:96
WP1StylesListener::insertExtendedCharacter
void insertExtendedCharacter(unsigned char)
Definition: WP1StylesListener.h:50