FB2TextContext.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* libe-book
3  * Version: MPL 2.0 / LGPLv2.1+
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  * Alternatively, the contents of this file may be used under the terms
10  * of the GNU Lesser General Public License Version 2.1 or later
11  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
12  * applicable instead of those above.
13  *
14  * For further information visit http://libebook.sourceforge.net
15  */
16 
17 #ifndef FB2TEXTCONTEXT_H_INCLUDED
18 #define FB2TEXTCONTEXT_H_INCLUDED
19 
20 #include <string>
21 
22 #include "FB2ParserContext.h"
23 
24 namespace libebook
25 {
26 
28 {
29 public:
30  FB2ParaContextBase(FB2ParserContext *parentContext, const FB2BlockFormat &format);
31 
32 private:
33  virtual void startOfElement();
34  virtual void endOfElement();
35  virtual void attribute(const EBOOKToken &name, const EBOOKToken *ns, const char *value);
36 };
37 
39 {
40 public:
41  FB2AContext(FB2ParserContext *parentContext, const FB2Style &style);
42 
43 private:
44  virtual void startOfElement();
45  virtual void endOfAttributes();
46  virtual void attribute(const EBOOKToken &name, const EBOOKToken *ns, const char *value);
47  virtual void text(const char *text);
48 
49 private:
50  std::string m_href;
51  bool m_valid;
52  bool m_note;
53 };
54 
56 {
57 public:
59 
60 private:
61  virtual void startOfElement();
62 };
63 
65 {
66 public:
68 
69 private:
70  virtual void startOfElement();
71 };
72 
74 {
75 public:
76  FB2InlineImageContext(FB2ParserContext *parentContext, const FB2Style &style);
77 
78 private:
79  virtual void startOfElement();
80  virtual void endOfElement();
81  virtual void endOfAttributes();
82  virtual void attribute(const EBOOKToken &name, const EBOOKToken *ns, const char *value);
83 
84 private:
85  const FB2Style &m_style;
86  std::string m_href;
87  std::string m_altText;
88  bool m_valid;
89 };
90 
92 {
93 public:
94  FB2PContext(FB2ParserContext *parentContext, const FB2BlockFormat &format);
95 
96 private:
97  static FB2BlockFormat makeBlockFormat(const FB2BlockFormat &format);
98 };
99 
101 {
102 public:
104 
105 private:
106  virtual void startOfElement();
107 };
108 
110 {
111 public:
113 
114 private:
115  virtual void startOfElement();
116 };
117 
119 {
120 public:
122 
123 private:
124  virtual void startOfElement();
125 };
126 
128 {
129 public:
130  FB2SubContext(FB2ParserContext *parentContext, FB2Style &style);
131 
132 private:
133  virtual void startOfElement();
134 };
135 
137 {
138 public:
139  explicit FB2SubtitleContext(FB2ParserContext *parentContext, const FB2BlockFormat &format);
140 
141 private:
142  static FB2BlockFormat makeBlockFormat(const FB2BlockFormat &format);
143 };
144 
146 {
147 public:
148  FB2SupContext(FB2ParserContext *parentContext, FB2Style &style);
149 
150 private:
151  virtual void startOfElement();
152 };
153 
155 {
156 public:
157  explicit FB2TextAuthorContext(FB2ParserContext *parentContext, const FB2BlockFormat &format);
158 
159 private:
160  static FB2BlockFormat makeBlockFormat(const FB2BlockFormat &format);
161 };
162 
164 {
165 public:
166  explicit FB2VContext(FB2ParserContext *parentContext, const FB2BlockFormat &format);
167 
168 private:
169  static FB2BlockFormat makeBlockFormat(const FB2BlockFormat &format);
170 };
171 
172 }
173 
174 #endif // FB2TEXTCONTEXT_H_INCLUDED
175 
176 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
bool m_valid
Definition: FB2TextContext.h:51
FB2CodeContext(FB2ParserContext *parentContext, FB2Style &style)
Definition: FB2TextContext.cpp:116
Definition: FB2TextContext.h:64
std::string m_altText
Definition: FB2TextContext.h:87
FB2SupContext(FB2ParserContext *parentContext, FB2Style &style)
Definition: FB2TextContext.cpp:253
optional< Style > style
Definition: TDParser.cpp:114
Definition: FB2TextContext.h:163
virtual void startOfElement()
Signalize the start of an element.
Definition: FB2TextContext.cpp:145
FB2SubtitleContext(FB2ParserContext *parentContext, const FB2BlockFormat &format)
Definition: FB2TextContext.cpp:241
static FB2BlockFormat makeBlockFormat(const FB2BlockFormat &format)
Definition: FB2TextContext.cpp:280
Base class for leaf data element contexts.
Definition: FB2ParserContext.h:88
FB2StyleContext(FB2ParserContext *parentContext, FB2Style &style)
Definition: FB2TextContext.cpp:221
Definition: FB2TextContext.h:109
bool m_note
Definition: FB2TextContext.h:52
Definition: FB2Style.h:58
virtual void attribute(const EBOOKToken &name, const EBOOKToken *ns, const char *value)
Process an attribute.
Definition: FB2TextContext.cpp:83
virtual void startOfElement()
Signalize the start of an element.
Definition: FB2TextContext.cpp:29
virtual void startOfElement()
Signalize the start of an element.
Definition: FB2TextContext.cpp:131
virtual void endOfElement()
Signalize the end of an element.
Definition: FB2TextContext.cpp:149
FB2VContext(FB2ParserContext *parentContext, const FB2BlockFormat &format)
Definition: FB2TextContext.cpp:275
virtual void startOfElement()
Signalize the start of an element.
Definition: FB2TextContext.cpp:216
bool m_valid
Definition: FB2TextContext.h:88
virtual void text(const char *text)
Process textual content of an element.
Definition: FB2TextContext.cpp:103
std::string m_href
Definition: FB2TextContext.h:86
virtual void endOfAttributes()
Signalize the end of attributes.
Definition: FB2TextContext.cpp:69
virtual void attribute(const EBOOKToken &name, const EBOOKToken *ns, const char *value)
Process an attribute.
Definition: FB2TextContext.cpp:39
static FB2BlockFormat makeBlockFormat(const FB2BlockFormat &format)
Definition: FB2TextContext.cpp:268
Definition: FB2Token.h:125
virtual void endOfElement()
Signalize the end of an element.
Definition: FB2TextContext.cpp:34
Definition: FB2TextContext.h:127
Definition: EBOOKToken.h:23
const FB2Style & m_style
Definition: FB2TextContext.h:85
FB2InlineImageContext(FB2ParserContext *parentContext, const FB2Style &style)
Definition: FB2TextContext.cpp:136
FB2AContext(FB2ParserContext *parentContext, const FB2Style &style)
Definition: FB2TextContext.cpp:57
FB2ParaContextBase(FB2ParserContext *parentContext, const FB2BlockFormat &format)
Definition: FB2TextContext.cpp:24
Definition: FB2TextContext.h:91
Definition: FB2TextContext.h:136
Definition: FB2TextContext.h:27
Definition: FB2TextContext.h:145
static FB2BlockFormat makeBlockFormat(const FB2BlockFormat &format)
Definition: FB2TextContext.cpp:246
FB2EmphasisContext(FB2ParserContext *parentContext, FB2Style &style)
Definition: FB2TextContext.cpp:126
FB2SubContext(FB2ParserContext *parentContext, FB2Style &style)
Definition: FB2TextContext.cpp:231
virtual void attribute(const EBOOKToken &name, const EBOOKToken *ns, const char *value)
Process an attribute.
Definition: FB2TextContext.cpp:169
virtual void endOfAttributes()
Signalize the end of attributes.
Definition: FB2TextContext.cpp:165
virtual void startOfElement()
Signalize the start of an element.
Definition: FB2TextContext.cpp:236
FB2StrikethroughContext(FB2ParserContext *parentContext, FB2Style &style)
Definition: FB2TextContext.cpp:201
Definition: FB2TextContext.h:73
Definition: FB2TextContext.h:154
std::string m_href
Definition: FB2TextContext.h:50
virtual void startOfElement()
Signalize the start of an element.
Definition: FB2TextContext.cpp:121
virtual void startOfElement()
Signalize the start of an element.
Definition: FB2TextContext.cpp:258
FB2StrongContext(FB2ParserContext *parentContext, FB2Style &style)
Definition: FB2TextContext.cpp:211
static FB2BlockFormat makeBlockFormat(const FB2BlockFormat &format)
Definition: FB2TextContext.cpp:194
Definition: FB2ParserContext.h:139
Definition: FB2Style.h:40
Base class for all contexts.
Definition: FB2ParserContext.h:30
Definition: FB2TextContext.h:100
const char * name
Definition: FB2Token.cpp:26
Definition: FB2TextContext.h:55
Definition: FB2TextContext.h:118
FB2TextAuthorContext(FB2ParserContext *parentContext, const FB2BlockFormat &format)
Definition: FB2TextContext.cpp:263
virtual void startOfElement()
Signalize the start of an element.
Definition: FB2TextContext.cpp:65
FB2PContext(FB2ParserContext *parentContext, const FB2BlockFormat &format)
Definition: FB2TextContext.cpp:189
Definition: FB2TextContext.h:38
virtual void startOfElement()
Signalize the start of an element.
Definition: FB2TextContext.cpp:206
virtual void startOfElement()
Signalize the start of an element.
Definition: FB2TextContext.cpp:226

Generated for libe-book by doxygen 1.8.5