QXP1Parser.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /*
00003  * This file is part of the libqxp project.
00004  *
00005  * This Source Code Form is subject to the terms of the Mozilla Public
00006  * License, v. 2.0. If a copy of the MPL was not distributed with this
00007  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
00008  */
00009 
00010 #ifndef QXP1PARSER_H_INCLUDED
00011 #define QXP1PARSER_H_INCLUDED
00012 
00013 #include "QXPParser.h"
00014 
00015 namespace libqxp
00016 {
00017 
00018 class QXP1Header;
00019 
00020 class QXP1Parser : public QXPParser
00021 {
00022 public:
00023   QXP1Parser(const std::shared_ptr<librevenge::RVNGInputStream> &input, librevenge::RVNGDrawingInterface *painter, const std::shared_ptr<QXP1Header> &header);
00024 
00025   static void adjust(double &pos, unsigned adjustment);
00026 
00027 private:
00028   bool parseDocument(const std::shared_ptr<librevenge::RVNGInputStream> &docStream, QXPCollector &collector) override;
00029   bool parsePages(const std::shared_ptr<librevenge::RVNGInputStream> &pagesStream, QXPCollector &collector) override;
00030 
00031   CharFormat parseCharFormat(const std::shared_ptr<librevenge::RVNGInputStream> &stream) override;
00032   ParagraphFormat parseParagraphFormat(const std::shared_ptr<librevenge::RVNGInputStream> &stream) override;
00033   std::shared_ptr<HJ> parseHJ(const std::shared_ptr<librevenge::RVNGInputStream> &stream) override;
00034 
00035   bool parsePage(const std::shared_ptr<librevenge::RVNGInputStream> &input);
00036   bool parseObject(const std::shared_ptr<librevenge::RVNGInputStream> &input, QXPCollector &collector);
00037 
00038   void parseLine(const std::shared_ptr<librevenge::RVNGInputStream> &input, QXPCollector &collector, const Rect &bbox, const Color &color, bool transparent);
00039   void parseText(const std::shared_ptr<librevenge::RVNGInputStream> &input, QXPCollector &collector, const Rect &bbox, const Color &color, bool transparent, unsigned content, unsigned textOffset, unsigned linkID);
00040   void parsePicture(const std::shared_ptr<librevenge::RVNGInputStream> &input, QXPCollector &collector, const Rect &bbox, const Color &color, bool transparent);
00041 
00042   void parseCoordPair(const std::shared_ptr<librevenge::RVNGInputStream> &input, double &x1, double &y1, double &x2, double &y2);
00043 
00044 private:
00045   const std::shared_ptr<QXP1Header> m_header;
00046 };
00047 
00048 }
00049 
00050 #endif // QXP1PARSER_H_INCLUDED
00051 
00052 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */