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
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 #ifndef WPS_OLE_PARSER_H
00056 #define WPS_OLE_PARSER_H
00057
00058 #include <string>
00059 #include <vector>
00060
00061 #include <librevenge-stream/librevenge-stream.h>
00062
00063 #include "libwps_internal.h"
00064
00065 #include "WPSDebug.h"
00066 #include "WPSPosition.h"
00067
00068 namespace libwps
00069 {
00070 class Storage;
00071 }
00072
00073 namespace WPSOLEParserInternal
00074 {
00075 class CompObj;
00076 }
00077
00079 struct WPSOLEParserObject
00080 {
00082 WPSOLEParserObject() : m_position(), m_data(), m_mime("image/pict")
00083 {
00084 }
00086 WPSPosition m_position;
00088 librevenge::RVNGBinaryData m_data;
00090 std::string m_mime;
00091 };
00092
00096 class WPSOLEParser
00097 {
00098 public:
00101 WPSOLEParser(const std::string &mainName);
00102
00104 ~WPSOLEParser();
00105
00108 bool parse(RVNGInputStreamPtr fileInput);
00109
00111 std::vector<std::string> const &getNotParse() const
00112 {
00113 return m_unknownOLEs;
00114 }
00115
00117 std::vector<int> const &getObjectsId() const
00118 {
00119 return m_objectsId;
00120 }
00122 std::vector<WPSOLEParserObject> const &getObjects() const
00123 {
00124 return m_objects;
00125 }
00126 protected:
00127
00129 static bool readOle(RVNGInputStreamPtr &ip, std::string const &oleName,
00130 libwps::DebugFile &ascii);
00132 static bool readMM(RVNGInputStreamPtr &input, std::string const &oleName,
00133 libwps::DebugFile &ascii);
00135 static bool readObjInfo(RVNGInputStreamPtr &input, std::string const &oleName,
00136 libwps::DebugFile &ascii);
00138 bool readCompObj(RVNGInputStreamPtr &ip, std::string const &oleName,
00139 libwps::DebugFile &ascii);
00140
00142 static bool isOlePres(RVNGInputStreamPtr &ip, std::string const &oleName);
00144 static bool readOlePres(RVNGInputStreamPtr &ip, librevenge::RVNGBinaryData &data,
00145 WPSPosition &pos, libwps::DebugFile &ascii);
00146
00148 static bool isOle10Native(RVNGInputStreamPtr &ip, std::string const &oleName);
00150 static bool readOle10Native(RVNGInputStreamPtr &ip, librevenge::RVNGBinaryData &data,
00151 libwps::DebugFile &ascii);
00152
00156 static bool readContents(RVNGInputStreamPtr &input, std::string const &oleName,
00157 librevenge::RVNGBinaryData &pict, WPSPosition &pos, libwps::DebugFile &ascii);
00158
00164 static bool readCONTENTS(RVNGInputStreamPtr &input, std::string const &oleName,
00165 librevenge::RVNGBinaryData &pict, WPSPosition &pos, libwps::DebugFile &ascii);
00166
00168 static bool readMN0AndCheckWKS(RVNGInputStreamPtr &input, std::string const &oleName,
00169 librevenge::RVNGBinaryData &wksData, libwps::DebugFile &ascii);
00170
00172 std::string m_avoidOLE;
00174 std::vector<std::string> m_unknownOLEs;
00175
00177 std::vector<WPSOLEParserObject> m_objects;
00179 std::vector<int> m_objectsId;
00180
00182 shared_ptr<WPSOLEParserInternal::CompObj> m_compObjIdName;
00183
00184 };
00185
00186 #endif
00187