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 #ifndef WPS4_TEXT_H
00027 #define WPS4_TEXT_H
00028
00029 #include <vector>
00030
00031 #include "libwps_internal.h"
00032 #include "libwps_tools_win.h"
00033
00034 #include "WPSEntry.h"
00035 #include "WPSDebug.h"
00036 #include "WPSTextParser.h"
00037
00038 class WPS4Parser;
00039 namespace WPS4TextInternal
00040 {
00041 struct Font;
00042 struct Paragraph;
00043 struct State;
00044 }
00045
00065 class WPS4Text : public WPSTextParser
00066 {
00067 friend class WPS4Parser;
00068
00069 public:
00071 WPS4Text(WPS4Parser &parser, RVNGInputStreamPtr &input);
00072
00074 ~WPS4Text();
00075
00077 void setListener(WPSContentListenerPtr &listen)
00078 {
00079 m_listener = listen;
00080 }
00081
00083 int numPages() const;
00084
00086 void flushExtra();
00087
00088 protected:
00090 WPS4Parser &mainParser()
00091 {
00092 return reinterpret_cast<WPS4Parser &>(m_mainParser);
00093 }
00095 WPS4Parser const &mainParser() const
00096 {
00097 return reinterpret_cast<WPS4Parser const &>(m_mainParser);
00098 }
00099
00101 libwps_tools_win::Font::Type getDefaultFontType() const;
00102
00104 WPSEntry getHeaderEntry() const;
00105
00107 WPSEntry getFooterEntry() const;
00108
00110 WPSEntry getMainTextEntry() const;
00111
00113 bool readText(WPSEntry const &entry);
00114
00116 bool readEntries();
00118 bool readStructures();
00119
00120 protected:
00121
00122
00123
00124
00127 bool findFDPStructures(int which);
00130 bool findFDPStructuresByHand(int which);
00131
00132
00133
00134
00135
00143 typedef bool (WPS4Text::* DataParser)
00144 (long bot, long eot, int id, long endPos, std::string &mess);
00145
00152 bool readPLC(WPSEntry const &zone,
00153 std::vector<long> &textPtrs, std::vector<long> &listValues,
00154 DataParser parser = 0L);
00155
00157 bool defDataParser(long bot, long eot, int id, long endPos, std::string &mess);
00158
00160 bool readFontNames(WPSEntry const &entry);
00161
00163 bool readFont(long endPos, int &id, std::string &mess);
00164
00166 bool readParagraph(long endPos, int &id, std::string &mess);
00167
00169 bool readDosLink(WPSEntry const &entry);
00170
00172 bool objectDataParser(long bot, long eot, int id,
00173 long endPos, std::string &mess);
00174
00176 bool readFootNotes(WPSEntry const &ftnD, WPSEntry const &ftnP);
00177
00179 bool footNotesDataParser(long bot, long eot, int id, long endPos, std::string &mess);
00180
00182 bool bkmkDataParser(long bot, long eot, int id, long endPos, std::string &mess);
00183
00185 bool dttmDataParser(long bot, long eot, int id, long endPos, std::string &mess);
00186
00187 protected:
00189 WPSContentListenerPtr m_listener;
00190
00192 mutable shared_ptr<WPS4TextInternal::State> m_state;
00193 };
00194 #endif
00195