FictionBook2Style.h Source File documentation

FictionBook2Style.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 FICTIONBOOK2STYLE_H_INCLUDED
11 #define FICTIONBOOK2STYLE_H_INCLUDED
12
13 #include <string>
14
15 #include "libebook_utils.h"
16
17
18 namespace libebook
19 {
20
21 struct FictionBook2TextFormat
22 {
23 FictionBook2TextFormat();
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 FictionBook2BlockFormat
36 {
37 FictionBook2BlockFormat();
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 FictionBook2Style
56 {
57 public:
58 explicit FictionBook2Style(const FictionBook2BlockFormat &blockFormat);
59
60 FictionBook2TextFormat &getTextFormat();
61 const FictionBook2TextFormat &getTextFormat() const;
62 const FictionBook2BlockFormat &getBlockFormat() const;
63
64 private:
65 FictionBook2TextFormat m_textFormat;
66 const FictionBook2BlockFormat m_blockFormat;
67 };
68
69 librevenge::RVNGPropertyList makePropertyList(const FictionBook2Style &style);
70 librevenge::RVNGPropertyList makePropertyList(const FictionBook2TextFormat &format, const FictionBook2BlockFormat &blockFormat);
71 librevenge::RVNGPropertyList makePropertyList(const FictionBook2BlockFormat &format);
72
73 }
74
75 #endif // FICTIONBOOK2STYLE_H_INCLUDED
76
77 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libebook::FictionBook2TextFormat
Definition: FictionBook2Style.h:22
libebook::FictionBook2Style::m_blockFormat
const FictionBook2BlockFormat m_blockFormat
Definition: FictionBook2Style.h:66
libebook::FictionBook2Token::annotation
@ annotation
Definition: FictionBook2Token.h:36
libebook::FictionBook2BlockFormat::poem
uint8_t poem
Definition: FictionBook2Style.h:44
libebook::FictionBook2TextFormat::FictionBook2TextFormat
FictionBook2TextFormat()
Definition: FictionBook2Style.cpp:17
libebook::FictionBook2Token::epigraph
@ epigraph
Definition: FictionBook2Token.h:53
libebook::EBOOKHTMLToken::title
@ title
Definition: EBOOKHTMLToken.h:146
libebook::FictionBook2Token::v
@ v
Definition: FictionBook2Token.h:97
libebook::FictionBook2BlockFormat::epigraph
uint8_t epigraph
Definition: FictionBook2Style.h:41
libebook::FictionBook2Token::subtitle
@ subtitle
Definition: FictionBook2Token.h:87
libebook::FictionBook2BlockFormat::textAuthor
bool textAuthor
Definition: FictionBook2Style.h:48
libebook::FictionBook2Token::poem
@ poem
Definition: FictionBook2Token.h:71
libebook::FictionBook2BlockFormat::annotation
uint8_t annotation
Definition: FictionBook2Style.h:39
libebook
Definition: BBeBCollector.cpp:19
libebook::EBOOKHTMLToken::sub
@ sub
Definition: EBOOKHTMLToken.h:136
libebook_utils.h
libebook::FictionBook2Token::stanza
@ stanza
Definition: FictionBook2Token.h:81
libebook::FictionBook2TextFormat::lang
std::string lang
Definition: FictionBook2Style.h:32
libebook::EBOOKHTMLToken::strong
@ strong
Definition: EBOOKHTMLToken.h:134
libebook::makePropertyList
librevenge::RVNGPropertyList makePropertyList(const FictionBook2Style &style)
Definition: FictionBook2Style.cpp:68
libebook::FictionBook2Style::getBlockFormat
const FictionBook2BlockFormat & getBlockFormat() const
Definition: FictionBook2Style.cpp:63
libebook::EBOOKOPFToken::format
@ format
Definition: EBOOKOPFToken.h:54
libebook::EBOOKHTMLToken::a
@ a
Definition: EBOOKHTMLToken.h:32
libebook::FictionBook2BlockFormat::cite
uint8_t cite
Definition: FictionBook2Style.h:40
libebook::FictionBook2BlockFormat::FictionBook2BlockFormat
FictionBook2BlockFormat()
Definition: FictionBook2Style.cpp:29
libebook::EBOOKHTMLToken::sup
@ sup
Definition: EBOOKHTMLToken.h:137
libebook::FictionBook2BlockFormat::headerRow
bool headerRow
Definition: FictionBook2Style.h:42
libebook::FictionBook2TextFormat::a
uint8_t a
Definition: FictionBook2Style.h:25
libebook::FictionBook2BlockFormat::table
bool table
Definition: FictionBook2Style.h:47
libebook::FictionBook2Style::m_textFormat
FictionBook2TextFormat m_textFormat
Definition: FictionBook2Style.h:65
libebook::FictionBook2TextFormat::strong
uint8_t strong
Definition: FictionBook2Style.h:29
libebook::FictionBook2Style::getTextFormat
FictionBook2TextFormat & getTextFormat()
Definition: FictionBook2Style.cpp:53
libebook::FictionBook2BlockFormat::headingLevel
uint8_t headingLevel
Definition: FictionBook2Style.h:51
libebook::FictionBook2BlockFormat::subtitle
bool subtitle
Definition: FictionBook2Style.h:46
libebook::FictionBook2Token::emphasis
@ emphasis
Definition: FictionBook2Token.h:51
libebook::EBOOKHTMLToken::p
@ p
Definition: EBOOKHTMLToken.h:116
libebook::FictionBook2TextFormat::emphasis
uint8_t emphasis
Definition: FictionBook2Style.h:27
libebook::FictionBook2BlockFormat::stanza
bool stanza
Definition: FictionBook2Style.h:45
libebook::EBOOKHTMLToken::code
@ code
Definition: EBOOKHTMLToken.h:54
libebook::FictionBook2TextFormat::strikethrough
uint8_t strikethrough
Definition: FictionBook2Style.h:28
libebook::FictionBook2TextFormat::code
uint8_t code
Definition: FictionBook2Style.h:26
libebook::EBOOKHTMLToken::table
@ table
Definition: EBOOKHTMLToken.h:138
libebook::FictionBook2BlockFormat::lang
std::string lang
Definition: FictionBook2Style.h:52
libebook::EBOOKHTMLToken::lang
@ lang
Definition: EBOOKHTMLToken.h:205
libebook::FictionBook2Style
Definition: FictionBook2Style.h:56
libebook::FictionBook2TextFormat::sup
uint8_t sup
Definition: FictionBook2Style.h:31
libebook::FictionBook2BlockFormat::p
bool p
Definition: FictionBook2Style.h:43
strikethrough
bool strikethrough
Definition: PluckerParser.cpp:814
libebook::FictionBook2BlockFormat::v
bool v
Definition: FictionBook2Style.h:50
libebook::EBOOKHTMLToken::cite
@ cite
Definition: EBOOKHTMLToken.h:53
libebook::FictionBook2BlockFormat
Definition: FictionBook2Style.h:36
libebook::FictionBook2BlockFormat::title
bool title
Definition: FictionBook2Style.h:49
libebook::FictionBook2Style::FictionBook2Style
FictionBook2Style(const FictionBook2BlockFormat &blockFormat)
Definition: FictionBook2Style.cpp:47
style
optional< Style > style
Definition: TealDocParser.cpp:105
libebook::FictionBook2TextFormat::sub
uint8_t sub
Definition: FictionBook2Style.h:30
FictionBook2Style.h