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