Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
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& , double ) {}
00047 void setTabs(const std::vector<WPXTabStop>& , uint16_t ) {}
00048 void insertCharacter(uint32_t ) { m_currentPageHasContent = true; }
00049 void insertTab(uint8_t , double ) { m_currentPageHasContent = true; }
00050 virtual void insertIndent(uint8_t , double ) { m_currentPageHasContent = true; }
00051 void characterColorChange(uint8_t , uint8_t , uint8_t ) {};
00052 void insertEOL() { m_currentPageHasContent = true; }
00053 void insertBreak(uint8_t breakType);
00054 void attributeChange(bool , uint8_t ) {}
00055 void lineSpacingChange(double ) {}
00056 void justificationChange(uint8_t ) {}
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 , uint16_t ) {}
00064 void addTableColumnDefinition(uint32_t , uint32_t , uint32_t ,
00065 uint32_t , uint8_t ) {}
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& ) {};
00075 void insertNote(WPXNoteType , const WP5SubDocument * ) {};
00076 void headerFooterGroup(uint8_t headerFooterType, uint8_t occurenceBits, WP5SubDocument *subDocument);
00077 void suppressPageCharacteristics(uint8_t suppressCode);
00078
00079 void boxOn(uint8_t , uint8_t , uint16_t , uint16_t , uint16_t , uint16_t ) {};
00080 virtual void boxOff() {};
00081 virtual void insertGraphicsData(const WPXBinaryData * ) {};
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