EPUBSplitGuard.h Source File documentation

EPUBSplitGuard.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_EPUBSPLITGUARD_H
11 #define INCLUDED_EPUBSPLITGUARD_H
12
13 #include <libepubgen/libepubgen-decls.h>
14
15 namespace libepubgen
16 {
17
18 class EPUBSplitGuard
19 {
20 public:
21 explicit EPUBSplitGuard(EPUBSplitMethod method,bool splitOnSecondPageSpan);
22
23 void setSplitHeadingLevel(unsigned level);
24 void setCurrentHeadingLevel(unsigned level);
25 void setSplitSize(unsigned size);
26 void setHtmlEverInPageSpan(bool value);
28 void setSplitMethod(EPUBSplitMethod method);
29 void setSplitOnSecondPageSpan(bool value);
30
31 void openLevel();
32 void closeLevel();
33 void incrementSize(unsigned size);
34
35 bool splitOnPageBreak() const;
36 bool splitOnHeading(unsigned level) const;
37 bool splitOnSecondPageSpan() const;
38 bool inHeading(bool any) const;
39 bool splitOnSize() const;
40
41 void onSplit();
42
43 private:
44 bool canSplit(EPUBSplitMethod method) const;
45
46 private:
47 EPUBSplitMethod m_method;
48 bool m_splitOnSecondPageSpan;
49 bool m_htmlEverInPageSpan;
50 unsigned m_headingLevel;
51 unsigned m_currentHeadingLevel;
52 unsigned m_size;
53 unsigned m_currentSize;
54 unsigned m_nestingLevel;
55 };
56
57 }
58
59 #endif // INCLUDED_EPUBSPLITGUARD
60
61 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libepubgen::EPUBSplitGuard::canSplit
bool canSplit(EPUBSplitMethod method) const
Definition: EPUBSplitGuard.cpp:111
libepubgen::EPUBSplitGuard::onSplit
void onSplit()
Definition: EPUBSplitGuard.cpp:106
libepubgen::EPUBSplitGuard::setSplitHeadingLevel
void setSplitHeadingLevel(unsigned level)
Definition: EPUBSplitGuard.cpp:35
libepubgen::EPUBSplitGuard::m_size
unsigned m_size
Definition: EPUBSplitGuard.h:52
libepubgen::EPUBSplitGuard::m_currentSize
unsigned m_currentSize
Definition: EPUBSplitGuard.h:53
libepubgen
Definition: EPUBBinaryContent.cpp:14
libepubgen::EPUBSplitGuard::openLevel
void openLevel()
Definition: EPUBSplitGuard.cpp:60
libepubgen::EPUBSplitGuard::setSplitMethod
void setSplitMethod(EPUBSplitMethod method)
Allows overwriting the value given in the constructor.
Definition: EPUBSplitGuard.cpp:50
libepubgen::EPUBSplitGuard::m_splitOnSecondPageSpan
bool m_splitOnSecondPageSpan
Definition: EPUBSplitGuard.h:48
libepubgen::EPUBSplitGuard::m_nestingLevel
unsigned m_nestingLevel
Definition: EPUBSplitGuard.h:54
libepubgen::EPUBSplitGuard::splitOnSecondPageSpan
bool splitOnSecondPageSpan() const
Definition: EPUBSplitGuard.cpp:85
libepubgen::EPUBSplitGuard::m_headingLevel
unsigned m_headingLevel
Definition: EPUBSplitGuard.h:50
libepubgen::EPUBSplitGuard::setHtmlEverInPageSpan
void setHtmlEverInPageSpan(bool value)
Definition: EPUBSplitGuard.cpp:30
libepubgen::EPUBSplitGuard::m_currentHeadingLevel
unsigned m_currentHeadingLevel
Definition: EPUBSplitGuard.h:51
libepubgen::EPUBSplitGuard::incrementSize
void incrementSize(unsigned size)
Definition: EPUBSplitGuard.cpp:70
libepubgen::EPUBSplitGuard::m_method
EPUBSplitMethod m_method
Definition: EPUBSplitGuard.h:47
libepubgen::EPUBSplitGuard
Definition: EPUBSplitGuard.h:18
libepubgen::EPUBSplitGuard::splitOnSize
bool splitOnSize() const
Definition: EPUBSplitGuard.cpp:101
libepubgen::EPUBSplitGuard::closeLevel
void closeLevel()
Definition: EPUBSplitGuard.cpp:65
libepubgen::EPUBSplitGuard::splitOnPageBreak
bool splitOnPageBreak() const
Definition: EPUBSplitGuard.cpp:75
libepubgen::EPUBSplitGuard::setSplitSize
void setSplitSize(unsigned size)
Definition: EPUBSplitGuard.cpp:45
libepubgen::EPUBSplitGuard::EPUBSplitGuard
EPUBSplitGuard(EPUBSplitMethod method, bool splitOnSecondPageSpan)
Definition: EPUBSplitGuard.cpp:18
libepubgen::EPUBSplitGuard::inHeading
bool inHeading(bool any) const
Definition: EPUBSplitGuard.cpp:90
libepubgen::EPUBSplitGuard::setCurrentHeadingLevel
void setCurrentHeadingLevel(unsigned level)
Definition: EPUBSplitGuard.cpp:40
libepubgen::EPUBSplitGuard::setSplitOnSecondPageSpan
void setSplitOnSecondPageSpan(bool value)
Definition: EPUBSplitGuard.cpp:55
libepubgen::EPUBSplitGuard::m_htmlEverInPageSpan
bool m_htmlEverInPageSpan
Definition: EPUBSplitGuard.h:49
libepubgen::EPUBSplitGuard::splitOnHeading
bool splitOnHeading(unsigned level) const
Definition: EPUBSplitGuard.cpp:80