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
00035
00036
00037
00038 #ifndef GW_GRAPH
00039 # define GW_GRAPH
00040
00041 #include <set>
00042 #include <string>
00043 #include <vector>
00044
00045 #include <libwpd/libwpd.h>
00046
00047 #include "libmwaw_internal.hxx"
00048
00049 #include "MWAWDebug.hxx"
00050 #include "MWAWInputStream.hxx"
00051
00052 namespace GWGraphInternal
00053 {
00054 struct Frame;
00055 struct FrameGroup;
00056 struct FrameShape;
00057 struct FrameText;
00058 struct Zone;
00059
00060 struct State;
00061 class SubDocument;
00062 }
00063
00064 class GWParser;
00065
00071 class GWGraph
00072 {
00073 friend class GWParser;
00074 friend class GWGraphInternal::SubDocument;
00075
00076 public:
00078 GWGraph(GWParser &parser);
00080 virtual ~GWGraph();
00081
00083 int version() const;
00084
00086 int numPages() const;
00087
00088 protected:
00090 bool sendPageGraphics();
00092 void flushExtra();
00093
00094
00095
00096
00097
00098
00100 bool readPatterns(MWAWEntry const &entry);
00102 bool readPalettes(MWAWEntry const &entry);
00103
00104
00106 bool sendPageFrames(GWGraphInternal::Zone const &zone);
00108 bool sendFrame(shared_ptr<GWGraphInternal::Frame> frame, GWGraphInternal::Zone const &zone);
00109
00111 bool sendGroup(GWGraphInternal::FrameGroup const &group, GWGraphInternal::Zone const &zone, MWAWPosition const &pos);
00113 void sendGroupChild(GWGraphInternal::FrameGroup const &group, GWGraphInternal::Zone const &zone, MWAWPosition const &pos);
00115 bool canCreateGraphic(GWGraphInternal::FrameGroup const &group, GWGraphInternal::Zone const &zone);
00117 void sendGroup(GWGraphInternal::FrameGroup const &group, GWGraphInternal::Zone const &zone, MWAWGraphicListenerPtr &listener);
00118
00120 bool sendTextbox(GWGraphInternal::FrameText const &text, GWGraphInternal::Zone const &zone, MWAWPosition const &pos);
00122 bool sendTextboxAsGraphic(Box2f const &box, GWGraphInternal::FrameText const &text, MWAWGraphicStyle const &style);
00124 bool sendTextbox(MWAWEntry const &entry, bool inGraphic);
00125
00127 bool sendPicture(MWAWEntry const &entry, MWAWPosition pos);
00129 bool sendShape(GWGraphInternal::FrameShape const &graph, GWGraphInternal::Zone const &zone, MWAWPosition const &pos);
00130
00131
00132
00134 bool readGraphicZone();
00136 bool isGraphicZone();
00138 bool findGraphicZone();
00139
00141 bool isPageFrames();
00143 bool readPageFrames();
00145 shared_ptr<GWGraphInternal::Frame> readFrameHeader();
00147 bool readFrameExtraData(GWGraphInternal::Frame &frame, int id, long endPos=-1);
00148
00150 bool readStyle(MWAWGraphicStyle &style);
00152 bool readLineFormat(std::string &extra);
00153
00154
00155
00156
00157
00158
00160 bool readFrameExtraDataRec(GWGraphInternal::Zone &zone, int id, std::set<int> &seens, long endPos=-1);
00162 bool checkGraph(GWGraphInternal::Zone &zone, int id, std::set<int> &seens);
00163
00164 private:
00165 GWGraph(GWGraph const &orig);
00166 GWGraph &operator=(GWGraph const &orig);
00167
00168 protected:
00169
00170
00171
00173 MWAWParserStatePtr m_parserState;
00174
00176 shared_ptr<GWGraphInternal::State> m_state;
00177
00179 GWParser *m_mainParser;
00180 };
00181 #endif
00182