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 #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 startSubDocument() {}
00043 void insertCharacter(uint32_t ) { if (!isUndoOn()) m_currentPageHasContent = true; }
00044 void insertTab() { if (!isUndoOn()) m_currentPageHasContent = true; }
00045 void insertTab(uint8_t , double ) { if (!isUndoOn()) m_currentPageHasContent = true; }
00046 void insertEOL() { if (!isUndoOn()) m_currentPageHasContent = true; }
00047 void insertBreak(uint8_t breakType);
00048 void attributeChange(bool , uint8_t ) {}
00049 void lineSpacingChange(double ) {}
00050 void justificationChange(uint8_t ) {}
00051 void pageMarginChange(uint8_t side, uint16_t margin);
00052 void pageFormChange(uint16_t length, uint16_t width, WPXFormOrientation orientation);
00053 void marginChange(uint8_t side, uint16_t margin);
00054 void indentFirstLineChange(int16_t ) {}
00055 void setTabs(bool , const std::vector<WPXTabStop> ) {}
00056 void columnChange(WPXTextColumnType , uint8_t ,
00057 const std::vector<double> & , const std::vector<bool> & ) {}
00058 void endDocument();
00059 void endSubDocument();
00060
00061 void defineTable(uint8_t , uint16_t ) {}
00062 void addTableColumnDefinition(uint32_t , uint32_t , uint32_t ,
00063 uint32_t , uint8_t ) {}
00064 void startTable();
00065 void insertRow();
00066 void insertCell();
00067 void closeCell() {}
00068 void closeRow() {}
00069 void setTableCellSpan(uint16_t , uint16_t ) {}
00070 void setTableCellFillColor(const RGBSColor * ) {}
00071 void endTable() {}
00072 void undoChange(uint8_t undoType, uint16_t undoLevel);
00073 void setTextColor(const RGBSColor * ) {}
00074 void setTextFont(const WPXString& ) {}
00075 void setFontSize(uint16_t ) {}
00076 void insertPageNumber(const WPXString & ) {}
00077 void insertNoteReference(const WPXString & ) {}
00078 void insertNote(WPXNoteType , const WP3SubDocument * ) { if (!isUndoOn()) m_currentPageHasContent = true; }
00079 void headerFooterGroup(uint8_t headerFooterType, uint8_t occurenceBits, WP3SubDocument *subDocument);
00080 void suppressPage(uint16_t suppressCode);
00081 void backTab() { if (!isUndoOn()) m_currentPageHasContent = true; }
00082 void leftIndent() {}
00083 void leftIndent(double ) {}
00084 void leftRightIndent() {}
00085 void leftRightIndent(double ) {}
00086 void insertPicture(double , double , double , double , uint8_t , uint8_t ,
00087 uint16_t , const WPXBinaryData & ) {}
00088 void insertTextBox(double , double , double , double , uint8_t , uint8_t ,
00089 uint16_t , const WP3SubDocument * , const WP3SubDocument * ) {}
00090 void insertWP51Table(double , double , double , double , uint8_t , uint8_t ,
00091 uint16_t , const WP3SubDocument * , const WP3SubDocument * ) {}
00092
00093 protected:
00094 void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, int nextTableIndice = 0);
00095
00096 private:
00097 WP3StylesListener(const WP3StylesListener&);
00098 WP3StylesListener& operator=(const WP3StylesListener&);
00099 WPXPageSpan m_currentPage;
00100
00101 WPXTableList m_tableList;
00102 WPXTable *m_currentTable;
00103 double m_tempMarginLeft, m_tempMarginRight;
00104 bool m_currentPageHasContent;
00105 bool m_isSubDocument;
00106 std::vector<WP3SubDocument *> &m_subDocuments;
00107 std::list<WPXPageSpan>::iterator m_pageListHardPageMark;
00108 };
00109
00110 #endif