VSDXParser.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 libvisio 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 __VSDXPARSER_H__
11#define __VSDXPARSER_H__
12
13#include <librevenge/librevenge.h>
14#include "VSDXTheme.h"
15#include "VSDXMLParserBase.h"
16
17 namespace libvisio
18{
19
20 class VSDCollector;
21
22 class VSDXParser : public VSDXMLParserBase
23{
24 using VSDXMLParserBase::readExtendedColourData;
25 using VSDXMLParserBase::readDoubleData;
26 using VSDXMLParserBase::readBoolData;
27 using VSDXMLParserBase::readLongData;
28 using VSDXMLParserBase::readStringData;
29
30
31 public:
32 explicit VSDXParser(librevenge::RVNGInputStream *input, librevenge::RVNGDrawingInterface *painter);
33 ~VSDXParser() override;
34 bool parseMain() override;
35 bool extractStencils() override;
36
37 private:
38 VSDXParser();
39 VSDXParser(const VSDXParser &);
40 VSDXParser &operator=(const VSDXParser &);
41
42 // Helper functions
43
44 xmlChar *readStringData(xmlTextReaderPtr reader) override;
45
46 int getElementToken(xmlTextReaderPtr reader) override;
47 int getElementDepth(xmlTextReaderPtr reader) override;
48
49 int skipSection(xmlTextReaderPtr reader);
50
51 // Functions parsing the Visio 2013 OPC document structure
52
53 bool parseDocument(librevenge::RVNGInputStream *input, const char *name);
54 bool parseMasters(librevenge::RVNGInputStream *input, const char *name);
55 bool parseMaster(librevenge::RVNGInputStream *input, const char *name);
56 bool parsePages(librevenge::RVNGInputStream *input, const char *name);
57 bool parsePage(librevenge::RVNGInputStream *input, const char *name);
58 bool parseTheme(librevenge::RVNGInputStream *input, const char *name);
59 void parseMetaData(librevenge::RVNGInputStream *input, VSDXRelationships &rels);
60 void processXmlDocument(librevenge::RVNGInputStream *input, VSDXRelationships &rels);
61 void processXmlNode(xmlTextReaderPtr reader);
62
63 // Functions reading the Visio 2013 OPC document content
64
65 void extractBinaryData(librevenge::RVNGInputStream *input, const char *name);
66
67 void readPageSheetProperties(xmlTextReaderPtr reader);
68
69 void readStyleProperties(xmlTextReaderPtr reader);
70
71 void readShapeProperties(xmlTextReaderPtr reader);
72
73 void getBinaryData(xmlTextReaderPtr reader) override;
74
75 void readLayer(xmlTextReaderPtr reader);
76 void readParagraph(xmlTextReaderPtr reader);
77 void readCharacter(xmlTextReaderPtr reader);
78 void readFonts(xmlTextReaderPtr reader);
79 void readTabs(xmlTextReaderPtr reader);
80 void readTabRow(xmlTextReaderPtr reader);
81
82 // Private data
83
84 librevenge::RVNGInputStream *m_input;
85 librevenge::RVNGDrawingInterface *m_painter;
86 int m_currentDepth;
87 VSDXRelationships *m_rels;
88 VSDXTheme m_currentTheme;
89};
90
91} // namespace libvisio
92
93#endif // __VSDXPARSER_H__
94/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
VSDXMLParserBase.h
VSDXTheme.h
libvisio::VSDXMLParserBase
Definition: VSDXMLParserBase.h:31
libvisio::VSDXMLParserBase::readStringData
int readStringData(VSDName &text, xmlTextReaderPtr reader)
Definition: VSDXMLParserBase.cpp:2074
libvisio::VSDXMLParserBase::readDoubleData
int readDoubleData(boost::optional< double > &value, xmlTextReaderPtr reader)
Definition: VSDXMLParserBase.cpp:2090
libvisio::VSDXMLParserBase::readBoolData
int readBoolData(boost::optional< bool > &value, xmlTextReaderPtr reader)
Definition: VSDXMLParserBase.cpp:2142
libvisio::VSDXMLParserBase::readExtendedColourData
int readExtendedColourData(Colour &value, long &idx, xmlTextReaderPtr reader)
Definition: VSDXMLParserBase.cpp:2181
libvisio::VSDXMLParserBase::readLongData
int readLongData(boost::optional< long > &value, xmlTextReaderPtr reader)
Definition: VSDXMLParserBase.cpp:2116
libvisio::VSDXParser
Definition: VSDXParser.h:23
libvisio::VSDXParser::VSDXParser
VSDXParser()
libvisio::VSDXParser::parseDocument
bool parseDocument(librevenge::RVNGInputStream *input, const char *name)
Definition: VSDXParser.cpp:113
libvisio::VSDXParser::readShapeProperties
void readShapeProperties(xmlTextReaderPtr reader)
Definition: VSDXParser.cpp:936
libvisio::VSDXParser::readTabs
void readTabs(xmlTextReaderPtr reader)
Definition: VSDXParser.cpp:1343
libvisio::VSDXParser::m_rels
VSDXRelationships * m_rels
Definition: VSDXParser.h:87
libvisio::VSDXParser::getElementToken
int getElementToken(xmlTextReaderPtr reader) override
Definition: VSDXParser.cpp:563
libvisio::VSDXParser::m_painter
librevenge::RVNGDrawingInterface * m_painter
Definition: VSDXParser.h:85
libvisio::VSDXParser::readCharacter
void readCharacter(xmlTextReaderPtr reader)
Definition: VSDXParser.cpp:1428
libvisio::VSDXParser::extractStencils
bool extractStencils() override
Definition: VSDXParser.cpp:107
libvisio::VSDXParser::m_currentDepth
int m_currentDepth
Definition: VSDXParser.h:86
libvisio::VSDXParser::m_currentTheme
VSDXTheme m_currentTheme
Definition: VSDXParser.h:88
libvisio::VSDXParser::operator=
VSDXParser & operator=(const VSDXParser &)
libvisio::VSDXParser::skipSection
int skipSection(xmlTextReaderPtr reader)
Definition: VSDXParser.cpp:1475
libvisio::VSDXParser::parseMasters
bool parseMasters(librevenge::RVNGInputStream *input, const char *name)
Definition: VSDXParser.cpp:167
libvisio::VSDXParser::readStringData
xmlChar * readStringData(xmlTextReaderPtr reader) override
Definition: VSDXParser.cpp:552
libvisio::VSDXParser::processXmlNode
void processXmlNode(xmlTextReaderPtr reader)
Definition: VSDXParser.cpp:372
libvisio::VSDXParser::extractBinaryData
void extractBinaryData(librevenge::RVNGInputStream *input, const char *name)
Definition: VSDXParser.cpp:531
libvisio::VSDXParser::parseMetaData
void parseMetaData(librevenge::RVNGInputStream *input, VSDXRelationships &rels)
Definition: VSDXParser.cpp:263
libvisio::VSDXParser::readStyleProperties
void readStyleProperties(xmlTextReaderPtr reader)
Definition: VSDXParser.cpp:706
libvisio::VSDXParser::m_input
librevenge::RVNGInputStream * m_input
Definition: VSDXParser.h:84
libvisio::VSDXParser::processXmlDocument
void processXmlDocument(librevenge::RVNGInputStream *input, VSDXRelationships &rels)
Definition: VSDXParser.cpp:298
libvisio::VSDXParser::readFonts
void readFonts(xmlTextReaderPtr reader)
Definition: VSDXParser.cpp:675
libvisio::VSDXParser::parseMaster
bool parseMaster(librevenge::RVNGInputStream *input, const char *name)
Definition: VSDXParser.cpp:187
libvisio::VSDXParser::parsePages
bool parsePages(librevenge::RVNGInputStream *input, const char *name)
Definition: VSDXParser.cpp:207
libvisio::VSDXParser::VSDXParser
VSDXParser(const VSDXParser &)
libvisio::VSDXParser::getBinaryData
void getBinaryData(xmlTextReaderPtr reader) override
Definition: VSDXParser.cpp:1449
libvisio::VSDXParser::readPageSheetProperties
void readPageSheetProperties(xmlTextReaderPtr reader)
Definition: VSDXParser.cpp:605
libvisio::VSDXParser::parsePage
bool parsePage(librevenge::RVNGInputStream *input, const char *name)
Definition: VSDXParser.cpp:227
libvisio::VSDXParser::readTabRow
void readTabRow(xmlTextReaderPtr reader)
Definition: VSDXParser.cpp:1371
libvisio::VSDXParser::getElementDepth
int getElementDepth(xmlTextReaderPtr reader) override
Definition: VSDXParser.cpp:931
libvisio::VSDXParser::~VSDXParser
~VSDXParser() override
Definition: VSDXParser.cpp:61
libvisio::VSDXParser::readLayer
void readLayer(xmlTextReaderPtr reader)
Definition: VSDXParser.cpp:1301
libvisio::VSDXParser::parseMain
bool parseMain() override
Definition: VSDXParser.cpp:65
libvisio::VSDXParser::parseTheme
bool parseTheme(librevenge::RVNGInputStream *input, const char *name)
Definition: VSDXParser.cpp:247
libvisio::VSDXParser::readParagraph
void readParagraph(xmlTextReaderPtr reader)
Definition: VSDXParser.cpp:1322
libvisio::VSDXRelationships
Definition: VSDXMLHelper.h:57
libvisio::VSDXTheme
Definition: VSDXTheme.h:77
libvisio
Definition: libvisio_utils.h:49