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: */
IWORKEnum.h
IWORKStyle.h
KEY1XMLContextBase.h
libetonyek::IWORKPropertyMap
Represents a (hierarchical) property map.
Definition IWORKPropertyMap.h:25
libetonyek::IWORKText
Definition IWORKText.h:34
libetonyek::KEY1ParserState
Definition KEY1ParserState.h:45
libetonyek::KEY1SpanElement::m_opened
bool m_opened
Definition KEY1SpanElement.h:55
libetonyek::KEY1SpanElement::m_style
KEY1SpanStyle m_style
Definition KEY1SpanElement.h:54
libetonyek::KEY1SpanElement::m_delayedLineBreak
bool & m_delayedLineBreak
Definition KEY1SpanElement.h:56
libetonyek::KEY1SpanElement::endOfElement
void endOfElement() override
Definition KEY1SpanElement.cpp:166
libetonyek::KEY1SpanElement::KEY1SpanElement
KEY1SpanElement(KEY1ParserState &state, IWORKStylePtr_t parentStyle, bool &delayedLineBreak)
Definition KEY1SpanElement.cpp:118
libetonyek::KEY1SpanElement::attribute
void attribute(int name, const char *value) override
Definition KEY1SpanElement.cpp:126
libetonyek::KEY1SpanElement::ensureOpened
void ensureOpened()
Definition KEY1SpanElement.cpp:171
libetonyek::KEY1SpanElement::CDATA
void CDATA(const char *value) override
Definition KEY1SpanElement.cpp:146
libetonyek::KEY1SpanElement::sendCDATA
static void sendCDATA(const char *value, std::shared_ptr< IWORKText > currentText, IWORKStylePtr_t spanStyle, bool &delayedLineBreak)
Definition KEY1SpanElement.cpp:194
libetonyek::KEY1SpanElement::ensureClosed
void ensureClosed()
Definition KEY1SpanElement.cpp:181
libetonyek::KEY1SpanStyle
Definition KEY1SpanElement.h:24
libetonyek::KEY1SpanStyle::KEY1SpanStyle
KEY1SpanStyle(KEY1ParserState &state, IWORKStylePtr_t parentStyle)
Definition KEY1SpanElement.cpp:26
libetonyek::KEY1SpanStyle::m_style
IWORKStylePtr_t m_style
Definition KEY1SpanElement.h:31
libetonyek::KEY1SpanStyle::m_parentStyle
IWORKStylePtr_t m_parentStyle
Definition KEY1SpanElement.h:32
libetonyek::KEY1SpanStyle::getStyle
IWORKStylePtr_t getStyle()
Definition KEY1SpanElement.cpp:111
libetonyek::KEY1SpanStyle::m_propMap
IWORKPropertyMap m_propMap
Definition KEY1SpanElement.h:33
libetonyek::KEY1SpanStyle::readAttribute
bool readAttribute(int name, const char *value)
Definition KEY1SpanElement.cpp:33
libetonyek::IWORKToken::value
@ value
Definition IWORKToken.h:631
libetonyek::IWORKToken::text
@ text
Definition IWORKToken.h:472
libetonyek::IWORKToken::element
@ element
Definition IWORKToken.h:192
libetonyek::IWORKToken::name
@ name
Definition IWORKToken.h:585
libetonyek
Definition IWORKBezierElement.cpp:21
libetonyek::KEY1XMLElementContextBase
KEY1XMLContextBase< IWORKXMLContextElement > KEY1XMLElementContextBase
Definition KEY1XMLContextBase.h:39
libetonyek::IWORKXMLContextPtr_t
std::shared_ptr< IWORKXMLContext > IWORKXMLContextPtr_t
Definition IWORKXMLContext.h:20
libetonyek::IWORKStylePtr_t
std::shared_ptr< IWORKStyle > IWORKStylePtr_t
Definition IWORKStyle_fwd.h:23