EPUBSplitGuard.h Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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.h>
14
15 namespace libepubgen
16 {
17
18 class EPUBSplitGuard
19 {
20 public:
21 explicit EPUBSplitGuard(EPUBSplitMethod method);
22
23 void setSplitHeadingLevel(unsigned level);
24 void setSplitSize(unsigned size);
25
26 void openLevel();
27 void closeLevel();
28 void incrementSize(unsigned size);
29
30 bool splitOnPageBreak() const;
31 bool splitOnHeading(unsigned level) const;
32 bool splitOnSize() const;
33
34 void onSplit();
35
36 private:
37 bool canSplit(EPUBSplitMethod method) const;
38
39 private:
40 const EPUBSplitMethod m_method;
41 unsigned m_headingLevel;
42 unsigned m_size;
43 unsigned m_currentSize;
44 unsigned m_nestingLevel;
45 };
46
47 }
48
49 #endif // INCLUDED_EPUBSPLITGUARD
50
51 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libepubgen::EPUBSplitGuard::onSplit
void onSplit()
Definition: EPUBSplitGuard.cpp:67
libepubgen::EPUBSplitGuard::splitOnPageBreak
bool splitOnPageBreak() const
Definition: EPUBSplitGuard.cpp:52
libepubgen::EPUBSplitGuard::setSplitHeadingLevel
void setSplitHeadingLevel(unsigned level)
Definition: EPUBSplitGuard.cpp:27
libepubgen::EPUBSplitGuard::m_size
unsigned m_size
Definition: EPUBSplitGuard.h:42
libepubgen::EPUBSplitGuard::m_currentSize
unsigned m_currentSize
Definition: EPUBSplitGuard.h:43
libepubgen
Definition: EPUBBinarySink.cpp:12
libepubgen::EPUBSplitGuard::openLevel
void openLevel()
Definition: EPUBSplitGuard.cpp:37
libepubgen::EPUBSplitGuard::canSplit
bool canSplit(EPUBSplitMethod method) const
Definition: EPUBSplitGuard.cpp:72
libepubgen::EPUBSplitGuard::m_nestingLevel
unsigned m_nestingLevel
Definition: EPUBSplitGuard.h:44
libepubgen::EPUBSplitGuard::m_headingLevel
unsigned m_headingLevel
Definition: EPUBSplitGuard.h:41
libepubgen::EPUBSplitGuard::EPUBSplitGuard
EPUBSplitGuard(EPUBSplitMethod method)
Definition: EPUBSplitGuard.cpp:18
libepubgen::EPUBSplitGuard::incrementSize
void incrementSize(unsigned size)
Definition: EPUBSplitGuard.cpp:47
libepubgen::EPUBSplitGuard
Definition: EPUBSplitGuard.h:18
libepubgen::EPUBSplitGuard::closeLevel
void closeLevel()
Definition: EPUBSplitGuard.cpp:42
libepubgen::EPUBSplitGuard::m_method
const EPUBSplitMethod m_method
Definition: EPUBSplitGuard.h:40
libepubgen::EPUBSplitGuard::setSplitSize
void setSplitSize(unsigned size)
Definition: EPUBSplitGuard.cpp:32
libepubgen::EPUBSplitGuard::splitOnSize
bool splitOnSize() const
Definition: EPUBSplitGuard.cpp:62
libepubgen::EPUBSplitGuard::splitOnHeading
bool splitOnHeading(unsigned level) const
Definition: EPUBSplitGuard.cpp:57