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 GREAT_WKS_DOCUMENT
00035 # define GREAT_WKS_DOCUMENT
00036
00037 #include <string>
00038 #include <vector>
00039
00040 #include <librevenge/librevenge.h>
00041
00042 #include "MWAWCell.hxx"
00043 #include "MWAWDebug.hxx"
00044
00045 namespace GreatWksDocumentInternal
00046 {
00047 struct State;
00048 }
00049
00050 class GreatWksGraph;
00051 class GreatWksParser;
00052 class GreatWksDBParser;
00053 class GreatWksDRParser;
00054 class GreatWksSSParser;
00055 class GreatWksText;
00056
00059 class GreatWksDocument
00060 {
00061 friend class GreatWksParser;
00062 friend class GreatWksDBParser;
00063 friend class GreatWksDRParser;
00064 friend class GreatWksSSParser;
00065 public:
00067 GreatWksDocument(MWAWParser &parser);
00069 virtual ~GreatWksDocument();
00070
00072 bool checkHeader(MWAWHeader *header, bool strict=false);
00073
00075 MWAWParser &getMainParser()
00076 {
00077 return *m_parser;
00078 }
00080 shared_ptr<GreatWksGraph> getGraphParser()
00081 {
00082 return m_graphParser;
00083 }
00085 shared_ptr<GreatWksText> getTextParser()
00086 {
00087 return m_textParser;
00088 }
00089
00091 MWAWSection getMainSection() const;
00093 void newPage(int page);
00095 bool sendPicture(MWAWEntry const &entry, MWAWPosition pos);
00096
00097
00098
00100 bool canSendTextboxAsGraphic(MWAWEntry const &entry);
00102 bool sendTextbox(MWAWEntry const &entry, MWAWListenerPtr listener);
00103
00104 protected:
00105
00107 bool readRSRCZones();
00108
00109
00110
00112 bool readCellInFormula(MWAWVec2i const &pos, MWAWCellContent::FormulaInstruction &instr);
00114 bool readString(long endPos, std::string &res);
00116 bool readNumber(long endPos, double &res, bool &isNan);
00118 bool readFormula(MWAWVec2i const &cPos, long endPos,
00119 std::vector<MWAWCellContent::FormulaInstruction> &formula, std::string &error);
00120
00121
00122
00123
00124
00126 bool readPrintInfo(MWAWEntry const &entry);
00127
00129 bool readWPSN(MWAWEntry const &entry);
00130
00132 bool readARRs(MWAWEntry const &entry);
00134 bool readDaHS(MWAWEntry const &entry);
00136 bool readGrDS(MWAWEntry const &entry);
00138 bool readNxEd(MWAWEntry const &entry);
00139
00141 MWAWInputStreamPtr rsrcInput();
00142
00144 libmwaw::DebugFile &rsrcAscii();
00145
00146 private:
00147 GreatWksDocument(GreatWksDocument const &orig);
00148 GreatWksDocument &operator=(GreatWksDocument const &orig);
00149
00150
00151
00152
00153
00154 protected:
00156 shared_ptr<GreatWksDocumentInternal::State> m_state;
00157 public:
00159 shared_ptr<MWAWParserState> m_parserState;
00160
00161 protected:
00163 MWAWParser *m_parser;
00165 shared_ptr<GreatWksGraph> m_graphParser;
00167 shared_ptr<GreatWksText> m_textParser;
00168
00170 typedef MWAWSection(MWAWParser::* GetMainSection)() const;
00172 typedef void (MWAWParser::* NewPage)(int page);
00173
00175 GetMainSection m_getMainSection;
00177 NewPage m_newPage;
00178 };
00179 #endif
00180