WP3Listener.h

Go to the documentation of this file.
00001 /* libwpd
00002  * Copyright (C) 2004 Marc Maurer (uwog@uwog.net)
00003  * Copyright (C) 2005-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Library General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2 of the License, or (at your option) any later version.
00009  *
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Library General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Library General Public
00016  * License along with this library; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
00018  *
00019  * For further information visit http://libwpd.sourceforge.net
00020  */
00021 
00022 /* "This product is not manufactured, approved, or supported by
00023  * Corel Corporation or Corel Corporation Limited."
00024  */
00025 
00026 #ifndef WP3LISTENER_H
00027 #define WP3LISTENER_H
00028 
00029 #include "libwpd_internal.h"
00030 #include <vector>
00031 
00032 class WP3SubDocument;
00033 class WP3ResourceFork;
00034 class WPXBinaryData;
00035 
00036 class WP3Listener
00037 {
00038 public:
00039         WP3Listener();
00040         virtual ~WP3Listener() {}
00041 
00042         virtual void startDocument() = 0;
00043         virtual void startSubDocument() = 0;
00044         virtual void insertCharacter(uint32_t character) = 0;
00045         virtual void insertTab() = 0;
00046         virtual void insertTab(uint8_t tabType, double tabPosition) = 0;
00047         virtual void insertBreak(uint8_t breakType) = 0;
00048         virtual void insertEOL() = 0;
00049         virtual void lineSpacingChange(double lineSpacing) = 0;
00050         virtual void attributeChange(bool isOn, uint8_t attribute) = 0;
00051         virtual void pageMarginChange(uint8_t side, uint16_t margin) = 0;
00052         virtual void pageFormChange(uint16_t length, uint16_t width, WPXFormOrientation orientation) = 0;
00053         virtual void marginChange(uint8_t side, uint16_t margin) = 0;
00054         virtual void indentFirstLineChange(int16_t offset) = 0;
00055         virtual void setTabs(bool isRelative, const std::vector<WPXTabStop> tabStops) = 0;
00056         virtual void columnChange(WPXTextColumnType columnType, uint8_t numColumns, const std::vector<double> &columnWidth,
00057                                         const std::vector<bool> &isFixedWidth) = 0;
00058         virtual void endDocument() = 0;
00059         virtual void endSubDocument() = 0;
00060 
00061         virtual void defineTable(uint8_t position, uint16_t leftOffset) = 0;
00062         virtual void addTableColumnDefinition(uint32_t width, uint32_t leftGutter, uint32_t rightGutter,
00063                                         uint32_t attributes, uint8_t alignment) = 0;
00064         virtual void startTable() = 0;
00065         virtual void closeCell() = 0;
00066         virtual void closeRow() = 0;
00067         virtual void setTableCellSpan(uint16_t colSpan, uint16_t rowSpan) = 0;
00068         virtual void setTableCellFillColor(const RGBSColor * cellFillColor) = 0;
00069         virtual void endTable() = 0;
00070         virtual void undoChange(uint8_t undoType, uint16_t undoLevel) = 0;
00071         virtual void justificationChange(uint8_t justification) = 0;
00072         virtual void setTextColor(const RGBSColor * fontColor) = 0;
00073         virtual void setTextFont(const WPXString &fontName) = 0;
00074         virtual void setFontSize(uint16_t fontSize) = 0;
00075         virtual void insertPageNumber(const WPXString &pageNumber) = 0;
00076         virtual void insertNoteReference(const WPXString &noteReference) = 0;
00077         virtual void insertNote(WPXNoteType noteType, const WP3SubDocument *subDocument) = 0;
00078         virtual void headerFooterGroup(uint8_t headerFooterType, uint8_t occurenceBits, WP3SubDocument *subDocument) = 0;
00079         virtual void suppressPage(uint16_t suppressCode) = 0;
00080         virtual void backTab() = 0;
00081         virtual void leftIndent() = 0;
00082         virtual void leftIndent(double offset) = 0;
00083         virtual void leftRightIndent() = 0;
00084         virtual void leftRightIndent(double offset) = 0;
00085         virtual void insertPicture(double height, double width, double verticalOffset, double horizontalOffset, uint8_t leftColumn, uint8_t rightColumn,
00086                         uint16_t figureFlags, const WPXBinaryData &binaryData) = 0;
00087         virtual void insertTextBox(double height, double width, double verticalOffset, double horizontalOffset, uint8_t leftColumn, uint8_t rightColumn,
00088                         uint16_t figureFlags, const WP3SubDocument *subDocument, const WP3SubDocument *caption) = 0;
00089         virtual void insertWP51Table(double height, double width, double verticalOffset, double horizontalOffset, uint8_t leftColumn, uint8_t rightColumn,
00090                         uint16_t figureFlags, const WP3SubDocument *subDocument, const WP3SubDocument *caption) = 0;
00091 
00092         void setResourceFork(WP3ResourceFork *resourceFork) { m_resourceFork = resourceFork; }
00093         const WP3ResourceFork *getResourceFork() const { return m_resourceFork; }
00094 
00095 private:
00096         WP3ResourceFork *m_resourceFork;
00097 };
00098 
00099 #endif /* WP3LISTENER_H */