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
00028
00029 #ifndef WP6STYLESLISTENER_H
00030 #define WP6STYLESLISTENER_H
00031
00032 #include "WP6Listener.h"
00033 #include "WPXStylesListener.h"
00034 #include <vector>
00035 #include <set>
00036 #include <list>
00037 #include "WPXPageSpan.h"
00038 #include "WPXTable.h"
00039
00040 class WPXSubDocument;
00041
00042 class WP6StylesListener : public WP6Listener, protected WPXStylesListener
00043 {
00044 public:
00045 WP6StylesListener(std::list<WPXPageSpan> &pageList, WPXTableList tableList);
00046
00047 void setDate(const uint16_t , const uint8_t , const uint8_t ,
00048 const uint8_t , const uint8_t , const uint8_t ,
00049 const uint8_t , const uint8_t , const uint8_t ) {}
00050 void setExtendedInformation(const uint16_t , const WPXString & ) {}
00051 void startDocument() {}
00052 void setAlignmentCharacter(const uint16_t ) {}
00053 void setLeaderCharacter(const uint16_t , const uint8_t ) {}
00054 void defineTabStops(const bool , const std::vector<WPXTabStop> & ,
00055 const std::vector<bool> & ) {}
00056 void insertCharacter(const uint16_t ) { if (!isUndoOn()) m_currentPageHasContent = true; }
00057 void insertTab(const uint8_t , float ) { if (!isUndoOn()) m_currentPageHasContent = true; }
00058 void handleLineBreak() { if (!isUndoOn()) m_currentPageHasContent = true; }
00059 void insertEOL() { if (!isUndoOn()) m_currentPageHasContent = true; }
00060 void insertBreak(const uint8_t breakType);
00061 void characterColorChange(const uint8_t , const uint8_t , const uint8_t ) {}
00062 void characterShadingChange(const uint8_t ) {}
00063 void highlightChange(const bool , const RGBSColor ) {}
00064 void fontChange(const uint16_t , const uint16_t ) {}
00065 void attributeChange(const bool , const uint8_t ) {}
00066 void lineSpacingChange(const float ) {}
00067 void spacingAfterParagraphChange(const float , const float ) {}
00068 void justificationChange(const uint8_t ) {}
00069 void pageMarginChange(const uint8_t side, const uint16_t margin);
00070 void pageFormChange(const uint16_t length, const uint16_t width, const WPXFormOrientation orientation);
00071 void marginChange(const uint8_t side, const uint16_t margin);
00072 void paragraphMarginChange(const uint8_t , const int16_t ) {}
00073 void indentFirstLineChange(const int16_t ) {}
00074 void columnChange(const WPXTextColumnType , const uint8_t ,
00075 const std::vector<float> & , const std::vector<bool> & ) {}
00076 void updateOutlineDefinition(const WP6OutlineLocation , const uint16_t ,
00077 const uint8_t * , const uint8_t ) {}
00078
00079 void paragraphNumberOn(const uint16_t , const uint8_t , const uint8_t ) {}
00080 void paragraphNumberOff() { if (!isUndoOn()) m_currentPageHasContent = true; }
00081 void displayNumberReferenceGroupOn(const uint8_t , const uint8_t ) {}
00082 void displayNumberReferenceGroupOff(const uint8_t ) { if (!isUndoOn()) m_currentPageHasContent = true; }
00083 void styleGroupOn(const uint8_t ) {}
00084 void styleGroupOff(const uint8_t ) {}
00085 void globalOn(const uint8_t ) {}
00086 void globalOff() {}
00087 void noteOn(const uint16_t textPID);
00088 void noteOff(const WPXNoteType ) {}
00089 void headerFooterGroup(const uint8_t headerFooterType, const uint8_t occurenceBits, const uint16_t textPID);
00090 void suppressPageCharacteristics(const uint8_t suppressCode);
00091 void endDocument();
00092
00093 void defineTable(const uint8_t position, const uint16_t leftOffset);
00094 void addTableColumnDefinition(const uint32_t , const uint32_t , const uint32_t ,
00095 const uint32_t , const uint8_t ) {}
00096 void startTable();
00097 void insertRow(const uint16_t rowHeight, const bool isMinimumHeight, const bool isHeaderRow);
00098 void insertCell(const uint8_t colSpan, const uint8_t rowSpan, const uint8_t borderBits,
00099 const RGBSColor * cellFgColor, const RGBSColor * cellBgColor,
00100 const RGBSColor * cellBorderColor, const WPXVerticalAlignment cellVerticalAlignment,
00101 const bool useCellAttributes, const uint32_t cellAttributes);
00102 void endTable();
00103
00104 void undoChange(const uint8_t undoType, const uint16_t undoLevel);
00105
00106 protected:
00107 void _handleSubDocument(const WPXSubDocument *subDocument, const bool isHeaderFooter, WPXTableList tableList, int nextTableIndice = 0);
00108
00109 void _flushText() {}
00110 void _changeList() {}
00111
00112 private:
00113 WPXPageSpan m_currentPage;
00114
00115 WPXTableList m_tableList;
00116 WPXTable * m_currentTable;
00117 float m_tempMarginLeft, m_tempMarginRight;
00118 bool m_currentPageHasContent;
00119 bool m_isTableDefined;
00120 bool m_isSubDocument;
00121 std::set <const WPXSubDocument *> m_subDocuments;
00122 std::list<WPXPageSpan>::iterator m_pageListHardPageMark;
00123 };
00124
00125 #endif