Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef QXPHEADER_H_INCLUDED
00011 #define QXPHEADER_H_INCLUDED
00012
00013 #include <memory>
00014
00015 #include <boost/optional.hpp>
00016
00017 #include <libqxp/libqxp.h>
00018
00019 namespace libqxp
00020 {
00021
00022 enum QXPVersion
00023 {
00024 UNKNOWN = 0,
00025 QXP_1 = 0x20,
00026 QXP_31_MAC = 0x39,
00027 QXP_31 = 0x3e,
00028 QXP_33 = 0x3f,
00029 QXP_4 = 0x41,
00030 QXP_5 = 0x42,
00031 QXP_6 = 0x43,
00032 QXP_7 = 0x44,
00033 QXP_8 = 0x45,
00034 };
00035
00036 class QXPParser;
00037
00038 struct QXPDocumentProperties;
00039
00040 class QXPHeader
00041 {
00042 public:
00043 explicit QXPHeader(const boost::optional<QXPDocument::Type> &fileType = boost::none);
00044 virtual ~QXPHeader() = default;
00045
00046 virtual bool load(const std::shared_ptr<librevenge::RVNGInputStream> &input) = 0;
00047
00048 virtual QXPDocument::Type getType() const = 0;
00049
00050 virtual std::unique_ptr<QXPParser> createParser(const std::shared_ptr<librevenge::RVNGInputStream> &input, librevenge::RVNGDrawingInterface *painter) = 0;
00051
00052 bool isLittleEndian() const;
00053 bool isBigEndian() const;
00054 unsigned version() const;
00055 const char *encoding() const;
00056
00057 protected:
00058 unsigned m_proc;
00059 unsigned m_version;
00060 unsigned m_language;
00061 boost::optional<QXPDocument::Type> m_fileType;
00062 };
00063
00064 }
00065
00066 #endif // QXPHEADER_H_INCLUDED
00067
00068