WP5Listener.h

Go to the documentation of this file.
00001 /* libwpd
00002  * Copyright (C) 2003 William Lachance (wrlach@gmail.com)
00003  * Copyright (C) 2003 Marc Maurer (uwog@uwog.net)
00004  * Copyright (C) 2005-2007 Fridrich Strba (fridrich.strba@bluewin.ch)
00005  * Copyright (C) 2007 Novell, Inc. (http://www.novell.com)
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Library General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2 of the License, or (at your option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Library General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Library General Public
00018  * License along with this library; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
00020  *
00021  * For further information visit http://libwpd.sourceforge.net
00022  */
00023 
00024 /* "This product is not manufactured, approved, or supported by
00025  * Corel Corporation or Corel Corporation Limited."
00026  */
00027 
00028 #ifndef WP5LISTENER_H
00029 #define WP5LISTENER_H
00030 
00031 #include "libwpd_internal.h"
00032 #include <vector>
00033 
00034 class WP5SubDocument;
00035 class WP5PrefixData;
00036 class WP5GeneralPacketData;
00037 class WPXBinaryData;
00038 
00039 class WP5Listener
00040 {
00041 public:
00042         WP5Listener();
00043         virtual ~WP5Listener() {};
00044 
00045         virtual void startDocument() = 0;
00046         virtual void startSubDocument() = 0;
00047         virtual void setFont(const WPXString &fontName, double fontSize) = 0;
00048         virtual void setTabs(const std::vector<WPXTabStop>& tabStops, uint16_t tabOffset) = 0;
00049         virtual void insertCharacter(uint16_t character) = 0;
00050         virtual void insertTab(uint8_t tabType, double tabPosition) = 0;
00051         virtual void insertIndent(uint8_t indentType, double indentPosition) = 0;
00052         virtual void insertEOL() = 0;
00053         virtual void insertBreak(uint8_t breakType) = 0;
00054         virtual void lineSpacingChange(double lineSpacing) = 0;
00055         virtual void justificationChange(uint8_t justification) = 0;
00056         virtual void characterColorChange(uint8_t red, uint8_t green, uint8_t blue) = 0;
00057         virtual void attributeChange(bool isOn, uint8_t attribute) = 0;
00058         virtual void pageMarginChange(uint8_t side, uint16_t margin) = 0;
00059         virtual void pageFormChange(uint16_t length, uint16_t width, WPXFormOrientation orientation) = 0;
00060         virtual void marginChange(uint8_t side, uint16_t margin) = 0;
00061         virtual void endDocument() = 0;
00062         virtual void endSubDocument() = 0;
00063 
00064         virtual void defineTable(uint8_t position, uint16_t leftOffset) = 0;
00065         virtual void addTableColumnDefinition(uint32_t width, uint32_t leftGutter, uint32_t rightGutter,
00066                                 uint32_t attributes, uint8_t alignment) = 0;
00067         virtual void startTable() = 0;
00068         virtual void insertRow(uint16_t rowHeight, bool isMinimumHeight, bool isHeaderRow) = 0;
00069         virtual void insertCell(uint8_t colSpan, uint8_t rowSpan, uint8_t borderBits,
00070                                 const RGBSColor * cellFgColor, const RGBSColor * cellBgColor, 
00071                                 const RGBSColor * cellBorderColor, WPXVerticalAlignment cellVerticalAlignment, 
00072                                 bool useCellAttributes, uint32_t cellAttributes) = 0;
00073         virtual void endTable() = 0;
00074 
00075         virtual void insertNoteReference(const WPXString &noteReference) = 0;
00076         virtual void insertNote(WPXNoteType noteType, const WP5SubDocument *subDocument) = 0;
00077         virtual void headerFooterGroup(uint8_t headerFooterType, uint8_t occurenceBits, WP5SubDocument *subDocument) = 0;
00078         virtual void suppressPageCharacteristics(uint8_t suppressCode) = 0;
00079 
00080         virtual void boxOn(uint8_t positionAndType, uint8_t alignment, uint16_t width, uint16_t height, uint16_t x, uint16_t y) = 0;
00081         virtual void boxOff() = 0;
00082         virtual void insertGraphicsData(const WPXBinaryData *data) = 0;
00083 
00084         void setPrefixData(WP5PrefixData *prefixData) { m_prefixData = prefixData; }
00085         const WP5GeneralPacketData * getGeneralPacketData(const int type) const;
00086 
00087 private:
00088         WP5Listener(const WP5Listener&);
00089         WP5Listener& operator=(const WP5Listener&);
00090         WP5PrefixData *m_prefixData;
00091 };
00092 
00093 #endif /* WP5LISTENER_H */

Generated on Sun Nov 21 10:48:11 2010 for libwpd by doxygen 1.5.4