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 #ifndef WP3STYLESLISTENER_H
00028 #define WP3STYLESLISTENER_H
00029
00030 #include "WP3Listener.h"
00031 #include "WPXStylesListener.h"
00032 #include <vector>
00033 #include <set>
00034 #include "WPXPageSpan.h"
00035 #include "WPXTable.h"
00036
00037 class WP3StylesListener : public WP3Listener, protected WPXStylesListener
00038 {
00039 public:
00040 WP3StylesListener(std::list<WPXPageSpan> &pageList, WPXTableList tableList, std::vector<WP3SubDocument *> &subDocuments);
00041
00042 void startDocument() {}
00043 void startSubDocument() {}
00044 void insertCharacter(uint32_t )
00045 {
00046 if (!isUndoOn()) m_currentPageHasContent = true;
00047 }
00048 void insertTab()
00049 {
00050 if (!isUndoOn()) m_currentPageHasContent = true;
00051 }
00052 void insertTab(uint8_t , double )
00053 {
00054 if (!isUndoOn()) m_currentPageHasContent = true;
00055 }
00056 void insertEOL()
00057 {
00058 if (!isUndoOn()) m_currentPageHasContent = true;
00059 }
00060 void insertBreak(uint8_t breakType);
00061 void attributeChange(bool , uint8_t ) {}
00062 void lineSpacingChange(double ) {}
00063 void justificationChange(uint8_t ) {}
00064 void pageMarginChange(uint8_t side, uint16_t margin);
00065 void pageFormChange(uint16_t length, uint16_t width, WPXFormOrientation orientation);
00066 void marginChange(uint8_t side, uint16_t margin);
00067 void indentFirstLineChange(int16_t ) {}
00068 void setTabs(bool , const std::vector<WPXTabStop> ) {}
00069 void columnChange(WPXTextColumnType , uint8_t ,
00070 const std::vector<double> & , const std::vector<bool> & ) {}
00071 void endDocument();
00072 void endSubDocument();
00073
00074 void defineTable(uint8_t , uint16_t ) {}
00075 void addTableColumnDefinition(uint32_t , uint32_t , uint32_t ,
00076 uint32_t , uint8_t ) {}
00077 void startTable();
00078 void insertRow();
00079 void insertCell();
00080 void closeCell() {}
00081 void closeRow() {}
00082 void setTableCellSpan(uint16_t , uint16_t ) {}
00083 void setTableCellFillColor(const RGBSColor * ) {}
00084 void endTable() {}
00085 void undoChange(uint8_t undoType, uint16_t undoLevel);
00086 void setTextColor(const RGBSColor * ) {}
00087 void setTextFont(const WPXString& ) {}
00088 void setFontSize(uint16_t ) {}
00089 void insertPageNumber(const WPXString & ) {}
00090 void insertNoteReference(const WPXString & ) {}
00091 void insertNote(WPXNoteType , const WP3SubDocument * )
00092 {
00093 if (!isUndoOn()) m_currentPageHasContent = true;
00094 }
00095 void headerFooterGroup(uint8_t headerFooterType, uint8_t occurenceBits, WP3SubDocument *subDocument);
00096 void suppressPage(uint16_t suppressCode);
00097 void backTab()
00098 {
00099 if (!isUndoOn()) m_currentPageHasContent = true;
00100 }
00101 void leftIndent() {}
00102 void leftIndent(double ) {}
00103 void leftRightIndent() {}
00104 void leftRightIndent(double ) {}
00105 void insertPicture(double , double , double , double , uint8_t , uint8_t ,
00106 uint16_t , const WPXBinaryData & ) {}
00107 void insertTextBox(double , double , double , double , uint8_t , uint8_t ,
00108 uint16_t , const WP3SubDocument * , const WP3SubDocument * ) {}
00109 void insertWP51Table(double , double , double , double , uint8_t , uint8_t ,
00110 uint16_t , const WP3SubDocument * , const WP3SubDocument * ) {}
00111
00112 protected:
00113 void _handleSubDocument(const WPXSubDocument *subDocument, WPXSubDocumentType subDocumentType, WPXTableList tableList, int nextTableIndice = 0);
00114
00115 private:
00116 WP3StylesListener(const WP3StylesListener &);
00117 WP3StylesListener &operator=(const WP3StylesListener &);
00118 WPXPageSpan m_currentPage;
00119
00120 WPXTableList m_tableList;
00121 WPXTable *m_currentTable;
00122 double m_tempMarginLeft, m_tempMarginRight;
00123 bool m_currentPageHasContent;
00124 bool m_isSubDocument;
00125 std::vector<WP3SubDocument *> &m_subDocuments;
00126 std::list<WPXPageSpan>::iterator m_pageListHardPageMark;
00127 };
00128
00129 #endif
00130