00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef WPS4_H
00023 #define WPS4_H
00024
00025 #include <vector>
00026 #include <map>
00027
00028 #include "libwps_internal.h"
00029 #include "WPS.h"
00030 #include "WPSContentListener.h"
00031 #include "WPSHeader.h"
00032 #include <libwpd-stream/WPXStream.h>
00033 #include <libwpd/WPXString.h>
00034 #include "WPSParser.h"
00035
00036
00037 class WPS4ContentListener : public WPSContentListener
00038 {
00039 public:
00040 WPS4ContentListener(std::list<WPSPageSpan> &pageList, WPXDocumentInterface *documentInterface);
00041 ~WPS4ContentListener();
00042
00043 void attributeChange(const bool isOn, const uint8_t attribute);
00044
00045 private:
00046 WPS4ContentListener(const WPS4ContentListener&);
00047 WPS4ContentListener& operator=(const WPS4ContentListener&);
00048 };
00049
00050 class WPS4Parser : public WPSParser
00051 {
00052 public:
00053 WPS4Parser(WPXInputStream *input, WPSHeader * header);
00054 ~WPS4Parser();
00055
00056 void parse(WPXDocumentInterface *documentInterface);
00057 private:
00058 void parsePages(std::list<WPSPageSpan> &pageList, WPXInputStream *input);
00059 void parse(WPXInputStream *stream, WPS4ContentListener *listener);
00060 void readFontsTable(WPXInputStream * input);
00061 bool readFODPage(WPXInputStream * input, std::vector<FOD> * FODs);
00062 void propertyChangeTextAttribute(const uint32_t newTextAttributeBits, const uint8_t attribute, const uint32_t bit, WPS4ContentListener *listener);
00063 void propertyChangeDelta(uint32_t newTextAttributeBits, WPS4ContentListener *listener);
00064 void propertyChange(std::string rgchProp, WPS4ContentListener *listener);
00065 void appendCP850(const uint8_t readVal, WPS4ContentListener *listener);
00066 void appendCP1252(const uint8_t readVal, WPS4ContentListener *listener);
00067 void readText(WPXInputStream * input, WPS4ContentListener *listener);
00068 uint32_t oldTextAttributeBits;
00069 uint32_t offset_eot;
00070 uint32_t offset_eos;
00071 std::vector<FOD> CHFODs;
00072 std::vector<FOD> PAFODs;
00073 std::map<uint8_t, std::string> fonts;
00074 const uint8_t m_worksVersion;
00075 };
00076
00077 #endif