EPUBHTMLGenerator.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 libepubgen 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 INCLUDED_EPUBHTMLGENERATOR_H
11 #define INCLUDED_EPUBHTMLGENERATOR_H
12
13 #include <memory>
14
15 #include <librevenge/librevenge.h>
16
17 #include "EPUBXMLSink.h"
18
19 namespace libepubgen
20 {
21
22 struct EPUBHTMLGeneratorImpl;
23 class EPUBImageManager;
24 class EPUBFontManager;
25 class EPUBListStyleManager;
26 class EPUBSpanStyleManager;
27 class EPUBParagraphStyleManager;
28 class EPUBTableStyleManager;
29 class EPUBPath;
30 class EPUBXMLSink;
31
32 class EPUBHTMLGenerator : public librevenge::RVNGTextInterface
33 {
34 public:
35 EPUBHTMLGenerator(EPUBXMLSink &document, EPUBImageManager &imageManager, EPUBFontManager &fontManager, EPUBListStyleManager &listStyleManager, EPUBParagraphStyleManager &paragraphStyleManager, EPUBSpanStyleManager &spanStyleManager, EPUBTableStyleManager &tableStyleManager, const EPUBPath &path, const EPUBPath &stylesheetPath, EPUBStylesMethod stylesMethod, EPUBLayoutMethod layoutMethod, int version);
36 ~EPUBHTMLGenerator() override;
37
38 void setDocumentMetaData(const librevenge::RVNGPropertyList &propList) override;
39
40 void startDocument(const librevenge::RVNGPropertyList &propList) override;
41 void endDocument() override;
42
43 void defineEmbeddedFont(const librevenge::RVNGPropertyList &propList) override;
44
45 void definePageStyle(const librevenge::RVNGPropertyList &) override;
46 void openPageSpan(const librevenge::RVNGPropertyList &propList) override;
47 void closePageSpan() override;
48 void openHeader(const librevenge::RVNGPropertyList &propList) override;
49 void closeHeader() override;
50 void openFooter(const librevenge::RVNGPropertyList &propList) override;
51 void closeFooter() override;
52
53 void defineSectionStyle(const librevenge::RVNGPropertyList &) override;
54 void openSection(const librevenge::RVNGPropertyList &propList) override;
55 void closeSection() override;
56
57 void defineParagraphStyle(const librevenge::RVNGPropertyList &) override;
58 void openParagraph(const librevenge::RVNGPropertyList &propList) override;
59 void closeParagraph() override;
60
61 void defineCharacterStyle(const librevenge::RVNGPropertyList &) override;
62 void openSpan(const librevenge::RVNGPropertyList &propList) override;
63 void closeSpan() override;
64
65 void openLink(const librevenge::RVNGPropertyList &propList) override;
66 void closeLink() override;
67
68 void insertTab() override;
69 void insertText(const librevenge::RVNGString &text) override;
70 void insertSpace() override;
71 void insertLineBreak() override;
72 void insertField(const librevenge::RVNGPropertyList &propList) override;
73
74 void openOrderedListLevel(const librevenge::RVNGPropertyList &propList) override;
75 void openUnorderedListLevel(const librevenge::RVNGPropertyList &propList) override;
76 void closeOrderedListLevel() override;
77 void closeUnorderedListLevel() override;
78 void openListElement(const librevenge::RVNGPropertyList &propList) override;
79 void closeListElement() override;
80
81 void openFootnote(const librevenge::RVNGPropertyList &propList) override;
82 void closeFootnote() override;
83 void openEndnote(const librevenge::RVNGPropertyList &propList) override;
84 void closeEndnote() override;
85 void openComment(const librevenge::RVNGPropertyList &propList) override;
86 void closeComment() override;
87 void openTextBox(const librevenge::RVNGPropertyList &propList) override;
88 void closeTextBox() override;
89
90 void openTable(const librevenge::RVNGPropertyList &propList) override;
91 void openTableRow(const librevenge::RVNGPropertyList &propList) override;
92 void closeTableRow() override;
93 void openTableCell(const librevenge::RVNGPropertyList &propList) override;
94 void closeTableCell() override;
95 void insertCoveredTableCell(const librevenge::RVNGPropertyList &propList) override;
96 void closeTable() override;
97
98 void openFrame(const librevenge::RVNGPropertyList &propList) override;
99 void closeFrame() override;
100
101 void openGroup(const librevenge::RVNGPropertyList &propList) override;
102 void closeGroup() override;
103
104 void defineGraphicStyle(const librevenge::RVNGPropertyList &propList) override;
105 void drawRectangle(const librevenge::RVNGPropertyList &propList) override;
106 void drawEllipse(const librevenge::RVNGPropertyList &propList) override;
107 void drawPolygon(const librevenge::RVNGPropertyList &propList) override;
108 void drawPolyline(const librevenge::RVNGPropertyList &propList) override;
109 void drawPath(const librevenge::RVNGPropertyList &propList) override;
110 void drawConnector(const librevenge::RVNGPropertyList &propList) override;
111
112 void insertBinaryObject(const librevenge::RVNGPropertyList &propList) override;
113 void insertEquation(const librevenge::RVNGPropertyList &propList) override;
114
116 void getPageProperties(librevenge::RVNGPropertyList &propList) const;
118 void setPageProperties(const librevenge::RVNGPropertyList &propList);
119
120 private:
121 EPUBXMLSink &openPopup();
122 void closePopup(EPUBXMLSink &main);
123
124 std::unique_ptr<EPUBHTMLGeneratorImpl> m_impl;
125
126 // Unimplemented to prevent compiler from creating crasher ones
127 EPUBHTMLGenerator(const EPUBHTMLGenerator &);
128 EPUBHTMLGenerator &operator=(const EPUBHTMLGenerator &);
129 };
130
131 typedef std::shared_ptr<EPUBHTMLGenerator> EPUBHTMLGeneratorPtr_t;
132
133 }
134
135 #endif /* EPUBHTMLGENERATOR_H */
136
137 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libepubgen::EPUBHTMLGenerator::defineSectionStyle
void defineSectionStyle(const librevenge::RVNGPropertyList &) override
Definition: EPUBHTMLGenerator.cpp:650
libepubgen::EPUBHTMLGenerator::openHeader
void openHeader(const librevenge::RVNGPropertyList &propList) override
Definition: EPUBHTMLGenerator.cpp:629
libepubgen::EPUBHTMLGenerator::openTableRow
void openTableRow(const librevenge::RVNGPropertyList &propList) override
Definition: EPUBHTMLGenerator.cpp:993
libepubgen::EPUBHTMLGenerator::defineEmbeddedFont
void defineEmbeddedFont(const librevenge::RVNGPropertyList &propList) override
Definition: EPUBHTMLGenerator.cpp:609
libepubgen::EPUBSpanStyleManager
Small class to manage the span style.
Definition: EPUBSpanStyleManager.h:29
EPUBXMLSink.h
libepubgen::EPUBHTMLGenerator::insertBinaryObject
void insertBinaryObject(const librevenge::RVNGPropertyList &propList) override
Definition: EPUBHTMLGenerator.cpp:1104
libepubgen::EPUBHTMLGenerator::openTableCell
void openTableCell(const librevenge::RVNGPropertyList &propList) override
Definition: EPUBHTMLGenerator.cpp:1017
libepubgen::EPUBHTMLGenerator::openPopup
EPUBXMLSink & openPopup()
Definition: EPUBHTMLGenerator.cpp:1144
libepubgen::EPUBHTMLGenerator::openFooter
void openFooter(const librevenge::RVNGPropertyList &propList) override
Definition: EPUBHTMLGenerator.cpp:640
libepubgen::EPUBHTMLGenerator::openSection
void openSection(const librevenge::RVNGPropertyList &propList) override
Definition: EPUBHTMLGenerator.cpp:652
libepubgen::EPUBHTMLGenerator::insertEquation
void insertEquation(const librevenge::RVNGPropertyList &propList) override
Definition: EPUBHTMLGenerator.cpp:1174
libepubgen::EPUBHTMLGenerator::closeListElement
void closeListElement() override
Definition: EPUBHTMLGenerator.cpp:868
libepubgen
Definition: EPUBBinarySink.cpp:12
libepubgen::EPUBHTMLGenerator::defineParagraphStyle
void defineParagraphStyle(const librevenge::RVNGPropertyList &) override
Definition: EPUBHTMLGenerator.cpp:664
libepubgen::EPUBHTMLGenerator::closeTextBox
void closeTextBox() override
Definition: EPUBHTMLGenerator.cpp:953
libepubgen::EPUBHTMLGenerator::m_impl
std::unique_ptr< EPUBHTMLGeneratorImpl > m_impl
Definition: EPUBHTMLGenerator.h:124
libepubgen::EPUBHTMLGenerator::openComment
void openComment(const librevenge::RVNGPropertyList &propList) override
Definition: EPUBHTMLGenerator.cpp:913
libepubgen::EPUBHTMLGenerator::openGroup
void openGroup(const librevenge::RVNGPropertyList &propList) override
Definition: EPUBHTMLGenerator.cpp:1093
libepubgen::EPUBHTMLGenerator::drawPath
void drawPath(const librevenge::RVNGPropertyList &propList) override
Definition: EPUBHTMLGenerator.cpp:1101
libepubgen::EPUBHTMLGenerator::defineGraphicStyle
void defineGraphicStyle(const librevenge::RVNGPropertyList &propList) override
Definition: EPUBHTMLGenerator.cpp:1096
libepubgen::EPUBHTMLGenerator::openFootnote
void openFootnote(const librevenge::RVNGPropertyList &propList) override
Definition: EPUBHTMLGenerator.cpp:875
libepubgen::EPUBParagraphStyleManager
Small class to manage the paragraph style.
Definition: EPUBParagraphStyleManager.h:29
libepubgen::EPUBHTMLGenerator::startDocument
void startDocument(const librevenge::RVNGPropertyList &propList) override
Definition: EPUBHTMLGenerator.cpp:552
libepubgen::EPUBListStyleManager
Small class to manage the list style.
Definition: EPUBListStyleManager.h:31
libepubgen::EPUBHTMLGenerator::setDocumentMetaData
void setDocumentMetaData(const librevenge::RVNGPropertyList &propList) override
Definition: EPUBHTMLGenerator.cpp:521
libepubgen::EPUBHTMLGenerator::openEndnote
void openEndnote(const librevenge::RVNGPropertyList &propList) override
Definition: EPUBHTMLGenerator.cpp:897
libepubgen::EPUBHTMLGenerator::openFrame
void openFrame(const librevenge::RVNGPropertyList &propList) override
Definition: EPUBHTMLGenerator.cpp:1057
libepubgen::EPUBHTMLGenerator::closeTableRow
void closeTableRow() override
Definition: EPUBHTMLGenerator.cpp:1010
libepubgen::EPUBTableStyleManager
Small class to manage the tables style.
Definition: EPUBTableStyleManager.h:29
libepubgen::EPUBHTMLGenerator::openSpan
void openSpan(const librevenge::RVNGPropertyList &propList) override
Definition: EPUBHTMLGenerator.cpp:704
libepubgen::EPUBHTMLGenerator::definePageStyle
void definePageStyle(const librevenge::RVNGPropertyList &) override
Definition: EPUBHTMLGenerator.cpp:627
libepubgen::EPUBHTMLGenerator::openUnorderedListLevel
void openUnorderedListLevel(const librevenge::RVNGPropertyList &propList) override
Definition: EPUBHTMLGenerator.cpp:839
libepubgen::EPUBHTMLGenerator::closeEndnote
void closeEndnote() override
Definition: EPUBHTMLGenerator.cpp:906
libepubgen::EPUBHTMLGenerator::endDocument
void endDocument() override
Definition: EPUBHTMLGenerator.cpp:556
libepubgen::EPUBHTMLGenerator::openListElement
void openListElement(const librevenge::RVNGPropertyList &propList) override
Definition: EPUBHTMLGenerator.cpp:859
libepubgen::EPUBHTMLGenerator::drawConnector
void drawConnector(const librevenge::RVNGPropertyList &propList) override
Definition: EPUBHTMLGenerator.cpp:1102
libepubgen::EPUBHTMLGenerator::drawPolygon
void drawPolygon(const librevenge::RVNGPropertyList &propList) override
Definition: EPUBHTMLGenerator.cpp:1099
libepubgen::EPUBHTMLGenerator::drawEllipse
void drawEllipse(const librevenge::RVNGPropertyList &propList) override
Definition: EPUBHTMLGenerator.cpp:1098
libepubgen::EPUBFontManager
Manages embedded fonts.
Definition: EPUBImageManager.h:77
libepubgen::EPUBHTMLGenerator::closeFootnote
void closeFootnote() override
Definition: EPUBHTMLGenerator.cpp:888
libepubgen::EPUBHTMLGenerator::EPUBHTMLGenerator
EPUBHTMLGenerator(EPUBXMLSink &document, EPUBImageManager &imageManager, EPUBFontManager &fontManager, EPUBListStyleManager &listStyleManager, EPUBParagraphStyleManager &paragraphStyleManager, EPUBSpanStyleManager &spanStyleManager, EPUBTableStyleManager &tableStyleManager, const EPUBPath &path, const EPUBPath &stylesheetPath, EPUBStylesMethod stylesMethod, EPUBLayoutMethod layoutMethod, int version)
Definition: EPUBHTMLGenerator.cpp:512
libepubgen::EPUBHTMLGenerator::drawRectangle
void drawRectangle(const librevenge::RVNGPropertyList &propList) override
Definition: EPUBHTMLGenerator.cpp:1097
libepubgen::EPUBHTMLGenerator::defineCharacterStyle
void defineCharacterStyle(const librevenge::RVNGPropertyList &) override
Definition: EPUBHTMLGenerator.cpp:699
libepubgen::EPUBHTMLGeneratorPtr_t
std::shared_ptr< EPUBHTMLGenerator > EPUBHTMLGeneratorPtr_t
Definition: EPUBHTMLGenerator.h:131
libepubgen::EPUBHTMLGenerator::closeSpan
void closeSpan() override
Definition: EPUBHTMLGenerator.cpp:722
libepubgen::EPUBHTMLGenerator::openPageSpan
void openPageSpan(const librevenge::RVNGPropertyList &propList) override
Definition: EPUBHTMLGenerator.cpp:614
libepubgen::EPUBHTMLGenerator::closeComment
void closeComment() override
Definition: EPUBHTMLGenerator.cpp:922
libepubgen::EPUBHTMLGenerator::closePopup
void closePopup(EPUBXMLSink &main)
Definition: EPUBHTMLGenerator.cpp:1157
libepubgen::EPUBPath
Representation of a path in the package.
Definition: EPUBPath.h:21
libepubgen::EPUBHTMLGenerator::openOrderedListLevel
void openOrderedListLevel(const librevenge::RVNGPropertyList &propList) override
Definition: EPUBHTMLGenerator.cpp:820
libepubgen::EPUBHTMLGenerator::setPageProperties
void setPageProperties(const librevenge::RVNGPropertyList &propList)
Sets the actual page properties from propList.
Definition: EPUBHTMLGenerator.cpp:1184
libepubgen::EPUBHTMLGenerator::insertTab
void insertTab() override
Definition: EPUBHTMLGenerator.cpp:774
libepubgen::EPUBHTMLGenerator::closeParagraph
void closeParagraph() override
Definition: EPUBHTMLGenerator.cpp:688
libepubgen::EPUBHTMLGenerator::insertLineBreak
void insertLineBreak() override
Definition: EPUBHTMLGenerator.cpp:787
libepubgen::EPUBHTMLGenerator::closeOrderedListLevel
void closeOrderedListLevel() override
Definition: EPUBHTMLGenerator.cpp:831
libepubgen::EPUBHTMLGenerator::~EPUBHTMLGenerator
~EPUBHTMLGenerator() override
Definition: EPUBHTMLGenerator.cpp:517
libepubgen::EPUBHTMLGenerator::closePageSpan
void closePageSpan() override
Definition: EPUBHTMLGenerator.cpp:623
libepubgen::EPUBHTMLGenerator::insertText
void insertText(const librevenge::RVNGString &text) override
Definition: EPUBHTMLGenerator.cpp:802
libepubgen::EPUBHTMLGenerator::closeLink
void closeLink() override
Definition: EPUBHTMLGenerator.cpp:764
libepubgen::EPUBHTMLGenerator::getPageProperties
void getPageProperties(librevenge::RVNGPropertyList &propList) const
Gets the actual page properties into propList.
Definition: EPUBHTMLGenerator.cpp:1176
libepubgen::EPUBHTMLGenerator::closeFrame
void closeFrame() override
Definition: EPUBHTMLGenerator.cpp:1079
libepubgen::EPUBHTMLGenerator
Definition: EPUBHTMLGenerator.h:32
libepubgen::EPUBHTMLGenerator::openLink
void openLink(const librevenge::RVNGPropertyList &propList) override
Definition: EPUBHTMLGenerator.cpp:729
libepubgen::EPUBHTMLGenerator::closeSection
void closeSection() override
Definition: EPUBHTMLGenerator.cpp:658
libepubgen::EPUBHTMLGenerator::closeUnorderedListLevel
void closeUnorderedListLevel() override
Definition: EPUBHTMLGenerator.cpp:850
libepubgen::EPUBHTMLGenerator::openTextBox
void openTextBox(const librevenge::RVNGPropertyList &propList) override
Definition: EPUBHTMLGenerator.cpp:929
libepubgen::EPUBHTMLGenerator::closeFooter
void closeFooter() override
Definition: EPUBHTMLGenerator.cpp:645
libepubgen::EPUBHTMLGenerator::closeTable
void closeTable() override
Definition: EPUBHTMLGenerator.cpp:1048
libepubgen::EPUBHTMLGenerator::insertSpace
void insertSpace() override
Definition: EPUBHTMLGenerator.cpp:812
libepubgen::EPUBHTMLGenerator::insertField
void insertField(const librevenge::RVNGPropertyList &propList) override
Definition: EPUBHTMLGenerator.cpp:795
libepubgen::EPUBHTMLGenerator::openParagraph
void openParagraph(const librevenge::RVNGPropertyList &propList) override
Definition: EPUBHTMLGenerator.cpp:669
libepubgen::EPUBHTMLGenerator::closeHeader
void closeHeader() override
Definition: EPUBHTMLGenerator.cpp:634
libepubgen::EPUBHTMLGenerator::closeTableCell
void closeTableCell() override
Definition: EPUBHTMLGenerator.cpp:1039
libepubgen::EPUBHTMLGenerator::closeGroup
void closeGroup() override
Definition: EPUBHTMLGenerator.cpp:1094
libepubgen::EPUBHTMLGenerator::drawPolyline
void drawPolyline(const librevenge::RVNGPropertyList &propList) override
Definition: EPUBHTMLGenerator.cpp:1100
libepubgen::EPUBXMLSink
Definition: EPUBXMLSink.h:25
libepubgen::EPUBHTMLGenerator::operator=
EPUBHTMLGenerator & operator=(const EPUBHTMLGenerator &)
libepubgen::EPUBHTMLGenerator::openTable
void openTable(const librevenge::RVNGPropertyList &propList) override
Definition: EPUBHTMLGenerator.cpp:973
libepubgen::EPUBHTMLGenerator::insertCoveredTableCell
void insertCoveredTableCell(const librevenge::RVNGPropertyList &propList) override
Definition: EPUBHTMLGenerator.cpp:1046
libepubgen::EPUBImageManager
Definition: EPUBImageManager.h:30