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 HMWJ_GRAPH
00039 # define HMWJ_GRAPH
00040
00041 #include <map>
00042 #include <set>
00043 #include <string>
00044 #include <vector>
00045
00046 #include <libwpd/libwpd.h>
00047
00048 #include "libmwaw_internal.hxx"
00049
00050 #include "MWAWDebug.hxx"
00051 #include "MWAWInputStream.hxx"
00052
00053 namespace HMWJGraphInternal
00054 {
00055 struct CellFormat;
00056 struct Frame;
00057 struct CommentFrame;
00058 struct Group;
00059 struct PictureFrame;
00060 struct ShapeGraph;
00061 struct TableFrame;
00062 struct TextboxFrame;
00063 struct TextFrame;
00064 struct Table;
00065 struct TableCell;
00066
00067 struct State;
00068 class SubDocument;
00069 }
00070
00071 class HMWJParser;
00072
00078 class HMWJGraph
00079 {
00080 friend class HMWJParser;
00081 friend struct HMWJGraphInternal::Table;
00082 friend class HMWJGraphInternal::SubDocument;
00083
00084 public:
00086 HMWJGraph(HMWJParser &parser);
00088 virtual ~HMWJGraph();
00089
00091 int version() const;
00092
00094 int numPages() const;
00095
00096 protected:
00097
00099 bool getColor(int colId, int patternId, MWAWColor &color) const;
00100
00102 void prepareStructures();
00104 bool sendPageGraphics(std::vector<long> const &doNotSendIds);
00106 void flushExtra();
00107
00108
00109
00110
00112 bool readFrames(MWAWEntry const &entry);
00114 shared_ptr<HMWJGraphInternal::Frame> readFrame(int id);
00116 shared_ptr<HMWJGraphInternal::ShapeGraph> readShapeGraph(HMWJGraphInternal::Frame const &header, long endPos);
00118 shared_ptr<HMWJGraphInternal::CommentFrame> readCommentData(HMWJGraphInternal::Frame const &header, long endPos);
00120 shared_ptr<HMWJGraphInternal::PictureFrame> readPictureData(HMWJGraphInternal::Frame const &header, long endPos);
00122 shared_ptr<HMWJGraphInternal::TableFrame> readTableData(HMWJGraphInternal::Frame const &header, long endPos);
00124 shared_ptr<HMWJGraphInternal::TextboxFrame> readTextboxData(HMWJGraphInternal::Frame const &header, long endPos);
00126 shared_ptr<HMWJGraphInternal::TextFrame> readTextData(HMWJGraphInternal::Frame const &header, long endPos);
00128 bool readGroupData(MWAWEntry const &entry, int actZone);
00130 bool readGraphData(MWAWEntry const &entry, int actZone);
00132 bool readPicture(MWAWEntry const &entry, int actZone);
00134 bool readTable(MWAWEntry const &entry, int actZone);
00136 bool readTableFormatsList(HMWJGraphInternal::Table &table, long endPos);
00137
00138
00140 bool sendFrame(HMWJGraphInternal::Frame const &frame, MWAWPosition pos, WPXPropertyList extras=WPXPropertyList());
00142 bool sendShapeGraph(HMWJGraphInternal::ShapeGraph const &pict, MWAWPosition pos);
00144 bool sendComment(HMWJGraphInternal::CommentFrame const &textbox, MWAWPosition pos, WPXPropertyList extras=WPXPropertyList());
00146 bool sendPictureFrame(HMWJGraphInternal::PictureFrame const &pict, MWAWPosition pos, WPXPropertyList extras=WPXPropertyList());
00148 bool sendEmptyPicture(MWAWPosition pos);
00150 bool sendTextbox(HMWJGraphInternal::TextboxFrame const &textbox, MWAWPosition pos, WPXPropertyList extras=WPXPropertyList());
00152 bool sendTableUnformatted(long zId);
00153
00155 bool sendGroup(long zId, MWAWPosition pos);
00157 bool sendGroup(HMWJGraphInternal::Group const &group, MWAWPosition pos);
00159 bool canCreateGraphic(HMWJGraphInternal::Group const &group);
00161 void sendGroupChild(HMWJGraphInternal::Group const &group, MWAWPosition const &pos);
00163 void sendGroup(HMWJGraphInternal::Group const &group, MWAWGraphicListenerPtr &listener);
00164
00165
00166
00169 std::map<long,int> getTextFrameInformations() const;
00171 bool getFootnoteInformations(long &textZId, std::vector<long> &fPosList) const;
00173 bool sendFrame(long frameId, MWAWPosition pos, WPXPropertyList extras=WPXPropertyList());
00175 bool sendText(long textId, long fPos, bool asGraphic=false);
00176
00177
00178
00179
00181 bool checkGroupStructures(long zId, std::set<long> &seens, bool inGroup);
00182
00183
00184 private:
00185 HMWJGraph(HMWJGraph const &orig);
00186 HMWJGraph &operator=(HMWJGraph const &orig);
00187
00188 protected:
00189
00190
00191
00193 MWAWParserStatePtr m_parserState;
00194
00196 shared_ptr<HMWJGraphInternal::State> m_state;
00197
00199 HMWJParser *m_mainParser;
00200 };
00201 #endif
00202