FB2ExtrasCollector.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 FB2EXTRASCOLLECTOR_H_INCLUDED
11 #define FB2EXTRASCOLLECTOR_H_INCLUDED
12
13 #include "FB2Collector.h"
14
15 namespace libebook
16 {
17
18 class FB2Content;
19 class FB2ContentMap;
20 class FB2Style;
21
22 class GroupContent;
23
24 class FB2ExtrasCollector : public FB2Collector
25 {
26 // no copying
27 FB2ExtrasCollector(const FB2ExtrasCollector &other);
28 FB2ExtrasCollector &operator=(const FB2ExtrasCollector &other);
29
30 public:
31 FB2ExtrasCollector(FB2ContentMap &notes, FB2ContentMap &bitmaps);
32 virtual ~FB2ExtrasCollector();
33
34 private:
35 virtual void defineMetadataEntry(const char *name, const char *value);
36 virtual void openMetadataEntry(const char *name);
37 virtual void closeMetadataEntry();
38
39 virtual void defineID(const char *);
40
41 virtual void openPageSpan();
42 virtual void closePageSpan();
43
44 virtual void openBlock();
45 virtual void closeBlock();
46
47 virtual void openParagraph(const FB2BlockFormat &format);
48 virtual void closeParagraph();
49
50 virtual void openSpan(const FB2Style &style);
51 virtual void closeSpan();
52
53 virtual void insertText(const char *text);
54
55 virtual void openTable(const FB2BlockFormat &format);
56 virtual void closeTable();
57
58 virtual void openTableRow(const FB2BlockFormat &format);
59 virtual void closeTableRow();
60
61 virtual void openTableCell(int rowspan, int colspan);
62 virtual void closeTableCell();
63 virtual void insertCoveredTableCell();
64
65 virtual void insertFootnote(const char *id);
66
67 virtual void insertBitmap(const char *id);
68 virtual void insertBitmapData(const char *contentType, const char *base64Data);
69
70 void flushCurrentNote();
71 bool isInNote() const;
72
73 private:
74 FB2ContentMap &m_notes;
75 FB2ContentMap &m_bitmaps;
76 std::string m_currentID;
77 GroupContent *m_currentNote;
78 GroupContent *m_currentPara;
79 const FB2Style *m_currentStyle;
80 };
81
82 }
83
84 #endif // FB2EXTRASCOLLECTOR_H_INCLUDED
85
86 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
style
optional< Style > style
Definition: TDParser.cpp:106
libebook::FB2ExtrasCollector::openParagraph
virtual void openParagraph(const FB2BlockFormat &format)
Definition: FB2ExtrasCollector.cpp:203
libebook::FB2ExtrasCollector::openTable
virtual void openTable(const FB2BlockFormat &format)
Definition: FB2ExtrasCollector.cpp:245
libebook::EBOOKHTMLToken::rowspan
Definition: EBOOKHTMLToken.h:244
libebook::FB2ExtrasCollector::closeTableCell
virtual void closeTableCell()
Definition: FB2ExtrasCollector.cpp:274
libebook::FB2ExtrasCollector::flushCurrentNote
void flushCurrentNote()
Definition: FB2ExtrasCollector.cpp:298
libebook::FB2Collector
Definition: FB2Collector.h:19
libebook::FB2ExtrasCollector::closePageSpan
virtual void closePageSpan()
Definition: FB2ExtrasCollector.cpp:189
FB2Collector.h
libebook::FB2ExtrasCollector::closeSpan
virtual void closeSpan()
Definition: FB2ExtrasCollector.cpp:227
libebook::FB2ExtrasCollector::isInNote
bool isInNote() const
Definition: FB2ExtrasCollector.cpp:313
libebook::EBOOKHTMLToken::text
Definition: EBOOKHTMLToken.h:259
libebook::FB2Style
Definition: FB2Style.h:55
libebook::EBOOKHTMLToken::value
Definition: EBOOKHTMLToken.h:263
libebook::FB2ExtrasCollector::openBlock
virtual void openBlock()
Definition: FB2ExtrasCollector.cpp:193
libebook::FB2ExtrasCollector::insertFootnote
virtual void insertFootnote(const char *id)
Definition: FB2ExtrasCollector.cpp:284
libebook::FB2ExtrasCollector::defineMetadataEntry
virtual void defineMetadataEntry(const char *name, const char *value)
Definition: FB2ExtrasCollector.cpp:165
libebook::FB2ExtrasCollector::closeTable
virtual void closeTable()
Definition: FB2ExtrasCollector.cpp:251
libebook::EBOOKHTMLToken::colspan
Definition: EBOOKHTMLToken.h:185
libebook::FB2ExtrasCollector::insertBitmapData
virtual void insertBitmapData(const char *contentType, const char *base64Data)
Definition: FB2ExtrasCollector.cpp:292
libebook::FB2ExtrasCollector::m_currentID
std::string m_currentID
Definition: FB2ExtrasCollector.h:76
libebook::FB2ExtrasCollector::m_bitmaps
FB2ContentMap & m_bitmaps
Definition: FB2ExtrasCollector.h:75
libebook::FB2ContentMap
Definition: FB2ContentMap.h:21
libebook::GroupContent
Definition: FB2ExtrasCollector.cpp:26
libebook::FB2ExtrasCollector::m_currentStyle
const FB2Style * m_currentStyle
Definition: FB2ExtrasCollector.h:79
libebook::FB2ExtrasCollector::m_notes
FB2ContentMap & m_notes
Definition: FB2ExtrasCollector.h:74
libebook::FB2ExtrasCollector::closeMetadataEntry
virtual void closeMetadataEntry()
Definition: FB2ExtrasCollector.cpp:173
libebook::FB2ExtrasCollector::openSpan
virtual void openSpan(const FB2Style &style)
Definition: FB2ExtrasCollector.cpp:218
libebook::FB2ExtrasCollector::openTableRow
virtual void openTableRow(const FB2BlockFormat &format)
Definition: FB2ExtrasCollector.cpp:256
name
string name
Definition: CHMStream.cpp:80
libebook::EBOOKOPFToken::format
Definition: EBOOKOPFToken.h:56
libebook::FB2ExtrasCollector::closeBlock
virtual void closeBlock()
Definition: FB2ExtrasCollector.cpp:198
libebook::FB2ExtrasCollector::closeParagraph
virtual void closeParagraph()
Definition: FB2ExtrasCollector.cpp:209
libebook::FB2ExtrasCollector::insertText
virtual void insertText(const char *text)
Definition: FB2ExtrasCollector.cpp:236
libebook::FB2ExtrasCollector::openMetadataEntry
virtual void openMetadataEntry(const char *name)
Definition: FB2ExtrasCollector.cpp:169
libebook::FB2ExtrasCollector::FB2ExtrasCollector
FB2ExtrasCollector(const FB2ExtrasCollector &other)
libebook::FB2ExtrasCollector::openPageSpan
virtual void openPageSpan()
Definition: FB2ExtrasCollector.cpp:185
libebook
Definition: CHMParser.cpp:20
libebook::FB2ExtrasCollector::openTableCell
virtual void openTableCell(int rowspan, int colspan)
Definition: FB2ExtrasCollector.cpp:267
libebook::FB2ExtrasCollector::insertBitmap
virtual void insertBitmap(const char *id)
Definition: FB2ExtrasCollector.cpp:288
libebook::FB2BlockFormat
Definition: FB2Style.h:35
libebook::FB2ExtrasCollector::m_currentNote
GroupContent * m_currentNote
Definition: FB2ExtrasCollector.h:77
libebook::FB2ExtrasCollector::~FB2ExtrasCollector
virtual ~FB2ExtrasCollector()
Definition: FB2ExtrasCollector.cpp:160
libebook::FB2ExtrasCollector::m_currentPara
GroupContent * m_currentPara
Definition: FB2ExtrasCollector.h:78
libebook::FB2ExtrasCollector::defineID
virtual void defineID(const char *)
Definition: FB2ExtrasCollector.cpp:177
libebook::FB2ExtrasCollector
Definition: FB2ExtrasCollector.h:24
libebook::FB2ExtrasCollector::operator=
FB2ExtrasCollector & operator=(const FB2ExtrasCollector &other)
libebook::FB2ExtrasCollector::insertCoveredTableCell
virtual void insertCoveredTableCell()
Definition: FB2ExtrasCollector.cpp:279
libebook::FB2ExtrasCollector::closeTableRow
virtual void closeTableRow()
Definition: FB2ExtrasCollector.cpp:262