KEY1ParserState.h Source File documentation

KEY1ParserState.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 KEY1PARSERSTATE_H_INCLUDED
11#define KEY1PARSERSTATE_H_INCLUDED
12
13#include "IWORKXMLParserState.h"
14
15namespace libetonyek
16{
17
18class KEY1Parser;
19class KEYCollector;
20struct KEY1Dictionary;
21
22 enum KEY1BulletType
23{
24 KEY1_BULLETTYPE_CHARACTER,
25 KEY1_BULLETTYPE_IMAGE,
26 KEY1_BULLETTYPE_INHERITED,
27 KEY1_BULLETTYPE_SEQUENCE,
28 KEY1_BULLETTYPE_NONE
29};
30
31 struct KEY1Bullet
32{
33 KEY1Bullet()
34 : m_type(KEY1_BULLETTYPE_NONE)
35 , m_level()
36 , m_spacing()
37 {
38 }
39 KEY1BulletType m_type;
40 boost::optional<int> m_level;
41 boost::optional<double> m_spacing;
42};
43
44 class KEY1ParserState : public IWORKXMLParserState
45{
46 // not copyable
47 KEY1ParserState(const KEY1ParserState &);
48 KEY1ParserState &operator=(const KEY1ParserState &);
49
50public:
51 KEY1ParserState(KEY1Parser &parser, KEYCollector &collector, KEY1Dictionary &dict);
52
53 KEY1Dictionary &getDictionary();
54 KEYCollector &getCollector();
55
56 void pushIsPrototype(bool isPrototype);
57 void popIsPrototype();
58 void pushIsMasterSlide(bool isMasterSlide);
59 void popIsMasterSlide();
60
61 void openBullets();
62 void openBullet(KEY1Bullet const &bullet);
63 void closeBullet();
64 void closeBullets();
65 bool m_isPrototype;
66 bool m_isMasterSlide;
67
68private:
69 void storeCurrentPlaceholder();
70
71 KEY1Dictionary &m_dict;
72 KEYCollector &m_collector;
73
74 std::deque<bool> m_prototypes;
75 std::deque<bool> m_masterSlides;
76
77 bool m_isBulletOpened;
78 bool m_isBulletsOpened;
79
80 bool m_isBodyContentOpened;
81 bool m_isTitleContentOpened;
82 bool m_bodyContentFound;
83 bool m_titleContentFound;
84};
85
86}
87
88#endif // KEY1PARSERSTATE_H_INCLUDED
89
90/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
IWORKXMLParserState.h
libetonyek::IWORKXMLParserState
Definition IWORKXMLParserState.h:32
libetonyek::KEY1ParserState
Definition KEY1ParserState.h:45
libetonyek::KEY1ParserState::m_titleContentFound
bool m_titleContentFound
Definition KEY1ParserState.h:83
libetonyek::KEY1ParserState::operator=
KEY1ParserState & operator=(const KEY1ParserState &)
libetonyek::KEY1ParserState::m_dict
KEY1Dictionary & m_dict
Definition KEY1ParserState.h:71
libetonyek::KEY1ParserState::m_masterSlides
std::deque< bool > m_masterSlides
Definition KEY1ParserState.h:75
libetonyek::KEY1ParserState::m_isMasterSlide
bool m_isMasterSlide
Definition KEY1ParserState.h:66
libetonyek::KEY1ParserState::m_prototypes
std::deque< bool > m_prototypes
Definition KEY1ParserState.h:74
libetonyek::KEY1ParserState::m_isTitleContentOpened
bool m_isTitleContentOpened
Definition KEY1ParserState.h:81
libetonyek::KEY1ParserState::closeBullets
void closeBullets()
Definition KEY1ParserState.cpp:148
libetonyek::KEY1ParserState::popIsPrototype
void popIsPrototype()
Definition KEY1ParserState.cpp:55
libetonyek::KEY1ParserState::openBullet
void openBullet(KEY1Bullet const &bullet)
Definition KEY1ParserState.cpp:93
libetonyek::KEY1ParserState::getDictionary
KEY1Dictionary & getDictionary()
Definition KEY1ParserState.cpp:39
libetonyek::KEY1ParserState::pushIsMasterSlide
void pushIsMasterSlide(bool isMasterSlide)
Definition KEY1ParserState.cpp:66
libetonyek::KEY1ParserState::closeBullet
void closeBullet()
Definition KEY1ParserState.cpp:133
libetonyek::KEY1ParserState::m_isBulletOpened
bool m_isBulletOpened
Definition KEY1ParserState.h:77
libetonyek::KEY1ParserState::m_isBulletsOpened
bool m_isBulletsOpened
Definition KEY1ParserState.h:78
libetonyek::KEY1ParserState::KEY1ParserState
KEY1ParserState(const KEY1ParserState &)
libetonyek::KEY1ParserState::getCollector
KEYCollector & getCollector()
Definition KEY1ParserState.cpp:44
libetonyek::KEY1ParserState::m_collector
KEYCollector & m_collector
Definition KEY1ParserState.h:72
libetonyek::KEY1ParserState::m_bodyContentFound
bool m_bodyContentFound
Definition KEY1ParserState.h:82
libetonyek::KEY1ParserState::storeCurrentPlaceholder
void storeCurrentPlaceholder()
Definition KEY1ParserState.cpp:160
libetonyek::KEY1ParserState::pushIsPrototype
void pushIsPrototype(bool isPrototype)
Definition KEY1ParserState.cpp:49
libetonyek::KEY1ParserState::m_isPrototype
bool m_isPrototype
Definition KEY1ParserState.h:65
libetonyek::KEY1ParserState::popIsMasterSlide
void popIsMasterSlide()
Definition KEY1ParserState.cpp:72
libetonyek::KEY1ParserState::openBullets
void openBullets()
Definition KEY1ParserState.cpp:83
libetonyek::KEY1ParserState::m_isBodyContentOpened
bool m_isBodyContentOpened
Definition KEY1ParserState.h:80
libetonyek::KEY1Parser
Definition KEY1Parser.h:24
libetonyek::KEYCollector
Definition KEYCollector.h:25
libetonyek::IWORKToken::bullet
@ bullet
Definition IWORKToken.h:659
libetonyek::KEY1Token::dict
@ dict
Definition KEY1Token.h:51
libetonyek
Definition IWORKBezierElement.cpp:21
libetonyek::KEY1BulletType
KEY1BulletType
Definition KEY1ParserState.h:23
libetonyek::KEY1_BULLETTYPE_SEQUENCE
@ KEY1_BULLETTYPE_SEQUENCE
Definition KEY1ParserState.h:27
libetonyek::KEY1_BULLETTYPE_CHARACTER
@ KEY1_BULLETTYPE_CHARACTER
Definition KEY1ParserState.h:24
libetonyek::KEY1_BULLETTYPE_INHERITED
@ KEY1_BULLETTYPE_INHERITED
Definition KEY1ParserState.h:26
libetonyek::KEY1_BULLETTYPE_IMAGE
@ KEY1_BULLETTYPE_IMAGE
Definition KEY1ParserState.h:25
libetonyek::KEY1_BULLETTYPE_NONE
@ KEY1_BULLETTYPE_NONE
Definition KEY1ParserState.h:28
libetonyek::KEY1Bullet
Definition KEY1ParserState.h:32
libetonyek::KEY1Bullet::m_type
KEY1BulletType m_type
Definition KEY1ParserState.h:39
libetonyek::KEY1Bullet::m_spacing
boost::optional< double > m_spacing
Definition KEY1ParserState.h:41
libetonyek::KEY1Bullet::m_level
boost::optional< int > m_level
Definition KEY1ParserState.h:40
libetonyek::KEY1Bullet::KEY1Bullet
KEY1Bullet()
Definition KEY1ParserState.h:33
libetonyek::KEY1Dictionary
A dictionary of all referenceable entities in the presentation.
Definition KEY1Dictionary.h:36