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 WP1CONTENTLISTENER_H
00028 #define WP1CONTENTLISTENER_H
00029
00030 #include "WP1Listener.h"
00031 #include "WP1SubDocument.h"
00032 #include "WPXContentListener.h"
00033 #include "WPXHLListenerImpl.h"
00034
00035 typedef struct _WP1ContentParsingState WP1ContentParsingState;
00036 struct _WP1ContentParsingState
00037 {
00038 _WP1ContentParsingState();
00039 ~_WP1ContentParsingState();
00040 WPXString m_textBuffer;
00041 int m_numDeferredTabs;
00042 int m_footNoteNumber, m_endNoteNumber;
00043 };
00044
00045 class WP1ContentListener : public WP1Listener, protected WPXContentListener
00046 {
00047 public:
00048 WP1ContentListener(std::list<WPXPageSpan> &pageList, std::vector<WP1SubDocument *> &subDocuments, WPXHLListenerImpl *listenerImpl);
00049 ~WP1ContentListener();
00050
00051 void startDocument() { WPXContentListener::startDocument(); }
00052 void insertCharacter(const uint16_t character);
00053 void insertExtendedCharacter(const uint8_t extendedCharacter);
00054 void insertTab();
00055 void insertBreak(const uint8_t breakType) { WPXContentListener::insertBreak(breakType); }
00056 void insertEOL();
00057 void insertNote(const WPXNoteType noteType, WP1SubDocument *subDocument);
00058 void attributeChange(const bool isOn, const uint8_t attribute);
00059 void fontPointSize(const uint8_t pointSize);
00060 void marginReset(const uint16_t leftMargin, const uint16_t rightMargin);
00061 void topMarginSet(const uint16_t topMargin) {}
00062 void bottomMarginSet(const uint16_t bottomMargin) {}
00063 void leftIndent(const uint16_t leftMarginOffset);
00064 void leftRightIndent(const uint16_t leftRightMarginOffset);
00065 void leftMarginRelease(const uint16_t release);
00066 void setTabs(const std::vector<WPXTabStop> tabStops);
00067 void headerFooterGroup(const uint8_t headerFooterDefinition, WP1SubDocument *subDocument);
00068 void suppressPageCharacteristics(const uint8_t suppressCode) {}
00069 void justificationChange(const uint8_t justification);
00070 void lineSpacingChange(const uint8_t spacing) { WPXContentListener::lineSpacingChange((float)((double)spacing/2.0f)); }
00071 void flushRightOn();
00072 void flushRightOff() {}
00073 void centerOn();
00074 void centerOff() {}
00075 void endDocument() { WPXContentListener::endDocument(); };
00076
00077 protected:
00078 void _handleSubDocument(const WPXSubDocument *subDocument, const bool isHeaderFooter, WPXTableList tableList, int nextTableIndice = 0);
00079
00080 void _flushText();
00081 void _changeList() {};
00082
00083 private:
00084 WP1ContentParsingState *m_parseState;
00085 std::vector<WP1SubDocument *> &m_subDocuments;
00086 };
00087
00088 #endif