XMLCollector.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 libe-book 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 XMLCOLLECTOR_H_INCLUDED
11#define XMLCOLLECTOR_H_INCLUDED
12
13#include <string>
14
15#include <librevenge/librevenge.h>
16
17#include "XMLTreeWalker.h"
18
19 namespace libebook
20{
21
22 class XMLCollector
23{
24 // disable copying
25 XMLCollector(const XMLCollector &);
26 XMLCollector &operator=(const XMLCollector &);
27
28 public:
29 struct State;
30
31 public:
32 explicit XMLCollector(librevenge::RVNGTextInterface *document);
33
34 void collectMetadata(const librevenge::RVNGPropertyList &metadata);
35
36 void collectText(const std::string &text);
37 void collectSpace();
38 void collectTab();
39 void collectLineBreak();
40
41 void collectImage(const librevenge::RVNGPropertyList &props);
42
43 void collectCoveredTableCell(const librevenge::RVNGPropertyList &props);
44
45 void openPageSpan(const librevenge::RVNGPropertyList &props);
46 void closePageSpan();
47 void openHeader(const librevenge::RVNGPropertyList &props);
48 void closeHeader();
49 void openFooter(const librevenge::RVNGPropertyList &props);
50 void closeFooter();
51 void openFootnote(const librevenge::RVNGPropertyList &props);
52 void closeFootnote();
53
54 void openParagraph(const librevenge::RVNGPropertyList &props);
55 void closeParagraph();
56 void openSpan(const librevenge::RVNGPropertyList &props);
57 void closeSpan();
58 void openLink(const librevenge::RVNGPropertyList &props);
59 void closeLink();
60
61 void openTable(const librevenge::RVNGPropertyList &props);
62 void closeTable();
63 void openTableRow(const librevenge::RVNGPropertyList &props);
64 void closeTableRow();
65 void openTableCell(const librevenge::RVNGPropertyList &props);
66 void closeTableCell();
67
68 void openOrderedList(const librevenge::RVNGPropertyList &props);
69 void closeOrderedList();
70 void openUnorderedList(const librevenge::RVNGPropertyList &props);
71 void closeUnorderedList();
72
73 void openListElement(const librevenge::RVNGPropertyList &props);
74 void closeListElement();
75
76 void openObject(const librevenge::RVNGPropertyList &props);
77 void closeObject();
78
81 void finish();
82
83 private:
84 librevenge::RVNGTextInterface *const m_document;
85 std::shared_ptr<State> m_state;
86};
87
88}
89
90#endif // XMLCOLLECTOR_H_INCLUDED
91
92/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
document
XMLTreeNodePtr_t document
Definition EBOOKHTMLParser.cpp:163
metadata
RVNGPropertyList metadata
Definition EBOOKOPFParser.cpp:63
text
qi::rule< Iterator, AttrValue_t, qi::space_type > text
Definition TealDocParser.cpp:232
XMLTreeWalker.h
libebook::XMLCollector
Definition XMLCollector.h:23
libebook::XMLCollector::closeParagraph
void closeParagraph()
Definition XMLCollector.cpp:1436
libebook::XMLCollector::closeTableCell
void closeTableCell()
Definition XMLCollector.cpp:1486
libebook::XMLCollector::collectLineBreak
void collectLineBreak()
Definition XMLCollector.cpp:1370
libebook::XMLCollector::closeObject
void closeObject()
Definition XMLCollector.cpp:1527
libebook::XMLCollector::collectCoveredTableCell
void collectCoveredTableCell(const librevenge::RVNGPropertyList &props)
Definition XMLCollector.cpp:1385
libebook::XMLCollector::collectText
void collectText(const std::string &text)
Definition XMLCollector.cpp:1352
libebook::XMLCollector::closeLink
void closeLink()
Definition XMLCollector.cpp:1456
libebook::XMLCollector::closeUnorderedList
void closeUnorderedList()
Definition XMLCollector.cpp:1506
libebook::XMLCollector::openFooter
void openFooter(const librevenge::RVNGPropertyList &props)
Definition XMLCollector.cpp:1411
libebook::XMLCollector::openFootnote
void openFootnote(const librevenge::RVNGPropertyList &props)
Definition XMLCollector.cpp:1421
libebook::XMLCollector::openHeader
void openHeader(const librevenge::RVNGPropertyList &props)
Definition XMLCollector.cpp:1401
libebook::XMLCollector::m_document
librevenge::RVNGTextInterface *const m_document
Definition XMLCollector.h:84
libebook::XMLCollector::openParagraph
void openParagraph(const librevenge::RVNGPropertyList &props)
Definition XMLCollector.cpp:1431
libebook::XMLCollector::openTableCell
void openTableCell(const librevenge::RVNGPropertyList &props)
Definition XMLCollector.cpp:1481
libebook::XMLCollector::openListElement
void openListElement(const librevenge::RVNGPropertyList &props)
Definition XMLCollector.cpp:1511
libebook::XMLCollector::finish
void finish()
Signalize an end of parsing from the parser.
Definition XMLCollector.cpp:1532
libebook::XMLCollector::collectImage
void collectImage(const librevenge::RVNGPropertyList &props)
Definition XMLCollector.cpp:1376
libebook::XMLCollector::closeOrderedList
void closeOrderedList()
Definition XMLCollector.cpp:1496
libebook::XMLCollector::closeFootnote
void closeFootnote()
Definition XMLCollector.cpp:1426
libebook::XMLCollector::closeSpan
void closeSpan()
Definition XMLCollector.cpp:1446
libebook::XMLCollector::collectSpace
void collectSpace()
Definition XMLCollector.cpp:1358
libebook::XMLCollector::openOrderedList
void openOrderedList(const librevenge::RVNGPropertyList &props)
Definition XMLCollector.cpp:1491
libebook::XMLCollector::closeFooter
void closeFooter()
Definition XMLCollector.cpp:1416
libebook::XMLCollector::closeListElement
void closeListElement()
Definition XMLCollector.cpp:1516
libebook::XMLCollector::openPageSpan
void openPageSpan(const librevenge::RVNGPropertyList &props)
Definition XMLCollector.cpp:1391
libebook::XMLCollector::m_state
std::shared_ptr< State > m_state
Definition XMLCollector.h:85
libebook::XMLCollector::openUnorderedList
void openUnorderedList(const librevenge::RVNGPropertyList &props)
Definition XMLCollector.cpp:1501
libebook::XMLCollector::collectMetadata
void collectMetadata(const librevenge::RVNGPropertyList &metadata)
Definition XMLCollector.cpp:1347
libebook::XMLCollector::openTableRow
void openTableRow(const librevenge::RVNGPropertyList &props)
Definition XMLCollector.cpp:1471
libebook::XMLCollector::XMLCollector
XMLCollector(const XMLCollector &)
libebook::XMLCollector::closeHeader
void closeHeader()
Definition XMLCollector.cpp:1406
libebook::XMLCollector::openSpan
void openSpan(const librevenge::RVNGPropertyList &props)
Definition XMLCollector.cpp:1441
libebook::XMLCollector::closePageSpan
void closePageSpan()
Definition XMLCollector.cpp:1396
libebook::XMLCollector::openObject
void openObject(const librevenge::RVNGPropertyList &props)
Definition XMLCollector.cpp:1521
libebook::XMLCollector::closeTable
void closeTable()
Definition XMLCollector.cpp:1466
libebook::XMLCollector::openLink
void openLink(const librevenge::RVNGPropertyList &props)
Definition XMLCollector.cpp:1451
libebook::XMLCollector::closeTableRow
void closeTableRow()
Definition XMLCollector.cpp:1476
libebook::XMLCollector::openTable
void openTable(const librevenge::RVNGPropertyList &props)
Definition XMLCollector.cpp:1461
libebook::XMLCollector::collectTab
void collectTab()
Definition XMLCollector.cpp:1364
libebook::XMLCollector::operator=
XMLCollector & operator=(const XMLCollector &)
libebook
Definition BBeBCollector.cpp:19
libebook::XMLCollector::State
Definition XMLCollector.cpp:738