FB2Style.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 libe-book 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 FB2STYLE_H_INCLUDED
11 #define FB2STYLE_H_INCLUDED
12
13 #include <string>
14
15 #include "libebook_utils.h"
16
17
18 namespace libebook
19 {
20
21 struct FB2TextFormat
22 {
23 FB2TextFormat();
24
25 uint8_t a;
26 uint8_t code;
27 uint8_t emphasis;
28 uint8_t strikethrough;
29 uint8_t strong;
30 uint8_t sub;
31 uint8_t sup;
32 std::string lang;
33 };
34
35 struct FB2BlockFormat
36 {
37 FB2BlockFormat();
38
39 uint8_t annotation;
40 uint8_t cite;
41 uint8_t epigraph;
42 bool headerRow;
43 bool p;
44 uint8_t poem;
45 bool stanza;
46 bool subtitle;
47 bool table;
48 bool textAuthor;
49 bool title;
50 bool v;
51 uint8_t headingLevel;
52 std::string lang;
53 };
54
55 class FB2Style
56 {
57 public:
58 explicit FB2Style(const FB2BlockFormat &blockFormat);
59
60 FB2TextFormat &getTextFormat();
61 const FB2TextFormat &getTextFormat() const;
62 const FB2BlockFormat &getBlockFormat() const;
63
64 private:
65 FB2TextFormat m_textFormat;
66 const FB2BlockFormat m_blockFormat;
67 };
68
69 librevenge::RVNGPropertyList makePropertyList(const FB2Style &style);
70 librevenge::RVNGPropertyList makePropertyList(const FB2TextFormat &format, const FB2BlockFormat &blockFormat);
71 librevenge::RVNGPropertyList makePropertyList(const FB2BlockFormat &format);
72
73 }
74
75 #endif // FB2STYLE_H_INCLUDED
76
77 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libebook::FB2BlockFormat::headerRow
bool headerRow
Definition: FB2Style.h:42
style
optional< Style > style
Definition: TDParser.cpp:106
libebook::FB2BlockFormat::epigraph
uint8_t epigraph
Definition: FB2Style.h:41
libebook::FB2TextFormat::sub
uint8_t sub
Definition: FB2Style.h:30
libebook::FB2BlockFormat::p
bool p
Definition: FB2Style.h:43
libebook::FB2BlockFormat::cite
uint8_t cite
Definition: FB2Style.h:40
libebook::FB2TextFormat::sup
uint8_t sup
Definition: FB2Style.h:31
libebook::FB2BlockFormat::headingLevel
uint8_t headingLevel
Definition: FB2Style.h:51
libebook::FB2TextFormat::emphasis
uint8_t emphasis
Definition: FB2Style.h:27
libebook::FB2BlockFormat::stanza
bool stanza
Definition: FB2Style.h:45
libebook::FB2Style::m_textFormat
FB2TextFormat m_textFormat
Definition: FB2Style.h:65
libebook::FB2BlockFormat::v
bool v
Definition: FB2Style.h:50
libebook::FB2Style
Definition: FB2Style.h:55
libebook::FB2TextFormat::strong
uint8_t strong
Definition: FB2Style.h:29
libebook_utils.h
libebook::FB2BlockFormat::annotation
uint8_t annotation
Definition: FB2Style.h:39
libebook::FB2BlockFormat::subtitle
bool subtitle
Definition: FB2Style.h:46
libebook::FB2TextFormat::code
uint8_t code
Definition: FB2Style.h:26
libebook::FB2TextFormat::lang
std::string lang
Definition: FB2Style.h:32
libebook::FB2TextFormat
Definition: FB2Style.h:21
libebook::FB2BlockFormat::table
bool table
Definition: FB2Style.h:47
libebook::FB2TextFormat::strikethrough
uint8_t strikethrough
Definition: FB2Style.h:28
libebook::FB2BlockFormat::title
bool title
Definition: FB2Style.h:49
libebook::FB2BlockFormat::poem
uint8_t poem
Definition: FB2Style.h:44
libebook::FB2BlockFormat::lang
std::string lang
Definition: FB2Style.h:52
libebook::FB2TextFormat::a
uint8_t a
Definition: FB2Style.h:25
libebook::EBOOKOPFToken::format
Definition: EBOOKOPFToken.h:56
libebook::FB2Style::m_blockFormat
const FB2BlockFormat m_blockFormat
Definition: FB2Style.h:66
libebook::FB2BlockFormat::textAuthor
bool textAuthor
Definition: FB2Style.h:48
libebook
Definition: CHMParser.cpp:20
libebook::FB2BlockFormat
Definition: FB2Style.h:35
libebook::FB2TextFormat::FB2TextFormat
FB2TextFormat()
Definition: FB2Style.cpp:17
libebook::makePropertyList
librevenge::RVNGPropertyList makePropertyList(const FB2Style &style)
Definition: FB2Style.cpp:68