- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

IWORKStyleContext.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 IWORKSTYLECONTEXT_H_INCLUDED
11 #define IWORKSTYLECONTEXT_H_INCLUDED
12
13 #include <string>
14
15 #include <boost/optional.hpp>
16
17 #include "IWORKPropertyMap.h"
18 #include "IWORKStyle_fwd.h"
19 #include "IWORKXMLContextBase.h"
20
21 namespace libetonyek
22 {
23
24 class IWORKStyleContext : public IWORKXMLElementContextBase
25 {
26 public:
27 IWORKStyleContext(IWORKXMLParserState &state, IWORKStyleMap_t *styleMap = 0, bool nested = false);
28 IWORKStyleContext(IWORKXMLParserState &state, IWORKPropertyMap &props, IWORKStyleMap_t *styleMap = 0, bool nested = false);
29 IWORKStyleContext(IWORKXMLParserState &state, IWORKPropertyMap &props, IWORKStyleMap_t *styleMap = 0, const char *defaultParent = 0, bool nested = false);
30
31 virtual void attribute(int name, const char *value);
32 virtual void endOfElement();
33
34 private:
35 virtual IWORKXMLContextPtr_t element(int name);
36
37 private:
38 IWORKStyleMap_t *const m_styleMap;
39 const std::string m_defaultParent;
40 const bool m_nested;
41 IWORKPropertyMap m_ownProps;
42 IWORKPropertyMap &m_props;
43 boost::optional<std::string> m_ident;
44 boost::optional<std::string> m_parentIdent;
45 };
46
47 }
48
49 #endif // IWORKSTYLECONTEXT_H_INCLUDED
50
51 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
IWORKStyle_fwd.h
libetonyek
Definition: IWORKBezierElement.cpp:18
IWORKXMLContextBase.h
libetonyek::IWORKStyleContext::attribute
virtual void attribute(int name, const char *value)
Definition: IWORKStyleContext.cpp:52
libetonyek::IWORKStyleContext
Definition: IWORKStyleContext.h:24
libetonyek::IWORKPropertyMap
Represents a (hierarchical) property map.
Definition: IWORKPropertyMap.h:23
libetonyek::IWORKStyleContext::m_defaultParent
const std::string m_defaultParent
Definition: IWORKStyleContext.h:39
libetonyek::IWORKStyleContext::m_props
IWORKPropertyMap & m_props
Definition: IWORKStyleContext.h:42
libetonyek::IWORKStyleContext::element
virtual IWORKXMLContextPtr_t element(int name)
Definition: IWORKStyleContext.cpp:68
libetonyek::IWORKStyleContext::IWORKStyleContext
IWORKStyleContext(IWORKXMLParserState &state, IWORKStyleMap_t *styleMap=0, bool nested=false)
Definition: IWORKStyleContext.cpp:22
libetonyek::IWORKXMLContextPtr_t
boost::shared_ptr< IWORKXMLContext > IWORKXMLContextPtr_t
Definition: IWORKXMLContext.h:18
libetonyek::IWORKStyleContext::m_styleMap
IWORKStyleMap_t *const m_styleMap
Definition: IWORKStyleContext.h:38
libetonyek::IWORKStyleContext::m_ident
boost::optional< std::string > m_ident
Definition: IWORKStyleContext.h:43
name
const char * name
Definition: IWORKToken.cpp:43
libetonyek::IWORKStyleContext::m_nested
const bool m_nested
Definition: IWORKStyleContext.h:40
IWORKPropertyMap.h
libetonyek::IWORKStyleContext::endOfElement
virtual void endOfElement()
Definition: IWORKStyleContext.cpp:79
libetonyek::IWORKXMLContextBase
Definition: IWORKXMLContextBase.h:27
libetonyek::IWORKXMLParserState
Definition: IWORKXMLParserState.h:30
libetonyek::IWORKStyleContext::m_parentIdent
boost::optional< std::string > m_parentIdent
Definition: IWORKStyleContext.h:44
libetonyek::IWORKStyleContext::m_ownProps
IWORKPropertyMap m_ownProps
Definition: IWORKStyleContext.h:41
libetonyek::IWORKToken::string
Definition: IWORKToken.h:252
libetonyek::IWORKStyleMap_t
boost::unordered_map< ID_t, IWORKStylePtr_t > IWORKStyleMap_t
Definition: IWORKStyle_fwd.h:24