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 MACDRAWPRO_PARSER
00035 # define MACDRAWPRO_PARSER
00036
00037 #include <map>
00038 #include <string>
00039 #include <vector>
00040
00041 #include <librevenge/librevenge.h>
00042
00043 #include "MWAWDebug.hxx"
00044 #include "MWAWInputStream.hxx"
00045
00046 #include "MWAWParser.hxx"
00047
00048 namespace MacDrawProParserInternal
00049 {
00050 struct Layer;
00051 struct Library;
00052 struct Shape;
00053 struct State;
00054
00055 class SubDocument;
00056 }
00057
00058 class MacDrawProStyleManager;
00059
00063 class MacDrawProParser : public MWAWGraphicParser
00064 {
00065 friend class MacDrawProStyleManager;
00066 friend class MacDrawProParserInternal::SubDocument;
00067 public:
00069 MacDrawProParser(MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header);
00071 virtual ~MacDrawProParser();
00072
00074 bool checkHeader(MWAWHeader *header, bool strict=false);
00075
00076
00077 void parse(librevenge::RVNGDrawingInterface *documentInterface);
00078
00079 protected:
00081 void init();
00082
00084 void createDocument(librevenge::RVNGDrawingInterface *documentInterface);
00085
00086 protected:
00088 bool createZones();
00089
00090
00091
00093 bool readPrintInfo();
00095 bool readHeaderInfo();
00097 bool readLayersInfo();
00099 bool readLayerLibraryCorrespondance();
00101 bool readLibrariesInfo();
00103 bool findObjectPositions(bool dataZone);
00105 bool computeLayersAndLibrariesBoundingBox();
00106
00108 bool readStructuredHeaderZone(MWAWEntry const &entry, std::map<int, long> &idToDeltaPosMap);
00109
00110
00111
00112
00113
00115 int readObject();
00117 bool readObjectData(MacDrawProParserInternal::Shape &shape, int zId);
00119 bool readRotationInObjectData(MacDrawProParserInternal::Shape &shape, long endPos, std::string &extra);
00121 bool updateGeometryShape(MacDrawProParserInternal::Shape &shape, float cornerWidth);
00123 bool readBitmap(MacDrawProParserInternal::Shape &shape, MWAWEntry const &entry);
00125 bool readTextII(MacDrawProParserInternal::Shape &shape, MWAWEntry const &entry);
00127 bool readTextPro(MacDrawProParserInternal::Shape &shape, MWAWEntry const &entry);
00129 bool readGeometryShapeData(MacDrawProParserInternal::Shape &shape, MWAWEntry const &entry);
00130
00131
00132
00134 bool sendMasterPage();
00136 bool sendPage(int page);
00138 bool send(MacDrawProParserInternal::Library const &library);
00140 bool send(MacDrawProParserInternal::Layer const &layer);
00142 bool send(MacDrawProParserInternal::Shape const &shape, MWAWVec2f const &orig);
00144 bool sendBitmap(MacDrawProParserInternal::Shape const &shape, MWAWPosition const &pos);
00146 bool sendText(int zoneId);
00148 bool sendLabel(MWAWEntry const &entry);
00150 void flushExtra();
00151
00152
00153
00154
00156 shared_ptr<MacDrawProParserInternal::State> m_state;
00157
00159 shared_ptr<MacDrawProStyleManager> m_styleManager;
00160 };
00161 #endif
00162