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
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef HMWJ_TEXT
00039 # define HMWJ_TEXT
00040
00041 #include <map>
00042 #include <vector>
00043
00044 #include "libmwaw_internal.hxx"
00045 #include "MWAWDebug.hxx"
00046
00047 namespace HMWJTextInternal
00048 {
00049 struct Paragraph;
00050 class SubDocument;
00051 struct TextZone;
00052 struct State;
00053 }
00054
00055 class HMWJParser;
00056
00062 class HMWJText
00063 {
00064 friend class HMWJTextInternal::SubDocument;
00065 friend class HMWJParser;
00066 public:
00068 HMWJText(HMWJParser &parser);
00070 virtual ~HMWJText();
00071
00073 int version() const;
00074
00076 int numPages() const;
00077
00078 protected:
00080 bool sendMainText();
00082 bool sendText(long id, long cPos, bool asGraphic=false);
00084 bool canSendTextAsGraphic(long id, long cPos);
00086 bool sendText(HMWJTextInternal::TextZone const &zone, long cPos, bool asGraphic);
00088 bool canSendTextAsGraphic(HMWJTextInternal::TextZone const &zone, long cPos);
00090 void flushExtra();
00091
00093 int computeNumPages(HMWJTextInternal::TextZone const &zone);
00095 std::vector<long> getTokenIdList() const;
00097 void updateTextZoneTypes(std::map<long,int> const &idTypeMap);
00099 void updateFootnoteInformations(long const &textZId, std::vector<long> const &fPosList);
00100
00101
00102
00103
00104
00106 bool readFontNames(MWAWEntry const &entry);
00108 bool readFonts(MWAWEntry const &entry);
00110 bool readFont(MWAWFont &font, long endPos=-1);
00112 bool readParagraphs(MWAWEntry const &entry);
00114 bool readParagraph(HMWJTextInternal::Paragraph ¶, long endPos=-1);
00116 bool readStyles(MWAWEntry const &entry);
00118 bool readTextZonesList(MWAWEntry const &entry);
00120 bool readTextZone(MWAWEntry const &entry, int actZone);
00122 bool readTextToken(long endPos, HMWJTextInternal::TextZone &zone);
00124 bool readSections(MWAWEntry const &entry);
00126 bool readFtnPos(MWAWEntry const &entry);
00127
00128
00129
00130
00131
00132 private:
00133 HMWJText(HMWJText const &orig);
00134 HMWJText &operator=(HMWJText const &orig);
00135
00136 protected:
00137
00138
00139
00141 MWAWParserStatePtr m_parserState;
00142
00144 shared_ptr<HMWJTextInternal::State> m_state;
00145
00147 HMWJParser *m_mainParser;
00148 };
00149 #endif
00150