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 #ifndef WPS8_H
00023 #define WPS8_H
00024
00025 #include <deque>
00026 #include <vector>
00027
00028 #include <librevenge/librevenge.h>
00029
00030 #include "libwps_internal.h"
00031 #include "WPSParser.h"
00032
00033 class WPSPageSpan;
00034
00035 namespace WPS8ParserInternal
00036 {
00037 class SubDocument;
00038 struct State;
00039 }
00040
00041 class WPS8Graph;
00042 class WPS8Table;
00043 class WPS8Text;
00044
00049 class WPS8Parser : public WPSParser
00050 {
00051 friend class WPS8ParserInternal::SubDocument;
00052 friend class WPS8Graph;
00053 friend class WPS8Table;
00054 friend class WPS8Text;
00055
00056 public:
00058 WPS8Parser(RVNGInputStreamPtr &input, WPSHeaderPtr &header);
00060 ~WPS8Parser();
00062 void parse(librevenge::RVNGTextInterface *documentInterface);
00063 protected:
00065 bool checkInFile(long pos);
00066
00068 void newPage(int number);
00070 void setListener(shared_ptr<WPSContentListener> listener);
00072 shared_ptr<WPSContentListener> createListener(librevenge::RVNGTextInterface *interface);
00073
00075 bool createStructures();
00077 bool createOLEStructures();
00078
00080 float pageHeight() const;
00082 float pageWidth() const;
00084 int numColumns() const;
00085
00087 void sendPageFrames();
00088
00089
00091 void sendTextBox(WPSPosition const &pos, int strsid,
00092 librevenge::RVNGPropertyList frameExtras=librevenge::RVNGPropertyList());
00093
00095 void send(WPSEntry const &entry);
00097 void send(int strsId);
00098
00100 void sendTextInCell(int strsId, int cellId);
00101
00102
00103
00105 bool sendTable(Vec2f const &size, int objectId);
00107 int getTableSTRSId(int tableId) const;
00108
00109
00110
00116 bool sendObject(Vec2f const &size, int objectId, bool ole);
00117
00118
00119
00120
00121
00123 bool parseHeaderIndexEntry();
00126 bool parseHeaderIndexEntryEnd(long endPos, WPSEntry &hie,std::string &mess);
00127
00132 bool parseHeaderIndex();
00133
00137 bool readDocProperties(WPSEntry const &entry, WPSPageSpan &page);
00138
00141 bool readFRAM(WPSEntry const &entry);
00142
00147 bool readSYID(WPSEntry const &entry, std::vector<int> &listId);
00148
00152 bool readWNPR(WPSEntry const &entry);
00153
00155 bool readSPELLING(RVNGInputStreamPtr input, std::string const &oleName);
00156
00157 shared_ptr<WPSContentListener> m_listener;
00159 shared_ptr<WPS8Graph> m_graphParser;
00161 shared_ptr<WPS8Table> m_tableParser;
00163 shared_ptr<WPS8Text> m_textParser;
00165 shared_ptr<WPS8ParserInternal::State> m_state;
00166
00167 private:
00168 std::deque<int> m_sendingTables;
00169 };
00170
00171 #endif
00172