KEY1FillElement.h Source File documentation

KEY1FillElement.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 KEY1FILLELEMENT_H_INCLUDED
11 #define KEY1FILLELEMENT_H_INCLUDED
12
13 #include <string>
14 #include <boost/optional.hpp>
15
16 #include "KEY1XMLContextBase.h"
17
18 #include "IWORKEnum.h"
19 #include "IWORKTypes.h"
20
21 namespace libetonyek
22 {
23 class KEY1FillElement : public KEY1XMLElementContextBase
24 {
25 enum FillType
26 {
27 FILL_TYPE_COLOR,
28 FILL_TYPE_IMAGE,
29 FILL_TYPE_NONE
30 };
31 public:
32 KEY1FillElement(KEY1ParserState &state, boost::optional<IWORKFill> &fill);
33
34 private:
35 void attribute(int name, const char *value) override;
36 IWORKXMLContextPtr_t element(int name) override;
37 void endOfElement() override;
38
39 private:
40 boost::optional<IWORKFill> &m_fill;
41 boost::optional<FillType> m_type;
42 boost::optional<IWORKColor> m_color;
43 boost::optional<std::string> m_imageName;
44 boost::optional<IWORKImageType> m_imageType;
45 };
46 }
47
48 #endif // KEY1FILLELEMENT_H_INCLUDED
49
50 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libetonyek::KEY1FillElement::attribute
void attribute(int name, const char *value) override
Definition: KEY1FillElement.cpp:37
libetonyek
Definition: IWORKBezierElement.cpp:20
KEY1Token.h
libetonyek::KEY1FillElement::element
IWORKXMLContextPtr_t element(int name) override
Definition: KEY1FillElement.cpp:89
IWORKTokenizer.h
libetonyek::KEY1Token::color
@ color
Definition: KEY1Token.h:46
libetonyek::IWORKDictionary::m_fills
IWORKFillMap_t m_fills
Definition: IWORKDictionary.h:69
IWORKEnum.h
libetonyek::KEY1Token::image_scale
@ image_scale
Definition: KEY1Token.h:149
libetonyek::IWORKXMLContextPtr_t
std::shared_ptr< IWORKXMLContext > IWORKXMLContextPtr_t
Definition: IWORKXMLContext.h:18
libetonyek::KEY1FillElement::m_imageType
boost::optional< IWORKImageType > m_imageType
Definition: KEY1FillElement.h:44
KEY1Dictionary.h
KEY1FillElement.h
libetonyek::KEY1Token::fill_color
@ fill_color
Definition: KEY1Token.h:131
libetonyek::KEY1ParserState::getDictionary
KEY1Dictionary & getDictionary()
Definition: KEY1ParserState.cpp:39
libetonyek::KEY1FillElement::endOfElement
void endOfElement() override
Definition: KEY1FillElement.cpp:101
libetonyek::KEY1Token::id
@ id
Definition: KEY1Token.h:145
libetonyek::KEY1Token::scale_to_fit
@ scale_to_fit
Definition: KEY1Token.h:232
ETONYEK_DEBUG_MSG
#define ETONYEK_DEBUG_MSG(M)
Definition: libetonyek_utils.h:54
libetonyek::KEY1FillElement::FILL_TYPE_IMAGE
@ FILL_TYPE_IMAGE
Definition: KEY1FillElement.h:28
libetonyek::KEY1FillElement::m_fill
boost::optional< IWORKFill > & m_fill
Definition: KEY1FillElement.h:40
KEY1ParserState.h
libetonyek::KEY1Token::image
@ image
Definition: KEY1Token.h:61
m_imageName
boost::optional< std::string > m_imageName
Definition: KEY1Parser.cpp:542
libetonyek::KEY1FillElement::FILL_TYPE_NONE
@ FILL_TYPE_NONE
Definition: KEY1FillElement.h:29
m_color
boost::optional< IWORKColor > m_color
Definition: IWORKFillElement.cpp:49
libetonyek::KEY1FillElement::FillType
FillType
Definition: KEY1FillElement.h:25
libetonyek::IWORK_IMAGE_TYPE_SCALE_TO_FIT
@ IWORK_IMAGE_TYPE_SCALE_TO_FIT
Definition: IWORKEnum.h:102
libetonyek::KEY1XMLContextBase
Definition: KEY1XMLContextBase.h:22
libetonyek::KEY1FillElement::m_color
boost::optional< IWORKColor > m_color
Definition: KEY1FillElement.h:42
libetonyek::IWORKToken::image
@ image
Definition: IWORKToken.h:260
libetonyek::KEY1FillElement::KEY1FillElement
KEY1FillElement(KEY1ParserState &state, boost::optional< IWORKFill > &fill)
Definition: KEY1FillElement.cpp:27
KEY1XMLContextBase.h
libetonyek::KEY1ParserState
Definition: KEY1ParserState.h:44
libetonyek::IWORKMediaContent
Definition: IWORKTypes.h:148
libetonyek::KEY1Token::tile
@ tile
Definition: KEY1Token.h:236
libetonyek::KEY1Token::none
@ none
Definition: KEY1Token.h:229
libetonyek_utils.h
libetonyek::KEY1FillElement::m_imageName
boost::optional< std::string > m_imageName
Definition: KEY1FillElement.h:43
IWORKTypes.h
libetonyek::KEY1FillElement::FILL_TYPE_COLOR
@ FILL_TYPE_COLOR
Definition: KEY1FillElement.h:27
libetonyek::IWORK_IMAGE_TYPE_TILE
@ IWORK_IMAGE_TYPE_TILE
Definition: IWORKEnum.h:100
IWORKParser.h
libetonyek::KEY1FillElement
Definition: KEY1FillElement.h:23
libetonyek::KEY1Token::byte_size
@ byte_size
Definition: KEY1Token.h:119
KEY1StringConverter.h
libetonyek::KEY1Token::image_data
@ image_data
Definition: KEY1Token.h:148
libetonyek::KEY1Token::fill_type
@ fill_type
Definition: KEY1Token.h:132
libetonyek::IWORKToken::fill
@ fill
Definition: IWORKToken.h:200
m_type
boost::optional< IWORKGradientType > m_type
Definition: IWORKFillElement.cpp:132
libetonyek::KEY1FillElement::m_type
boost::optional< FillType > m_type
Definition: KEY1FillElement.h:41
libetonyek::get
const ValueT & get(const detail::IWAFieldImpl< TagV, ValueT, Reader > &field)
Definition: IWAField.h:190
libetonyek::IWORKToken::getTokenizer
const IWORKTokenizer & getTokenizer()
Definition: IWORKToken.cpp:57
libetonyek::IWORKToken::name
@ name
Definition: IWORKToken.h:578
libetonyek::IWORKToken::value
@ value
Definition: IWORKToken.h:624
libetonyek_xml.h
libetonyek::KEY1StringConverter::convert
static boost::optional< T > convert(const char *value)
Definition: KEY1StringConverter.cpp:28
libetonyek::IWORKXMLContextBase< Base, KEY1ParserState, KEYCollector >::getState
KEY1ParserState & getState()
Definition: IWORKXMLContextBase.h:43