| 1 |
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
| 2 |
/* |
| 3 |
* This file is part of the libqxp project. |
| 4 |
* |
| 5 |
* This Source Code Form is subject to the terms of the Mozilla Public |
| 6 |
* License, v. 2.0. If a copy of the MPL was not distributed with this |
| 7 |
* file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 8 |
*/ |
| 9 |
|
| 10 |
#ifndef QXP1PARSER_H_INCLUDED |
| 11 |
#define QXP1PARSER_H_INCLUDED |
| 12 |
|
| 13 |
#include "QXPParser.h" |
| 14 |
|
| 15 |
namespace libqxp |
| 16 |
{ |
| 17 |
|
| 18 |
class QXP1Header; |
| 19 |
|
| 20 |
class QXP1Parser : public QXPParser |
| 21 |
{ |
| 22 |
public: |
| 23 |
QXP1Parser(const std::shared_ptr<librevenge::RVNGInputStream> &input, librevenge::RVNGDrawingInterface *painter, const std::shared_ptr<QXP1Header> &header); |
| 24 |
|
| 25 |
static void adjust(double &pos, unsigned adjustment); |
| 26 |
|
| 27 |
private: |
| 28 |
bool parseDocument(const std::shared_ptr<librevenge::RVNGInputStream> &docStream, QXPCollector &collector) override; |
| 29 |
bool parsePages(const std::shared_ptr<librevenge::RVNGInputStream> &pagesStream, QXPCollector &collector) override; |
| 30 |
|
| 31 |
CharFormat parseCharFormat(const std::shared_ptr<librevenge::RVNGInputStream> &stream) override; |
| 32 |
ParagraphFormat parseParagraphFormat(const std::shared_ptr<librevenge::RVNGInputStream> &stream) override; |
| 33 |
std::shared_ptr<HJ> parseHJ(const std::shared_ptr<librevenge::RVNGInputStream> &stream) override; |
| 34 |
|
| 35 |
bool parsePage(const std::shared_ptr<librevenge::RVNGInputStream> &input); |
| 36 |
bool parseObject(const std::shared_ptr<librevenge::RVNGInputStream> &input, QXPCollector &collector); |
| 37 |
|
| 38 |
void parseLine(const std::shared_ptr<librevenge::RVNGInputStream> &input, QXPCollector &collector, const Rect &bbox, const Color &color, bool transparent); |
| 39 |
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); |
| 40 |
void parsePicture(const std::shared_ptr<librevenge::RVNGInputStream> &input, QXPCollector &collector, const Rect &bbox, const Color &color, bool transparent); |
| 41 |
|
| 42 |
void parseCoordPair(const std::shared_ptr<librevenge::RVNGInputStream> &input, double &x1, double &y1, double &x2, double &y2); |
| 43 |
|
| 44 |
private: |
| 45 |
const std::shared_ptr<QXP1Header> m_header; |
| 46 |
}; |
| 47 |
|
| 48 |
} |
| 49 |
|
| 50 |
#endif // QXP1PARSER_H_INCLUDED |
| 51 |
|
| 52 |
/* vim:set shiftwidth=2 softtabstop=2 expandtab: */ |