Go to the documentation of this file.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 WP42CONTENTLISTENER_H
00028 #define WP42CONTENTLISTENER_H
00029
00030 #include "WP42Listener.h"
00031 #include "WP42SubDocument.h"
00032 #include "WPXContentListener.h"
00033 #include "WPXHLListenerImpl.h"
00034
00035 typedef struct _WP42ContentParsingState WP42ContentParsingState;
00036 struct _WP42ContentParsingState
00037 {
00038 _WP42ContentParsingState();
00039 ~_WP42ContentParsingState();
00040 WPXString m_textBuffer;
00041 };
00042
00043 class WP42ContentListener : public WP42Listener, protected WPXContentListener
00044 {
00045 public:
00046 WP42ContentListener(std::list<WPXPageSpan> &pageList, std::vector<WP42SubDocument *> &subDocuments, WPXHLListenerImpl *listenerImpl);
00047 ~WP42ContentListener();
00048
00049 void startDocument() { WPXContentListener::startDocument(); }
00050 void insertCharacter(const uint16_t character);
00051 void insertTab(const uint8_t tabType, float tabPosition);
00052 void insertBreak(const uint8_t breakType) { WPXContentListener::insertBreak(breakType); }
00053 void insertEOL();
00054 void attributeChange(const bool isOn, const uint8_t attribute);
00055 void marginReset(const uint8_t leftMargin, const uint8_t rightMargin);
00056 void headerFooterGroup(const uint8_t headerFooterDefinition, WP42SubDocument *subDocument);
00057 void suppressPageCharacteristics(const uint8_t ) {}
00058 void endDocument() { WPXContentListener::endDocument(); };
00059
00060 protected:
00061 void _handleSubDocument(const WPXSubDocument *subDocument, const bool isHeaderFooter, WPXTableList tableList, int nextTableIndice = 0);
00062
00063 void _flushText();
00064 void _changeList() {};
00065
00066 private:
00067 WP42ContentListener(const WP42ContentListener&);
00068 WP42ContentListener& operator=(const WP42ContentListener&);
00069 WP42ContentParsingState *m_parseState;
00070 std::vector<WP42SubDocument *> &m_subDocuments;
00071 };
00072
00073 #endif