WP3ContentListener.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) 2005-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 WP3CONTENTLISTENER_H
28 #define WP3CONTENTLISTENER_H
29 
30 #include "WP3Listener.h"
31 #include "WPXContentListener.h"
32 #include "WP3SubDocument.h"
33 
36 {
39  uint16_t m_colSpan;
40  uint16_t m_rowSpan;
44 
46 private:
49 };
50 
52 {
53 public:
54  WP3ContentListener(std::list<WPXPageSpan> &pageList, std::vector<WP3SubDocument *> &subDocuments, WPXDocumentInterface *documentInterface);
56 
58  {
60  }
62  {
64  }
65  void insertCharacter(uint32_t character);
66  void insertTab();
67  void insertTab(uint8_t tabType, double tabPosition);
68  void insertBreak(uint8_t breakType)
69  {
71  }
72  void insertEOL();
73  void attributeChange(bool isOn, uint8_t attribute);
74  void lineSpacingChange(double lineSpacing)
75  {
77  }
78  void pageMarginChange(uint8_t /* side */, uint16_t /* margin */) {}
79  void pageFormChange(uint16_t /* length */, uint16_t /* width */, WPXFormOrientation /* orientation */) {}
80  void marginChange(uint8_t side, uint16_t margin);
81  void indentFirstLineChange(int16_t offset);
82  void setTabs(bool isRelative, const std::vector<WPXTabStop> tabStops);
83  void columnChange(WPXTextColumnType columnType, uint8_t numColumns, const std::vector<double> &columnWidth,
84  const std::vector<bool> &isFixedWidth);
85  void endDocument()
86  {
88  }
90  {
92  }
93 
94  void defineTable(uint8_t position, uint16_t leftOffset);
95  void addTableColumnDefinition(uint32_t width, uint32_t leftGutter, uint32_t rightGutter,
96  uint32_t attributes, uint8_t alignment);
97  void startTable();
98  void insertRow();
99  void insertCell();
100  void closeCell();
101  void closeRow();
102  void setTableCellSpan(uint16_t colSpan, uint16_t rowSpan);
103  void setTableCellFillColor(const RGBSColor *cellFillColor);
104  void endTable();
105  void undoChange(uint8_t undoType, uint16_t undoLevel);
106  void justificationChange(uint8_t justification);
107  void setTextColor(const RGBSColor *fontColor);
108  void setTextFont(const WPXString &fontName);
109  void setFontSize(uint16_t fontSize);
110  void insertPageNumber(const WPXString &pageNumber);
111  void insertNoteReference(const WPXString &noteReference);
112  void insertNote(WPXNoteType noteType, const WP3SubDocument *subDocument);
113  void headerFooterGroup(uint8_t headerFooterType, uint8_t occurenceBits, WP3SubDocument *subDocument);
114  void suppressPage(uint16_t /* suppressCode */) {}
115  void backTab();
116  void leftIndent();
117  void leftIndent(double offset);
118  void leftRightIndent();
119  void leftRightIndent(double offset);
120  void insertPicture(double height, double width, double verticalOffset, double horizontalOffset, uint8_t leftColumn, uint8_t rightColumn,
121  uint16_t figureFlags, const WPXBinaryData &binaryData);
122  void insertTextBox(double height, double width, double verticalOffset, double horizontalOffset, uint8_t leftColumn, uint8_t rightColumn,
123  uint16_t figureFlags, const WP3SubDocument *subDocument, const WP3SubDocument *caption);
124  void insertWP51Table(double height, double width, double verticalOffset, double horizontalOffset, uint8_t leftColumn, uint8_t rightColumn,
125  uint16_t figureFlags, const WP3SubDocument *subDocument, const WP3SubDocument *caption);
126 
127 protected:
128  void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, int nextTableIndice = 0);
129  void _openParagraph();
130 
131  void _flushText();
132  void _changeList() {}
133 
134  void _handleFrameParameters( WPXPropertyList &propList, double height, double width, double verticalOffset, double horizontalOffset, uint8_t leftColumn, uint8_t rightColumn,
135  uint16_t figureFlags );
136 
137 private:
141  std::vector<WP3SubDocument *> &m_subDocuments;
142 };
143 
144 #endif /* WP3CONTENTLISTENER_H */
145 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */

Generated for libwpd by doxygen 1.8.1.2