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 HAN_MAC_WRD_K_TEXT
00039 # define HAN_MAC_WRD_K_TEXT
00040
00041 #include <map>
00042
00043 #include "libmwaw_internal.hxx"
00044 #include "MWAWDebug.hxx"
00045
00046 namespace HanMacWrdKTextInternal
00047 {
00048 struct Paragraph;
00049 struct Token;
00050 struct State;
00051 }
00052
00053 struct HanMacWrdKZone;
00054 class HanMacWrdKParser;
00055
00061 class HanMacWrdKText
00062 {
00063 friend class HanMacWrdKParser;
00064 public:
00066 HanMacWrdKText(HanMacWrdKParser &parser);
00068 virtual ~HanMacWrdKText();
00069
00071 int version() const;
00072
00074 int numPages() const;
00075
00076 protected:
00078 bool sendMainText();
00080 bool sendText(long id, long subId, MWAWListenerPtr listener=MWAWListenerPtr());
00082 bool canSendTextAsGraphic(long id, long subId);
00084 void flushExtra();
00086 void updateTextZoneTypes(std::map<long,int> const &idTypeMap);
00088 int computeNumPages(HanMacWrdKZone const &zone) const;
00090 std::vector<long> const &getTokenIdList() const;
00092 void getHeaderFooterId(long &headerId, long &footerId) const;
00093
00094
00095
00096
00097
00099 bool readTextZone(shared_ptr<HanMacWrdKZone> zone);
00101 bool readFontNames(shared_ptr<HanMacWrdKZone> zone);
00103 bool readStyles(shared_ptr<HanMacWrdKZone> zone);
00105 bool readSections(shared_ptr<HanMacWrdKZone> zone);
00106
00108 bool sendText(HanMacWrdKZone &zone, MWAWListenerPtr listener=MWAWListenerPtr());
00110 bool canSendTextAsGraphic(HanMacWrdKZone &zone);
00111
00112
00113
00114
00116 bool readFont(HanMacWrdKZone const &zone, MWAWFont &font) const;
00117
00119 bool readParagraph(HanMacWrdKZone const &zone, HanMacWrdKTextInternal::Paragraph ¶) const;
00121 void setProperty(HanMacWrdKTextInternal::Paragraph const ¶, float width);
00122
00124 bool readToken(HanMacWrdKZone const &zone, HanMacWrdKTextInternal::Token &token) const;
00125
00126 private:
00127 HanMacWrdKText(HanMacWrdKText const &orig);
00128 HanMacWrdKText &operator=(HanMacWrdKText const &orig);
00129
00130 protected:
00131
00132
00133
00135 MWAWParserStatePtr m_parserState;
00136
00138 shared_ptr<HanMacWrdKTextInternal::State> m_state;
00139
00141 HanMacWrdKParser *m_mainParser;
00142 };
00143 #endif
00144