QXP1Parser.h
Go to the documentation of this file.
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: */
libqxp::Color
Definition: QXPTypes.h:68
libqxp::Page
Definition: QXPTypes.h:545
libqxp::QXP1Parser
Definition: QXP1Parser.h:20
libqxp::TabStop::isDefined
bool isDefined() const
Definition: QXPTypes.h:223
libqxp::readU16
uint16_t readU16(librevenge::RVNGInputStream *input, bool bigEndian)
Definition: libqxp_utils.cpp:111
libqxp::QXPParser::getColor
Color getColor(unsigned id, Color defaultColor=Color(0, 0, 0)) const
Definition: QXPParser.cpp:83
libqxp::QXP1Parser::parseCoordPair
void parseCoordPair(const std::shared_ptr< librevenge::RVNGInputStream > &input, double &x1, double &y1, double &x2, double &y2)
Definition: QXP1Parser.cpp:250
QXP1Parser.h
libqxp::QXP1Parser::QXP1Parser
QXP1Parser(const std::shared_ptr< librevenge::RVNGInputStream > &input, librevenge::RVNGDrawingInterface *painter, const std::shared_ptr< QXP1Header > &header)
Definition: QXP1Parser.cpp:37
libqxp::TabStop::type
TabStopType type
Definition: QXPTypes.h:218
libqxp
Definition: libqxp_utils.cpp:24
QXP1Header.h
libqxp::ParagraphFormat::leading
double leading
Definition: QXPTypes.h:252
libqxp::QXPParser
Definition: QXPParser.h:30
libqxp::QXPCollector::startPage
virtual void startPage(const Page &)
Definition: QXPCollector.h:40
QXPCollector.h
libqxp::readS16
int16_t readS16(librevenge::RVNGInputStream *input, bool bigEndian)
Definition: libqxp_utils.cpp:159
libqxp::ParagraphFormat::firstLineIndent
double firstLineIndent
Definition: QXPTypes.h:251
libqxp::QXPCollector
Definition: QXPCollector.h:27
libqxp::TabStop::position
double position
Definition: QXPTypes.h:219
libqxp::QXP1Parser::parseDocument
bool parseDocument(const std::shared_ptr< librevenge::RVNGInputStream > &docStream, QXPCollector &collector) override
Definition: QXP1Parser.cpp:48
libqxp::ParagraphFormat::tabStops
std::vector< TabStop > tabStops
Definition: QXPTypes.h:256
libqxp::QXPParser::parseParagraphFormats
void parseParagraphFormats(const std::shared_ptr< librevenge::RVNGInputStream > &stream)
Definition: QXPParser.cpp:230
libqxp::readU32
uint32_t readU32(librevenge::RVNGInputStream *input, bool bigEndian)
Definition: libqxp_utils.cpp:127
libqxp::CharFormat::fontName
librevenge::RVNGString fontName
Definition: QXPTypes.h:146
libqxp::readFraction
double readFraction(librevenge::RVNGInputStream *input, bool bigEndian)
Definition: libqxp_utils.cpp:174
QXP_DEBUG_MSG
#define QXP_DEBUG_MSG(M)
Definition: libqxp_utils.h:53
libqxp::TabStop
Definition: QXPTypes.h:216
QXP_FALLTHROUGH
#define QXP_FALLTHROUGH
Definition: libqxp_utils.h:40
libqxp::QXP1Parser::parsePicture
void parsePicture(const std::shared_ptr< librevenge::RVNGInputStream > &input, QXPCollector &collector, const Rect &bbox, const Color &color, bool transparent)
Definition: QXP1Parser.cpp:240
libqxp::Page::pageSettings
std::vector< PageSettings > pageSettings
Definition: QXPTypes.h:547
libqxp::QXP1Parser::adjust
static void adjust(double &pos, unsigned adjustment)
Definition: QXP1Parser.cpp:43
libqxp::CharFormat
Definition: QXPTypes.h:144
libqxp::Rect::top
double top
Definition: QXPTypes.h:48
libqxp::QXP1Parser::parsePages
bool parsePages(const std::shared_ptr< librevenge::RVNGInputStream > &pagesStream, QXPCollector &collector) override
Definition: QXP1Parser.cpp:55
libqxp::CharFormat::color
Color color
Definition: QXPTypes.h:149
libqxp::QXP1Parser::parseParagraphFormat
ParagraphFormat parseParagraphFormat(const std::shared_ptr< librevenge::RVNGInputStream > &stream) override
Definition: QXP1Parser.cpp:101
libqxp::TabStop::fillChar
librevenge::RVNGString fillChar
Definition: QXPTypes.h:220
libqxp::Rect::right
double right
Definition: QXPTypes.h:49
libqxp::Rect
Definition: QXPTypes.h:46
libqxp::QXP1Parser::m_header
const std::shared_ptr< QXP1Header > m_header
Definition: QXP1Parser.h:45
libqxp::readU8
uint8_t readU8(librevenge::RVNGInputStream *input, bool)
Definition: libqxp_utils.cpp:99
libqxp::QXPParser::readHorAlign
HorizontalAlignment readHorAlign(const std::shared_ptr< librevenge::RVNGInputStream > &stream)
Definition: QXPParser.cpp:392
libqxp::QXP1Parser::parseHJ
std::shared_ptr< HJ > parseHJ(const std::shared_ptr< librevenge::RVNGInputStream > &stream) override
Definition: QXP1Parser.cpp:131
libqxp::QXP1Parser::parseObject
bool parseObject(const std::shared_ptr< librevenge::RVNGInputStream > &input, QXPCollector &collector)
Definition: QXP1Parser.cpp:152
libqxp::Color::applyShade
Color applyShade(double shade) const
Definition: QXPTypes.cpp:105
libqxp::QXP1Parser::parseCharFormat
CharFormat parseCharFormat(const std::shared_ptr< librevenge::RVNGInputStream > &stream) override
Definition: QXP1Parser.cpp:77
libqxp::QXPParser::convertTabStopType
TabStopType convertTabStopType(unsigned type)
Definition: QXPParser.cpp:542
libqxp::CharFormat::fontSize
double fontSize
Definition: QXPTypes.h:147
libqxp::Rect::bottom
double bottom
Definition: QXPTypes.h:50
libqxp::QXPCollector::endPage
virtual void endPage()
Definition: QXPCollector.h:41
libqxp::QXP1Parser::parseLine
void parseLine(const std::shared_ptr< librevenge::RVNGInputStream > &input, QXPCollector &collector, const Rect &bbox, const Color &color, bool transparent)
Definition: QXP1Parser.cpp:217
libqxp::ParagraphFormat
Definition: QXPTypes.h:247
libqxp::Rect::left
double left
Definition: QXPTypes.h:51
libqxp::skip
void skip(librevenge::RVNGInputStream *input, unsigned long numBytes)
Definition: libqxp_utils.cpp:234
QXPParser.h
libqxp::ParseError
Definition: libqxp_utils.h:142
libqxp::QXP1Parser::parseText
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)
Definition: QXP1Parser.cpp:227
libqxp::ParagraphFormat::margin
Rect margin
Definition: QXPTypes.h:250
libqxp::QXP1Parser::parsePage
bool parsePage(const std::shared_ptr< librevenge::RVNGInputStream > &input)
Definition: QXP1Parser.cpp:136
libqxp::QXPParser::convertCharFormatFlags
void convertCharFormatFlags(unsigned flags, CharFormat &format)
Definition: QXPParser.cpp:526
libqxp::QXPParser::parseCharFormats
void parseCharFormats(const std::shared_ptr< librevenge::RVNGInputStream > &stream)
Definition: QXPParser.cpp:167
libqxp::ParagraphFormat::alignment
HorizontalAlignment alignment
Definition: QXPTypes.h:249