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 CLARIS_WKS_GRAPH
00039 # define CLARIS_WKS_GRAPH
00040
00041 #include <string>
00042 #include <vector>
00043
00044 #include <librevenge/librevenge.h>
00045
00046 #include "libmwaw_internal.hxx"
00047
00048 #include "MWAWDebug.hxx"
00049 #include "MWAWInputStream.hxx"
00050 #include "MWAWPosition.hxx"
00051
00052 #include "ClarisWksStruct.hxx"
00053
00054 namespace ClarisWksGraphInternal
00055 {
00056 struct Group;
00057 struct State;
00058 struct Style;
00059 struct Zone;
00060 struct Chart;
00061 struct ZoneShape;
00062 struct Bitmap;
00063 struct ZonePict;
00064
00065 class SubDocument;
00066 }
00067
00068 class ClarisWksDocument;
00069 class ClarisWksParser;
00070 class MWAWParser;
00071
00077 class ClarisWksGraph
00078 {
00079 friend class ClarisWksGraphInternal::SubDocument;
00080 friend class ClarisWksDocument;
00081 friend class ClarisWksParser;
00082
00083 public:
00085 ClarisWksGraph(ClarisWksDocument &document);
00087 virtual ~ClarisWksGraph();
00088
00090 int version() const;
00091
00093 int numPages() const;
00094
00096 bool getPageDimension(MWAWVec2f &dim) const;
00097
00099 void computePositions() const;
00100
00102 void findMasterPage() const;
00103
00105 shared_ptr<ClarisWksStruct::DSET> readGroupZone
00106 (ClarisWksStruct::DSET const &zone, MWAWEntry const &entry, bool &complete);
00107
00109 shared_ptr<ClarisWksStruct::DSET> readBitmapZone
00110 (ClarisWksStruct::DSET const &zone, MWAWEntry const &entry, bool &complete);
00111
00113 bool getSurfaceColor(ClarisWksGraphInternal::Style const &style, MWAWColor &col) const;
00114 protected:
00116 bool canSendGroupAsGraphic(int number) const;
00118 bool sendPageGraphics(int groupId);
00120 bool sendMaster(int pg);
00122 bool sendGroup(int number, MWAWListenerPtr listener, MWAWPosition const &pos=MWAWPosition());
00124 bool canSendBitmapAsGraphic(int number) const;
00126 bool sendBitmap(int number, MWAWListenerPtr listener, MWAWPosition const &pos=MWAWPosition());
00127
00129 void flushExtra();
00130
00131
00132
00134 void askToSend(int number, MWAWListenerPtr listener, MWAWPosition const &pos=MWAWPosition());
00135
00136
00137
00138
00139
00141 void updateGroup(ClarisWksGraphInternal::Group &group) const;
00143 bool canSendAsGraphic(ClarisWksGraphInternal::Group &group) const;
00145 bool sendGroup(ClarisWksGraphInternal::Group &group, MWAWPosition const &position);
00147 bool sendGroupChild(std::vector<shared_ptr<ClarisWksGraphInternal::Zone> > const &lChild, MWAWListenerPtr listener, MWAWVec2f const &leftTop);
00149 bool sendGroupChild(shared_ptr<ClarisWksGraphInternal::Zone> zone, MWAWPosition position);
00151 bool sendPageChild(ClarisWksGraphInternal::Group &group);
00152
00153 shared_ptr<ClarisWksGraphInternal::Zone> readGroupDef(MWAWEntry const &entry);
00154
00155
00156
00157 bool readGroupData(ClarisWksGraphInternal::Group &group, long beginGroupPos);
00158
00159
00160 bool readShape(MWAWEntry const &entry,
00161 ClarisWksGraphInternal::ZoneShape &zone);
00162
00163
00164 bool readChartData(shared_ptr<ClarisWksGraphInternal::Zone> zone);
00165
00166
00167 bool readPictData(shared_ptr<ClarisWksGraphInternal::Zone> zone);
00168
00169
00170 bool readPolygonData(shared_ptr<ClarisWksGraphInternal::Zone> zone);
00171
00172
00173 bool readPICT(ClarisWksGraphInternal::ZonePict &zone);
00174
00175
00176 bool readPS(ClarisWksGraphInternal::ZonePict &zone);
00177
00178
00179 bool readOLE(ClarisWksGraphInternal::ZonePict &zone);
00180
00182
00183 bool readQTimeData(shared_ptr<ClarisWksGraphInternal::Zone> zone);
00184
00185
00186 bool readNamedPict(ClarisWksGraphInternal::ZonePict &zone);
00187
00189
00190 bool readBitmapColorMap(std::vector<MWAWColor> &cMap);
00191
00192
00193 bool readBitmapData(ClarisWksGraphInternal::Bitmap &zone);
00194
00195
00196
00197
00198
00199 bool readGroupHeader(ClarisWksGraphInternal::Group &group);
00200
00201
00202 bool readGroupUnknown(ClarisWksGraphInternal::Group &group, int zoneSz, int id);
00203
00205 bool sendPicture(ClarisWksGraphInternal::ZonePict &pict, MWAWPosition pos);
00206
00208 bool sendShape(ClarisWksGraphInternal::ZoneShape &pict, MWAWPosition pos);
00209
00211 bool sendBitmap(ClarisWksGraphInternal::Bitmap &pict, MWAWListener &listener, MWAWPosition pos);
00212
00213 private:
00214 ClarisWksGraph(ClarisWksGraph const &orig);
00215 ClarisWksGraph &operator=(ClarisWksGraph const &orig);
00216
00217 protected:
00218
00219
00220
00222 ClarisWksDocument &m_document;
00223
00225 MWAWParserStatePtr m_parserState;
00226
00228 shared_ptr<ClarisWksGraphInternal::State> m_state;
00229
00231 MWAWParser *m_mainParser;
00232 };
00233 #endif
00234