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 #ifndef WPS4_H
00024 #define WPS4_H
00025
00026 #include <vector>
00027 #include <map>
00028
00029 #include <libwpd-stream/WPXStream.h>
00030 #include "libwps_internal.h"
00031 #include "WPSDebug.h"
00032
00033 #include "WPSParser.h"
00034
00035 class WPXString;
00036 class WPSContentListener;
00037 typedef WPSContentListener WPS4ContentListener;
00038 class WPSEntry;
00039 class WPSPosition;
00040 class WPSPageSpan;
00041
00042 namespace WPS4ParserInternal
00043 {
00044 class SubDocument;
00045 struct State;
00046 }
00047
00048 class WPS4Graph;
00049 class WPS4Text;
00050
00055 class WPS4Parser : public WPSParser
00056 {
00057 friend class WPS4ParserInternal::SubDocument;
00058 friend class WPS4Graph;
00059 friend class WPS4Text;
00060
00061 public:
00063 WPS4Parser(WPXInputStreamPtr &input, WPSHeaderPtr &header);
00065 ~WPS4Parser();
00067 void parse(WPXDocumentInterface *documentInterface);
00068 protected:
00070 int version() const;
00072 bool getColor(int id, uint32_t &color) const;
00073
00075 long getSizeFile() const;
00077 void setSizeFile(long sz);
00079 bool checkInFile(long pos);
00080
00082 void newPage(int number);
00084 void setListener(shared_ptr<WPS4ContentListener> listener);
00085
00087 bool createStructures();
00089 bool createOLEStructures();
00091 shared_ptr<WPS4ContentListener> createListener(WPXDocumentInterface *interface);
00092
00093
00094
00096 float pageHeight() const;
00098 float pageWidth() const;
00100 int numColumns() const;
00101
00105 void createDocument(WPSEntry const &entry, libwps::SubDocumentType type);
00107 void createNote(WPSEntry const &entry, WPXString const &label);
00109 void createTextBox(WPSEntry const &entry, WPSPosition const &pos, WPXPropertyList &extras);
00111 void send(WPSEntry const &entry, libwps::SubDocumentType type);
00112
00113
00114
00118 int readObject(WPXInputStreamPtr input, WPSEntry const &entry);
00119
00123 void sendObject(Vec2f const &size, int id);
00124
00125
00126
00127
00128
00130 bool findZones();
00131
00135 bool parseEntry(std::string const &name);
00136
00138 bool readDocDim();
00139
00141 bool readPrnt(WPSEntry const &entry);
00142
00147 bool readDocWindowsInfo(WPSEntry const &entry);
00148
00150 libwps::DebugFile &ascii()
00151 {
00152 return m_asciiFile;
00153 }
00154
00155 shared_ptr<WPS4ContentListener> m_listener;
00157 shared_ptr<WPS4Graph> m_graphParser;
00159 shared_ptr<WPS4Text> m_textParser;
00161 shared_ptr<WPS4ParserInternal::State> m_state;
00162
00164 typedef std::multimap <std::string, WPSEntry> NameMultiMap;
00166 NameMultiMap m_nameMultiMap;
00168 libwps::DebugFile m_asciiFile;
00169 };
00170
00171 #endif
00172