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 GREAT_WKS_GRAPH
00039 # define GREAT_WKS_GRAPH
00040
00041 #include <set>
00042 #include <string>
00043 #include <vector>
00044
00045 #include <librevenge/librevenge.h>
00046
00047 #include "libmwaw_internal.hxx"
00048
00049 #include "MWAWDebug.hxx"
00050 #include "MWAWInputStream.hxx"
00051
00052 namespace GreatWksGraphInternal
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 GreatWksDocument;
00065 class GreatWksParser;
00066 class GreatWksDBParser;
00067 class GreatWksDRParser;
00068 class GreatWksSSParser;
00069
00075 class GreatWksGraph
00076 {
00077 friend class GreatWksDocument;
00078 friend class GreatWksParser;
00079 friend class GreatWksDBParser;
00080 friend class GreatWksDRParser;
00081 friend class GreatWksSSParser;
00082 friend class GreatWksGraphInternal::SubDocument;
00083
00084 public:
00086 GreatWksGraph(GreatWksDocument &document);
00088 virtual ~GreatWksGraph();
00089
00091 int version() const;
00092
00094 int numPages() const;
00095
00096 protected:
00098 bool sendPageGraphics();
00100 void flushExtra();
00101
00102
00103
00104
00105
00106
00108 bool readPatterns(MWAWEntry const &entry);
00110 bool readPalettes(MWAWEntry const &entry);
00111
00112
00114 bool sendPageFrames(GreatWksGraphInternal::Zone const &zone);
00116 bool sendFrame(shared_ptr<GreatWksGraphInternal::Frame> frame, GreatWksGraphInternal::Zone const &zone);
00117
00119 bool sendGroup(GreatWksGraphInternal::FrameGroup const &group, GreatWksGraphInternal::Zone const &zone, MWAWPosition const &pos);
00121 void sendGroupChild(GreatWksGraphInternal::FrameGroup const &group, GreatWksGraphInternal::Zone const &zone, MWAWPosition const &pos);
00123 bool canCreateGraphic(GreatWksGraphInternal::FrameGroup const &group, GreatWksGraphInternal::Zone const &zone);
00125 void sendGroup(GreatWksGraphInternal::FrameGroup const &group, GreatWksGraphInternal::Zone const &zone, MWAWGraphicListenerPtr &listener);
00126
00128 bool sendTextbox(GreatWksGraphInternal::FrameText const &text, GreatWksGraphInternal::Zone const &zone, MWAWPosition const &pos);
00130 bool sendTextboxAsGraphic(MWAWBox2f const &box, GreatWksGraphInternal::FrameText const &text, MWAWGraphicStyle const &style, MWAWListenerPtr listener);
00132 bool sendTextbox(MWAWEntry const &entry, MWAWListenerPtr listener);
00133
00135 bool sendPicture(MWAWEntry const &entry, MWAWPosition pos);
00137 bool sendShape(GreatWksGraphInternal::FrameShape const &graph, GreatWksGraphInternal::Zone const &zone, MWAWPosition const &pos);
00138
00139
00140
00142 bool readGraphicZone();
00144 bool isGraphicZone();
00146 bool findGraphicZone();
00147
00149 bool isPageFrames();
00151 bool readPageFrames();
00153 shared_ptr<GreatWksGraphInternal::Frame> readFrameHeader();
00155 bool readFrameExtraData(GreatWksGraphInternal::Frame &frame, int id, long endPos=-1);
00156
00158 bool readStyle(MWAWGraphicStyle &style);
00160 bool readLineFormat(std::string &extra);
00161
00162
00163
00164
00165
00166
00168 bool readFrameExtraDataRec(GreatWksGraphInternal::Zone &zone, int id, std::set<int> &seens, long endPos=-1);
00170 bool checkGraph(GreatWksGraphInternal::Zone &zone, int id, std::set<int> &seens);
00171
00172 private:
00173 GreatWksGraph(GreatWksGraph const &orig);
00174 GreatWksGraph &operator=(GreatWksGraph const &orig);
00175
00176 protected:
00177
00178
00179
00181 GreatWksDocument &m_document;
00183 MWAWParserStatePtr m_parserState;
00185 shared_ptr<GreatWksGraphInternal::State> m_state;
00187 MWAWParser *m_mainParser;
00188 };
00189 #endif
00190