KEYCollector.h Source File documentation

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::IWORKCollector::m_currentPath
IWORKPathPtr_t m_currentPath
Definition: IWORKCollector.h:177
libetonyek::IWORKCollector::endDocument
void endDocument()
Definition: IWORKCollector.cpp:566
libetonyek::IWORKCollector::getOutputManager
IWORKOutputManager & getOutputManager()
Definition: IWORKCollector.cpp:1034
libetonyek::KEYCollector::insertSlide
void insertSlide(const KEYSlidePtr_t &slide, bool isMaster, const boost::optional< std::string > &pageName=boost::none)
Definition: KEYCollector.cpp:120
libetonyek::IWORKDocumentInterface
Definition: IWORKDocumentInterface.h:18
libetonyek::IWORKOutputManager::pop
void pop()
Pop a output element from the stack.
Definition: IWORKOutputManager.cpp:33
libetonyek
Definition: IWORKBezierElement.cpp:20
libetonyek::IWORKToken::none
@ none
Definition: IWORKToken.h:666
libetonyek::IWORKCollector::startDocument
void startDocument()
Definition: IWORKCollector.cpp:561
libetonyek::IWORKCollector::startLevel
void startLevel()
Definition: IWORKCollector.cpp:635
libetonyek::KEYCollector::endLayer
void endLayer()
Definition: KEYCollector.cpp:339
IWORKProperties.h
libetonyek::KEYPlaceholderPtr_t
std::shared_ptr< KEYPlaceholder > KEYPlaceholderPtr_t
Definition: KEYTypes_fwd.h:26
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::IWORKCollector::m_outputManager
IWORKOutputManager m_outputManager
Definition: IWORKCollector.h:166
libetonyek::IWORKOutputManager::getCurrent
IWORKOutputElements & getCurrent()
Get the current output element.
Definition: IWORKOutputManager.cpp:57
libetonyek::IWORKDocumentInterface::startSlide
virtual void startSlide(const librevenge::RVNGPropertyList &propList)=0
libetonyek::KEYLayer
Definition: KEYTypes.h:31
libetonyek::KEYSlidePtr_t
std::shared_ptr< KEYSlide > KEYSlidePtr_t
Definition: KEYTypes_fwd.h:31
libetonyek::IWORKOutputManager::save
IWORKOutputID_t save()
Save the current output element.
Definition: IWORKOutputManager.cpp:39
libetonyek::KEYCollector::endThemes
void endThemes()
Definition: KEYCollector.cpp:297
libetonyek::IWORKOutputElements::addDrawGraphicObject
void addDrawGraphicObject(const librevenge::RVNGPropertyList &propList)
Definition: IWORKOutputElements.cpp:978
libetonyek::KEYCollector::drawMedia
void drawMedia(double x, double y, const librevenge::RVNGPropertyList &data) override
Definition: KEYCollector.cpp:382
libetonyek::KEYCollector::collectStickyNote
void collectStickyNote()
Definition: KEYCollector.cpp:193
ETONYEK_DEBUG_MSG
#define ETONYEK_DEBUG_MSG(M)
Definition: libetonyek_utils.h:54
KEYCollector.h
libetonyek::IWORKDocumentInterface::endSlide
virtual void endSlide()=0
libetonyek::IWORKTextPtr_t
std::shared_ptr< IWORKText > IWORKTextPtr_t
Definition: IWORKText_fwd.h:18
libetonyek::IWORKDocumentInterface::endMasterSlide
virtual void endMasterSlide()=0
IWORKTable.h
libetonyek::KEYCollector::startLayer
void startLayer()
Definition: KEYCollector.cpp:328
libetonyek::IWORKCollector::endLevel
void endLevel()
Definition: IWORKCollector.cpp:656
libetonyek::IWORKStyleStack::set
void set(const IWORKStylePtr_t &style)
Definition: IWORKStyleStack.cpp:45
libetonyek::IWORKOutputElements::addOpenComment
void addOpenComment(const librevenge::RVNGPropertyList &propList)
Definition: IWORKOutputElements.cpp:1043
libetonyek::IWORKOutputElements::clear
void clear()
Definition: IWORKOutputElements.cpp:883
m_size
optional< IWORKSize > m_size
Definition: IWORKPathElement.cpp:48
libetonyek::KEYCollector::createFrameStylesForTextBox
bool createFrameStylesForTextBox() const override
Definition: KEYCollector.h:71
libetonyek::IWORKSize::m_width
double m_width
Definition: IWORKTypes.h:46
libetonyek::IWORKCollector::fillMetadata
void fillMetadata(librevenge::RVNGPropertyList &props)
Definition: IWORKCollector.cpp:769
libetonyek::KEYCollector::insertLayer
void insertLayer(const KEYLayerPtr_t &layer)
Definition: KEYCollector.cpp:75
libetonyek::KEYCollector::startPage
void startPage()
Definition: KEYCollector.cpp:301
libetonyek::KEYCollector::m_layerOpened
bool m_layerOpened
Definition: KEYCollector.h:85
libetonyek::IWORKDocumentInterface::setDocumentMetaData
virtual void setDocumentMetaData(const librevenge::RVNGPropertyList &propList)=0
libetonyek::IWORKToken::h
@ h
Definition: IWORKToken.h:550
libetonyek::IWORKStyleStack::has
bool has(const bool lookInParent=true) const
Definition: IWORKStyleStack.h:69
libetonyek::KEYCollector::startThemes
void startThemes()
Definition: KEYCollector.cpp:293
libetonyek::IWORKOutputElements::addSetStyle
void addSetStyle(const librevenge::RVNGPropertyList &propList)
Definition: IWORKOutputElements.cpp:1133
libetonyek::KEYCollector::endSlides
void endSlides()
Definition: KEYCollector.cpp:288
libetonyek::pt2in
double pt2in(const double d)
Convert a length from points to inches.
Definition: libetonyek_utils.cpp:225
libetonyek::IWORKCollector::m_styleStack
IWORKStyleStack m_styleStack
Definition: IWORKCollector.h:164
libetonyek::IWORKCollector::m_currentTable
std::shared_ptr< IWORKTable > m_currentTable
Definition: IWORKCollector.h:170
libetonyek::IWORKOutputManager::push
void push()
Push a new output element onto the stack.
Definition: IWORKOutputManager.cpp:28
libetonyek::IWORKToken::size
@ size
Definition: IWORKToken.h:395
libetonyek::IWORKToken::title
@ title
Definition: IWORKToken.h:476
libetonyek::makeTransformation
glm::dmat3 makeTransformation(const IWORKGeometry &geometry)
Create a transformation from a geometry.
Definition: IWORKTransformation.cpp:19
libetonyek::KEYCollector::sendSlides
void sendSlides(const std::deque< KEYSlidePtr_t > &slides)
Definition: KEYCollector.cpp:233
libetonyek::KEY1Token::slide
@ slide
Definition: KEY1Token.h:92
libetonyek::IWORKStyleStack::get
const IWORKPropertyInfo< Property >::ValueType & get(const bool lookInParent=true) const
Definition: IWORKStyleStack.h:85
libetonyek::KEYCollector::~KEYCollector
~KEYCollector() override
Definition: KEYCollector.cpp:49
libetonyek::KEYCollector::startSlides
void startSlides()
Definition: KEYCollector.cpp:283
IWORKPath.h
libetonyek::KEYCollector::m_size
IWORKSize m_size
Definition: KEYCollector.h:78
libetonyek::KEYCollector::collectSlide
KEYSlidePtr_t collectSlide()
Definition: KEYCollector.cpp:101
libetonyek::IWORKToken::metadata
@ metadata
Definition: IWORKToken.h:323
libetonyek::KEYCollector::collectNote
void collectNote()
Definition: KEYCollector.cpp:184
libetonyek::KEYCollector::m_layerCount
int m_layerCount
Definition: KEYCollector.h:86
libetonyek::IWORKOutputElements::addStartTextObject
void addStartTextObject(const librevenge::RVNGPropertyList &propList)
Definition: IWORKOutputElements.cpp:1148
libetonyek::IWORKOutputElements::empty
bool empty() const
Definition: IWORKOutputElements.cpp:888
libetonyek::IWORKToken::layer
@ layer
Definition: IWORKToken.h:286
IWORKDocumentInterface.h
libetonyek::NUM1Token::document
@ document
Definition: NUM1Token.h:34
IWORKText.h
libetonyek::KEYCollector::collectPresentationSize
void collectPresentationSize(const IWORKSize &size)
Definition: KEYCollector.cpp:54
libetonyek_utils.h
libetonyek::IWORKToken::w
@ w
Definition: IWORKToken.h:630
libetonyek::KEYCollector::m_currentSlide
KEYSlidePtr_t m_currentSlide
Definition: KEYCollector.h:80
libetonyek::KEYCollector::collectLayer
KEYLayerPtr_t collectLayer()
Definition: KEYCollector.cpp:59
libetonyek::KEYCollector::insertTextPlaceholder
void insertTextPlaceholder(const KEYPlaceholderPtr_t &placeholder)
Definition: KEYCollector.cpp:166
libetonyek::IWORKToken::style
@ style
Definition: IWORKToken.h:414
y
double y
Definition: IWORKShape.cpp:46
libetonyek::IWORKCollector
Definition: IWORKCollector.h:41
libetonyek::IWORKSize::m_height
double m_height
Definition: IWORKTypes.h:47
libetonyek::IWORKSize
Definition: IWORKTypes.h:44
libetonyek::KEYCollector::m_pageOpened
bool m_pageOpened
Definition: KEYCollector.h:84
libetonyek::KEYLayerPtr_t
std::shared_ptr< KEYLayer > KEYLayerPtr_t
Definition: KEYTypes_fwd.h:21
libetonyek::IWORKOutputElements::addCloseComment
void addCloseComment()
Definition: IWORKOutputElements.cpp:893
libetonyek::IWORKCollector::fillWrapProps
static void fillWrapProps(const IWORKStylePtr_t style, librevenge::RVNGPropertyList &props, const boost::optional< int > &order)
Definition: IWORKCollector.cpp:984
IWORKCollector.h
x
double x
Definition: IWORKShape.cpp:45
libetonyek::KEYCollector::m_notes
IWORKOutputElements m_notes
Definition: KEYCollector.h:81
libetonyek::KEYCollector::setSlideStyle
void setSlideStyle(const IWORKStylePtr_t &style)
Definition: KEYCollector.cpp:219
IWORKOutputElements.h
libetonyek::IWORKGeometryPtr_t
std::shared_ptr< IWORKGeometry > IWORKGeometryPtr_t
Definition: IWORKTypes_fwd.h:41
libetonyek::IWORKStylePtr_t
std::shared_ptr< IWORKStyle > IWORKStylePtr_t
Definition: IWORKStyle_fwd.h:21
libetonyek::IWORKToken::s
@ s
Definition: IWORKToken.h:387
m_notes
boost::optional< std::string > m_notes
Definition: KEY1Parser.cpp:1513
IWORKPath_fwd.h
KEYTypes_fwd.h
libetonyek::KEYCollector::KEYCollector
KEYCollector(IWORKDocumentInterface *document)
Definition: KEYCollector.cpp:35
libetonyek::KEYCollector::fillShapeProperties
void fillShapeProperties(librevenge::RVNGPropertyList &props) override
Definition: KEYCollector.cpp:397
libetonyek::KEYCollector::m_stickyNotes
IWORKOutputElements m_stickyNotes
Definition: KEYCollector.h:82
libetonyek::KEYPlaceholder
Definition: KEYTypes.h:39
libetonyek::KEYCollector::endDocument
void endDocument()
Definition: KEYCollector.cpp:278
libetonyek::IWORKStyleStack::pop
void pop()
Pop a style from the active styles stack.
Definition: IWORKStyleStack.cpp:40
libetonyek::IWORKCollector::m_recorder
std::shared_ptr< IWORKRecorder > m_recorder
Definition: IWORKCollector.h:161
IWORKRecorder.h
libetonyek::get
const ValueT & get(const detail::IWAFieldImpl< TagV, ValueT, Reader > &field)
Definition: IWAField.h:190
libetonyek::KEYCollector
Definition: KEYCollector.h:24
IWORKStyle_fwd.h
libetonyek::IWORKCollector::writeFill
static void writeFill(const IWORKFill &fill, librevenge::RVNGPropertyList &props)
Definition: IWORKCollector.cpp:1249
libetonyek::IWORKDocumentInterface::startMasterSlide
virtual void startMasterSlide(const librevenge::RVNGPropertyList &propList)=0
libetonyek::IWORKToken::geometry
@ geometry
Definition: IWORKToken.h:232
libetonyek::KEYCollector::drawTable
void drawTable() override
Definition: KEYCollector.cpp:350
libetonyek::KEYCollector::collectTextPlaceholder
KEYPlaceholderPtr_t collectTextPlaceholder(const IWORKStylePtr_t &style, bool title)
Definition: KEYCollector.cpp:145
libetonyek::IWORKCollector::m_levelStack
std::stack< Level > m_levelStack
Definition: IWORKCollector.h:163
libetonyek::IWORKToken::name
@ name
Definition: IWORKToken.h:578
libetonyek::IWORKToken::data
@ data
Definition: IWORKToken.h:174
libetonyek::IWORKCollector::m_currentText
std::shared_ptr< IWORKText > m_currentText
Definition: IWORKCollector.h:171
libetonyek::KEYCollector::endPage
void endPage()
Definition: KEYCollector.cpp:315
libetonyek::IWORKStyleStack::push
void push()
Push a style onto the active styles stack.
Definition: IWORKStyleStack.cpp:30
libetonyek::IWORKOutputElements::addEndTextObject
void addEndTextObject()
Definition: IWORKOutputElements.cpp:1003
libetonyek::KEYCollector::startDocument
void startDocument()
Definition: KEYCollector.cpp:228
libetonyek::IWORKCollector::m_document
IWORKDocumentInterface * m_document
Definition: IWORKCollector.h:160
libetonyek::KEYCollector::m_inSlides
bool m_inSlides
Definition: KEYCollector.h:64
libetonyek::IWORKOutputElements
Definition: IWORKOutputElements.h:32
libetonyek::IWORKToken::text
@ text
Definition: IWORKToken.h:465
KEYTypes.h