WP3Listener.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
00002 /* libwpd
00003  * Version: MPL 2.0 / LGPLv2.1+
00004  *
00005  * This Source Code Form is subject to the terms of the Mozilla Public
00006  * License, v. 2.0. If a copy of the MPL was not distributed with this
00007  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
00008  *
00009  * Major Contributor(s):
00010  * Copyright (C) 2004 Marc Maurer (uwog@uwog.net)
00011  * Copyright (C) 2005-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
00012  *
00013  * For minor contributions see the git repository.
00014  *
00015  * Alternatively, the contents of this file may be used under the terms
00016  * of the GNU Lesser General Public License Version 2.1 or later
00017  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
00018  * applicable instead of those above.
00019  *
00020  * For further information visit http://libwpd.sourceforge.net
00021  */
00022 
00023 /* "This product is not manufactured, approved, or supported by
00024  * Corel Corporation or Corel Corporation Limited."
00025  */
00026 
00027 #ifndef WP3LISTENER_H
00028 #define WP3LISTENER_H
00029 
00030 #include "libwpd_internal.h"
00031 #include <vector>
00032 
00033 class WP3SubDocument;
00034 class WP3ResourceFork;
00035 class WPXBinaryData;
00036 
00037 class WP3Listener
00038 {
00039 public:
00040         WP3Listener();
00041         virtual ~WP3Listener() {}
00042 
00043         virtual void startDocument() = 0;
00044         virtual void startSubDocument() = 0;
00045         virtual void insertCharacter(uint32_t character) = 0;
00046         virtual void insertTab() = 0;
00047         virtual void insertTab(uint8_t tabType, double tabPosition) = 0;
00048         virtual void insertBreak(uint8_t breakType) = 0;
00049         virtual void insertEOL() = 0;
00050         virtual void lineSpacingChange(double lineSpacing) = 0;
00051         virtual void attributeChange(bool isOn, uint8_t attribute) = 0;
00052         virtual void pageMarginChange(uint8_t side, uint16_t margin) = 0;
00053         virtual void pageFormChange(uint16_t length, uint16_t width, WPXFormOrientation orientation) = 0;
00054         virtual void marginChange(uint8_t side, uint16_t margin) = 0;
00055         virtual void indentFirstLineChange(double offset) = 0;
00056         virtual void setTabs(bool isRelative, const std::vector<WPXTabStop> tabStops) = 0;
00057         virtual void columnChange(WPXTextColumnType columnType, uint8_t numColumns, const std::vector<double> &columnWidth,
00058                                   const std::vector<bool> &isFixedWidth) = 0;
00059         virtual void endDocument() = 0;
00060         virtual void endSubDocument() = 0;
00061 
00062         virtual void defineTable(uint8_t position, uint16_t leftOffset) = 0;
00063         virtual void addTableColumnDefinition(uint32_t width, uint32_t leftGutter, uint32_t rightGutter,
00064                                               uint32_t attributes, uint8_t alignment) = 0;
00065         virtual void startTable() = 0;
00066         virtual void closeCell() = 0;
00067         virtual void closeRow() = 0;
00068         virtual void setTableCellSpan(uint16_t colSpan, uint16_t rowSpan) = 0;
00069         virtual void setTableCellFillColor(const RGBSColor *cellFillColor) = 0;
00070         virtual void endTable() = 0;
00071         virtual void undoChange(uint8_t undoType, uint16_t undoLevel) = 0;
00072         virtual void justificationChange(uint8_t justification) = 0;
00073         virtual void setTextColor(const RGBSColor *fontColor) = 0;
00074         virtual void setTextFont(const WPXString &fontName) = 0;
00075         virtual void setFontSize(uint16_t fontSize) = 0;
00076         virtual void insertPageNumber(const WPXString &pageNumber) = 0;
00077         virtual void insertNoteReference(const WPXString &noteReference) = 0;
00078         virtual void insertNote(WPXNoteType noteType, const WP3SubDocument *subDocument) = 0;
00079         virtual void headerFooterGroup(uint8_t headerFooterType, uint8_t occurenceBits, WP3SubDocument *subDocument) = 0;
00080         virtual void suppressPage(uint16_t suppressCode) = 0;
00081         virtual void backTab() = 0;
00082         virtual void leftIndent() = 0;
00083         virtual void leftIndent(double offset) = 0;
00084         virtual void leftRightIndent() = 0;
00085         virtual void leftRightIndent(double offset) = 0;
00086         virtual void insertPicture(double height, double width, double verticalOffset, double horizontalOffset, uint8_t leftColumn, uint8_t rightColumn,
00087                                    uint16_t figureFlags, const WPXBinaryData &binaryData) = 0;
00088         virtual void insertTextBox(double height, double width, double verticalOffset, double horizontalOffset, uint8_t leftColumn, uint8_t rightColumn,
00089                                    uint16_t figureFlags, const WP3SubDocument *subDocument, const WP3SubDocument *caption) = 0;
00090         virtual void insertWP51Table(double height, double width, double verticalOffset, double horizontalOffset, uint8_t leftColumn, uint8_t rightColumn,
00091                                      uint16_t figureFlags, const WP3SubDocument *subDocument, const WP3SubDocument *caption) = 0;
00092 
00093         void setResourceFork(WP3ResourceFork *resourceFork)
00094         {
00095                 m_resourceFork = resourceFork;
00096         }
00097         const WP3ResourceFork *getResourceFork() const
00098         {
00099                 return m_resourceFork;
00100         }
00101 
00102 private:
00103         WP3ResourceFork *m_resourceFork;
00104         // Unimplemented to prevent compiler from creating crasher ones
00105         WP3Listener(const WP3Listener &);
00106         WP3Listener &operator=(const WP3Listener &);
00107 };
00108 
00109 #endif /* WP3LISTENER_H */
00110 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */