10 #ifndef IWORKSTYLECONTAINER_H_INCLUDED
11 #define IWORKSTYLECONTAINER_H_INCLUDED
16 #include <boost/optional.hpp>
28 template<
int TokenId,
int RefTokenId,
int TokenId2=0,
int RefTokenId2=0>
51 template<
int TokenId,
int RefTokenId,
int TokenId2,
int RefTokenId2>
55 , m_styleMap(styleMap)
58 , m_styleMap2(nullptr)
63 template<
int TokenId,
int RefTokenId,
int TokenId2,
int RefTokenId2>
67 , m_styleMap(styleMap)
70 , m_styleMap2(&styleMap2)
75 template<
int TokenId,
int RefTokenId,
int TokenId2,
int RefTokenId2>
81 m_context = std::make_shared<IWORKStyleContext>(getState(), &m_styleMap);
84 return std::make_shared<IWORKRefContext>(getState(),
m_ref);
93 m_context = std::make_shared<IWORKStyleContext>(getState(), m_styleMap2);
96 if (name==RefTokenId2)
97 return std::make_shared<IWORKRefContext>(getState(), m_ref2);
100 ETONYEK_DEBUG_MSG((
"IWORKStyleContainer<...>::element: unknown element %d\n", name));
104 template<
int TokenId,
int RefTokenId,
int TokenId2,
int RefTokenId2>
108 m_style = getState().getStyleByName(
get(
m_ref).c_str(), m_styleMap);
109 else if (m_ref2 && m_styleMap2)
110 m_style = getState().getStyleByName(
get(m_ref2).c_str(), *m_styleMap2);
117 #endif // IWORKSTYLECONTAINER_H_INCLUDED
#define ETONYEK_DEBUG_MSG(M)
Definition: libetonyek_utils.h:54
std::shared_ptr< IWORKXMLContext > IWORKXMLContextPtr_t
Definition: IWORKXMLContext.h:18
IWORKStyleContainer(IWORKXMLParserState &state, IWORKStylePtr_t &style, IWORKStyleMap_t &styleMap)
Definition: IWORKStyleContainer.h:52
void endOfElement() override
Definition: IWORKStyleContainer.h:105
Definition: IWORKToken.h:335
std::shared_ptr< IWORKStyle > IWORKStylePtr_t
Definition: IWORKStyle_fwd.h:21
boost::optional< ID_t > m_ref
Definition: IWORKPathElement.cpp:285
IWORKStylePtr_t & m_style
Definition: IWORKStyleContainer.h:43
boost::optional< ID_t > m_ref
Definition: IWORKStyleContainer.h:46
IWORKStyleMap_t * m_styleMap2
Definition: IWORKStyleContainer.h:47
Definition: IWORKToken.h:421
std::shared_ptr< IWORKXMLContext > m_context
Definition: IWORKPropertyMapElement.cpp:90
Definition: IWORKToken.h:696
const char * name
Definition: IWORKToken.cpp:43
Definition: IWORKToken.h:27
Definition: IWORKXMLContextBase.h:27
Definition: IWORKXMLParserState.h:31
Definition: IWORKStyleContainer.h:29
IWORKStyleContainer & operator=(IWORKStyleContainer const &)
std::shared_ptr< IWORKStyleContext > m_context
Definition: IWORKStyleContainer.h:45
IWORKXMLContextPtr_t element(int name) override
Definition: IWORKStyleContainer.h:76
boost::optional< ID_t > m_ref2
Definition: IWORKStyleContainer.h:48
IWORKStyleMap_t & m_styleMap
Definition: IWORKStyleContainer.h:44
std::unordered_map< ID_t, IWORKStylePtr_t > IWORKStyleMap_t
Definition: IWORKStyle_fwd.h:24
IWORKStylePtr_t m_style
Definition: IWORKPropertyMapElement.cpp:172