KEY1Dictionary.h Source File documentation

KEY1Dictionary.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 KEY1DICTIONARY_H_INCLUDED
11#define KEY1DICTIONARY_H_INCLUDED
12
13#include <boost/optional.hpp>
14
15#include "IWORKDictionary.h"
16#include "KEYTypes.h"
17
18namespace libetonyek
19{
20
35 struct KEY1Dictionary : public IWORKDictionary
36{
37
38 KEY1Dictionary();
39 void pushStylesContext();
40 void collectStylesContext(const std::string &contextName);
41 void linkStylesContext(const boost::optional<std::string> &master);
42 void popStylesContext();
43
44 void storeImageStyle(IWORKStylePtr_t style, bool definition);
45 void storeLineStyle(IWORKStylePtr_t style, bool definition);
46 void storeShapeStyle(IWORKStylePtr_t style, bool definition);
47 void storeTextboxStyle(IWORKStylePtr_t style, bool definition);
48
49 KEYPlaceholderPtr_t getBodyPlaceholder();
50 KEYPlaceholderPtr_t getPageNumberPlaceholder();
51 KEYPlaceholderPtr_t getTitlePlaceholder();
52
53 void storeBodyPlaceholder(KEYPlaceholderPtr_t placeHolder);
54 void storePageNumberPlaceholder(KEYPlaceholderPtr_t placeHolder);
55 void storeTitlePlaceholder(KEYPlaceholderPtr_t placeHolder);
56
57 KEYSlideMap_t m_masterSlides;
58 std::deque<KEYSlidePtr_t> m_slides;
59
60protected:
61 struct StyleContext
62 {
63 StyleContext();
64
65 IWORKStylePtr_t m_style;
66
67 std::deque<IWORKStylePtr_t> m_styles;
68
70 void storeStyle(IWORKStylePtr_t style, bool definition);
72 void link(const StyleContext &parentContext);
73 };
74 struct StylesContext
75 {
76 StylesContext();
77
78 StyleContext m_imageContext;
79 StyleContext m_lineContext;
80 StyleContext m_shapeContext;
81 StyleContext m_textboxContext;
82
83 KEYPlaceholderPtr_t m_bodyPlaceholder;
84 KEYPlaceholderPtr_t m_pageNumberPlaceholder;
85 KEYPlaceholderPtr_t m_titlePlaceholder;
86
88 void link(const StylesContext &parentContext);
89
90 protected:
91 static void link(KEYPlaceholderPtr_t &placeholder, const KEYPlaceholderPtr_t &parentHolder);
92 };
93 typedef std::unordered_map<ID_t, StylesContext> StylesContextMap_t;
94 StylesContext &getCurrentStylesContext();
95
96 std::deque<StylesContext> m_styleContexts;
97 StylesContextMap_t m_styleContextsMap;
98};
99
100}
101
102#endif // KEY1DICTIONARY_H_INCLUDED
103
104/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
IWORKDictionary.h
KEYTypes.h
libetonyek::IWORKToken::string
@ string
Definition: IWORKToken.h:418
libetonyek::IWORKToken::style
@ style
Definition: IWORKToken.h:421
libetonyek
Definition: IWORKBezierElement.cpp:21
libetonyek::KEYSlideMap_t
std::unordered_map< ID_t, KEYSlidePtr_t > KEYSlideMap_t
Definition: KEYTypes_fwd.h:34
libetonyek::KEYPlaceholderPtr_t
std::shared_ptr< KEYPlaceholder > KEYPlaceholderPtr_t
Definition: KEYTypes_fwd.h:26
libetonyek::IWORKStylePtr_t
std::shared_ptr< IWORKStyle > IWORKStylePtr_t
Definition: IWORKStyle_fwd.h:21
libetonyek::IWORKDictionary
A dictionary of all referenceable entities in the presentation.
Definition: IWORKDictionary.h:40
libetonyek::KEY1Dictionary::StyleContext
Definition: KEY1Dictionary.h:62
libetonyek::KEY1Dictionary::StyleContext::storeStyle
void storeStyle(IWORKStylePtr_t style, bool definition)
store a style
Definition: KEY1Dictionary.cpp:124
libetonyek::KEY1Dictionary::StyleContext::m_style
IWORKStylePtr_t m_style
Definition: KEY1Dictionary.h:65
libetonyek::KEY1Dictionary::StyleContext::link
void link(const StyleContext &parentContext)
link all style to their parent
Definition: KEY1Dictionary.cpp:133
libetonyek::KEY1Dictionary::StyleContext::m_styles
std::deque< IWORKStylePtr_t > m_styles
Definition: KEY1Dictionary.h:67
libetonyek::KEY1Dictionary::StyleContext::StyleContext
StyleContext()
Definition: KEY1Dictionary.cpp:118
libetonyek::KEY1Dictionary::StylesContext
Definition: KEY1Dictionary.h:75
libetonyek::KEY1Dictionary::StylesContext::m_pageNumberPlaceholder
KEYPlaceholderPtr_t m_pageNumberPlaceholder
Definition: KEY1Dictionary.h:84
libetonyek::KEY1Dictionary::StylesContext::m_titlePlaceholder
KEYPlaceholderPtr_t m_titlePlaceholder
Definition: KEY1Dictionary.h:85
libetonyek::KEY1Dictionary::StylesContext::m_bodyPlaceholder
KEYPlaceholderPtr_t m_bodyPlaceholder
Definition: KEY1Dictionary.h:83
libetonyek::KEY1Dictionary::StylesContext::StylesContext
StylesContext()
Definition: KEY1Dictionary.cpp:147
libetonyek::KEY1Dictionary::StylesContext::m_textboxContext
StyleContext m_textboxContext
Definition: KEY1Dictionary.h:81
libetonyek::KEY1Dictionary::StylesContext::m_shapeContext
StyleContext m_shapeContext
Definition: KEY1Dictionary.h:80
libetonyek::KEY1Dictionary::StylesContext::link
void link(const StylesContext &parentContext)
link all style to their parent
Definition: KEY1Dictionary.cpp:158
libetonyek::KEY1Dictionary::StylesContext::m_imageContext
StyleContext m_imageContext
Definition: KEY1Dictionary.h:78
libetonyek::KEY1Dictionary::StylesContext::m_lineContext
StyleContext m_lineContext
Definition: KEY1Dictionary.h:79
libetonyek::KEY1Dictionary
A dictionary of all referenceable entities in the presentation.
Definition: KEY1Dictionary.h:36
libetonyek::KEY1Dictionary::getPageNumberPlaceholder
KEYPlaceholderPtr_t getPageNumberPlaceholder()
Definition: KEY1Dictionary.cpp:93
libetonyek::KEY1Dictionary::collectStylesContext
void collectStylesContext(const std::string &contextName)
Definition: KEY1Dictionary.cpp:45
libetonyek::KEY1Dictionary::m_masterSlides
KEYSlideMap_t m_masterSlides
Definition: KEY1Dictionary.h:57
libetonyek::KEY1Dictionary::storeLineStyle
void storeLineStyle(IWORKStylePtr_t style, bool definition)
Definition: KEY1Dictionary.cpp:73
libetonyek::KEY1Dictionary::m_styleContexts
std::deque< StylesContext > m_styleContexts
Definition: KEY1Dictionary.h:96
libetonyek::KEY1Dictionary::storeImageStyle
void storeImageStyle(IWORKStylePtr_t style, bool definition)
Definition: KEY1Dictionary.cpp:68
libetonyek::KEY1Dictionary::popStylesContext
void popStylesContext()
Definition: KEY1Dictionary.cpp:35
libetonyek::KEY1Dictionary::getBodyPlaceholder
KEYPlaceholderPtr_t getBodyPlaceholder()
Definition: KEY1Dictionary.cpp:88
libetonyek::KEY1Dictionary::storeBodyPlaceholder
void storeBodyPlaceholder(KEYPlaceholderPtr_t placeHolder)
Definition: KEY1Dictionary.cpp:103
libetonyek::KEY1Dictionary::pushStylesContext
void pushStylesContext()
Definition: KEY1Dictionary.cpp:30
libetonyek::KEY1Dictionary::storeTextboxStyle
void storeTextboxStyle(IWORKStylePtr_t style, bool definition)
Definition: KEY1Dictionary.cpp:83
libetonyek::KEY1Dictionary::storeShapeStyle
void storeShapeStyle(IWORKStylePtr_t style, bool definition)
Definition: KEY1Dictionary.cpp:78
libetonyek::KEY1Dictionary::StylesContextMap_t
std::unordered_map< ID_t, StylesContext > StylesContextMap_t
Definition: KEY1Dictionary.h:93
libetonyek::KEY1Dictionary::m_slides
std::deque< KEYSlidePtr_t > m_slides
Definition: KEY1Dictionary.h:58
libetonyek::KEY1Dictionary::storePageNumberPlaceholder
void storePageNumberPlaceholder(KEYPlaceholderPtr_t placeHolder)
Definition: KEY1Dictionary.cpp:108
libetonyek::KEY1Dictionary::linkStylesContext
void linkStylesContext(const boost::optional< std::string > &master)
Definition: KEY1Dictionary.cpp:55
libetonyek::KEY1Dictionary::KEY1Dictionary
KEY1Dictionary()
Definition: KEY1Dictionary.cpp:15
libetonyek::KEY1Dictionary::m_styleContextsMap
StylesContextMap_t m_styleContextsMap
Definition: KEY1Dictionary.h:97
libetonyek::KEY1Dictionary::getTitlePlaceholder
KEYPlaceholderPtr_t getTitlePlaceholder()
Definition: KEY1Dictionary.cpp:98
libetonyek::KEY1Dictionary::getCurrentStylesContext
StylesContext & getCurrentStylesContext()
Definition: KEY1Dictionary.cpp:25
libetonyek::KEY1Dictionary::storeTitlePlaceholder
void storeTitlePlaceholder(KEYPlaceholderPtr_t placeHolder)
Definition: KEY1Dictionary.cpp:113