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 BEAGLE_WKS_STRUCT_MANAGER
00039 # define BEAGLE_WKS_STRUCT_MANAGER
00040
00041 #include <map>
00042
00043 #include "libmwaw_internal.hxx"
00044
00045 #include "MWAWCell.hxx"
00046
00047 namespace BeagleWksStructManagerInternal
00048 {
00049 struct State;
00050 }
00056 class BeagleWksStructManager
00057 {
00058 public:
00059 struct Frame;
00060
00062 BeagleWksStructManager(MWAWParserStatePtr parserState);
00064 ~BeagleWksStructManager();
00065
00067 bool getFrame(int fId, Frame &frame) const;
00069 std::map<int,Frame> const &getIdFrameMap() const;
00070
00072 int getFontId(int fFontId) const;
00074 void getHeaderFooterEntries(MWAWEntry &header, MWAWEntry &footer) const;
00076 bool readFontNames(MWAWEntry const &entry);
00078 bool readFrame(MWAWEntry const &entry);
00080 bool readDocumentInfo();
00082 bool readDocumentPreferences();
00083
00084
00085
00087 bool readPicture(int pId, librevenge::RVNGBinaryData &pict);
00089 bool readwPos(MWAWEntry const &entry);
00091 bool readFontStyle(MWAWEntry const &entry);
00092
00093
00094
00095
00096
00097 bool readCellInFormula(MWAWVec2i actPos, MWAWCellContent::FormulaInstruction &instr);
00098
00099 bool readFormula(long endPos, MWAWVec2i const &pos, std::vector<MWAWCellContent::FormulaInstruction> &formula, std::string &error);
00100
00102 struct Frame {
00104 Frame() : m_charAnchor(true), m_id(0), m_pictId(0), m_origin(), m_dim(), m_page(1),
00105 m_wrap(0), m_border(), m_bordersSet(0), m_extra("")
00106 {
00107 }
00109 friend std::ostream &operator<<(std::ostream &o, Frame const &frm)
00110 {
00111 if (frm.m_id) o << "id=" << frm.m_id << ",";
00112 if (!frm.m_charAnchor) o << "pageFrame,";
00113 if (frm.m_page!=1) o << "page=" << frm.m_page << ",";
00114 if (frm.m_origin[0]>0||frm.m_origin[1]>0)
00115 o << "origin=" << frm.m_origin << ",";
00116 o << "dim=" << frm.m_dim << ",";
00117 if (frm.m_pictId) o << "picId=" << std::hex << frm.m_pictId << std::dec << ",";
00118 o << frm.m_extra;
00119 return o;
00120 }
00122 bool m_charAnchor;
00124 int m_id;
00126 int m_pictId;
00128 MWAWVec2f m_origin;
00130 MWAWVec2f m_dim;
00132 int m_page;
00134 int m_wrap;
00136 MWAWBorder m_border;
00138 int m_bordersSet;
00140 std::string m_extra;
00141 };
00142 protected:
00144 MWAWInputStreamPtr getInput();
00146 libmwaw::DebugFile &ascii();
00148 MWAWInputStreamPtr rsrcInput();
00150 libmwaw::DebugFile &rsrcAscii();
00151
00152 private:
00153 BeagleWksStructManager(BeagleWksStructManager const &orig);
00154 BeagleWksStructManager &operator=(BeagleWksStructManager const &orig);
00155
00156 protected:
00157
00158
00159
00161 MWAWParserStatePtr m_parserState;
00162
00164 shared_ptr<BeagleWksStructManagerInternal::State> m_state;
00165 };
00166
00167 #endif
00168