IWORKFormulaElement.h Source File documentation

IWORKFormulaElement.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 IWORKFORMULAELEMENT_H_INCLUDED
11 #define IWORKFORMULAELEMENT_H_INCLUDED
12
13 #include <boost/optional.hpp>
14
15 #include "IWORKXMLContextBase.h"
16 #include "IWORKXMLParserState.h"
17
18 namespace libetonyek
19 {
21 class IWORKFoElement : public IWORKXMLEmptyContextBase
22 {
23 public:
24 explicit IWORKFoElement(IWORKXMLParserState &state);
25
26 private:
27 void attribute(int name, const char *value) override;
28 IWORKXMLContextPtr_t element(int name) override;
29 void endOfElement() override;
30 const boost::optional<ID_t> &getId() const;
31
32 private:
33 boost::optional<ID_t> m_id;
34 boost::optional<std::string> m_formula;
35 boost::optional<unsigned> m_hc;
36 };
37
39 class IWORKFormulaElement : public IWORKXMLEmptyContextBase
40 {
41 public:
42 explicit IWORKFormulaElement(IWORKXMLParserState &state);
43
44 private:
45 void attribute(int name, const char *value) override;
46 IWORKXMLContextPtr_t element(int name) override;
47 void endOfElement() override;
48 const boost::optional<ID_t> &getId() const;
49
50 private:
51 boost::optional<ID_t> m_id;
52 boost::optional<std::string> m_formula;
53 boost::optional<unsigned> m_hc;
54 };
55
57 class IWORKTableCellFormulaElement : public IWORKXMLEmptyContextBase
58 {
59 public:
60 explicit IWORKTableCellFormulaElement(IWORKXMLParserState &state);
61
62 private:
63 void attribute(int name, const char *value) override;
64 IWORKXMLContextPtr_t element(int name) override;
65 void endOfElement() override;
66 const boost::optional<ID_t> &getId() const;
67
68 private:
69 boost::optional<ID_t> m_id;
70 boost::optional<std::string> m_formula;
71 boost::optional<std::string> m_tableId;
72 };
73
75 class IWORKOfElement : public IWORKXMLEmptyContextBase
76 {
77 public:
78 explicit IWORKOfElement(IWORKXMLParserState &state);
79
80 private:
81 void attribute(int name, const char *value) override;
82 IWORKXMLContextPtr_t element(int name) override;
83 void endOfElement() override;
84
85 boost::optional<ID_t> m_ref;
86 boost::optional<unsigned> m_hc;
87 };
88 }
89
90 #endif // IWORKFORMULAELEMENT_H_INCLUDED
91
92 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libetonyek::IWORKTableCellFormulaElement::endOfElement
void endOfElement() override
Definition: IWORKFormulaElement.cpp:365
libetonyek::IWORKXMLEmptyContextBase
IWORKXMLContextBase< IWORKXMLContextEmpty, IWORKXMLParserState > IWORKXMLEmptyContextBase
Definition: IWORKXMLContextBase.h:128
IWORKDictionary.h
libetonyek
Definition: IWORKBezierElement.cpp:20
libetonyek::IWORKToken::formula
@ formula
Definition: IWORKToken.h:224
libetonyek::IWORKToken::fm
@ fm
Definition: IWORKToken.h:210
libetonyek::IWORKTableCellFormulaElement::IWORKTableCellFormulaElement
IWORKTableCellFormulaElement(IWORKXMLParserState &state)
Definition: IWORKFormulaElement.cpp:322
libetonyek::IWORKTableCellFormulaElement::m_formula
boost::optional< std::string > m_formula
Definition: IWORKFormulaElement.h:70
m_col
boost::optional< unsigned > m_col
Definition: IWORKFormulaElement.cpp:64
libetonyek::IWORKToken::ID
@ ID
Definition: IWORKToken.h:499
m_tableId
boost::optional< std::string > m_tableId
Definition: IWORKTableInfoElement.cpp:567
libetonyek::IWORKXMLContextPtr_t
std::shared_ptr< IWORKXMLContext > IWORKXMLContextPtr_t
Definition: IWORKXMLContext.h:18
libetonyek::IWORKToken::NS_URI_SFA
@ NS_URI_SFA
Definition: IWORKToken.h:689
m_y
boost::optional< unsigned > m_y
Definition: IWORKFormulaElement.cpp:111
libetonyek::IWORKFormulaElement
class to parse the sf:formula element
Definition: IWORKFormulaElement.h:39
m_row
boost::optional< unsigned > m_row
Definition: IWORKFormulaElement.cpp:64
ETONYEK_DEBUG_MSG
#define ETONYEK_DEBUG_MSG(M)
Definition: libetonyek_utils.h:54
libetonyek::IWORKFormulaElement::IWORKFormulaElement
IWORKFormulaElement(IWORKXMLParserState &state)
Definition: IWORKFormulaElement.cpp:266
IWORKFormulaElement.h
libetonyek::IWORKToken::row
@ row
Definition: IWORKToken.h:383
libetonyek::IWORKFoElement
class to parse the sf:fo element, ie. formula element
Definition: IWORKFormulaElement.h:21
libetonyek::IWORKFormulaElement::element
IWORKXMLContextPtr_t element(int name) override
Definition: IWORKFormulaElement.cpp:292
libetonyek::IWORKFoElement::endOfElement
void endOfElement() override
Definition: IWORKFormulaElement.cpp:197
libetonyek::IWORKOfElement::element
IWORKXMLContextPtr_t element(int name) override
Definition: IWORKFormulaElement.cpp:231
libetonyek::IWORKXMLParserState
Definition: IWORKXMLParserState.h:31
libetonyek::IWORKToken::mf_ref
@ mf_ref
Definition: IWORKToken.h:324
libetonyek::IWORKFoElement::m_hc
boost::optional< unsigned > m_hc
Definition: IWORKFormulaElement.h:35
libetonyek::IWORKTableCellFormulaElement::m_id
boost::optional< ID_t > m_id
Definition: IWORKFormulaElement.h:69
libetonyek::IWORKFormulaElement::m_formula
boost::optional< std::string > m_formula
Definition: IWORKFormulaElement.h:52
libetonyek::IWORKOfElement::m_ref
boost::optional< ID_t > m_ref
Definition: IWORKFormulaElement.h:85
libetonyek::IWORKFormulaElement::m_hc
boost::optional< unsigned > m_hc
Definition: IWORKFormulaElement.h:53
libetonyek::IWORKOfElement::endOfElement
void endOfElement() override
Definition: IWORKFormulaElement.cpp:248
libetonyek::IWORKFoElement::getId
const boost::optional< ID_t > & getId() const
Definition: IWORKFormulaElement.cpp:156
libetonyek::IWORKToken::y_coordinate
@ y_coordinate
Definition: IWORKToken.h:636
libetonyek::IWORKTableCellFormulaElement::attribute
void attribute(int name, const char *value) override
Definition: IWORKFormulaElement.cpp:335
libetonyek::IWORKFoElement::IWORKFoElement
IWORKFoElement(IWORKXMLParserState &state)
Definition: IWORKFormulaElement.cpp:148
libetonyek::IWORKOfElement
class to parse the sf:of element, ie formula offset element
Definition: IWORKFormulaElement.h:75
libetonyek::IWORKFormulaPtr_t
std::shared_ptr< IWORKFormula > IWORKFormulaPtr_t
Definition: IWORKTypes.h:123
libetonyek::IWORKToken::fs
@ fs
Definition: IWORKToken.h:230
libetonyek::IWORKFormulaElement::m_id
boost::optional< ID_t > m_id
Definition: IWORKFormulaElement.h:51
libetonyek::IWORKOfElement::IWORKOfElement
IWORKOfElement(IWORKXMLParserState &state)
Definition: IWORKFormulaElement.cpp:211
m_formula
const IWORKFormula m_formula
Definition: IWORKOutputElements.cpp:332
libetonyek::IWORKToken::element
@ element
Definition: IWORKToken.h:188
libetonyek::IWORKFormulaElement::getId
const boost::optional< ID_t > & getId() const
Definition: IWORKFormulaElement.cpp:274
libetonyek::IWORKToken::host_table_ID
@ host_table_ID
Definition: IWORKToken.h:257
libetonyek::IWORKFoElement::m_id
boost::optional< ID_t > m_id
Definition: IWORKFormulaElement.h:33
libetonyek::IWORKOfElement::attribute
void attribute(int name, const char *value) override
Definition: IWORKFormulaElement.cpp:218
libetonyek::IWORKTableCellFormulaElement
class to parse the sf:TableCellFormula element
Definition: IWORKFormulaElement.h:57
libetonyek::IWORKToken::column
@ column
Definition: IWORKToken.h:152
libetonyek::IWORKOfElement::m_hc
boost::optional< unsigned > m_hc
Definition: IWORKFormulaElement.h:86
IWORKTypes.h
libetonyek::IWORKXMLContextBase
Definition: IWORKXMLContextBase.h:27
IWORKXMLParserState.h
libetonyek::IWORKFoElement::m_formula
boost::optional< std::string > m_formula
Definition: IWORKFormulaElement.h:34
IWORKStringElement.h
libetonyek::IWORKToken::x_coordinate
@ x_coordinate
Definition: IWORKToken.h:634
libetonyek::IWORKToken::host_cell_ID
@ host_cell_ID
Definition: IWORKToken.h:256
libetonyek::IWORKToken::cell_address
@ cell_address
Definition: IWORKToken.h:128
libetonyek::IWORKFormulaElement::endOfElement
void endOfElement() override
Definition: IWORKFormulaElement.cpp:309
libetonyek::IWORKToken::first
@ first
Definition: IWORKToken.h:524
libetonyek::IWORKToken::NS_URI_SF
@ NS_URI_SF
Definition: IWORKToken.h:688
IWORKXMLContextBase.h
m_id
boost::optional< ID_t > m_id
Definition: IWORKLineEndElement.cpp:34
libetonyek::int_cast
int int_cast(const char *value)
Definition: libetonyek_xml.cpp:94
libetonyek::IWORKFoElement::attribute
void attribute(int name, const char *value) override
Definition: IWORKFormulaElement.cpp:161
libetonyek::IWORKFoElement::element
IWORKXMLContextPtr_t element(int name) override
Definition: IWORKFormulaElement.cpp:182
IWORKToken.h
libetonyek::IWORKTableCellFormulaElement::element
IWORKXMLContextPtr_t element(int name) override
Definition: IWORKFormulaElement.cpp:348
libetonyek::IWORKToken::formula_string
@ formula_string
Definition: IWORKToken.h:227
m_ref
boost::optional< ID_t > m_ref
Definition: IWORKPathElement.cpp:285
libetonyek::IWORKTableCellFormulaElement::getId
const boost::optional< ID_t > & getId() const
Definition: IWORKFormulaElement.cpp:330
libetonyek::get
const ValueT & get(const detail::IWAFieldImpl< TagV, ValueT, Reader > &field)
Definition: IWAField.h:190
IWORKRefContext.h
IWORKFormula.h
libetonyek::IWORKToken::name
@ name
Definition: IWORKToken.h:578
libetonyek::IWORKToken::value
@ value
Definition: IWORKToken.h:624
libetonyek::IWORKToken::ht
@ ht
Definition: IWORKToken.h:553
m_x
boost::optional< unsigned > m_x
Definition: IWORKFormulaElement.cpp:111
libetonyek::IWORKTableCellFormulaElement::m_tableId
boost::optional< std::string > m_tableId
Definition: IWORKFormulaElement.h:71
libetonyek::IWORKFormula
Definition: IWORKFormula.h:24
libetonyek::IWORKToken::hc
@ hc
Definition: IWORKToken.h:552
libetonyek_xml.h
libetonyek::IWORKFormulaElement::attribute
void attribute(int name, const char *value) override
Definition: IWORKFormulaElement.cpp:279
libetonyek::IWORKXMLContextBase::getState
State & getState()
Definition: IWORKXMLContextBase.h:43