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 
23 {
24  // disable copying
25  XMLCollector(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: */
libebook::XMLCollector::finish
void finish()
Signalize an end of parsing from the parser.
Definition: XMLCollector.cpp:1532
m_continued
bool m_continued
Definition: XMLCollector.cpp:146
libebook::XMLCollector::XMLCollector
XMLCollector(const XMLCollector &)
EBOOKOutputElements.h
libebook::XMLCollector::State::metadata
RVNGPropertyList metadata
Definition: XMLCollector.cpp:740
TR
#define TR(c, e, a)
Definition: XMLCollector.cpp:901
action
ActionFun_t action
Definition: XMLCollector.cpp:571
libebook::XMLCollector::openFootnote
void openFootnote(const librevenge::RVNGPropertyList &props)
Definition: XMLCollector.cpp:1421
libebook::XMLCollector::State
Definition: XMLCollector.cpp:737
libebook::XMLCollector::closeTable
void closeTable()
Definition: XMLCollector.cpp:1466
libebook::XMLCollector::openLink
void openLink(const librevenge::RVNGPropertyList &props)
Definition: XMLCollector.cpp:1451
libebook::XMLCollector
Definition: XMLCollector.h:22
libebook::XMLCollector::closePageSpan
void closePageSpan()
Definition: XMLCollector.cpp:1396
m_openFun
OpenFun_t m_openFun
Definition: XMLCollector.cpp:140
libebook::XMLCollector::closeFootnote
void closeFootnote()
Definition: XMLCollector.cpp:1426
libebook::XMLCollector::openFooter
void openFooter(const librevenge::RVNGPropertyList &props)
Definition: XMLCollector.cpp:1411
libebook::XMLCollector::m_state
std::shared_ptr< State > m_state
Definition: XMLCollector.h:85
libebook::XMLCollector::collectMetadata
void collectMetadata(const librevenge::RVNGPropertyList &metadata)
Definition: XMLCollector.cpp:1347
libebook::XMLCollector::State::machine
StackMachine machine
Definition: XMLCollector.cpp:742
libebook::XMLCollector::collectSpace
void collectSpace()
Definition: XMLCollector.cpp:1358
libebook::XMLCollector::collectCoveredTableCell
void collectCoveredTableCell(const librevenge::RVNGPropertyList &props)
Definition: XMLCollector.cpp:1385
newContext
ContextType newContext
Definition: XMLCollector.cpp:570
libebook::XMLCollector::collectImage
void collectImage(const librevenge::RVNGPropertyList &props)
Definition: XMLCollector.cpp:1376
libebook
Definition: BBeBCollector.cpp:18
libebook::XMLCollector::collectText
void collectText(const std::string &text)
Definition: XMLCollector.cpp:1352
libebook::XMLCollector::closeSpan
void closeSpan()
Definition: XMLCollector.cpp:1446
libebook::XMLCollector::openTableCell
void openTableCell(const librevenge::RVNGPropertyList &props)
Definition: XMLCollector.cpp:1481
m_queue
EventQueue_t m_queue
Definition: XMLCollector.cpp:730
libebook::XMLCollector::State::contextStack
stack< Context > contextStack
Definition: XMLCollector.cpp:744
libebook_utils.h
m_dummy
bool m_dummy
Definition: XMLCollector.cpp:143
libebook::XMLCollector::closeTableRow
void closeTableRow()
Definition: XMLCollector.cpp:1476
text
qi::rule< Iterator, AttrValue_t, qi::space_type > text
Definition: TealDocParser.cpp:232
event
EventType event
Definition: XMLCollector.cpp:569
TR_ANY_R
#define TR_ANY_R(c, e, a)
Definition: XMLCollector.cpp:909
context
ContextType context
Definition: XMLCollector.cpp:568
libebook::XMLCollector::openListElement
void openListElement(const librevenge::RVNGPropertyList &props)
Definition: XMLCollector.cpp:1511
libebook::XMLCollector::openParagraph
void openParagraph(const librevenge::RVNGPropertyList &props)
Definition: XMLCollector.cpp:1431
m_closeFun
CloseFun_t m_closeFun
Definition: XMLCollector.cpp:141
libebook::XMLCollector::openOrderedList
void openOrderedList(const librevenge::RVNGPropertyList &props)
Definition: XMLCollector.cpp:1491
libebook::XMLCollector::closeOrderedList
void closeOrderedList()
Definition: XMLCollector.cpp:1496
libebook::EBOOKHTMLToken::i
@ i
Definition: EBOOKHTMLToken.h:86
libebook::XMLCollector::closeTableCell
void closeTableCell()
Definition: XMLCollector.cpp:1486
data
MSPackFileData * data
Definition: HTMLHelpStream.cpp:63
document
XMLTreeNodePtr_t document
Definition: EBOOKHTMLParser.cpp:163
m_data
shared_ptr< XMLCollector::State > m_data
Definition: XMLCollector.cpp:731
EBOOK_NUM_ELEMENTS
#define EBOOK_NUM_ELEMENTS(array)
Definition: libebook_utils.h:49
libebook::XMLCollector::closeParagraph
void closeParagraph()
Definition: XMLCollector.cpp:1436
libebook::XMLCollector::openObject
void openObject(const librevenge::RVNGPropertyList &props)
Definition: XMLCollector.cpp:1521
m_propList
RVNGPropertyList m_propList
Definition: XMLCollector.cpp:142
metadata
RVNGPropertyList metadata
Definition: EBOOKOPFParser.cpp:63
libebook::XMLCollector::openTableRow
void openTableRow(const librevenge::RVNGPropertyList &props)
Definition: XMLCollector.cpp:1471
libebook::XMLCollector::collectLineBreak
void collectLineBreak()
Definition: XMLCollector.cpp:1370
repeat
bool repeat
Definition: XMLCollector.cpp:572
m_transitions
TransitionTable_t m_transitions
Definition: XMLCollector.cpp:729
libebook::XMLCollector::State::currentProps
const RVNGPropertyList * currentProps
Definition: XMLCollector.cpp:747
libebook::XMLCollector::openUnorderedList
void openUnorderedList(const librevenge::RVNGPropertyList &props)
Definition: XMLCollector.cpp:1501
libebook::XMLCollector::closeUnorderedList
void closeUnorderedList()
Definition: XMLCollector.cpp:1506
libebook::XMLCollector::closeListElement
void closeListElement()
Definition: XMLCollector.cpp:1516
libebook::XMLCollector::closeFooter
void closeFooter()
Definition: XMLCollector.cpp:1416
libebook::XMLCollector::State::getCurrentOutput
const OutputHandlerPtr_t getCurrentOutput() const
Definition: XMLCollector.cpp:1332
libebook::XMLCollector::openHeader
void openHeader(const librevenge::RVNGPropertyList &props)
Definition: XMLCollector.cpp:1401
restore
bool restore
Restore one (or more) contexts on close.
Definition: XMLCollector.cpp:602
TR_ANY
#define TR_ANY(c, e, a)
Definition: XMLCollector.cpp:908
libebook::XMLCollector::openSpan
void openSpan(const librevenge::RVNGPropertyList &props)
Definition: XMLCollector.cpp:1441
libebook::XMLCollector::openPageSpan
void openPageSpan(const librevenge::RVNGPropertyList &props)
Definition: XMLCollector.cpp:1391
continued
bool continued
Indicates that this is a continuation of an interrupted context.
Definition: XMLCollector.cpp:598
XMLTreeWalker.h
m_output
EBOOKOutputElements & m_output
Definition: XMLCollector.cpp:138
libebook::XMLCollector::closeHeader
void closeHeader()
Definition: XMLCollector.cpp:1406
m_parent
const OutputHandlerPtr_t m_parent
Definition: XMLCollector.cpp:139
libebook::XMLCollector::State::savedStack
stack< Context > savedStack
Definition: XMLCollector.cpp:745
libebook::XMLCollector::openTable
void openTable(const librevenge::RVNGPropertyList &props)
Definition: XMLCollector.cpp:1461
output
OutputHandlerPtr_t output
Definition: XMLCollector.cpp:587
m_closed
bool m_closed
Definition: XMLCollector.cpp:145
artificial
bool artificial
Definition: XMLCollector.cpp:592
restoring
bool restoring
Indicate whether restoring should continue with another context.
Definition: XMLCollector.cpp:609
libebook::XMLCollector::m_document
librevenge::RVNGTextInterface *const m_document
Definition: XMLCollector.h:84
XMLCollector.h
TR_NEW_R
#define TR_NEW_R(c, e, n, a)
Definition: XMLCollector.cpp:906
libebook::XMLCollector::closeObject
void closeObject()
Definition: XMLCollector.cpp:1527
libebook::XMLCollector::collectTab
void collectTab()
Definition: XMLCollector.cpp:1364
TR_NEW
#define TR_NEW(c, e, n, a)
Definition: XMLCollector.cpp:905
m_init
ContextType m_init
Definition: XMLCollector.cpp:732
libebook::EBOOKOutputElements
Definition: EBOOKOutputElements.h:23
libebook::XMLCollector::State::output
EBOOKOutputElements output
Definition: XMLCollector.cpp:739
libebook::XMLCollector::closeLink
void closeLink()
Definition: XMLCollector.cpp:1456
libebook::XMLCollector::operator=
XMLCollector & operator=(const XMLCollector &)
m_state
const shared_ptr< XMLCollector::State > m_state
Definition: XMLCollector.cpp:1294
m_open
bool m_open
Definition: XMLCollector.cpp:144
libebook::EBOOKHTMLToken::reset
@ reset
Definition: EBOOKHTMLToken.h:308
type
ContextType type
Definition: XMLCollector.cpp:588

Generated for libe-book by doxygen 1.8.17