IWORKTabularModelElement.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 IWORKTABULARMODELELEMENT_H_INCLUDED
11 #define IWORKTABULARMODELELEMENT_H_INCLUDED
12
13 #include <string>
14
15 #include <boost/optional.hpp>
16
17 #include "IWORKStyle_fwd.h"
18
19 #include "IWORKXMLContextBase.h"
20
21 namespace libetonyek
22 {
23 class IWORKTable;
24
25 class IWORKTabularModelElement : public IWORKXMLElementContextBase
26 {
27 public:
28 explicit IWORKTabularModelElement(IWORKXMLParserState &state, bool isDefinition=false);
29
30 private:
31 void attribute(int name, const char *value) override;
32 void endOfAttributes() override;
33 void startOfElement() override;
34 IWORKXMLContextPtr_t element(int name) override;
35 void endOfElement() override;
36
37 private:
38 void sendStyle(const IWORKStylePtr_t &style, const std::shared_ptr<IWORKTable> &table);
39
40 private:
41 bool m_isDefinition;
42 boost::optional<ID_t> m_id;
43 boost::optional<std::string> m_tableName;
44 boost::optional<std::string> m_tableId;
45 boost::optional<ID_t> m_styleRef;
46 boost::optional<unsigned> m_headerColumns;
47 boost::optional<unsigned> m_headerRows;
48 boost::optional<unsigned> m_footerRows;
49 };
50
51 }
52
53 #endif // IWORKTABULARMODELELEMENT_H_INCLUDED
54
55 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
IWORKStyle_fwd.h
libetonyek
Definition: IWORKBezierElement.cpp:20
libetonyek::IWORKTabularModelElement::element
IWORKXMLContextPtr_t element(int name) override
Definition: IWORKTabularModelElement.cpp:1867
libetonyek::IWORKXMLContextPtr_t
std::shared_ptr< IWORKXMLContext > IWORKXMLContextPtr_t
Definition: IWORKXMLContext.h:18
libetonyek::IWORKTabularModelElement::endOfAttributes
void endOfAttributes() override
Definition: IWORKTabularModelElement.cpp:1851
IWORKXMLContextBase.h
libetonyek::IWORKTabularModelElement::m_footerRows
boost::optional< unsigned > m_footerRows
Definition: IWORKTabularModelElement.h:48
libetonyek::IWORKTabularModelElement::m_tableName
boost::optional< std::string > m_tableName
Definition: IWORKTabularModelElement.h:43
libetonyek::IWORKTabularModelElement::m_styleRef
boost::optional< ID_t > m_styleRef
Definition: IWORKTabularModelElement.h:45
libetonyek::IWORKStylePtr_t
std::shared_ptr< IWORKStyle > IWORKStylePtr_t
Definition: IWORKStyle_fwd.h:21
libetonyek::IWORKToken::value
Definition: IWORKToken.h:624
libetonyek::IWORKTabularModelElement::IWORKTabularModelElement
IWORKTabularModelElement(IWORKXMLParserState &state, bool isDefinition=false)
Definition: IWORKTabularModelElement.cpp:1810
libetonyek::KEY1Token::table
Definition: KEY1Token.h:198
libetonyek::IWORKTabularModelElement::m_id
boost::optional< ID_t > m_id
Definition: IWORKTabularModelElement.h:42
libetonyek::IWORKToken::style
Definition: IWORKToken.h:414
name
const char * name
Definition: IWORKToken.cpp:43
libetonyek::IWORKTabularModelElement::startOfElement
void startOfElement() override
Definition: IWORKTabularModelElement.cpp:1857
libetonyek::IWORKTabularModelElement::m_headerRows
boost::optional< unsigned > m_headerRows
Definition: IWORKTabularModelElement.h:47
libetonyek::IWORKTabularModelElement::sendStyle
void sendStyle(const IWORKStylePtr_t &style, const std::shared_ptr< IWORKTable > &table)
Definition: IWORKTabularModelElement.cpp:1916
libetonyek::IWORKXMLContextBase
Definition: IWORKXMLContextBase.h:27
libetonyek::IWORKTabularModelElement
Definition: IWORKTabularModelElement.h:25
libetonyek::IWORKXMLParserState
Definition: IWORKXMLParserState.h:31
libetonyek::IWORKTabularModelElement::attribute
void attribute(int name, const char *value) override
Definition: IWORKTabularModelElement.cpp:1823
libetonyek::IWORKTabularModelElement::endOfElement
void endOfElement() override
Definition: IWORKTabularModelElement.cpp:1891
libetonyek::IWORKTabularModelElement::m_isDefinition
bool m_isDefinition
Definition: IWORKTabularModelElement.h:41
libetonyek::IWORKTabularModelElement::m_headerColumns
boost::optional< unsigned > m_headerColumns
Definition: IWORKTabularModelElement.h:46
libetonyek::IWORKTabularModelElement::m_tableId
boost::optional< std::string > m_tableId
Definition: IWORKTabularModelElement.h:44