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
00029 #ifndef WP5STYLESLISTENER_H
00030 #define WP5STYLESLISTENER_H
00031
00032 #include "WP5Listener.h"
00033 #include "WPXStylesListener.h"
00034 #include <vector>
00035 #include <list>
00036 #include "WPXPageSpan.h"
00037 #include "WPXTable.h"
00038 #include "WP5SubDocument.h"
00039
00040 class WP5StylesListener : public WP5Listener, protected WPXStylesListener
00041 {
00042 public:
00043 WP5StylesListener(std::list<WPXPageSpan> &pageList, WPXTableList tableList, std::vector<WP5SubDocument *> &subDocuments);
00044
00045 void startDocument() {}
00046 void startSubDocument() {}
00047 void setFont(const WPXString& , double ) {}
00048 void setTabs(const std::vector<WPXTabStop>& , uint16_t ) {}
00049 void insertCharacter(uint32_t )
00050 {
00051 m_currentPageHasContent = true;
00052 }
00053 void insertTab(uint8_t , double )
00054 {
00055 m_currentPageHasContent = true;
00056 }
00057 virtual void insertIndent(uint8_t , double )
00058 {
00059 m_currentPageHasContent = true;
00060 }
00061 void characterColorChange(uint8_t , uint8_t , uint8_t ) {};
00062 void insertEOL()
00063 {
00064 m_currentPageHasContent = true;
00065 }
00066 void insertBreak(uint8_t breakType);
00067 void attributeChange(bool , uint8_t ) {}
00068 void lineSpacingChange(double ) {}
00069 void justificationChange(uint8_t ) {}
00070 void pageMarginChange(uint8_t side, uint16_t margin);
00071 void pageFormChange(uint16_t length, uint16_t width, WPXFormOrientation orientation);
00072 void marginChange(uint8_t side, uint16_t margin);
00073 void endDocument();
00074 void endSubDocument();
00075
00076 void defineTable(uint8_t , uint16_t ) {}
00077 void addTableColumnDefinition(uint32_t , uint32_t , uint32_t ,
00078 uint32_t , uint8_t ) {}
00079 void startTable();
00080 void insertRow(uint16_t rowHeight, bool isMinimumHeight, bool isHeaderRow);
00081 void insertCell(uint8_t colSpan, uint8_t rowSpan, uint8_t borderBits,
00082 const RGBSColor *cellFgColor, const RGBSColor *cellBgColor,
00083 const RGBSColor *cellBorderColor, WPXVerticalAlignment cellVerticalAlignment,
00084 bool useCellAttributes, uint32_t cellAttributes);
00085 void endTable() {}
00086
00087 void insertNoteReference(const WPXString& ) {};
00088 void insertNote(WPXNoteType , const WP5SubDocument * ) {};
00089 void headerFooterGroup(uint8_t headerFooterType, uint8_t occurenceBits, WP5SubDocument *subDocument);
00090 void suppressPageCharacteristics(uint8_t suppressCode);
00091
00092 void boxOn(uint8_t , uint8_t , uint16_t , uint16_t , uint16_t , uint16_t ) {};
00093 virtual void boxOff() {};
00094 virtual void insertGraphicsData(const WPXBinaryData * ) {};
00095
00096 protected:
00097 void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, int nextTableIndice = 0);
00098
00099 private:
00100 WP5StylesListener(const WP5StylesListener &);
00101 WP5StylesListener &operator=(const WP5StylesListener &);
00102 WPXPageSpan m_currentPage, m_nextPage;
00103
00104 WPXTableList m_tableList;
00105 WPXTable *m_currentTable;
00106 double m_tempMarginLeft, m_tempMarginRight;
00107 bool m_currentPageHasContent;
00108 bool m_isSubDocument;
00109 std::vector<WP5SubDocument *> &m_subDocuments;
00110 std::list<WPXPageSpan>::iterator m_pageListHardPageMark;
00111 };
00112
00113 #endif
00114