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