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 RAG_TIME_PARSER
00035 # define RAG_TIME_PARSER
00036
00037 #include <set>
00038 #include <vector>
00039
00040 #include "MWAWDebug.hxx"
00041 #include "MWAWInputStream.hxx"
00042
00043 #include "MWAWParser.hxx"
00044
00045 namespace RagTimeParserInternal
00046 {
00047 struct Picture;
00048 struct State;
00049 class SubDocument;
00050 }
00051
00052 class RagTimeText;
00053 class RagTimeSpreadsheet;
00054
00060 class RagTimeParser : public MWAWTextParser
00061 {
00062 friend class RagTimeParserInternal::SubDocument;
00063 friend class RagTimeText;
00064 friend class RagTimeSpreadsheet;
00065
00066 public:
00068 RagTimeParser(MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header);
00070 virtual ~RagTimeParser();
00071
00073 bool checkHeader(MWAWHeader *header, bool strict=false);
00074
00075
00076 void parse(librevenge::RVNGTextInterface *documentInterface);
00077
00078 protected:
00080 void init();
00081
00082
00083
00084
00085
00087 bool getColor(int colId, MWAWColor &color, int listId=-1) const;
00089 bool getDateTimeFormat(int dtId, std::string &dtFormat) const;
00091 int getZoneDataFieldSize(int zId) const;
00093 int getNewZoneId();
00094
00095
00096
00097
00098
00100 int getFontId(int localId) const;
00102 bool getCharStyle(int charId, MWAWFont &font) const;
00104 bool readTextZone(MWAWEntry &entry, int width, MWAWColor const &fontColor=MWAWColor::black());
00105
00107 void createDocument(librevenge::RVNGTextInterface *documentInterface);
00109 bool sendZones();
00110
00112 void newPage(int number);
00113
00115 bool createZones();
00116
00118 bool findDataZones();
00120 bool readDataZoneHeader(int id, long endPos);
00122 bool findPagesZones();
00123
00125 bool findRsrcZones();
00126
00128 bool sendPageZone(int page);
00130 bool send(int zId);
00132 bool sendText(int zId, MWAWListenerPtr listener);
00133
00135 bool sendPicture(int zId, MWAWPosition const &pos);
00137 bool sendBitmap(RagTimeParserInternal::Picture const &pict, MWAWPosition const &pos);
00139 bool sendBasicPicture(int zId, MWAWPosition const &pos);
00141 void flushExtra();
00142
00145 bool readPageZone(MWAWEntry &entry);
00146
00148 bool readPictZone(MWAWEntry &entry);
00149
00151 bool readPictZoneV2(MWAWEntry &entry);
00152
00153
00154
00156 bool readColorMapV2(MWAWEntry &entry);
00158 bool readColorsMap();
00160 bool readPrintInfo(MWAWEntry &entry, bool inRSRCFork=false);
00162 bool readLinks(MWAWEntry &entry);
00164 bool readFormatsMap();
00166 bool readMacroFormats(MWAWEntry &entry);
00168 bool readColorTable(MWAWEntry &entry);
00169
00170
00171
00173 bool readZone6(MWAWEntry &entry);
00174
00175
00177 bool readRsrcBeDc(MWAWEntry &entry);
00178
00180 bool readRsrcStructured(MWAWEntry &entry);
00181
00183 bool readRsrcBtch(MWAWEntry &entry);
00185 bool readRsrcCalc(MWAWEntry &entry);
00187 bool readRsrcfppr(MWAWEntry &entry);
00189 bool readRsrcSele(MWAWEntry &entry);
00190
00192 bool readRsrcFHwl(MWAWEntry &entry);
00193 protected:
00194
00195
00196
00198 shared_ptr<RagTimeParserInternal::State> m_state;
00200 shared_ptr<RagTimeSpreadsheet> m_spreadsheetParser;
00202 shared_ptr<RagTimeText> m_textParser;
00203 };
00204 #endif
00205