KEY1SpanElement.h Source File documentation

KEY1SpanElement.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 libetonyek 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 KEY1SPANELEMENT_H_INCLUDED
11 #define KEY1SPANELEMENT_H_INCLUDED
12
13 #include "KEY1XMLContextBase.h"
14
15 #include "IWORKEnum.h"
16 #include "IWORKStyle.h"
17
18 namespace libetonyek
19 {
20 class IWORKText;
21 class KEY1ParserState;
22
23 class KEY1SpanStyle
24 {
25 public:
26 KEY1SpanStyle(KEY1ParserState &state, IWORKStylePtr_t parentStyle);
27 bool readAttribute(int name, const char *value);
28 IWORKStylePtr_t getStyle();
29
30 private:
31 IWORKStylePtr_t m_style;
32 IWORKStylePtr_t m_parentStyle;
33 IWORKPropertyMap m_propMap;
34 };
35
36 class KEY1SpanElement : public KEY1XMLElementContextBase
37 {
38 public:
39 KEY1SpanElement(KEY1ParserState &state, IWORKStylePtr_t parentStyle, bool &delayedLineBreak);
40
41 static void sendCDATA(const char *value, std::shared_ptr<IWORKText> currentText, IWORKStylePtr_t spanStyle, bool &delayedLineBreak);
42
43 protected:
44 void attribute(int name, const char *value) override;
45 IWORKXMLContextPtr_t element(int name) override;
46 void CDATA(const char *value) override;
47 void text(const char *value) override;
48 void endOfElement() override;
49
50 void ensureClosed();
51 void ensureOpened();
52
53 private:
54 KEY1SpanStyle m_style;
55 bool m_opened;
56 bool &m_delayedLineBreak;
57 };
58
59 }
60
61 #endif // KEY1SPANELEMENT_H_INCLUDED
62
63 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libetonyek::try_double_cast
boost::optional< double > try_double_cast(const char *value)
Definition: libetonyek_xml.cpp:84
m_style
IWORKStylePtr_t m_style
Definition: IWORKPropertyMapElement.cpp:172
libetonyek
Definition: IWORKBezierElement.cpp:20
libetonyek::IWORKToken::none
@ none
Definition: IWORKToken.h:666
libetonyek::KEY1SpanElement::endOfElement
void endOfElement() override
Definition: KEY1SpanElement.cpp:166
KEY1Token.h
m_opened
bool m_opened
Definition: PAG1TextStorageElement.cpp:666
IWORKEnum.h
libetonyek::KEY1Token::font_underline
@ font_underline
Definition: KEY1Token.h:140
libetonyek::KEY1SpanStyle::m_parentStyle
IWORKStylePtr_t m_parentStyle
Definition: KEY1SpanElement.h:32
IWORKProperties.h
libetonyek::IWORKXMLContextPtr_t
std::shared_ptr< IWORKXMLContext > IWORKXMLContextPtr_t
Definition: IWORKXMLContext.h:18
libetonyek::IWORKToken::empty
@ empty
Definition: IWORKToken.h:656
libetonyek::KEY1SpanElement::ensureOpened
void ensureOpened()
Definition: KEY1SpanElement.cpp:171
libetonyek::KEY1Token::id
@ id
Definition: KEY1Token.h:145
libetonyek::KEY1SpanStyle::m_style
IWORKStylePtr_t m_style
Definition: KEY1SpanElement.h:31
ETONYEK_DEBUG_MSG
#define ETONYEK_DEBUG_MSG(M)
Definition: libetonyek_utils.h:54
libetonyek::KEY2Token::i
@ i
Definition: KEY2Token.h:101
m_propMap
IWORKPropertyMap & m_propMap
Definition: IWORKPropertyMapElement.cpp:756
libetonyek::KEY1SpanStyle::KEY1SpanStyle
KEY1SpanStyle(KEY1ParserState &state, IWORKStylePtr_t parentStyle)
Definition: KEY1SpanElement.cpp:26
libetonyek::KEY1SpanElement::m_style
KEY1SpanStyle m_style
Definition: KEY1SpanElement.h:54
libetonyek::KEY1SpanElement::m_opened
bool m_opened
Definition: KEY1SpanElement.h:55
libetonyek::KEY1SpanElement::attribute
void attribute(int name, const char *value) override
Definition: KEY1SpanElement.cpp:126
libetonyek::try_int_cast
boost::optional< int > try_int_cast(const char *value)
Definition: libetonyek_xml.cpp:99
libetonyek::try_bool_cast
boost::optional< bool > try_bool_cast(const char *value)
Definition: libetonyek_xml.cpp:61
KEY1ParserState.h
libetonyek::KEY1Token::font_kerning
@ font_kerning
Definition: KEY1Token.h:135
libetonyek::KEY1SpanStyle
Definition: KEY1SpanElement.h:23
libetonyek::KEY1Token::font_color
@ font_color
Definition: KEY1Token.h:134
libetonyek::IWORKToken::size
@ size
Definition: IWORKToken.h:395
libetonyek::KEY1SpanElement::text
void text(const char *value) override
Definition: KEY1SpanElement.cpp:152
libetonyek::KEY1Token::font_name
@ font_name
Definition: KEY1Token.h:137
libetonyek::KEY1SpanElement
Definition: KEY1SpanElement.h:36
libetonyek::KEY1SpanElement::m_delayedLineBreak
bool & m_delayedLineBreak
Definition: KEY1SpanElement.h:56
libetonyek::KEY1Token::font_superscript
@ font_superscript
Definition: KEY1Token.h:139
libetonyek::KEY1SpanElement::element
IWORKXMLContextPtr_t element(int name) override
Definition: KEY1SpanElement.cpp:140
libetonyek::KEY1XMLContextBase
Definition: KEY1XMLContextBase.h:22
libetonyek::KEY1SpanElement::CDATA
void CDATA(const char *value) override
Definition: KEY1SpanElement.cpp:146
libetonyek::IWORKToken::val
@ val
Definition: IWORKToken.h:623
libetonyek::IWORKPropertyMap::put
void put(const typename IWORKPropertyInfo< Property >::ValueType &value)
Insert a new value for key key.
Definition: IWORKPropertyMap.h:134
KEY1XMLContextBase.h
libetonyek::KEY1ParserState
Definition: KEY1ParserState.h:44
libetonyek::IWORKToken::color
@ color
Definition: IWORKToken.h:151
libetonyek::KEY1SpanElement::sendCDATA
static void sendCDATA(const char *value, std::shared_ptr< IWORKText > currentText, IWORKStylePtr_t spanStyle, bool &delayedLineBreak)
Definition: KEY1SpanElement.cpp:194
KEY1SpanElement.h
libetonyek::IWORKToken::string
@ string
Definition: IWORKToken.h:411
libetonyek::KEY1SpanStyle::readAttribute
bool readAttribute(int name, const char *value)
Definition: KEY1SpanElement.cpp:33
IWORKText.h
libetonyek::KEY1SpanElement::KEY1SpanElement
KEY1SpanElement(KEY1ParserState &state, IWORKStylePtr_t parentStyle, bool &delayedLineBreak)
Definition: KEY1SpanElement.cpp:118
libetonyek::KEY1Token::font_size
@ font_size
Definition: KEY1Token.h:138
KEY1StringConverter.h
libetonyek::IWORKPropertyMap
Represents a (hierarchical) property map.
Definition: IWORKPropertyMap.h:24
libetonyek::IWORKToken::first
@ first
Definition: IWORKToken.h:524
libetonyek::IWORKStylePtr_t
std::shared_ptr< IWORKStyle > IWORKStylePtr_t
Definition: IWORKStyle_fwd.h:21
libetonyek::IWORKToken::end
@ end
Definition: IWORKToken.h:189
libetonyek::get
const ValueT & get(const detail::IWAFieldImpl< TagV, ValueT, Reader > &field)
Definition: IWAField.h:190
libetonyek::KEY1SpanStyle::getStyle
IWORKStylePtr_t getStyle()
Definition: KEY1SpanElement.cpp:111
libetonyek::IWORKXMLParserState::m_currentText
std::shared_ptr< IWORKText > m_currentText
Definition: IWORKXMLParserState.h:55
libetonyek::IWORKToken::name
@ name
Definition: IWORKToken.h:578
libetonyek::IWORKToken::value
@ value
Definition: IWORKToken.h:624
libetonyek::KEY1SpanStyle::m_propMap
IWORKPropertyMap m_propMap
Definition: KEY1SpanElement.h:33
libetonyek::KEY1SpanElement::ensureClosed
void ensureClosed()
Definition: KEY1SpanElement.cpp:181
libetonyek::KEY1Token::font_ligatures
@ font_ligatures
Definition: KEY1Token.h:136
IWORKStyle.h
libetonyek_xml.h
libetonyek::KEY1StringConverter::convert
static boost::optional< T > convert(const char *value)
Definition: KEY1StringConverter.cpp:28
libetonyek::IWORKXMLContextBase< Base, KEY1ParserState, KEYCollector >::getState
KEY1ParserState & getState()
Definition: IWORKXMLContextBase.h:43