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 
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: */
void onSplit()
Definition: EPUBSplitGuard.cpp:67
bool splitOnPageBreak() const
Definition: EPUBSplitGuard.cpp:52
void setSplitHeadingLevel(unsigned level)
Definition: EPUBSplitGuard.cpp:27
unsigned m_size
Definition: EPUBSplitGuard.h:42
unsigned m_currentSize
Definition: EPUBSplitGuard.h:43
void openLevel()
Definition: EPUBSplitGuard.cpp:37
bool canSplit(EPUBSplitMethod method) const
Definition: EPUBSplitGuard.cpp:72
unsigned m_nestingLevel
Definition: EPUBSplitGuard.h:44
unsigned m_headingLevel
Definition: EPUBSplitGuard.h:41
EPUBSplitGuard(EPUBSplitMethod method)
Definition: EPUBSplitGuard.cpp:18
void incrementSize(unsigned size)
Definition: EPUBSplitGuard.cpp:47
Definition: EPUBSplitGuard.h:18
void closeLevel()
Definition: EPUBSplitGuard.cpp:42
const EPUBSplitMethod m_method
Definition: EPUBSplitGuard.h:40
void setSplitSize(unsigned size)
Definition: EPUBSplitGuard.cpp:32
bool splitOnSize() const
Definition: EPUBSplitGuard.cpp:62
bool splitOnHeading(unsigned level) const
Definition: EPUBSplitGuard.cpp:57

Generated for libepubgen by doxygen 1.8.7