PAGParser.h Source File documentation

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

PAGParser.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 libetonyek 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 PAGPARSER_H_INCLUDED
11 #define PAGPARSER_H_INCLUDED
12
13 #include <libxml/xmlreader.h>
14
15 #include "libetonyek_utils.h"
16
17 namespace libetonyek
18 {
19
20 class PAGCollector;
21 class KEYXMLReader;
22
23 class PAGParser
24 {
25 // -Weffc++
26 PAGParser(const PAGParser &);
27 PAGParser &operator=(const PAGParser &);
28
29 enum TextStorageKind
30 {
31 TEXT_STORAGE_KIND_UNKNOWN,
32 TEXT_STORAGE_KIND_BODY,
33 TEXT_STORAGE_KIND_HEADER,
34 TEXT_STORAGE_KIND_FOOTNOTE,
35 TEXT_STORAGE_KIND_TEXTBOX,
36 TEXT_STORAGE_KIND_NOTE,
37 TEXT_STORAGE_KIND_CELL
38 };
39
40 public:
41 PAGParser(const RVNGInputStreamPtr_t &input, const RVNGInputStreamPtr_t &package, PAGCollector *collector);
42
43 bool parse();
44
45 private:
46 void parseDocument(const KEYXMLReader &reader);
47 void parseMetadata(const KEYXMLReader &reader);
48 void parseSectionPrototypes(const KEYXMLReader &reader);
49 void parseStylesheet(const KEYXMLReader &reader);
50 void parseHeaders(const KEYXMLReader &reader);
51 void parseFooters(const KEYXMLReader &reader);
52 void parseTextStorage(const KEYXMLReader &reader);
53
54 void parseTextBody(const KEYXMLReader &reader, TextStorageKind kind);
55 void parseSection(const KEYXMLReader &reader);
56 void parseLayout(const KEYXMLReader &reader);
57 void parseP(const KEYXMLReader &reader);
58 void parseSpan(const KEYXMLReader &reader);
59 void parseTab(const KEYXMLReader &reader);
60 void parseBr(const KEYXMLReader &reader);
61
62 private:
63 RVNGInputStreamPtr_t m_input;
64 RVNGInputStreamPtr_t m_package;
65 PAGCollector *m_collector;
66 };
67
68 } // namespace libetonyek
69
70 #endif // PAGPARSER_H_INCLUDED
71
72 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libetonyek
Definition: EtonyekDocument.cpp:40
libetonyek::PAGParser::parseP
void parseP(const KEYXMLReader &reader)
Definition: PAGParser.cpp:217
libetonyek::PAGParser::parseFooters
void parseFooters(const KEYXMLReader &reader)
Definition: PAGParser.cpp:107
libetonyek::PAGCollector
Definition: PAGCollector.h:18
libetonyek::PAGParser::parseTextBody
void parseTextBody(const KEYXMLReader &reader, TextStorageKind kind)
Definition: PAGParser.cpp:167
libetonyek::PAGParser::TEXT_STORAGE_KIND_UNKNOWN
Definition: PAGParser.h:31
libetonyek::PAGParser::PAGParser
PAGParser(const PAGParser &)
libetonyek::PAGParser
Definition: PAGParser.h:23
libetonyek::PAGParser::m_package
RVNGInputStreamPtr_t m_package
Definition: PAGParser.h:64
libetonyek::PAGParser::TextStorageKind
TextStorageKind
Definition: PAGParser.h:29
libetonyek::PAGParser::m_input
RVNGInputStreamPtr_t m_input
Definition: PAGParser.h:63
libetonyek::PAGParser::parseSpan
void parseSpan(const KEYXMLReader &reader)
Definition: PAGParser.cpp:253
libetonyek::PAGParser::parseBr
void parseBr(const KEYXMLReader &reader)
Definition: PAGParser.cpp:295
libetonyek::PAGParser::parseTab
void parseTab(const KEYXMLReader &reader)
Definition: PAGParser.cpp:286
libetonyek::PAGParser::parseDocument
void parseDocument(const KEYXMLReader &reader)
Definition: PAGParser.cpp:41
libetonyek::PAGParser::m_collector
PAGCollector * m_collector
Definition: PAGParser.h:65
libetonyek::PAGParser::TEXT_STORAGE_KIND_FOOTNOTE
Definition: PAGParser.h:34
package
RVNGInputStreamPtr_t package
Definition: EtonyekDocument.cpp:60
libetonyek::PAGParser::TEXT_STORAGE_KIND_TEXTBOX
Definition: PAGParser.h:35
libetonyek::PAGParser::operator=
PAGParser & operator=(const PAGParser &)
libetonyek::PAGParser::TEXT_STORAGE_KIND_CELL
Definition: PAGParser.h:37
libetonyek::KEYXMLReader
Definition: KEYXMLReader.h:20
libetonyek::PAGParser::parse
bool parse()
Definition: PAGParser.cpp:30
libetonyek::RVNGInputStreamPtr_t
boost::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr_t
Definition: libetonyek_utils.h:88
input
RVNGInputStreamPtr_t input
Definition: EtonyekDocument.cpp:59
libetonyek::PAGParser::parseSectionPrototypes
void parseSectionPrototypes(const KEYXMLReader &reader)
Definition: PAGParser.cpp:86
libetonyek::PAGParser::parseMetadata
void parseMetadata(const KEYXMLReader &reader)
Definition: PAGParser.cpp:79
libetonyek::PAGParser::TEXT_STORAGE_KIND_HEADER
Definition: PAGParser.h:33
libetonyek::PAGParser::parseStylesheet
void parseStylesheet(const KEYXMLReader &reader)
Definition: PAGParser.cpp:93
libetonyek_utils.h
libetonyek::PAGParser::parseSection
void parseSection(const KEYXMLReader &reader)
Definition: PAGParser.cpp:189
libetonyek::KEY2Token::kind
Definition: KEY2Token.h:1010
libetonyek::PAGParser::TEXT_STORAGE_KIND_NOTE
Definition: PAGParser.h:36
libetonyek::PAGParser::parseTextStorage
void parseTextStorage(const KEYXMLReader &reader)
Definition: PAGParser.cpp:114
libetonyek::PAGParser::TEXT_STORAGE_KIND_BODY
Definition: PAGParser.h:32
libetonyek::PAGParser::parseHeaders
void parseHeaders(const KEYXMLReader &reader)
Definition: PAGParser.cpp:100
libetonyek::PAGParser::parseLayout
void parseLayout(const KEYXMLReader &reader)
Definition: PAGParser.cpp:203