KEY2ParserState.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 KEY2PARSERSTATE_H_INCLUDED
11 #define KEY2PARSERSTATE_H_INCLUDED
12
13 #include "IWORKXMLParserState.h"
14
15 #include <IWORKText_fwd.h>
16
17 namespace libetonyek
18 {
19
20 class KEY2Parser;
21 class KEYCollector;
22 struct KEY2Dictionary;
23
24 class KEY2ParserState : public IWORKXMLParserState
25 {
26 // not copyable
27 KEY2ParserState(const KEY2ParserState &);
28 KEY2ParserState &operator=(const KEY2ParserState &);
29
30 public:
31 KEY2ParserState(KEY2Parser &parser, KEYCollector &collector, KEY2Dictionary &dict);
32
33 void setVersion(unsigned version);
34 unsigned getVersion() const;
35
36 KEY2Dictionary &getDictionary();
37 KEYCollector &getCollector();
38
39 // Keynote v2: the title and body content is stored in bullets element
40 void openBullets();
41 void openHeadline(int depth);
42 void closeHeadline();
43 void closeBullets();
44
45 IWORKTextPtr_t getBodyText();
46 IWORKTextPtr_t getTitleText();
47
48 private:
49 unsigned m_version;
50 KEY2Dictionary &m_dict;
51 KEYCollector &m_collector;
52
53 bool m_isHeadlineOpened;
54 bool m_isBulletsOpened;
55
56 IWORKTextPtr_t m_bodyText;
57 IWORKTextPtr_t m_titleText;
58 };
59
60 }
61
62 #endif // KEY2PARSERSTATE_H_INCLUDED
63
64 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libetonyek
Definition: IWORKBezierElement.cpp:20
libetonyek::KEY2ParserState::KEY2ParserState
KEY2ParserState(const KEY2ParserState &)
libetonyek::KEY1Token::dict
Definition: KEY1Token.h:51
libetonyek::KEY2ParserState::getBodyText
IWORKTextPtr_t getBodyText()
Definition: KEY2ParserState.cpp:53
libetonyek::KEY2ParserState::openBullets
void openBullets()
Definition: KEY2ParserState.cpp:63
libetonyek::KEY2ParserState::m_collector
KEYCollector & m_collector
Definition: KEY2ParserState.h:51
libetonyek::KEY2ParserState::m_dict
KEY2Dictionary & m_dict
Definition: KEY2ParserState.h:50
libetonyek::KEY2Dictionary
A dictionary of all referenceable entities in the presentation.
Definition: KEY2Dictionary.h:33
libetonyek::KEY2ParserState::m_isBulletsOpened
bool m_isBulletsOpened
Definition: KEY2ParserState.h:54
libetonyek::KEY2ParserState::openHeadline
void openHeadline(int depth)
Definition: KEY2ParserState.cpp:75
IWORKXMLParserState.h
libetonyek::KEY2ParserState::getVersion
unsigned getVersion() const
Definition: KEY2ParserState.cpp:38
libetonyek::KEY2ParserState::closeBullets
void closeBullets()
Definition: KEY2ParserState.cpp:113
libetonyek::IWORKToken::version
Definition: IWORKToken.h:626
libetonyek::IWORKTextPtr_t
std::shared_ptr< IWORKText > IWORKTextPtr_t
Definition: IWORKText_fwd.h:18
libetonyek::KEY2ParserState::m_isHeadlineOpened
bool m_isHeadlineOpened
Definition: KEY2ParserState.h:53
libetonyek::KEY2ParserState
Definition: KEY2ParserState.h:24
libetonyek::KEY2ParserState::closeHeadline
void closeHeadline()
Definition: KEY2ParserState.cpp:98
libetonyek::KEY2ParserState::getTitleText
IWORKTextPtr_t getTitleText()
Definition: KEY2ParserState.cpp:58
libetonyek::KEY2ParserState::m_titleText
IWORKTextPtr_t m_titleText
Definition: KEY2ParserState.h:57
libetonyek::KEY2Token::depth
Definition: KEY2Token.h:90
libetonyek::IWORKXMLParserState
Definition: IWORKXMLParserState.h:31
libetonyek::KEYCollector
Definition: KEYCollector.h:24
libetonyek::KEY2ParserState::operator=
KEY2ParserState & operator=(const KEY2ParserState &)
libetonyek::KEY2ParserState::setVersion
void setVersion(unsigned version)
Definition: KEY2ParserState.cpp:33
libetonyek::KEY2ParserState::getCollector
KEYCollector & getCollector()
Definition: KEY2ParserState.cpp:48
libetonyek::KEY2ParserState::getDictionary
KEY2Dictionary & getDictionary()
Definition: KEY2ParserState.cpp:43
IWORKText_fwd.h
libetonyek::KEY2ParserState::m_bodyText
IWORKTextPtr_t m_bodyText
Definition: KEY2ParserState.h:56
libetonyek::KEY2Parser
Definition: KEY2Parser.h:22
libetonyek::KEY2ParserState::m_version
unsigned m_version
Definition: KEY2ParserState.h:49