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 <vector>
00026
00027 #include <librevenge/librevenge.h>
00028
00029 #include "libwps_internal.h"
00030 #include "WPSParser.h"
00031
00032 class WPSPageSpan;
00033
00034 namespace WPS8ParserInternal
00035 {
00036 class SubDocument;
00037 struct State;
00038 }
00039
00040 class WPS8Graph;
00041 class WPS8Table;
00042 class WPS8Text;
00043
00048 class WPS8Parser : public WPSParser
00049 {
00050 friend class WPS8ParserInternal::SubDocument;
00051 friend class WPS8Graph;
00052 friend class WPS8Table;
00053 friend class WPS8Text;
00054
00055 public:
00057 WPS8Parser(RVNGInputStreamPtr &input, WPSHeaderPtr &header);
00059 ~WPS8Parser();
00061 void parse(librevenge::RVNGTextInterface *documentInterface);
00062 protected:
00064 bool checkInFile(long pos);
00065
00067 void newPage(int number);
00069 void setListener(shared_ptr<WPSContentListener> listener);
00071 shared_ptr<WPSContentListener> createListener(librevenge::RVNGTextInterface *interface);
00072
00074 bool createStructures();
00076 bool createOLEStructures();
00077
00079 float pageHeight() const;
00081 float pageWidth() const;
00083 int numColumns() const;
00084
00086 void sendPageFrames();
00087
00088
00090 void sendTextBox(WPSPosition const &pos, int strsid,
00091 librevenge::RVNGPropertyList frameExtras=librevenge::RVNGPropertyList());
00092
00094 void send(WPSEntry const &entry);
00096 void send(int strsId);
00097
00099 void sendTextInCell(int strsId, int cellId);
00100
00101
00102
00104 bool sendTable(Vec2f const &size, int objectId);
00106 int getTableSTRSId(int tableId) const;
00107
00108
00109
00115 bool sendObject(Vec2f const &size, int objectId, bool ole);
00116
00117
00118
00119
00120
00122 bool parseHeaderIndexEntry();
00125 bool parseHeaderIndexEntryEnd(long endPos, WPSEntry &hie,std::string &mess);
00126
00131 bool parseHeaderIndex();
00132
00136 bool readDocProperties(WPSEntry const &entry, WPSPageSpan &page);
00137
00140 bool readFRAM(WPSEntry const &entry);
00141
00146 bool readSYID(WPSEntry const &entry, std::vector<int> &listId);
00147
00151 bool readWNPR(WPSEntry const &entry);
00152
00154 bool readSPELLING(RVNGInputStreamPtr input, std::string const &oleName);
00155
00156 shared_ptr<WPSContentListener> m_listener;
00158 shared_ptr<WPS8Graph> m_graphParser;
00160 shared_ptr<WPS8Table> m_tableParser;
00162 shared_ptr<WPS8Text> m_textParser;
00164 shared_ptr<WPS8ParserInternal::State> m_state;
00165 };
00166
00167 #endif
00168