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 #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 int getCodepage();
00046
00047 private:
00048 WPS4ContentListener(const WPS4ContentListener&);
00049 WPS4ContentListener& operator=(const WPS4ContentListener&);
00050 };
00051
00052 struct wpsfont
00053 {
00054 std::string name;
00055 int cp;
00056 wpsfont() : name(), cp(0) {}
00057 };
00058
00059 class WPS4Parser : public WPSParser
00060 {
00061 public:
00062 WPS4Parser(WPXInputStream *input, WPSHeader * header);
00063 ~WPS4Parser();
00064
00065 void parse(WPXDocumentInterface *documentInterface);
00066 private:
00067 void parsePages(std::list<WPSPageSpan> &pageList, WPXInputStream *input);
00068 void parse(WPXInputStream *stream, WPS4ContentListener *listener);
00069 void readFontsTable(WPXInputStream * input);
00070 bool readFODPage(WPXInputStream * input, std::vector<FOD> * FODs);
00071 void propertyChangeTextAttribute(const uint32_t newTextAttributeBits, const uint8_t attribute, const uint32_t bit, WPS4ContentListener *listener);
00072 void propertyChangeDelta(uint32_t newTextAttributeBits, WPS4ContentListener *listener);
00073 void propertyChange(std::string rgchProp, WPS4ContentListener *listener);
00074 void propertyChangePara(std::string rgchProp, WPS4ContentListener *listener);
00075 void appendCP(const uint8_t readVal, int codepage, WPS4ContentListener *listener);
00076 void appendUCS(const uint16_t readVal, WPS4ContentListener *listener);
00077 void appendCP850(const uint8_t readVal, WPS4ContentListener *listener);
00078 void appendCP1252(const uint8_t readVal, WPS4ContentListener *listener);
00079 void readText(WPXInputStream * input, WPS4ContentListener *listener);
00080 uint32_t oldTextAttributeBits;
00081 uint32_t offset_eot;
00082 uint32_t offset_eos;
00083 std::vector<FOD> CHFODs;
00084 std::vector<FOD> PAFODs;
00085 std::map<uint8_t, wpsfont> fonts;
00086 const uint8_t m_worksVersion;
00087 };
00088
00089 #endif