FictionBook2ContentCollector.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 FICTIONBOOK2CONTENTCOLLECTOR_H_INCLUDED
11#define FICTIONBOOK2CONTENTCOLLECTOR_H_INCLUDED
12
13#include "EBOOKLanguageManager.h"
14#include "FictionBook2Collector.h"
15
16 namespace libebook
17{
18
19 class FictionBook2ContentCollector : public FictionBook2Collector
20{
21 // no copying
22 FictionBook2ContentCollector(const FictionBook2ContentCollector &other);
23 FictionBook2ContentCollector &operator=(const FictionBook2ContentCollector &other);
24
25 public:
26 FictionBook2ContentCollector(librevenge::RVNGTextInterface *m_document, const librevenge::RVNGPropertyList &metadata, const NoteMap_t &notes, const BinaryMap_t &bitmaps);
27
28 private:
29 void defineMetadataEntry(const char *name, const char *value) override;
30 void openMetadataEntry(const char *name) override;
31 void closeMetadataEntry() override;
32
33 void defineID(const char *id) override;
34
35 void openPageSpan() override;
36 void closePageSpan() override;
37
38 void openBlock() override;
39 void closeBlock() override;
40
41 void openParagraph(const FictionBook2BlockFormat &format) override;
42 void closeParagraph() override;
43
44 void openSpan(const FictionBook2Style &style) override;
45 void closeSpan() override;
46
47 void insertText(const char *text) override;
48
49 void openTable(const FictionBook2BlockFormat &format) override;
50 void closeTable() override;
51
52 void openTableRow(const FictionBook2BlockFormat &format) override;
53 void closeTableRow() override;
54
55 void openTableCell(int rowspan, int colspan) override;
56 void closeTableCell() override;
57 void insertCoveredTableCell() override;
58
59 void insertFootnote(const char *id) override;
60
61 void insertBitmap(const char *id) override;
62 void insertBitmapData(const char *contentType, const char *base64Data) override;
63
64 private:
65 librevenge::RVNGTextInterface *m_document;
66 const librevenge::RVNGPropertyList &m_metadata;
67 const NoteMap_t &m_notes;
68 const BinaryMap_t &m_bitmaps;
69 EBOOKLanguageManager m_languageManager;
70 int m_currentFootnote;
71 int m_openPara;
72};
73
74}
75
76#endif // FICTIONBOOK2CONTENTCOLLECTOR_H_INCLUDED
77
78/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
EBOOKLanguageManager.h
metadata
RVNGPropertyList metadata
Definition EBOOKOPFParser.cpp:63
FictionBook2Collector.h
name
string name
Definition HTMLHelpStream.cpp:80
style
optional< Style > style
Definition TealDocParser.cpp:105
value
qi::rule< Iterator, AttrValue_t, qi::space_type > value
Definition TealDocParser.cpp:231
text
qi::rule< Iterator, AttrValue_t, qi::space_type > text
Definition TealDocParser.cpp:232
libebook::EBOOKLanguageManager
Definition EBOOKLanguageManager.h:24
libebook::FictionBook2Collector
Definition FictionBook2Collector.h:23
libebook::FictionBook2Collector::NoteMap_t
std::unordered_map< std::string, Note > NoteMap_t
Definition FictionBook2Collector.h:58
libebook::FictionBook2Collector::BinaryMap_t
std::unordered_map< std::string, Binary > BinaryMap_t
Definition FictionBook2Collector.h:57
libebook::FictionBook2ContentCollector
Definition FictionBook2ContentCollector.h:20
libebook::FictionBook2ContentCollector::insertBitmap
void insertBitmap(const char *id) override
Definition FictionBook2ContentCollector.cpp:197
libebook::FictionBook2ContentCollector::m_notes
const NoteMap_t & m_notes
Definition FictionBook2ContentCollector.h:67
libebook::FictionBook2ContentCollector::insertCoveredTableCell
void insertCoveredTableCell() override
Definition FictionBook2ContentCollector.cpp:162
libebook::FictionBook2ContentCollector::m_document
librevenge::RVNGTextInterface * m_document
Definition FictionBook2ContentCollector.h:65
libebook::FictionBook2ContentCollector::openBlock
void openBlock() override
Definition FictionBook2ContentCollector.cpp:60
libebook::FictionBook2ContentCollector::closeParagraph
void closeParagraph() override
Definition FictionBook2ContentCollector.cpp:83
libebook::FictionBook2ContentCollector::insertBitmapData
void insertBitmapData(const char *contentType, const char *base64Data) override
Definition FictionBook2ContentCollector.cpp:226
libebook::FictionBook2ContentCollector::m_currentFootnote
int m_currentFootnote
Definition FictionBook2ContentCollector.h:70
libebook::FictionBook2ContentCollector::closeSpan
void closeSpan() override
Definition FictionBook2ContentCollector.cpp:112
libebook::FictionBook2ContentCollector::defineID
void defineID(const char *id) override
Definition FictionBook2ContentCollector.cpp:46
libebook::FictionBook2ContentCollector::openTableRow
void openTableRow(const FictionBook2BlockFormat &format) override
Definition FictionBook2ContentCollector.cpp:132
libebook::FictionBook2ContentCollector::m_openPara
int m_openPara
Definition FictionBook2ContentCollector.h:71
libebook::FictionBook2ContentCollector::openParagraph
void openParagraph(const FictionBook2BlockFormat &format) override
Definition FictionBook2ContentCollector.cpp:68
libebook::FictionBook2ContentCollector::closeTableRow
void closeTableRow() override
Definition FictionBook2ContentCollector.cpp:141
libebook::FictionBook2ContentCollector::openTable
void openTable(const FictionBook2BlockFormat &format) override
Definition FictionBook2ContentCollector.cpp:122
libebook::FictionBook2ContentCollector::closeTable
void closeTable() override
Definition FictionBook2ContentCollector.cpp:127
libebook::FictionBook2ContentCollector::closePageSpan
void closePageSpan() override
Definition FictionBook2ContentCollector.cpp:55
libebook::FictionBook2ContentCollector::openMetadataEntry
void openMetadataEntry(const char *name) override
Definition FictionBook2ContentCollector.cpp:38
libebook::FictionBook2ContentCollector::FictionBook2ContentCollector
FictionBook2ContentCollector(const FictionBook2ContentCollector &other)
libebook::FictionBook2ContentCollector::operator=
FictionBook2ContentCollector & operator=(const FictionBook2ContentCollector &other)
libebook::FictionBook2ContentCollector::closeMetadataEntry
void closeMetadataEntry() override
Definition FictionBook2ContentCollector.cpp:42
libebook::FictionBook2ContentCollector::closeBlock
void closeBlock() override
Definition FictionBook2ContentCollector.cpp:64
libebook::FictionBook2ContentCollector::openSpan
void openSpan(const FictionBook2Style &style) override
Definition FictionBook2ContentCollector.cpp:89
libebook::FictionBook2ContentCollector::m_bitmaps
const BinaryMap_t & m_bitmaps
Definition FictionBook2ContentCollector.h:68
libebook::FictionBook2ContentCollector::m_metadata
const librevenge::RVNGPropertyList & m_metadata
Definition FictionBook2ContentCollector.h:66
libebook::FictionBook2ContentCollector::openTableCell
void openTableCell(int rowspan, int colspan) override
Definition FictionBook2ContentCollector.cpp:146
libebook::FictionBook2ContentCollector::defineMetadataEntry
void defineMetadataEntry(const char *name, const char *value) override
Definition FictionBook2ContentCollector.cpp:34
libebook::FictionBook2ContentCollector::insertText
void insertText(const char *text) override
Definition FictionBook2ContentCollector.cpp:117
libebook::FictionBook2ContentCollector::insertFootnote
void insertFootnote(const char *id) override
Definition FictionBook2ContentCollector.cpp:167
libebook::FictionBook2ContentCollector::openPageSpan
void openPageSpan() override
Definition FictionBook2ContentCollector.cpp:50
libebook::FictionBook2ContentCollector::m_languageManager
EBOOKLanguageManager m_languageManager
Definition FictionBook2ContentCollector.h:69
libebook::FictionBook2ContentCollector::closeTableCell
void closeTableCell() override
Definition FictionBook2ContentCollector.cpp:157
libebook::FictionBook2Style
Definition FictionBook2Style.h:56
libebook
Definition BBeBCollector.cpp:19
libebook::FictionBook2BlockFormat
Definition FictionBook2Style.h:36