WP5ContentListener.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) 2003 Marc Maurer (uwog@uwog.net)
5  * Copyright (C) 2005-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 WP5CONTENTLISTENER_H
30 #define WP5CONTENTLISTENER_H
31 
32 #include "WP5Listener.h"
33 #include "WPXContentListener.h"
34 #include "WP5SubDocument.h"
35 #include "WPXString.h"
36 #include "libwpd_internal.h"
37 #include "WPXDocumentInterface.h"
38 #include <vector>
39 
42 {
47 
49 
51 };
52 
54 {
55 public:
56  WP5ContentListener(std::list<WPXPageSpan> &pageList, std::vector<WP5SubDocument *> &subDocuments, WPXDocumentInterface *documentInterface);
58 
60  {
62  };
64  {
66  };
67  void setFont(const WPXString &fontName, double fontSize);
68  void setTabs(const std::vector<WPXTabStop> &tabStops, uint16_t tabOffset);
69  void insertCharacter(uint32_t character);
70  void insertTab(uint8_t tabType, double tabPosition);
71  void insertIndent(uint8_t indentType, double indentPosition);
72  void insertEOL();
73  void insertBreak(uint8_t breakType)
74  {
76  };
77  void lineSpacingChange(double lineSpacing)
78  {
80  };
81  void justificationChange(uint8_t justification)
82  {
84  };
85  void characterColorChange(uint8_t red, uint8_t green, uint8_t blue);
86  void attributeChange(bool isOn, uint8_t attribute);
87  void pageMarginChange(uint8_t /* side */, uint16_t /* margin */) {};
88  void pageFormChange(uint16_t /* length */, uint16_t /* width */, WPXFormOrientation /* orientation */) {};
89  void marginChange(uint8_t side, uint16_t margin);
90  void paragraphMarginChange(uint8_t /* side */, int16_t /* margin */) {};
91  void endDocument()
92  {
94  };
96  {
98  };
99 
100  void defineTable(uint8_t position, uint16_t leftOffset);
101  void addTableColumnDefinition(uint32_t width, uint32_t leftGutter, uint32_t rightGutter,
102  uint32_t attributes, uint8_t alignment);
103  void startTable();
104  void insertRow(uint16_t rowHeight, bool isMinimumHeight, bool isHeaderRow);
105  void insertCell(uint8_t colSpan, uint8_t rowSpan, uint8_t borderBits,
106  const RGBSColor *cellFgColor, const RGBSColor *cellBgColor,
107  const RGBSColor *cellBorderColor, WPXVerticalAlignment cellVerticalAlignment,
108  bool useCellAttributes, uint32_t cellAttributes);
109  void endTable();
110 
111  void insertNoteReference(const WPXString &noteReference);
112  void insertNote(WPXNoteType noteType, const WP5SubDocument *subDocument);
113  void headerFooterGroup(uint8_t headerFooterType, uint8_t occurenceBits, WP5SubDocument *subDocument);
114  void suppressPageCharacteristics(uint8_t /* suppressCode */) {};
115 
116  void setDefaultFont(const WPXString &fontName, double fontSize);
117 
118  void boxOn(uint8_t positionAndType, uint8_t alignment, uint16_t width, uint16_t height, uint16_t x, uint16_t y);
119  virtual void boxOff();
120  virtual void insertGraphicsData(const WPXBinaryData *data);
121 
122 protected:
123  void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, int nextTableIndice = 0);
124 
125  void _flushText();
126  void _changeList() {};
127 
128 private:
132  std::vector<WP5SubDocument *> &m_subDocuments;
135 };
136 
137 #endif /* WP5CONTENTLISTENER_H */
138 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */

Generated for libwpd by doxygen 1.8.1.2