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 ClarisDrawGraphInternal
00055 {
00056 struct Group;
00057 struct State;
00058 struct Style;
00059 struct Zone;
00060 struct ZoneShape;
00061 struct Bitmap;
00062
00063 class SubDocument;
00064 }
00065
00066 class ClarisDrawParser;
00067
00073 class ClarisDrawGraph
00074 {
00075 friend class ClarisDrawGraphInternal::SubDocument;
00076 friend class ClarisDrawParser;
00077 friend class ClarisWksParser;
00078
00079 public:
00081 ClarisDrawGraph(ClarisDrawParser &parser);
00083 virtual ~ClarisDrawGraph();
00084
00086 int version() const;
00088 void resetState();
00090 int numPages() const;
00091
00093 shared_ptr<ClarisWksStruct::DSET> readGroupZone
00094 (ClarisWksStruct::DSET const &zone, MWAWEntry const &entry, bool isLibHeader=false);
00096 shared_ptr<ClarisWksStruct::DSET> readBitmapZone(ClarisWksStruct::DSET const &zone, MWAWEntry const &entry);
00098 bool readTransformations();
00100 void updateGroup(bool isLibrary);
00102 bool isEmptyGroup(int gId) const;
00103
00105 bool getSurfaceColor(ClarisDrawGraphInternal::Style const &style, MWAWColor &col) const;
00106 protected:
00108 bool sendBitmap(int number, MWAWPosition const &pos=MWAWPosition());
00110 bool sendGroup(int number, MWAWPosition const &pos=MWAWPosition());
00112 bool sendMainGroupChild(int childId, MWAWPosition const &pos=MWAWPosition());
00114 void flushExtra();
00115
00116
00117
00119 bool sendTextZone(int number, int subZone=-1);
00120
00121
00122
00123
00124
00125
00126 shared_ptr<ClarisDrawGraphInternal::Zone> readGroupDef(MWAWEntry const &entry);
00127
00128
00129
00130 bool readGroupData(ClarisDrawGraphInternal::Group &group, long beginGroupPos, bool isLibHeader);
00131
00132
00133 bool readShape(MWAWEntry const &entry,
00134 ClarisDrawGraphInternal::ZoneShape &zone);
00135
00136
00137 bool readPolygonData(shared_ptr<ClarisDrawGraphInternal::Zone> zone);
00138
00140
00141 bool readBitmapColorMap(std::vector<MWAWColor> &cMap);
00142
00143
00144 bool readBitmapData(ClarisDrawGraphInternal::Bitmap &zone);
00145
00146
00147
00148
00149
00150
00151 bool readGroupHeader(ClarisDrawGraphInternal::Group &group);
00152
00153
00154 bool readGroupUnknown(ClarisDrawGraphInternal::Group &group, int zoneSz, int id);
00155
00157 bool sendShape(ClarisDrawGraphInternal::ZoneShape &pict, MWAWPosition pos);
00158
00160 bool sendBitmap(ClarisDrawGraphInternal::Bitmap &pict, MWAWPosition pos);
00161
00162 private:
00163 ClarisDrawGraph(ClarisDrawGraph const &orig);
00164 ClarisDrawGraph &operator=(ClarisDrawGraph const &orig);
00165
00166 protected:
00167
00168
00169
00171 MWAWParserStatePtr m_parserState;
00172
00174 shared_ptr<ClarisDrawGraphInternal::State> m_state;
00175
00177 ClarisDrawParser *m_mainParser;
00179 shared_ptr<ClarisDrawStyleManager> m_styleManager;
00180 };
00181 #endif
00182