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  * Copyright (C) 2004 Marc Maurer (uwog@uwog.net)
4  * Copyright (C) 2006 Fridrich Strba (fridrich.strba@bluewin.ch)
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
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 
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(uint32_t /* character */)
45  {
46  if (!isUndoOn()) m_currentPageHasContent = true;
47  }
48  void insertTab()
49  {
50  if (!isUndoOn()) m_currentPageHasContent = true;
51  }
52  void insertTab(uint8_t /* 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(uint8_t breakType);
61  void attributeChange(bool /* isOn */, uint8_t /* attribute */) {}
62  void lineSpacingChange(double /* lineSpacing */) {}
63  void justificationChange(uint8_t /* justification */) {}
64  void pageMarginChange(uint8_t side, uint16_t margin);
65  void pageFormChange(uint16_t length, uint16_t width, WPXFormOrientation orientation);
66  void marginChange(uint8_t side, uint16_t margin);
67  void indentFirstLineChange(int16_t /* offset */) {}
68  void setTabs(bool /* isRelative */, const std::vector<WPXTabStop> /* tabStops */) {}
69  void columnChange(WPXTextColumnType /* columnType */, uint8_t /* numColumns */,
70  const std::vector<double> & /* columnWidth */, const std::vector<bool> & /* isFixedWidth */) {}
71  void endDocument();
72  void endSubDocument();
73 
74  void defineTable(uint8_t /* position */, uint16_t /* leftOffset */) {}
75  void addTableColumnDefinition(uint32_t /* width */, uint32_t /* leftGutter */, uint32_t /* rightGutter */,
76  uint32_t /* attributes */, uint8_t /* alignment */) {}
77  void startTable();
78  void insertRow();
79  void insertCell();
80  void closeCell() {}
81  void closeRow() {}
82  void setTableCellSpan(uint16_t /* colSpan */, uint16_t /* rowSpan */) {}
83  void setTableCellFillColor(const RGBSColor * /* cellFillColor */) {}
84  void endTable() {}
85  void undoChange(uint8_t undoType, uint16_t undoLevel);
86  void setTextColor(const RGBSColor * /* fontColor */) {}
87  void setTextFont(const WPXString& /* fontName */) {}
88  void setFontSize(uint16_t /* fontSize */) {}
89  void insertPageNumber(const WPXString & /* pageNumber */) {}
90  void insertNoteReference(const WPXString & /* noteReference */) {}
91  void insertNote(WPXNoteType /* noteType */, const WP3SubDocument * /* subDocument */)
92  {
93  if (!isUndoOn()) m_currentPageHasContent = true;
94  }
95  void headerFooterGroup(uint8_t headerFooterType, uint8_t occurenceBits, WP3SubDocument *subDocument);
96  void suppressPage(uint16_t suppressCode);
97  void backTab()
98  {
99  if (!isUndoOn()) m_currentPageHasContent = true;
100  }
101  void leftIndent() {}
102  void leftIndent(double /* offset */) {}
103  void leftRightIndent() {}
104  void leftRightIndent(double /* offset */) {}
105  void insertPicture(double /* height */, double /* width */, double /* verticalOffset */, double /* horizontalOffset */, uint8_t /* leftColumn */, uint8_t /* rightColumn */,
106  uint16_t /* figureFlags */, const WPXBinaryData & /* binaryData */) {}
107  void insertTextBox(double /* height */, double /* width */, double /* verticalOffset */, double /* horizontalOffset */, uint8_t /* leftColumn */, uint8_t /* rightColumn */,
108  uint16_t /* figureFlags */, const WP3SubDocument * /* subDocument */, const WP3SubDocument * /* caption */) {}
109  void insertWP51Table(double /* height */, double /* width */, double /* verticalOffset */, double /* horizontalOffset */, uint8_t /* leftColumn */, uint8_t /* rightColumn */,
110  uint16_t /* figureFlags */, const WP3SubDocument * /* subDocument */, const WP3SubDocument * /* caption */) {}
111 
112 protected:
113  void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, int nextTableIndice = 0);
114 
115 private:
119 
125  std::vector<WP3SubDocument *> &m_subDocuments;
126  std::list<WPXPageSpan>::iterator m_pageListHardPageMark;
127 };
128 
129 #endif /* WP3STYLESLISTENER_H */
130 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */

Generated for libwpd by doxygen 1.8.3