KEY2StyleContext.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 KEY2STYLECONTEXT_H_INCLUDED
11#define KEY2STYLECONTEXT_H_INCLUDED
12
13#include <string>
14
15#include <boost/optional.hpp>
16
17#include "IWORKPropertyMap.h"
18#include "IWORKStyleContext.h"
19#include "KEY2XMLContextBase.h"
20
21 namespace libetonyek
22{
23
24 class KEY2StyleContext : public KEY2XMLElementContextBase
25{
26 public:
27 KEY2StyleContext(KEY2ParserState &state, IWORKStyleMap_t *styleMap, const char *defaultParent=nullptr, bool nested = false);
28
29 private:
30 void attribute(int name, const char *value) override;
31 IWORKXMLContextPtr_t element(int name) override;
32 void endOfElement() override;
33
34 private:
35 IWORKPropertyMap m_props;
36 IWORKStyleContext m_base;
37 boost::optional<std::string> m_ident;
38 boost::optional<std::string> m_parentIdent;
39};
40
41}
42
43#endif // KEY2STYLECONTEXT_H_INCLUDED
44
45/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
IWORKPropertyMap.h
IWORKStyleContext.h
KEY2XMLContextBase.h
libetonyek::IWORKPropertyMap
Represents a (hierarchical) property map.
Definition IWORKPropertyMap.h:25
libetonyek::IWORKStyleContext
Definition IWORKStyleContext.h:25
libetonyek::KEY2ParserState
Definition KEY2ParserState.h:25
libetonyek::KEY2StyleContext::KEY2StyleContext
KEY2StyleContext(KEY2ParserState &state, IWORKStyleMap_t *styleMap, const char *defaultParent=nullptr, bool nested=false)
Definition KEY2StyleContext.cpp:242
libetonyek::KEY2StyleContext::m_props
IWORKPropertyMap m_props
Definition KEY2StyleContext.h:35
libetonyek::KEY2StyleContext::endOfElement
void endOfElement() override
Definition KEY2StyleContext.cpp:282
libetonyek::KEY2StyleContext::m_ident
boost::optional< std::string > m_ident
Definition KEY2StyleContext.h:37
libetonyek::KEY2StyleContext::m_base
IWORKStyleContext m_base
Definition KEY2StyleContext.h:36
libetonyek::KEY2StyleContext::m_parentIdent
boost::optional< std::string > m_parentIdent
Definition KEY2StyleContext.h:38
libetonyek::KEY2StyleContext::attribute
void attribute(int name, const char *value) override
Definition KEY2StyleContext.cpp:251
libetonyek::IWORKToken::value
@ value
Definition IWORKToken.h:631
libetonyek::IWORKToken::element
@ element
Definition IWORKToken.h:192
libetonyek::IWORKToken::name
@ name
Definition IWORKToken.h:585
libetonyek
Definition IWORKBezierElement.cpp:21
libetonyek::IWORKStyleMap_t
std::unordered_map< ID_t, IWORKStylePtr_t > IWORKStyleMap_t
Definition IWORKStyle_fwd.h:24
libetonyek::IWORKXMLContextPtr_t
std::shared_ptr< IWORKXMLContext > IWORKXMLContextPtr_t
Definition IWORKXMLContext.h:20
libetonyek::KEY2XMLElementContextBase
KEY2XMLContextBase< IWORKXMLContextElement > KEY2XMLElementContextBase
Definition KEY2XMLContextBase.h:39