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);
92 m_context = std::make_shared<IWORKStyleContext>(getState(), m_styleMap2);
95 if (
name==RefTokenId2)
96 return std::make_shared<IWORKRefContext>(getState(), m_ref2);
103 template<
int TokenId,
int RefTokenId,
int TokenId2,
int RefTokenId2>
108 else if (m_ref2 && m_styleMap2)
109 m_style = getState().getStyleByName(
get(m_ref2).c_str(), *m_styleMap2);
116 #endif // IWORKSTYLECONTAINER_H_INCLUDED
#define ETONYEK_DEBUG_MSG(M)
Definition: libetonyek_utils.h:54
Definition: IWORKBezierElement.cpp:20
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:104
Definition: IWORKToken.h:330
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
const ValueT & get(const detail::IWAFieldImpl< TagV, ValueT, Reader > &field)
Definition: IWAField.h:190
boost::optional< ID_t > m_ref
Definition: IWORKStyleContainer.h:46
IWORKStyleMap_t * m_styleMap2
Definition: IWORKStyleContainer.h:47
Definition: IWORKToken.h:414
std::shared_ptr< IWORKXMLContext > m_context
Definition: IWORKPropertyMapElement.cpp:90
Definition: IWORKToken.h:688
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