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