WP5StylesListener.h

Go to the documentation of this file.
00001 /* libwpd
00002  * Copyright (C) 2003 William Lachance (wrlach@gmail.com)
00003  * Copyright (C) 2004 Marc Maurer (uwog@uwog.net)
00004  * Copyright (C) 2006-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 WP5STYLESLISTENER_H
00029 #define WP5STYLESLISTENER_H
00030 
00031 #include "WP5Listener.h"
00032 #include "WPXStylesListener.h"
00033 #include <vector>
00034 #include <list>
00035 #include "WPXPageSpan.h"
00036 #include "WPXTable.h"
00037 #include "WP5SubDocument.h"
00038 
00039 class WP5StylesListener : public WP5Listener, protected WPXStylesListener
00040 {
00041 public:
00042         WP5StylesListener(std::list<WPXPageSpan> &pageList, WPXTableList tableList, std::vector<WP5SubDocument*> &subDocuments);
00043 
00044         void startDocument() {}
00045         void startSubDocument() {}
00046         void setFont(const WPXString& /* fontName */, double /* fontSize */) {}
00047         void setTabs(const std::vector<WPXTabStop>& /* tabStops */, uint16_t /* tabOffset */) {} 
00048         void insertCharacter(uint16_t /* character */) { /*if (!isUndoOn())*/ m_currentPageHasContent = true; }
00049         void insertTab(uint8_t /* tabType */, double /* tabPosition */) { /*if (!isUndoOn())*/ m_currentPageHasContent = true; }
00050         virtual void insertIndent(uint8_t /* indentType */, double /* indentPosition */) { /*if (!isUndoOn())*/ m_currentPageHasContent = true; }
00051         void characterColorChange(uint8_t /* red */, uint8_t /* green */, uint8_t /* blue */) {};
00052         void insertEOL() { /*if (!isUndoOn())*/ m_currentPageHasContent = true; }
00053         void insertBreak(uint8_t breakType);
00054         void attributeChange(bool /* isOn */, uint8_t /* attribute */) {}
00055         void lineSpacingChange(double /* lineSpacing */) {}
00056         void justificationChange(uint8_t /* justification */) {}
00057         void pageMarginChange(uint8_t side, uint16_t margin);
00058         void pageFormChange(uint16_t length, uint16_t width, WPXFormOrientation orientation);
00059         void marginChange(uint8_t side, uint16_t margin);
00060         void endDocument();
00061         void endSubDocument();
00062 
00063         void defineTable(uint8_t /* position */, uint16_t /* leftOffset */) {}
00064         void addTableColumnDefinition(uint32_t /* width */, uint32_t /* leftGutter */, uint32_t /* rightGutter */,
00065                                 uint32_t /* attributes */, uint8_t /* alignment */) {}
00066         void startTable();
00067         void insertRow(uint16_t rowHeight, bool isMinimumHeight, bool isHeaderRow);
00068         void insertCell(uint8_t colSpan, uint8_t rowSpan, uint8_t borderBits,
00069                                 const RGBSColor * cellFgColor, const RGBSColor * cellBgColor, 
00070                                 const RGBSColor * cellBorderColor, WPXVerticalAlignment cellVerticalAlignment, 
00071                                 bool useCellAttributes, uint32_t cellAttributes);
00072         void endTable() {}
00073 
00074         void insertNoteReference(const WPXString& /* noteReference */) {};
00075         void insertNote(WPXNoteType /* noteType */, const WP5SubDocument * /* subDocument */) {};
00076         void headerFooterGroup(uint8_t headerFooterType, uint8_t occurenceBits, WP5SubDocument *subDocument);
00077         void suppressPageCharacteristics(uint8_t suppressCode);
00078 
00079         void boxOn(uint8_t /* positionAndType */, uint8_t /* alignment */, uint16_t /* width */, uint16_t /* height */, uint16_t /* x */, uint16_t /* y */) {};
00080         virtual void boxOff() {};
00081         virtual void insertGraphicsData(const WPXBinaryData * /* data */) {};
00082 
00083 protected:
00084         void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, int nextTableIndice = 0);
00085 
00086 private:
00087         WP5StylesListener(const WP5StylesListener&);
00088         WP5StylesListener& operator=(const WP5StylesListener&);
00089         WPXPageSpan m_currentPage, m_nextPage;
00090 
00091         WPXTableList m_tableList;
00092         WPXTable *m_currentTable;
00093         double m_tempMarginLeft, m_tempMarginRight;
00094         bool m_currentPageHasContent;
00095         bool m_isSubDocument;
00096         std::vector<WP5SubDocument *> &m_subDocuments;
00097         std::list<WPXPageSpan>::iterator m_pageListHardPageMark;
00098 };
00099 
00100 #endif /* WP5STYLESLISTENER_H */

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