QXP4Parser.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 QXP4PARSER_H_INCLUDED
11#define QXP4PARSER_H_INCLUDED
12
13#include "QXPParser.h"
14#include <vector>
15
16namespace libqxp
17{
18
19class QXP4Deobfuscator;
20class QXP4Header;
21
22class QXP4Parser : public QXPParser
23{
24public:
25 QXP4Parser(const std::shared_ptr<librevenge::RVNGInputStream> &input, librevenge::RVNGDrawingInterface *painter, const std::shared_ptr<QXP4Header> &header);
26
40
70
71private:
73 {
74 unsigned offset;
75 unsigned padding;
76
78 : offset(0), padding(0)
79 { }
80 };
81
82 const std::shared_ptr<QXP4Header> m_header;
83
84 std::vector<std::vector<TabStop>> m_paragraphTabStops;
85
86 bool parseDocument(const std::shared_ptr<librevenge::RVNGInputStream> &docStream, QXPCollector &collector) override;
87 bool parsePages(const std::shared_ptr<librevenge::RVNGInputStream> &stream, QXPCollector &collector) override;
88
89 void parseColors(const std::shared_ptr<librevenge::RVNGInputStream> &docStream);
90 ColorBlockSpec parseColorBlockSpec(const std::shared_ptr<librevenge::RVNGInputStream> &stream);
91 void parseColor(const std::shared_ptr<librevenge::RVNGInputStream> &stream, const std::vector<ColorBlockSpec> &blocks);
92 void skipParagraphStylesheets(const std::shared_ptr<librevenge::RVNGInputStream> &stream);
93 CharFormat parseCharFormat(const std::shared_ptr<librevenge::RVNGInputStream> &stream) override;
94 void parseLineStyles(const std::shared_ptr<librevenge::RVNGInputStream> &docStream);
95 void skipTemplates(const std::shared_ptr<librevenge::RVNGInputStream> &stream);
96 void parseTabStops(const std::shared_ptr<librevenge::RVNGInputStream> &stream);
97 ParagraphFormat parseParagraphFormat(const std::shared_ptr<librevenge::RVNGInputStream> &stream) override;
98 std::shared_ptr<HJ> parseHJ(const std::shared_ptr<librevenge::RVNGInputStream> &stream) override;
99
100 Page parsePage(const std::shared_ptr<librevenge::RVNGInputStream> &stream, QXP4Deobfuscator &deobfuscate);
101
102 void parseObject(const std::shared_ptr<librevenge::RVNGInputStream> &stream, QXP4Deobfuscator &deobfuscate, QXPCollector &collector, const Page &page, unsigned index);
103 ObjectHeader parseObjectHeader(const std::shared_ptr<librevenge::RVNGInputStream> &stream, QXP4Deobfuscator &deobfuscate);
104 void parseLine(const std::shared_ptr<librevenge::RVNGInputStream> &stream, const ObjectHeader &header, QXPCollector &collector);
105 void parseBezierLine(const std::shared_ptr<librevenge::RVNGInputStream> &stream, const ObjectHeader &header, QXPCollector &collector);
106 void parseBezierEmptyBox(const std::shared_ptr<librevenge::RVNGInputStream> &stream, const ObjectHeader &header, QXPCollector &collector);
107 void parseEmptyBox(const std::shared_ptr<librevenge::RVNGInputStream> &stream, const ObjectHeader &header, QXPCollector &collector);
108 void parseBezierPictureBox(const std::shared_ptr<librevenge::RVNGInputStream> &stream, const ObjectHeader &header, QXPCollector &collector);
109 void parsePictureBox(const std::shared_ptr<librevenge::RVNGInputStream> &stream, const ObjectHeader &header, QXPCollector &collector);
110 void parseLineText(const std::shared_ptr<librevenge::RVNGInputStream> &stream, const ObjectHeader &header, QXPCollector &collector);
111 void parseBezierText(const std::shared_ptr<librevenge::RVNGInputStream> &stream, const ObjectHeader &header, QXPCollector &collector);
112 void parseBezierTextBox(const std::shared_ptr<librevenge::RVNGInputStream> &stream, const ObjectHeader &header, QXPCollector &collector);
113 void parseTextBox(const std::shared_ptr<librevenge::RVNGInputStream> &stream, const ObjectHeader &header, QXPCollector &collector);
114 void parseGroup(const std::shared_ptr<librevenge::RVNGInputStream> &stream, const ObjectHeader &header, QXPCollector &collector, const Page &page, unsigned index);
115
116 Frame readFrame(const std::shared_ptr<librevenge::RVNGInputStream> &stream);
117 bool readRunaround(const std::shared_ptr<librevenge::RVNGInputStream> &stream);
118 void readLinkedTextSettings(const std::shared_ptr<librevenge::RVNGInputStream> &stream, LinkedTextSettings &settings);
119 void readTextSettings(const std::shared_ptr<librevenge::RVNGInputStream> &stream, TextSettings &settings);
120 void readTextPathSettings(const std::shared_ptr<librevenge::RVNGInputStream> &stream, TextPathSettings &settings);
121 void readOleObject(const std::shared_ptr<librevenge::RVNGInputStream> &stream);
122 void readPictureSettings(const std::shared_ptr<librevenge::RVNGInputStream> &stream, std::shared_ptr<PictureBox> &picturebox);
123 void readImageData(const std::shared_ptr<librevenge::RVNGInputStream> &stream);
124 void readBezierData(const std::shared_ptr<librevenge::RVNGInputStream> &stream, std::vector<CurveComponent> &curveComponents, Rect &bbox);
125 void skipTextObjectEnd(const std::shared_ptr<librevenge::RVNGInputStream> &stream, const ObjectHeader &header, const LinkedTextSettings &linkedTextSettings);
126};
127
128}
129
130#endif // QXP4PARSER_H_INCLUDED
131
132/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
Definition QXP4Deobfuscator.h:20
Definition QXP4Parser.h:23
std::shared_ptr< HJ > parseHJ(const std::shared_ptr< librevenge::RVNGInputStream > &stream) override
Definition QXP4Parser.cpp:447
bool readRunaround(const std::shared_ptr< librevenge::RVNGInputStream > &stream)
Definition QXP4Parser.cpp:1023
void parseLine(const std::shared_ptr< librevenge::RVNGInputStream > &stream, const ObjectHeader &header, QXPCollector &collector)
Definition QXP4Parser.cpp:666
void parseLineText(const std::shared_ptr< librevenge::RVNGInputStream > &stream, const ObjectHeader &header, QXPCollector &collector)
Definition QXP4Parser.cpp:802
void skipTextObjectEnd(const std::shared_ptr< librevenge::RVNGInputStream > &stream, const ObjectHeader &header, const LinkedTextSettings &linkedTextSettings)
Definition QXP4Parser.cpp:1176
std::vector< std::vector< TabStop > > m_paragraphTabStops
Definition QXP4Parser.h:84
void parseGroup(const std::shared_ptr< librevenge::RVNGInputStream > &stream, const ObjectHeader &header, QXPCollector &collector, const Page &page, unsigned index)
Definition QXP4Parser.cpp:976
QXP4Parser(const std::shared_ptr< librevenge::RVNGInputStream > &input, librevenge::RVNGDrawingInterface *painter, const std::shared_ptr< QXP4Header > &header)
Definition QXP4Parser.cpp:50
void parseBezierTextBox(const std::shared_ptr< librevenge::RVNGInputStream > &stream, const ObjectHeader &header, QXPCollector &collector)
Definition QXP4Parser.cpp:884
bool parseDocument(const std::shared_ptr< librevenge::RVNGInputStream > &docStream, QXPCollector &collector) override
Definition QXP4Parser.cpp:57
void readTextPathSettings(const std::shared_ptr< librevenge::RVNGInputStream > &stream, TextPathSettings &settings)
Definition QXP4Parser.cpp:1051
void skipTemplates(const std::shared_ptr< librevenge::RVNGInputStream > &stream)
Definition QXP4Parser.cpp:332
void parseColor(const std::shared_ptr< librevenge::RVNGInputStream > &stream, const std::vector< ColorBlockSpec > &blocks)
Definition QXP4Parser.cpp:173
void parseBezierEmptyBox(const std::shared_ptr< librevenge::RVNGInputStream > &stream, const ObjectHeader &header, QXPCollector &collector)
Definition QXP4Parser.cpp:696
void readOleObject(const std::shared_ptr< librevenge::RVNGInputStream > &stream)
Definition QXP4Parser.cpp:1092
void parseEmptyBox(const std::shared_ptr< librevenge::RVNGInputStream > &stream, const ObjectHeader &header, QXPCollector &collector)
Definition QXP4Parser.cpp:715
void parseTextBox(const std::shared_ptr< librevenge::RVNGInputStream > &stream, const ObjectHeader &header, QXPCollector &collector)
Definition QXP4Parser.cpp:928
void skipParagraphStylesheets(const std::shared_ptr< librevenge::RVNGInputStream > &stream)
Definition QXP4Parser.cpp:197
void parseBezierLine(const std::shared_ptr< librevenge::RVNGInputStream > &stream, const ObjectHeader &header, QXPCollector &collector)
Definition QXP4Parser.cpp:682
void readPictureSettings(const std::shared_ptr< librevenge::RVNGInputStream > &stream, std::shared_ptr< PictureBox > &picturebox)
Definition QXP4Parser.cpp:1098
void parseBezierPictureBox(const std::shared_ptr< librevenge::RVNGInputStream > &stream, const ObjectHeader &header, QXPCollector &collector)
Definition QXP4Parser.cpp:738
ParagraphFormat parseParagraphFormat(const std::shared_ptr< librevenge::RVNGInputStream > &stream) override
Definition QXP4Parser.cpp:395
Frame readFrame(const std::shared_ptr< librevenge::RVNGInputStream > &stream)
Definition QXP4Parser.cpp:999
void readTextSettings(const std::shared_ptr< librevenge::RVNGInputStream > &stream, TextSettings &settings)
Definition QXP4Parser.cpp:1036
void parseBezierText(const std::shared_ptr< librevenge::RVNGInputStream > &stream, const ObjectHeader &header, QXPCollector &collector)
Definition QXP4Parser.cpp:844
void parseObject(const std::shared_ptr< librevenge::RVNGInputStream > &stream, QXP4Deobfuscator &deobfuscate, QXPCollector &collector, const Page &page, unsigned index)
Definition QXP4Parser.cpp:466
CharFormat parseCharFormat(const std::shared_ptr< librevenge::RVNGInputStream > &stream) override
Definition QXP4Parser.cpp:227
ObjectHeader parseObjectHeader(const std::shared_ptr< librevenge::RVNGInputStream > &stream, QXP4Deobfuscator &deobfuscate)
Definition QXP4Parser.cpp:551
void parseTabStops(const std::shared_ptr< librevenge::RVNGInputStream > &stream)
Definition QXP4Parser.cpp:357
ShapeType
Definition QXP4Parser.h:28
void readBezierData(const std::shared_ptr< librevenge::RVNGInputStream > &stream, std::vector< CurveComponent > &curveComponents, Rect &bbox)
Definition QXP4Parser.cpp:1115
const std::shared_ptr< QXP4Header > m_header
Definition QXP4Parser.h:82
void parsePictureBox(const std::shared_ptr< librevenge::RVNGInputStream > &stream, const ObjectHeader &header, QXPCollector &collector)
Definition QXP4Parser.cpp:768
void parseLineStyles(const std::shared_ptr< librevenge::RVNGInputStream > &docStream)
Definition QXP4Parser.cpp:253
void readLinkedTextSettings(const std::shared_ptr< librevenge::RVNGInputStream > &stream, LinkedTextSettings &settings)
Definition QXP4Parser.cpp:1030
bool parsePages(const std::shared_ptr< librevenge::RVNGInputStream > &stream, QXPCollector &collector) override
Definition QXP4Parser.cpp:95
Page parsePage(const std::shared_ptr< librevenge::RVNGInputStream > &stream, QXP4Deobfuscator &deobfuscate)
Definition QXP4Parser.cpp:458
void readImageData(const std::shared_ptr< librevenge::RVNGInputStream > &stream)
Definition QXP4Parser.cpp:1109
ColorBlockSpec parseColorBlockSpec(const std::shared_ptr< librevenge::RVNGInputStream > &stream)
Definition QXP4Parser.cpp:164
void parseColors(const std::shared_ptr< librevenge::RVNGInputStream > &docStream)
Definition QXP4Parser.cpp:121
Definition QXPCollector.h:28
Definition QXPParser.h:31
Definition libqxp_utils.cpp:25
CornerType
Definition QXPTypes.h:470
BoxType
Definition QXPTypes.h:478
ContentType
Definition QXPTypes.h:266
Definition QXPTypes.h:145
Definition QXPTypes.h:69
Definition QXPTypes.h:345
Definition QXPTypes.h:362
Definition QXPTypes.h:546
Definition QXPTypes.h:248
Definition QXP4Parser.h:73
ColorBlockSpec()
Definition QXP4Parser.h:77
unsigned padding
Definition QXP4Parser.h:75
unsigned offset
Definition QXP4Parser.h:74
Definition QXP4Parser.h:42
CornerType cornerType
Definition QXP4Parser.h:61
unsigned oleId
Definition QXP4Parser.h:48
unsigned gradientId
Definition QXP4Parser.h:49
BoxType boxType
Definition QXP4Parser.h:60
unsigned linkId
Definition QXP4Parser.h:47
unsigned contentIndex
Definition QXP4Parser.h:46
ObjectHeader()
Definition QXP4Parser.h:63
ContentType contentType
Definition QXP4Parser.h:57
bool vflip
Definition QXP4Parser.h:55
double skew
Definition QXP4Parser.h:52
double rotation
Definition QXP4Parser.h:51
ShapeType shapeType
Definition QXP4Parser.h:58
bool hflip
Definition QXP4Parser.h:54
boost::optional< Color > fillColor
Definition QXP4Parser.h:43
Color color
Definition QXP4Parser.h:44
Definition QXPTypes.h:47
Definition QXPTypes.h:416
Definition QXPTypes.h:387

Generated for libqxp by doxygen 1.12.0