/src/libetonyek/src/lib/KEYCollector.h
Line | Count | Source |
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, const boost::optional<unsigned> &resizeFlags=boost::none); |
39 | | void insertTextPlaceholder(const KEYPlaceholderPtr_t &placeholder); |
40 | | |
41 | | void collectNote(); |
42 | | |
43 | | void collectStickyNote() override; |
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 | 126 | { |
73 | 126 | return false; |
74 | 126 | } |
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: */ |