WP3StylesListener.h Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

WP3StylesListener.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) 2004 Marc Maurer (uwog@uwog.net)
11 * Copyright (C) 2006 Fridrich Strba (fridrich.strba@bluewin.ch)
12 *
13 * For minor contributions see the git repository.
14 *
15 * Alternatively, the contents of this file may be used under the terms
16 * of the GNU Lesser General Public License Version 2.1 or later
17 * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
18 * applicable instead of those above.
19 *
20 * For further information visit http://libwpd.sourceforge.net
21 */
22
23 /* "This product is not manufactured, approved, or supported by
24 * Corel Corporation or Corel Corporation Limited."
25 */
26
27 #ifndef WP3STYLESLISTENER_H
28 #define WP3STYLESLISTENER_H
29
30 #include "WP3Listener.h"
31 #include "WPXStylesListener.h"
32 #include <vector>
33 #include <set>
34 #include "WPXPageSpan.h"
35 #include "WPXTable.h"
36
37 class WP3StylesListener : public WP3Listener, protected WPXStylesListener
38 {
39 public:
40 WP3StylesListener(std::list<WPXPageSpan> &pageList, WPXTableList tableList, std::vector<WP3SubDocument *> &subDocuments);
41
42 void startDocument() {}
43 void startSubDocument() {}
44 void insertCharacter(unsigned /* character */)
45 {
46 if (!isUndoOn()) m_currentPageHasContent = true;
47 }
48 void insertTab()
49 {
50 if (!isUndoOn()) m_currentPageHasContent = true;
51 }
52 void insertTab(unsigned char /* tabType */, double /* tabPosition */)
53 {
54 if (!isUndoOn()) m_currentPageHasContent = true;
55 }
56 void insertEOL()
57 {
58 if (!isUndoOn()) m_currentPageHasContent = true;
59 }
60 void insertBreak(unsigned char breakType);
61 void attributeChange(bool /* isOn */, unsigned char /* attribute */) {}
62 void lineSpacingChange(double /* lineSpacing */) {}
63 void justificationChange(unsigned char /* justification */) {}
64 void pageMarginChange(unsigned char side, unsigned short margin);
65 void pageFormChange(unsigned short length, unsigned short width, WPXFormOrientation orientation);
66 void marginChange(unsigned char side, unsigned short margin);
67 void indentFirstLineChange(double /* offset */) {}
68 void setTabs(bool /* isRelative */, const std::vector<WPXTabStop> /* tabStops */) {}
69 void columnChange(WPXTextColumnType /* columnType */, unsigned char /* numColumns */,
70 const std::vector<double> & /* columnWidth */, const std::vector<bool> & /* isFixedWidth */) {}
71 void endDocument();
72 void endSubDocument();
73
74 void defineTable(unsigned char /* position */, unsigned short /* leftOffset */) {}
75 void addTableColumnDefinition(unsigned /* width */, unsigned /* leftGutter */, unsigned /* rightGutter */,
76 unsigned /* attributes */, unsigned char /* alignment */) {}
77 void startTable();
78 void closeCell() {}
79 void closeRow() {}
80 void setTableCellSpan(unsigned short /* colSpan */, unsigned short /* rowSpan */) {}
81 void setTableCellFillColor(const RGBSColor * /* cellFillColor */) {}
82 void endTable() {}
83 void undoChange(unsigned char undoType, unsigned short undoLevel);
84 void setTextColor(const RGBSColor * /* fontColor */) {}
85 void setTextFont(const librevenge::RVNGString & /* fontName */) {}
86 void setFontSize(unsigned short /* fontSize */) {}
87 void insertPageNumber(const librevenge::RVNGString & /* pageNumber */) {}
88 void insertNoteReference(const librevenge::RVNGString & /* noteReference */) {}
89 void insertNote(WPXNoteType /* noteType */, const WP3SubDocument * /* subDocument */)
90 {
91 if (!isUndoOn()) m_currentPageHasContent = true;
92 }
93 void headerFooterGroup(unsigned char headerFooterType, unsigned char occurrenceBits, WP3SubDocument *subDocument);
94 void suppressPage(unsigned short suppressCode);
95 void backTab()
96 {
97 if (!isUndoOn()) m_currentPageHasContent = true;
98 }
99 void leftIndent() {}
100 void leftIndent(double /* offset */) {}
101 void leftRightIndent() {}
102 void leftRightIndent(double /* offset */) {}
103 void insertPicture(double /* height */, double /* width */, double /* verticalOffset */, double /* horizontalOffset */, unsigned char /* leftColumn */, unsigned char /* rightColumn */,
104 unsigned short /* figureFlags */, const librevenge::RVNGBinaryData & /* binaryData */) {}
105 void insertTextBox(double /* height */, double /* width */, double /* verticalOffset */, double /* horizontalOffset */, unsigned char /* leftColumn */, unsigned char /* rightColumn */,
106 unsigned short /* figureFlags */, const WP3SubDocument * /* subDocument */, const WP3SubDocument * /* caption */) {}
107 void insertWP51Table(double /* height */, double /* width */, double /* verticalOffset */, double /* horizontalOffset */, unsigned char /* leftColumn */, unsigned char /* rightColumn */,
108 unsigned short /* figureFlags */, const WP3SubDocument * /* subDocument */, const WP3SubDocument * /* caption */) {}
109
110 protected:
111 void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, int nextTableIndice = 0);
112
113 private:
114 WP3StylesListener(const WP3StylesListener &);
115 WP3StylesListener &operator=(const WP3StylesListener &);
116 WPXPageSpan m_currentPage;
117
118 WPXTableList m_tableList;
119 WPXTable *m_currentTable;
120 double m_tempMarginLeft, m_tempMarginRight;
121 bool m_currentPageHasContent;
122 bool m_isSubDocument;
123 std::vector<WP3SubDocument *> &m_subDocuments;
124 std::list<WPXPageSpan>::iterator m_pageListHardPageMark;
125 };
126
127 #endif /* WP3STYLESLISTENER_H */
128 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WP3StylesListener::insertPicture
void insertPicture(double, double, double, double, unsigned char, unsigned char, unsigned short, const librevenge::RVNGBinaryData &)
Definition: WP3StylesListener.h:103
WPXStylesListener.h
WP3Listener
Definition: WP3Listener.h:37
WP3StylesListener::pageFormChange
void pageFormChange(unsigned short length, unsigned short width, WPXFormOrientation orientation)
Definition: WP3StylesListener.cpp:178
WP3StylesListener::endSubDocument
void endSubDocument()
Definition: WP3StylesListener.cpp:56
WP3StylesListener::setTextFont
void setTextFont(const librevenge::RVNGString &)
Definition: WP3StylesListener.h:85
WP3StylesListener::setTextColor
void setTextColor(const RGBSColor *)
Definition: WP3StylesListener.h:84
WP3StylesListener::endDocument
void endDocument()
Definition: WP3StylesListener.cpp:50
WP3StylesListener::indentFirstLineChange
void indentFirstLineChange(double)
Definition: WP3StylesListener.h:67
WPXTable
Definition: WPXTable.h:51
WP3StylesListener::setTableCellFillColor
void setTableCellFillColor(const RGBSColor *)
Definition: WP3StylesListener.h:81
WP3StylesListener::endTable
void endTable()
Definition: WP3StylesListener.h:82
WP3StylesListener::insertTab
void insertTab()
Definition: WP3StylesListener.h:48
WPXTable.h
WPXPageSpan.h
WP3StylesListener::insertWP51Table
void insertWP51Table(double, double, double, double, unsigned char, unsigned char, unsigned short, const WP3SubDocument *, const WP3SubDocument *)
Definition: WP3StylesListener.h:107
WP3StylesListener::setFontSize
void setFontSize(unsigned short)
Definition: WP3StylesListener.h:86
WPXTextColumnType
WPXTextColumnType
Definition: libwpd_internal.h:109
WP3StylesListener::m_tempMarginRight
double m_tempMarginRight
Definition: WP3StylesListener.h:120
WP3StylesListener::m_currentPageHasContent
bool m_currentPageHasContent
Definition: WP3StylesListener.h:121
WP3StylesListener::m_currentTable
WPXTable * m_currentTable
Definition: WP3StylesListener.h:119
WP3StylesListener::startTable
void startTable()
Definition: WP3StylesListener.cpp:248
WP3StylesListener::leftIndent
void leftIndent(double)
Definition: WP3StylesListener.h:100
WP3StylesListener::m_tempMarginLeft
double m_tempMarginLeft
Definition: WP3StylesListener.h:120
WP3StylesListener::leftRightIndent
void leftRightIndent(double)
Definition: WP3StylesListener.h:102
WP3Listener.h
WP3StylesListener::insertPageNumber
void insertPageNumber(const librevenge::RVNGString &)
Definition: WP3StylesListener.h:87
WPXSubDocumentType
WPXSubDocumentType
Definition: libwpd_internal.h:111
_RGBSColor
Definition: libwpd_internal.h:167
WP3StylesListener::insertTextBox
void insertTextBox(double, double, double, double, unsigned char, unsigned char, unsigned short, const WP3SubDocument *, const WP3SubDocument *)
Definition: WP3StylesListener.h:105
WP3StylesListener::m_pageListHardPageMark
std::list< WPXPageSpan >::iterator m_pageListHardPageMark
Definition: WP3StylesListener.h:124
WPXTableList
Definition: WPXTable.h:81
WP3StylesListener::insertNoteReference
void insertNoteReference(const librevenge::RVNGString &)
Definition: WP3StylesListener.h:88
WP3StylesListener::m_tableList
WPXTableList m_tableList
Definition: WP3StylesListener.h:118
WP3StylesListener::marginChange
void marginChange(unsigned char side, unsigned short margin)
Definition: WP3StylesListener.cpp:132
WP3StylesListener::setTabs
void setTabs(bool, const std::vector< WPXTabStop >)
Definition: WP3StylesListener.h:68
WP3StylesListener::attributeChange
void attributeChange(bool, unsigned char)
Definition: WP3StylesListener.h:61
WP3StylesListener::insertNote
void insertNote(WPXNoteType, const WP3SubDocument *)
Definition: WP3StylesListener.h:89
WP3StylesListener::insertCharacter
void insertCharacter(unsigned)
Definition: WP3StylesListener.h:44
WP3StylesListener::WP3StylesListener
WP3StylesListener(std::list< WPXPageSpan > &pageList, WPXTableList tableList, std::vector< WP3SubDocument * > &subDocuments)
Definition: WP3StylesListener.cpp:34
WPXFormOrientation
WPXFormOrientation
Definition: libwpd_internal.h:105
WP3StylesListener::m_subDocuments
std::vector< WP3SubDocument * > & m_subDocuments
Definition: WP3StylesListener.h:123
WP3StylesListener::backTab
void backTab()
Definition: WP3StylesListener.h:95
WP3StylesListener::leftIndent
void leftIndent()
Definition: WP3StylesListener.h:99
WP3StylesListener::suppressPage
void suppressPage(unsigned short suppressCode)
Definition: WP3StylesListener.cpp:232
WPXSubDocument
Definition: WPXSubDocument.h:34
WP3StylesListener::closeCell
void closeCell()
Definition: WP3StylesListener.h:78
WP3StylesListener::m_isSubDocument
bool m_isSubDocument
Definition: WP3StylesListener.h:122
WP3StylesListener::addTableColumnDefinition
void addTableColumnDefinition(unsigned, unsigned, unsigned, unsigned, unsigned char)
Definition: WP3StylesListener.h:75
WP3StylesListener::leftRightIndent
void leftRightIndent()
Definition: WP3StylesListener.h:101
WP3StylesListener::_handleSubDocument
void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, int nextTableIndice=0)
Definition: WP3StylesListener.cpp:258
WP3StylesListener::lineSpacingChange
void lineSpacingChange(double)
Definition: WP3StylesListener.h:62
WP3StylesListener::operator=
WP3StylesListener & operator=(const WP3StylesListener &)
WP3StylesListener::insertBreak
void insertBreak(unsigned char breakType)
Definition: WP3StylesListener.cpp:62
WP3StylesListener::startDocument
void startDocument()
Definition: WP3StylesListener.h:42
WP3StylesListener::startSubDocument
void startSubDocument()
Definition: WP3StylesListener.h:43
WP3StylesListener::m_currentPage
WPXPageSpan m_currentPage
Definition: WP3StylesListener.h:116
WP3StylesListener::closeRow
void closeRow()
Definition: WP3StylesListener.h:79
WPXPageSpan
Definition: WPXPageSpan.h:77
WP3StylesListener::justificationChange
void justificationChange(unsigned char)
Definition: WP3StylesListener.h:63
WP3StylesListener::insertTab
void insertTab(unsigned char, double)
Definition: WP3StylesListener.h:52
WPXListener::isUndoOn
bool isUndoOn()
Definition: WPXListener.h:40
WP3StylesListener::columnChange
void columnChange(WPXTextColumnType, unsigned char, const std::vector< double > &, const std::vector< bool > &)
Definition: WP3StylesListener.h:69
WP3StylesListener::setTableCellSpan
void setTableCellSpan(unsigned short, unsigned short)
Definition: WP3StylesListener.h:80
WP3StylesListener::undoChange
void undoChange(unsigned char undoType, unsigned short undoLevel)
Definition: WP3StylesListener.cpp:102
WPXStylesListener
Definition: WPXStylesListener.h:33
WP3StylesListener::pageMarginChange
void pageMarginChange(unsigned char side, unsigned short margin)
Definition: WP3StylesListener.cpp:113
WP3SubDocument
Definition: WP3SubDocument.h:33
WP3StylesListener::defineTable
void defineTable(unsigned char, unsigned short)
Definition: WP3StylesListener.h:74
WP3StylesListener
Definition: WP3StylesListener.h:37
WP3StylesListener::insertEOL
void insertEOL()
Definition: WP3StylesListener.h:56
WP3StylesListener::headerFooterGroup
void headerFooterGroup(unsigned char headerFooterType, unsigned char occurrenceBits, WP3SubDocument *subDocument)
Definition: WP3StylesListener.cpp:193
WPXNoteType
WPXNoteType
Definition: libwpd_internal.h:93