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);
00058 ~WPS4Parser();
00060 void parse(librevenge::RVNGTextInterface *documentInterface);
00062 bool checkHeader(WPSHeader *header, bool strict=false);
00063 protected:
00065 bool getColor(int id, uint32_t &color) const;
00066
00068 void setSizeFile(long sz);
00070 bool checkFilePosition(long pos);
00071
00073 void newPage(int number);
00075 void setListener(shared_ptr<WPSContentListener> listener);
00076
00078 bool createStructures();
00080 bool createOLEStructures();
00082 shared_ptr<WPSContentListener> createListener(librevenge::RVNGTextInterface *interface);
00083
00084
00085
00087 float pageHeight() const;
00089 float pageWidth() const;
00091 int numColumns() const;
00093 libwps_tools_win::Font::Type getDocumentFontType() const;
00094
00098 void createDocument(WPSEntry const &entry, libwps::SubDocumentType type);
00100 void createNote(WPSEntry const &entry, librevenge::RVNGString const &label);
00102 void createTextBox(WPSEntry const &entry, WPSPosition const &pos, librevenge::RVNGPropertyList &extras);
00104 void send(WPSEntry const &entry, libwps::SubDocumentType type);
00105
00106
00107
00111 int readObject(RVNGInputStreamPtr input, WPSEntry const &entry);
00112
00116 void sendObject(Vec2f const &size, int id);
00117
00118
00119
00120
00121
00123 bool findZones();
00124
00128 bool parseEntry(std::string const &name);
00129
00131 bool readDocDim();
00132
00134 bool readPrnt(WPSEntry const &entry);
00135
00140 bool readDocWindowsInfo(WPSEntry const &entry);
00141
00142 shared_ptr<WPSContentListener> m_listener;
00144 shared_ptr<WPS4Graph> m_graphParser;
00146 shared_ptr<WPS4Text> m_textParser;
00148 shared_ptr<WPS4ParserInternal::State> m_state;
00149 };
00150
00151 #endif
00152