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

Generated for libetonyek by doxygen 1.8.6