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 #ifndef NISUS_WRT_PARSER
00035 # define NISUS_WRT_PARSER
00036
00037 #include <string>
00038 #include <vector>
00039
00040 #include <librevenge/librevenge.h>
00041
00042 #include "MWAWDebug.hxx"
00043 #include "MWAWInputStream.hxx"
00044
00045 #include "NisusWrtStruct.hxx"
00046
00047 #include "MWAWParser.hxx"
00048
00049 namespace NisusWrtParserInternal
00050 {
00051 struct State;
00052 }
00053
00054 class NisusWrtGraph;
00055 class NisusWrtText;
00056
00059 class NisusWrtParser : public MWAWTextParser
00060 {
00061 friend struct NisusWrtStruct::RecursifData;
00062 friend class NisusWrtGraph;
00063 friend class NisusWrtText;
00064 public:
00066 NisusWrtParser(MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header);
00068 virtual ~NisusWrtParser();
00069
00071 bool checkHeader(MWAWHeader *header, bool strict=false);
00072
00073
00074 void parse(librevenge::RVNGTextInterface *documentInterface);
00075
00076 protected:
00078 void init();
00079
00081 void createDocument(librevenge::RVNGTextInterface *documentInterface);
00082
00084 MWAWVec2f getPageLeftTop() const;
00086 void getColumnInfo(int &numColumns, float &colSep) const;
00088 void getFootnoteInfo(NisusWrtStruct::FootnoteInfo &fInfo) const;
00089
00091 void newPage(int number);
00092
00093
00094
00096 std::string getDateFormat(NisusWrtStruct::ZoneType zoneId, int vId) const;
00097
00099 bool getReferenceData(NisusWrtStruct::ZoneType zoneId, int vId,
00100 MWAWField::Type &fType,
00101 std::string &content,
00102 std::vector<int> &number) const;
00103
00104
00105
00107 bool sendPicture(int pictId, MWAWPosition const &pictPos);
00108
00109 protected:
00111 bool createZones();
00112
00114 bool readPrintInfo(MWAWEntry const &entry);
00116 bool readCPRC(MWAWEntry const &entry);
00118 bool readPageLimit(MWAWEntry const &entry);
00119
00121 bool readStringsList(MWAWEntry const &entry, std::vector<std::string> &list, bool simpleList);
00122
00124 bool readINFO(MWAWEntry const &entry);
00125
00127 bool readReference(NisusWrtStruct::RecursifData const &data);
00129 bool readVariable(NisusWrtStruct::RecursifData const &data);
00131 bool readCNTR(MWAWEntry const &entry, int zoneId);
00133 bool readNumberingReset(MWAWEntry const &entry, int zoneId);
00134
00136 bool readSGP1(NisusWrtStruct::RecursifData const &data);
00138 bool readABBR(MWAWEntry const &entry);
00140 bool readFTA2(MWAWEntry const &entry);
00142 bool readFnSc(MWAWEntry const &entry);
00143
00145 MWAWInputStreamPtr rsrcInput();
00146
00148 libmwaw::DebugFile &rsrcAscii();
00149
00150
00151
00152
00154 shared_ptr<NisusWrtParserInternal::State> m_state;
00155
00157 shared_ptr<NisusWrtGraph> m_graphParser;
00158
00160 shared_ptr<NisusWrtText> m_textParser;
00161 };
00162 #endif
00163