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