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 WPS4_H
00023 #define WPS4_H
00024
00025 #include <vector>
00026
00027 #include <librevenge-stream/librevenge-stream.h>
00028 #include "libwps_internal.h"
00029 #include "libwps_tools_win.h"
00030
00031 #include "WPSParser.h"
00032
00033 class WPSPageSpan;
00034
00035 namespace WPS4ParserInternal
00036 {
00037 class SubDocument;
00038 struct State;
00039 }
00040
00041 class WPS4Graph;
00042 class WPS4Text;
00043
00048 class WPS4Parser : public WPSParser
00049 {
00050 friend class WPS4ParserInternal::SubDocument;
00051 friend class WPS4Graph;
00052 friend class WPS4Text;
00053
00054 public:
00056 WPS4Parser(RVNGInputStreamPtr &input, WPSHeaderPtr &header,
00057 libwps_tools_win::Font::Type encoding=libwps_tools_win::Font::UNKNOWN);
00059 ~WPS4Parser();
00061 void parse(librevenge::RVNGTextInterface *documentInterface);
00063 bool checkHeader(WPSHeader *header, bool strict=false);
00064 protected:
00066 bool getColor(int id, WPSColor &color) const;
00067
00069 void setSizeFile(long sz);
00071 bool checkFilePosition(long pos);
00072
00074 void newPage(int number);
00076 void setListener(shared_ptr<WPSContentListener> listener);
00077
00079 bool createStructures();
00081 bool createOLEStructures();
00083 shared_ptr<WPSContentListener> createListener(librevenge::RVNGTextInterface *interface);
00084
00085
00086
00088 float pageHeight() const;
00090 float pageWidth() const;
00092 int numColumns() const;
00096 libwps_tools_win::Font::Type getDefaultFontType() const;
00098 libwps_tools_win::Font::Type getOEMFontType() const;
00099
00103 void createDocument(WPSEntry const &entry, libwps::SubDocumentType type);
00105 void createNote(WPSEntry const &entry, librevenge::RVNGString const &label);
00107 void createTextBox(WPSEntry const &entry, WPSPosition const &pos, librevenge::RVNGPropertyList &extras);
00109 void send(WPSEntry const &entry, libwps::SubDocumentType type);
00110
00111
00112
00116 int readObject(RVNGInputStreamPtr input, WPSEntry const &entry);
00117
00121 void sendObject(Vec2f const &size, int id);
00122
00123
00124
00125
00126
00128 bool findZones();
00129
00133 bool parseEntry(std::string const &name);
00134
00136 bool readDocDim();
00137
00139 bool readPrnt(WPSEntry const &entry);
00140
00145 bool readDocWindowsInfo(WPSEntry const &entry);
00146
00147 shared_ptr<WPSContentListener> m_listener;
00149 shared_ptr<WPS4Graph> m_graphParser;
00151 shared_ptr<WPS4Text> m_textParser;
00153 shared_ptr<WPS4ParserInternal::State> m_state;
00154 };
00155
00156 #endif
00157