| 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_EPUBHTMLMANAGER_H |
| 11 |
#define INCLUDED_EPUBHTMLMANAGER_H |
| 12 |
|
| 13 |
#include <memory> |
| 14 |
#include <string> |
| 15 |
#include <vector> |
| 16 |
|
| 17 |
#include <librevenge/librevenge.h> |
| 18 |
|
| 19 |
#include <libepubgen/libepubgen-decls.h> |
| 20 |
|
| 21 |
#include "EPUBCounter.h" |
| 22 |
#include "EPUBPath.h" |
| 23 |
#include "EPUBXMLContent.h" |
| 24 |
|
| 25 |
namespace libepubgen |
| 26 |
{ |
| 27 |
|
| 28 |
class EPUBFontManager; |
| 29 |
class EPUBHTMLGenerator; |
| 30 |
class EPUBImageManager; |
| 31 |
class EPUBListStyleManager; |
| 32 |
class EPUBParagraphStyleManager; |
| 33 |
class EPUBSpanStyleManager; |
| 34 |
class EPUBTableStyleManager; |
| 35 |
class EPUBManifest; |
| 36 |
class EPUBPackage; |
| 37 |
|
| 38 |
class EPUBHTMLManager |
| 39 |
{ |
| 40 |
// disable copying |
| 41 |
EPUBHTMLManager(const EPUBHTMLManager &); |
| 42 |
EPUBHTMLManager &operator=(const EPUBHTMLManager &); |
| 43 |
|
| 44 |
public: |
| 45 |
explicit EPUBHTMLManager(EPUBManifest &manifest); |
| 46 |
|
| 47 |
const std::shared_ptr<EPUBHTMLGenerator> create(EPUBImageManager &imageManager, EPUBFontManager &fontManager, EPUBListStyleManager &listStyleManager, EPUBParagraphStyleManager ¶graphStyleManager, EPUBSpanStyleManager &spanStyleManager, EPUBSpanStyleManager &bodyStyleManager, EPUBTableStyleManager &tableStyleManager, const EPUBPath &stylesheetPath, EPUBStylesMethod stylesMethod, EPUBLayoutMethod layoutMethod, int version); |
| 48 |
|
| 49 |
void writeTo(EPUBPackage &package); |
| 50 |
|
| 51 |
void writeSpineTo(EPUBXMLContent &xml); |
| 52 |
void writeTocTo(EPUBXMLContent &xml, const EPUBPath &tocPath, int version, EPUBLayoutMethod layout); |
| 53 |
|
| 54 |
/// Appends text to the title of the current heading. |
| 55 |
void insertHeadingText(const std::string &text); |
| 56 |
|
| 57 |
/// Registers a chapter name for the current page (fixed layout case). |
| 58 |
void addChapterName(const std::string &text); |
| 59 |
|
| 60 |
/// If the current heading has a title. |
| 61 |
bool hasHeadingText() const; |
| 62 |
|
| 63 |
private: |
| 64 |
EPUBManifest &m_manifest; |
| 65 |
std::vector<EPUBPath> m_paths; |
| 66 |
std::vector<EPUBXMLContent> m_contents; |
| 67 |
std::vector<std::string> m_ids; |
| 68 |
EPUBCounter m_number; |
| 69 |
}; |
| 70 |
|
| 71 |
} |
| 72 |
|
| 73 |
#endif // INCLUDED_EPUBHTMLMANAGER |
| 74 |
|
| 75 |
/* vim:set shiftwidth=2 softtabstop=2 expandtab: */ |