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 CW_GRAPH
00039 # define CW_GRAPH
00040
00041 #include <string>
00042 #include <vector>
00043
00044 #include <libwpd/libwpd.h>
00045
00046 #include "libmwaw_internal.hxx"
00047
00048 #include "MWAWDebug.hxx"
00049 #include "MWAWInputStream.hxx"
00050 #include "MWAWPosition.hxx"
00051
00052 #include "CWStruct.hxx"
00053
00054 namespace CWGraphInternal
00055 {
00056 struct Group;
00057 struct State;
00058 struct Style;
00059 struct Zone;
00060 struct ZoneShape;
00061 struct Bitmap;
00062 struct ZonePict;
00063
00064 class SubDocument;
00065 }
00066
00067 class CWParser;
00068 class CWStyleManager;
00069
00075 class CWGraph
00076 {
00077 friend class CWGraphInternal::SubDocument;
00078 friend class CWParser;
00079
00080 public:
00082 CWGraph(CWParser &parser);
00084 virtual ~CWGraph();
00085
00087 int version() const;
00088
00090 int numPages() const;
00091
00093 shared_ptr<CWStruct::DSET> readGroupZone
00094 (CWStruct::DSET const &zone, MWAWEntry const &entry, bool &complete);
00095
00097 shared_ptr<CWStruct::DSET> readBitmapZone
00098 (CWStruct::DSET const &zone, MWAWEntry const &entry, bool &complete);
00099
00101 bool getSurfaceColor(CWGraphInternal::Style const style, MWAWColor &col) const;
00102 protected:
00104 void setSlideList(std::vector<int> const &slideList);
00106 bool canSendGroupAsGraphic(int number) const;
00108 bool sendGroup(int number, bool asGraphic, MWAWPosition const &pos=MWAWPosition());
00110 bool canSendBitmapAsGraphic(int number) const;
00112 bool sendBitmap(int number, bool asGraphic, MWAWPosition const &pos=MWAWPosition());
00113
00115 void flushExtra();
00116
00117
00118
00120 void askToSend(int number, bool asGraphic, MWAWPosition const &pos=MWAWPosition());
00121
00122
00123
00124
00125
00127 void checkNumberAccrossPages(CWGraphInternal::Group &group) const;
00129 void updateInformation(CWGraphInternal::Group &group) const;
00131 bool canSendAsGraphic(CWGraphInternal::Group &group) const;
00133 bool sendGroup(CWGraphInternal::Group &group, MWAWPosition const &position);
00135 bool sendGroup(CWGraphInternal::Group &group, std::vector<size_t> const &lChild, MWAWGraphicListener &listener);
00137 bool sendGroupChild(CWGraphInternal::Group &group, size_t child, MWAWPosition position);
00138
00139 shared_ptr<CWGraphInternal::Zone> readGroupDef(MWAWEntry const &entry);
00140
00141
00142 bool readShape(MWAWEntry const &entry,
00143 CWGraphInternal::ZoneShape &zone);
00144
00145
00146
00147
00148 bool readGroupData(CWGraphInternal::Group &group, long beginGroupPos);
00149
00150
00151 bool readPolygonData(shared_ptr<CWGraphInternal::Zone> zone);
00152
00154
00155 bool readPictData(shared_ptr<CWGraphInternal::Zone> zone);
00156
00157
00158 bool readPICT(CWGraphInternal::ZonePict &zone);
00159
00160
00161 bool readPS(CWGraphInternal::ZonePict &zone);
00162
00163
00164 bool readOLE(CWGraphInternal::ZonePict &zone);
00165
00167
00168 bool readQTimeData(shared_ptr<CWGraphInternal::Zone> zone);
00169
00170
00171 bool readNamedPict(CWGraphInternal::ZonePict &zone);
00172
00174
00175 bool readBitmapColorMap(std::vector<MWAWColor> &cMap);
00176
00177
00178 bool readBitmapData(CWGraphInternal::Bitmap &zone);
00179
00180
00181
00182
00183
00184 bool readGroupHeader(CWGraphInternal::Group &group);
00185
00186
00187 bool readGroupUnknown(CWGraphInternal::Group &group, int zoneSz, int id);
00188
00190 bool sendPicture(CWGraphInternal::ZonePict &pict, MWAWPosition pos,
00191 WPXPropertyList extras = WPXPropertyList());
00192
00194 bool sendShape(CWGraphInternal::ZoneShape &pict, MWAWPosition pos);
00195
00197 bool sendBitmap(CWGraphInternal::Bitmap &pict, bool asGraphic, MWAWPosition pos);
00198
00199 private:
00200 CWGraph(CWGraph const &orig);
00201 CWGraph &operator=(CWGraph const &orig);
00202
00203 protected:
00204
00205
00206
00208 MWAWParserStatePtr m_parserState;
00209
00211 shared_ptr<CWGraphInternal::State> m_state;
00212
00214 CWParser *m_mainParser;
00215
00217 shared_ptr<CWStyleManager> m_styleManager;
00218 };
00219 #endif
00220