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 NS_PARSER
00035 # define NS_PARSER
00036
00037 #include <string>
00038 #include <vector>
00039
00040 #include <libwpd/libwpd.h>
00041
00042 #include "MWAWDebug.hxx"
00043 #include "MWAWInputStream.hxx"
00044
00045 #include "NSStruct.hxx"
00046
00047 #include "MWAWParser.hxx"
00048
00049 namespace NSParserInternal
00050 {
00051 struct State;
00052 }
00053
00054 class NSGraph;
00055 class NSText;
00056
00059 class NSParser : public MWAWParser
00060 {
00061 friend struct NSStruct::RecursifData;
00062 friend class NSGraph;
00063 friend class NSText;
00064 public:
00066 NSParser(MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header);
00068 virtual ~NSParser();
00069
00071 bool checkHeader(MWAWHeader *header, bool strict=false);
00072
00073
00074 void parse(WPXDocumentInterface *documentInterface);
00075
00076 protected:
00078 void init();
00079
00081 void createDocument(WPXDocumentInterface *documentInterface);
00082
00084 Vec2f getPageLeftTop() const;
00086 void getColumnInfo(int &numColumns, float &colSep) const;
00088 void getFootnoteInfo(NSStruct::FootnoteInfo &fInfo) const;
00089
00091 void newPage(int number);
00092
00093
00094
00096 std::string getDateFormat(NSStruct::ZoneType zoneId, int vId) const;
00097
00099 bool getReferenceData(NSStruct::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 WPXPropertyList extras = WPXPropertyList());
00109
00110 protected:
00112 bool createZones();
00113
00115 bool readPrintInfo(MWAWEntry const &entry);
00117 bool readCPRC(MWAWEntry const &entry);
00119 bool readPageLimit(MWAWEntry const &entry);
00120
00122 bool readStringsList(MWAWEntry const &entry, std::vector<std::string> &list, bool simpleList);
00123
00125 bool readINFO(MWAWEntry const &entry);
00126
00128 bool readReference(NSStruct::RecursifData const &data);
00130 bool readVariable(NSStruct::RecursifData const &data);
00132 bool readCNTR(MWAWEntry const &entry, int zoneId);
00134 bool readNumberingReset(MWAWEntry const &entry, int zoneId);
00135
00137 bool readSGP1(NSStruct::RecursifData const &data);
00139 bool readABBR(MWAWEntry const &entry);
00141 bool readFTA2(MWAWEntry const &entry);
00143 bool readFnSc(MWAWEntry const &entry);
00144
00146 MWAWInputStreamPtr rsrcInput();
00147
00149 libmwaw::DebugFile &rsrcAscii();
00150
00151
00152
00153
00155 shared_ptr<NSParserInternal::State> m_state;
00156
00158 shared_ptr<NSGraph> m_graphParser;
00159
00161 shared_ptr<NSText> m_textParser;
00162 };
00163 #endif
00164