EPUBGenerator.h Source File documentation

EPUBGenerator.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_EPUBGENERATOR_H
11 #define INCLUDED_EPUBGENERATOR_H
12
13 #include <memory>
14
15 #include "EPUBFontManager.h"
16 #include "EPUBHTMLManager.h"
17 #include "EPUBImageManager.h"
18 #include "EPUBListStyleManager.h"
19 #include "EPUBManifest.h"
20 #include "EPUBParagraphStyleManager.h"
21 #include "EPUBPath.h"
22 #include "EPUBSpanStyleManager.h"
23 #include "EPUBBodyStyleManager.h"
24 #include "EPUBSplitGuard.h"
25 #include "EPUBTableStyleManager.h"
26
27 namespace libepubgen
28 {
29
30 class EPUBHTMLGenerator;
31 class EPUBPackage;
32
33 class EPUBGenerator
34 {
35 // disable copying
36 EPUBGenerator(const EPUBGenerator &);
37 EPUBGenerator &operator=(const EPUBGenerator &);
38
39 public:
40 EPUBGenerator(EPUBPackage *package, int version);
41 virtual ~EPUBGenerator();
42
43 void startDocument(const librevenge::RVNGPropertyList &props);
44 void endDocument();
45
46 void setDocumentMetaData(const librevenge::RVNGPropertyList &props);
47
48 void startNewHtmlFile();
49
50 const std::shared_ptr<EPUBHTMLGenerator> &getHtml() const;
51
52 EPUBHTMLManager &getHtmlManager();
53
54 const EPUBSplitGuard &getSplitGuard() const;
55 EPUBSplitGuard &getSplitGuard();
56 int getVersion() const;
57
58 void setSplitMethod(EPUBSplitMethod splitMethod);
59
60 void setStylesMethod(EPUBStylesMethod stylesMethod);
61
62 void setLayoutMethod(EPUBLayoutMethod layoutMethod);
63
64 private:
65 virtual void startHtmlFile() = 0;
66 virtual void endHtmlFile() = 0;
67
68 private:
69 void writeContainer();
70 void writeNavigation();
71 void writeStylesheet();
72 void writeRoot();
73
74 private:
75 EPUBPackage *m_package;
76 EPUBManifest m_manifest;
77 EPUBHTMLManager m_htmlManager;
78 EPUBImageManager m_imageManager;
79 EPUBFontManager m_fontManager;
80 EPUBListStyleManager m_listStyleManager;
81 EPUBParagraphStyleManager m_paragraphStyleManager;
82 EPUBSpanStyleManager m_spanStyleManager;
83 EPUBBodyStyleManager m_bodyStyleManager;
84 EPUBTableStyleManager m_tableStyleManager;
85 const EPUBPath m_stylesheetPath;
86
87 librevenge::RVNGPropertyList m_documentProps;
88 librevenge::RVNGPropertyList m_metadata;
89
90 std::shared_ptr<EPUBHTMLGenerator> m_currentHtml;
91
92 EPUBSplitGuard m_splitGuard;
93
94 int m_version;
95 EPUBStylesMethod m_stylesMethod;
96 EPUBLayoutMethod m_layoutMethod;
97 };
98
99 }
100
101 #endif // INCLUDED_EPUBGENERATOR
102
103 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libepubgen::EPUBGenerator::startNewHtmlFile
void startNewHtmlFile()
Definition: EPUBGenerator.cpp:112
libepubgen::EPUBGenerator::operator=
EPUBGenerator & operator=(const EPUBGenerator &)
EPUBListStyleManager.h
libepubgen::EPUBSpanStyleManager
Small class to manage the span style.
Definition: EPUBSpanStyleManager.h:30
libepubgen::EPUBGenerator::getHtml
const std::shared_ptr< EPUBHTMLGenerator > & getHtml() const
Definition: EPUBGenerator.cpp:137
libepubgen::EPUBGenerator::setStylesMethod
void setStylesMethod(EPUBStylesMethod stylesMethod)
Definition: EPUBGenerator.cpp:167
libepubgen::EPUBGenerator::m_metadata
librevenge::RVNGPropertyList m_metadata
Definition: EPUBGenerator.h:88
libepubgen
Definition: EPUBBinaryContent.cpp:14
libepubgen::EPUBGenerator::getSplitGuard
const EPUBSplitGuard & getSplitGuard() const
Definition: EPUBGenerator.cpp:147
libepubgen::EPUBGenerator::m_version
int m_version
Definition: EPUBGenerator.h:94
EPUBFontManager.h
libepubgen::EPUBGenerator::m_listStyleManager
EPUBListStyleManager m_listStyleManager
Definition: EPUBGenerator.h:80
libepubgen::EPUBGenerator::m_fontManager
EPUBFontManager m_fontManager
Definition: EPUBGenerator.h:79
libepubgen::EPUBParagraphStyleManager
Small class to manage the paragraph style.
Definition: EPUBParagraphStyleManager.h:29
EPUBTableStyleManager.h
libepubgen::EPUBListStyleManager
Small class to manage the list style.
Definition: EPUBListStyleManager.h:31
libepubgen::EPUBHTMLManager
Definition: EPUBHTMLManager.h:38
libepubgen::EPUBGenerator::endDocument
void endDocument()
Definition: EPUBGenerator.cpp:72
libepubgen::EPUBGenerator::startHtmlFile
virtual void startHtmlFile()=0
libepubgen::EPUBGenerator::m_documentProps
librevenge::RVNGPropertyList m_documentProps
Definition: EPUBGenerator.h:87
libepubgen::EPUBTableStyleManager
Small class to manage the tables style.
Definition: EPUBTableStyleManager.h:29
libepubgen::EPUBGenerator::m_spanStyleManager
EPUBSpanStyleManager m_spanStyleManager
Definition: EPUBGenerator.h:82
libepubgen::EPUBGenerator::startDocument
void startDocument(const librevenge::RVNGPropertyList &props)
Definition: EPUBGenerator.cpp:60
libepubgen::EPUBGenerator::m_stylesheetPath
const EPUBPath m_stylesheetPath
Definition: EPUBGenerator.h:85
libepubgen::EPUBFontManager
Manages embedded fonts.
Definition: EPUBFontManager.h:32
libepubgen::EPUBGenerator::setSplitMethod
void setSplitMethod(EPUBSplitMethod splitMethod)
Definition: EPUBGenerator.cpp:162
libepubgen::EPUBManifest
Definition: EPUBManifest.h:23
EPUBHTMLManager.h
libepubgen::EPUBSplitGuard
Definition: EPUBSplitGuard.h:18
libepubgen::EPUBGenerator::m_paragraphStyleManager
EPUBParagraphStyleManager m_paragraphStyleManager
Definition: EPUBGenerator.h:81
EPUBPath.h
EPUBManifest.h
libepubgen::EPUBGenerator::getVersion
int getVersion() const
Definition: EPUBGenerator.cpp:157
libepubgen::EPUBGenerator::m_currentHtml
std::shared_ptr< EPUBHTMLGenerator > m_currentHtml
Definition: EPUBGenerator.h:90
libepubgen::EPUBGenerator::m_package
EPUBPackage * m_package
Definition: EPUBGenerator.h:75
libepubgen::EPUBPath
Representation of a path in the package.
Definition: EPUBPath.h:21
EPUBImageManager.h
libepubgen::EPUBGenerator::getHtmlManager
EPUBHTMLManager & getHtmlManager()
Definition: EPUBGenerator.cpp:142
libepubgen::EPUBGenerator::setLayoutMethod
void setLayoutMethod(EPUBLayoutMethod layoutMethod)
Definition: EPUBGenerator.cpp:172
libepubgen::EPUBGenerator::m_manifest
EPUBManifest m_manifest
Definition: EPUBGenerator.h:76
EPUBSpanStyleManager.h
EPUBSplitGuard.h
libepubgen::EPUBGenerator::m_layoutMethod
EPUBLayoutMethod m_layoutMethod
Definition: EPUBGenerator.h:96
libepubgen::EPUBGenerator::endHtmlFile
virtual void endHtmlFile()=0
libepubgen::EPUBGenerator::m_tableStyleManager
EPUBTableStyleManager m_tableStyleManager
Definition: EPUBGenerator.h:84
libepubgen::EPUBGenerator::EPUBGenerator
EPUBGenerator(const EPUBGenerator &)
libepubgen::EPUBGenerator::writeContainer
void writeContainer()
Definition: EPUBGenerator.cpp:182
libepubgen::EPUBGenerator::setDocumentMetaData
void setDocumentMetaData(const librevenge::RVNGPropertyList &props)
Definition: EPUBGenerator.cpp:89
libepubgen::EPUBGenerator::m_htmlManager
EPUBHTMLManager m_htmlManager
Definition: EPUBGenerator.h:77
EPUBParagraphStyleManager.h
EPUBBodyStyleManager.h
libepubgen::EPUBGenerator::writeRoot
void writeRoot()
Definition: EPUBGenerator.cpp:283
libepubgen::EPUBGenerator::m_imageManager
EPUBImageManager m_imageManager
Definition: EPUBGenerator.h:78
libepubgen::EPUBGenerator::m_stylesMethod
EPUBStylesMethod m_stylesMethod
Definition: EPUBGenerator.h:95
libepubgen::EPUBGenerator
Definition: EPUBGenerator.h:33
libepubgen::EPUBBodyStyleManager
EPUBBodyStyleManager manages the body style converted from properties of the page span...
Definition: EPUBBodyStyleManager.h:18
libepubgen::EPUBGenerator::writeStylesheet
void writeStylesheet()
Definition: EPUBGenerator.cpp:268
libepubgen::EPUBGenerator::~EPUBGenerator
virtual ~EPUBGenerator()
Definition: EPUBGenerator.cpp:56
libepubgen::EPUBGenerator::writeNavigation
void writeNavigation()
Definition: EPUBGenerator.cpp:205
libepubgen::EPUBGenerator::m_splitGuard
EPUBSplitGuard m_splitGuard
Definition: EPUBGenerator.h:92
libepubgen::EPUBGenerator::m_bodyStyleManager
EPUBBodyStyleManager m_bodyStyleManager
Definition: EPUBGenerator.h:83
libepubgen::EPUBImageManager
Definition: EPUBImageManager.h:32