WP3StylesListener.h

Go to the documentation of this file.
00001 /* libwpd
00002  * Copyright (C) 2004 Marc Maurer (uwog@uwog.net)
00003  * Copyright (C) 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 WP3STYLESLISTENER_H
00027 #define WP3STYLESLISTENER_H
00028 
00029 #include "WP3Listener.h"
00030 #include "WPXStylesListener.h"
00031 #include <vector>
00032 #include <set>
00033 #include "WPXPageSpan.h"
00034 #include "WPXTable.h"
00035 
00036 class WP3StylesListener : public WP3Listener, protected WPXStylesListener
00037 {
00038 public:
00039         WP3StylesListener(std::list<WPXPageSpan> &pageList, WPXTableList tableList, std::vector<WP3SubDocument *> &subDocuments);
00040 
00041         void startDocument() {}
00042         void insertCharacter(const uint16_t /* character */) { if (!isUndoOn()) m_currentPageHasContent = true; }
00043         void insertTab(const uint8_t /* tabType */, float /* tabPosition */) { if (!isUndoOn()) m_currentPageHasContent = true; }
00044         void insertEOL() { if (!isUndoOn()) m_currentPageHasContent = true; }
00045         void insertBreak(const uint8_t breakType);
00046         void attributeChange(const bool /* isOn */, const uint8_t /* attribute */) {}
00047         void lineSpacingChange(const float /* lineSpacing */) {}
00048         void justificationChange(const uint8_t /* justification */) {}
00049         void pageMarginChange(const uint8_t side, const uint16_t margin);
00050         void pageFormChange(const uint16_t length, const uint16_t width, const WPXFormOrientation orientation);
00051         void marginChange(const uint8_t side, const uint16_t margin);
00052         void indentFirstLineChange(const int16_t /* offset */) {}
00053         void setTabs(const bool /* isRelative */, const std::vector<WPXTabStop> /* tabStops */) {}
00054         void columnChange(const WPXTextColumnType /* columnType */, const uint8_t /* numColumns */,
00055                         const std::vector<float> & /* columnWidth */, const std::vector<bool> & /* isFixedWidth */) {}
00056         void endDocument();
00057 
00058         void defineTable(const uint8_t /* position */, const uint16_t /* leftOffset */) {}
00059         void addTableColumnDefinition(const uint32_t /* width */, const uint32_t /* leftGutter */, const uint32_t /* rightGutter */,
00060                                         const uint32_t /* attributes */, const uint8_t /* alignment */) {}
00061         void startTable();
00062         void insertRow();
00063         void insertCell();
00064         void closeCell() {}
00065         void closeRow() {}
00066         void setTableCellSpan(const uint16_t /* colSpan */, const uint16_t /* rowSpan */) {}
00067         void setTableCellFillColor(const RGBSColor * /* cellFillColor */) {}
00068         void endTable() {}
00069         void undoChange(const uint8_t undoType, const uint16_t undoLevel);
00070         void setTextColor(const RGBSColor * /* fontColor */) {}
00071         void setTextFont(const WPXString& /* fontName */) {}
00072         void setFontSize(const uint16_t /* fontSize */) {}
00073         void insertPageNumber(const WPXString & /* pageNumber */) {}
00074         void insertNoteReference(const WPXString & /* noteReference */) {}
00075         void insertNote(const WPXNoteType /* noteType */, WP3SubDocument * /* subDocument */) { if (!isUndoOn()) m_currentPageHasContent = true; }
00076         void headerFooterGroup(const uint8_t headerFooterType, const uint8_t occurenceBits, WP3SubDocument *subDocument);
00077         void suppressPage(const uint16_t suppressCode);
00078 
00079 protected:
00080         void _handleSubDocument(const WPXSubDocument *subDocument, const bool isHeaderFooter, WPXTableList tableList, int nextTableIndice = 0);
00081 
00082 private:
00083         WPXPageSpan m_currentPage;
00084 
00085         WPXTableList m_tableList;
00086         WPXTable *m_currentTable;
00087         float m_tempMarginLeft, m_tempMarginRight;
00088         bool m_currentPageHasContent;
00089         bool m_isSubDocument;
00090         std::vector<WP3SubDocument *> &m_subDocuments;
00091         std::list<WPXPageSpan>::iterator m_pageListHardPageMark;
00092 };
00093 
00094 #endif /* WP3STYLESLISTENER_H */

Generated on Fri Apr 20 15:46:24 2007 for libwpd by doxygen 1.5.1