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