KEYCollector.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 KEYCOLLECTOR_H_INCLUDED
11 #define KEYCOLLECTOR_H_INCLUDED
12
13 #include <deque>
14
15 #include "IWORKCollector.h"
16 #include "IWORKPath_fwd.h"
17 #include "IWORKStyle_fwd.h"
18 #include "KEYTypes.h"
19 #include "KEYTypes_fwd.h"
20
21 namespace libetonyek
22 {
23
24 class KEYCollector : public IWORKCollector
25 {
26 public:
27 explicit KEYCollector(IWORKDocumentInterface *document);
28 ~KEYCollector() override;
29
30 // collector functions
31
32 void collectPresentationSize(const IWORKSize &size);
33
34 KEYLayerPtr_t collectLayer();
35 void insertLayer(const KEYLayerPtr_t &layer);
36 KEYSlidePtr_t collectSlide();
37
38 KEYPlaceholderPtr_t collectTextPlaceholder(const IWORKStylePtr_t &style, bool title);
39 void insertTextPlaceholder(const KEYPlaceholderPtr_t &placeholder);
40
41 void collectNote();
42
43 void collectStickyNote();
44
45 void setSlideStyle(const IWORKStylePtr_t &style);
46
47 // helper functions
48
49 void startDocument();
50 void sendSlides(const std::deque<KEYSlidePtr_t> &slides);
51 void endDocument();
52
53 void startSlides();
54 void endSlides();
55 void startThemes();
56 void endThemes();
57
58 void startPage();
59 void endPage();
60 void startLayer();
61 void endLayer();
62
63 protected:
64 bool m_inSlides;
65
66 private:
67 void insertSlide(const KEYSlidePtr_t &slide, bool isMaster, const boost::optional<std::string> &pageName=boost::none);
68 void drawTable() override;
69 void drawMedia(double x, double y, const librevenge::RVNGPropertyList &data) override;
70 void fillShapeProperties(librevenge::RVNGPropertyList &props) override;
71 bool createFrameStylesForTextBox() const override
72 {
73 return false;
74 }
75 void drawTextBox(const IWORKTextPtr_t &text, const glm::dmat3 &trafo, const IWORKGeometryPtr_t &boundingBox, const librevenge::RVNGPropertyList &style) override;
76
77 private:
78 IWORKSize m_size;
79
80 KEYSlidePtr_t m_currentSlide;
81 IWORKOutputElements m_notes;
82 IWORKOutputElements m_stickyNotes;
83
84 bool m_pageOpened;
85 bool m_layerOpened;
86 int m_layerCount;
87 };
88
89 } // namespace libetonyek
90
91 #endif // KEYCOLLECTOR_H_INCLUDED
92
93 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libetonyek::KEYCollector::m_pageOpened
bool m_pageOpened
Definition: KEYCollector.h:84
IWORKStyle_fwd.h
libetonyek::KEYCollector::endPage
void endPage()
Definition: KEYCollector.cpp:315
libetonyek::IWORKGeometryPtr_t
std::shared_ptr< IWORKGeometry > IWORKGeometryPtr_t
Definition: IWORKTypes_fwd.h:41
libetonyek
Definition: IWORKBezierElement.cpp:20
libetonyek::KEYCollector::startSlides
void startSlides()
Definition: KEYCollector.cpp:283
libetonyek::KEYCollector::m_layerOpened
bool m_layerOpened
Definition: KEYCollector.h:85
libetonyek::KEYCollector::fillShapeProperties
void fillShapeProperties(librevenge::RVNGPropertyList &props) override
Definition: KEYCollector.cpp:397
libetonyek::KEYCollector::startLayer
void startLayer()
Definition: KEYCollector.cpp:328
libetonyek::IWORKOutputElements
Definition: IWORKOutputElements.h:32
libetonyek::KEYCollector::createFrameStylesForTextBox
bool createFrameStylesForTextBox() const override
Definition: KEYCollector.h:71
libetonyek::IWORKToken::layer
Definition: IWORKToken.h:286
KEYTypes_fwd.h
KEYTypes.h
y
double y
Definition: IWORKShape.cpp:46
libetonyek::KEYCollector::sendSlides
void sendSlides(const std::deque< KEYSlidePtr_t > &slides)
Definition: KEYCollector.cpp:233
libetonyek::KEYCollector::insertTextPlaceholder
void insertTextPlaceholder(const KEYPlaceholderPtr_t &placeholder)
Definition: KEYCollector.cpp:166
libetonyek::KEYPlaceholderPtr_t
std::shared_ptr< KEYPlaceholder > KEYPlaceholderPtr_t
Definition: KEYTypes_fwd.h:26
libetonyek::KEYCollector::~KEYCollector
~KEYCollector() override
Definition: KEYCollector.cpp:49
libetonyek::KEYSlidePtr_t
std::shared_ptr< KEYSlide > KEYSlidePtr_t
Definition: KEYTypes_fwd.h:31
libetonyek::KEYCollector::collectStickyNote
void collectStickyNote()
Definition: KEYCollector.cpp:193
libetonyek::KEY1Token::slide
Definition: KEY1Token.h:92
libetonyek::IWORKStylePtr_t
std::shared_ptr< IWORKStyle > IWORKStylePtr_t
Definition: IWORKStyle_fwd.h:21
libetonyek::KEYCollector::endDocument
void endDocument()
Definition: KEYCollector.cpp:278
libetonyek::KEYCollector::collectLayer
KEYLayerPtr_t collectLayer()
Definition: KEYCollector.cpp:59
libetonyek::KEYCollector::startDocument
void startDocument()
Definition: KEYCollector.cpp:228
libetonyek::IWORKSize
Definition: IWORKTypes.h:44
libetonyek::IWORKToken::text
Definition: IWORKToken.h:465
libetonyek::IWORKDocumentInterface
Definition: IWORKDocumentInterface.h:18
libetonyek::KEYCollector::setSlideStyle
void setSlideStyle(const IWORKStylePtr_t &style)
Definition: KEYCollector.cpp:219
x
double x
Definition: IWORKShape.cpp:45
libetonyek::IWORKToken::none
Definition: IWORKToken.h:666
libetonyek::IWORKToken::style
Definition: IWORKToken.h:414
libetonyek::KEYCollector::endLayer
void endLayer()
Definition: KEYCollector.cpp:339
libetonyek::KEYCollector::startPage
void startPage()
Definition: KEYCollector.cpp:301
libetonyek::KEYCollector::drawTable
void drawTable() override
Definition: KEYCollector.cpp:350
libetonyek::KEYLayerPtr_t
std::shared_ptr< KEYLayer > KEYLayerPtr_t
Definition: KEYTypes_fwd.h:21
libetonyek::IWORKCollector
Definition: IWORKCollector.h:41
libetonyek::KEYCollector::insertLayer
void insertLayer(const KEYLayerPtr_t &layer)
Definition: KEYCollector.cpp:75
libetonyek::IWORKTextPtr_t
std::shared_ptr< IWORKText > IWORKTextPtr_t
Definition: IWORKText_fwd.h:18
libetonyek::IWORKToken::size
Definition: IWORKToken.h:395
libetonyek::KEYCollector::m_notes
IWORKOutputElements m_notes
Definition: KEYCollector.h:81
IWORKPath_fwd.h
libetonyek::KEYCollector::m_layerCount
int m_layerCount
Definition: KEYCollector.h:86
libetonyek::KEYCollector::m_size
IWORKSize m_size
Definition: KEYCollector.h:78
libetonyek::KEYCollector::collectPresentationSize
void collectPresentationSize(const IWORKSize &size)
Definition: KEYCollector.cpp:54
libetonyek::KEYCollector::m_currentSlide
KEYSlidePtr_t m_currentSlide
Definition: KEYCollector.h:80
libetonyek::IWORKToken::title
Definition: IWORKToken.h:476
libetonyek::KEYCollector::startThemes
void startThemes()
Definition: KEYCollector.cpp:293
libetonyek::IWORKToken::data
Definition: IWORKToken.h:174
libetonyek::NUM1Token::document
Definition: NUM1Token.h:34
libetonyek::KEYCollector::drawMedia
void drawMedia(double x, double y, const librevenge::RVNGPropertyList &data) override
Definition: KEYCollector.cpp:382
libetonyek::KEYCollector
Definition: KEYCollector.h:24
libetonyek::KEYCollector::m_stickyNotes
IWORKOutputElements m_stickyNotes
Definition: KEYCollector.h:82
libetonyek::KEYCollector::collectSlide
KEYSlidePtr_t collectSlide()
Definition: KEYCollector.cpp:101
libetonyek::KEYCollector::endSlides
void endSlides()
Definition: KEYCollector.cpp:288
IWORKCollector.h
libetonyek::KEYCollector::endThemes
void endThemes()
Definition: KEYCollector.cpp:297
libetonyek::KEYCollector::drawTextBox
void drawTextBox(const IWORKTextPtr_t &text, const glm::dmat3 &trafo, const IWORKGeometryPtr_t &boundingBox, const librevenge::RVNGPropertyList &style) override
Definition: KEYCollector.cpp:401
libetonyek::KEYCollector::collectNote
void collectNote()
Definition: KEYCollector.cpp:184
libetonyek::KEYCollector::m_inSlides
bool m_inSlides
Definition: KEYCollector.h:64
libetonyek::KEYCollector::insertSlide
void insertSlide(const KEYSlidePtr_t &slide, bool isMaster, const boost::optional< std::string > &pageName=boost::none)
Definition: KEYCollector.cpp:120
libetonyek::KEYCollector::collectTextPlaceholder
KEYPlaceholderPtr_t collectTextPlaceholder(const IWORKStylePtr_t &style, bool title)
Definition: KEYCollector.cpp:145
libetonyek::KEYCollector::KEYCollector
KEYCollector(IWORKDocumentInterface *document)
Definition: KEYCollector.cpp:35