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