WP5StylesListener.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) 2003 William Lachance (wrlach@gmail.com)
4  * Copyright (C) 2004 Marc Maurer (uwog@uwog.net)
5  * Copyright (C) 2006-2007 Fridrich Strba (fridrich.strba@bluewin.ch)
6  * Copyright (C) 2007 Novell, Inc. (http://www.novell.com)
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
21  *
22  * For further information visit http://libwpd.sourceforge.net
23  */
24 
25 /* "This product is not manufactured, approved, or supported by
26  * Corel Corporation or Corel Corporation Limited."
27  */
28 
29 #ifndef WP5STYLESLISTENER_H
30 #define WP5STYLESLISTENER_H
31 
32 #include "WP5Listener.h"
33 #include "WPXStylesListener.h"
34 #include <vector>
35 #include <list>
36 #include "WPXPageSpan.h"
37 #include "WPXTable.h"
38 #include "WP5SubDocument.h"
39 
41 {
42 public:
43  WP5StylesListener(std::list<WPXPageSpan> &pageList, WPXTableList tableList, std::vector<WP5SubDocument *> &subDocuments);
44 
45  void startDocument() {}
46  void startSubDocument() {}
47  void setFont(const WPXString& /* fontName */, double /* fontSize */) {}
48  void setTabs(const std::vector<WPXTabStop>& /* tabStops */, uint16_t /* tabOffset */) {}
49  void insertCharacter(uint32_t /* character */)
50  {
51  /*if (!isUndoOn())*/ m_currentPageHasContent = true;
52  }
53  void insertTab(uint8_t /* tabType */, double /* tabPosition */)
54  {
55  /*if (!isUndoOn())*/ m_currentPageHasContent = true;
56  }
57  virtual void insertIndent(uint8_t /* indentType */, double /* indentPosition */)
58  {
59  /*if (!isUndoOn())*/ m_currentPageHasContent = true;
60  }
61  void characterColorChange(uint8_t /* red */, uint8_t /* green */, uint8_t /* blue */) {}
62  void insertEOL()
63  {
64  /*if (!isUndoOn())*/ m_currentPageHasContent = true;
65  }
66  void insertBreak(uint8_t breakType);
67  void attributeChange(bool /* isOn */, uint8_t /* attribute */) {}
68  void lineSpacingChange(double /* lineSpacing */) {}
69  void justificationChange(uint8_t /* justification */) {}
70  void pageMarginChange(uint8_t side, uint16_t margin);
71  void pageFormChange(uint16_t length, uint16_t width, WPXFormOrientation orientation);
72  void marginChange(uint8_t side, uint16_t margin);
73  void endDocument();
74  void endSubDocument();
75 
76  void defineTable(uint8_t /* position */, uint16_t /* leftOffset */) {}
77  void addTableColumnDefinition(uint32_t /* width */, uint32_t /* leftGutter */, uint32_t /* rightGutter */,
78  uint32_t /* attributes */, uint8_t /* alignment */) {}
79  void startTable();
80  void insertRow(uint16_t rowHeight, bool isMinimumHeight, bool isHeaderRow);
81  void insertCell(uint8_t colSpan, uint8_t rowSpan, uint8_t borderBits,
82  const RGBSColor *cellFgColor, const RGBSColor *cellBgColor,
83  const RGBSColor *cellBorderColor, WPXVerticalAlignment cellVerticalAlignment,
84  bool useCellAttributes, uint32_t cellAttributes);
85  void endTable() {}
86 
87  void insertNoteReference(const WPXString& /* noteReference */) {}
88  void insertNote(WPXNoteType /* noteType */, const WP5SubDocument * /* subDocument */) {}
89  void headerFooterGroup(uint8_t headerFooterType, uint8_t occurenceBits, WP5SubDocument *subDocument);
90  void suppressPageCharacteristics(uint8_t suppressCode);
91 
92  void boxOn(uint8_t /* positionAndType */, uint8_t /* alignment */, uint16_t /* width */, uint16_t /* height */, uint16_t /* x */, uint16_t /* y */) {}
93  virtual void boxOff() {}
94  virtual void insertGraphicsData(const WPXBinaryData * /* data */) {}
95 
96 protected:
97  void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, int nextTableIndice = 0);
98 
99 private:
103 
109  std::vector<WP5SubDocument *> &m_subDocuments;
110  std::list<WPXPageSpan>::iterator m_pageListHardPageMark;
111 };
112 
113 #endif /* WP5STYLESLISTENER_H */
114 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */

Generated for libwpd by doxygen 1.8.3