KEYCollectorBase.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 KEYCOLLECTORBASE_H_INCLUDED
11#define KEYCOLLECTORBASE_H_INCLUDED
12
13#include <deque>
14#include <stack>
15
16#include "KEYCollector.h"
17#include "KEYObject.h"
18#include "KEYStyle.h"
19#include "KEYStylesheet.h"
20#include "KEYText_fwd.h"
21#include "KEYTypes.h"
22
23namespace libetonyek
24{
25
26struct KEYDictionary;
27
33{
34 struct Level
35 {
38
39 Level();
40 };
41
42public:
45
46 // collector functions
47
48 virtual void collectCellStyle(const boost::optional<ID_t> &id,
49 const boost::optional<KEYPropertyMap> &props,
50 const boost::optional<std::string> &ident, const boost::optional<std::string> &parentIdent,
51 bool ref, bool anonymous);
52 virtual void collectCharacterStyle(const boost::optional<ID_t> &id,
53 const boost::optional<KEYPropertyMap> &props,
54 const boost::optional<std::string> &ident, const boost::optional<std::string> &parentIdent,
55 bool ref, bool anonymous);
56 virtual void collectConnectionStyle(const boost::optional<ID_t> &id,
57 const boost::optional<KEYPropertyMap> &props,
58 const boost::optional<std::string> &ident, const boost::optional<std::string> &parentIdent,
59 bool ref, bool anonymous);
60 virtual void collectGraphicStyle(const boost::optional<ID_t> &id,
61 const boost::optional<KEYPropertyMap> &props,
62 const boost::optional<std::string> &ident, const boost::optional<std::string> &parentIdent,
63 bool ref, bool anonymous);
64 virtual void collectLayoutStyle(const boost::optional<ID_t> &id,
65 const boost::optional<KEYPropertyMap> &props,
66 const boost::optional<std::string> &ident, const boost::optional<std::string> &parentIdent,
67 bool ref, bool anonymous);
68 virtual void collectListStyle(const boost::optional<ID_t> &id,
69 const boost::optional<KEYPropertyMap> &props,
70 const boost::optional<std::string> &ident, const boost::optional<std::string> &parentIdent,
71 bool ref, bool anonymous);
72 virtual void collectParagraphStyle(const boost::optional<ID_t> &id,
73 const boost::optional<KEYPropertyMap> &props,
74 const boost::optional<std::string> &ident, const boost::optional<std::string> &parentIdent,
75 bool ref, bool anonymous);
76 virtual void collectPlaceholderStyle(const boost::optional<ID_t> &id,
77 const boost::optional<KEYPropertyMap> &props,
78 const boost::optional<std::string> &ident, const boost::optional<std::string> &parentIdent,
79 bool ref, bool anonymous);
80 virtual void collectSlideStyle(const boost::optional<ID_t> &id,
81 const boost::optional<KEYPropertyMap> &props,
82 const boost::optional<std::string> &ident, const boost::optional<std::string> &parentIdent,
83 bool ref, bool anonymous);
84 virtual void collectTabularStyle(const boost::optional<ID_t> &id,
85 const boost::optional<KEYPropertyMap> &props,
86 const boost::optional<std::string> &ident, const boost::optional<std::string> &parentIdent,
87 bool ref, bool anonymous);
88 virtual void collectVectorStyle(const boost::optional<ID_t> &id,
89 const boost::optional<KEYPropertyMap> &props,
90 const boost::optional<std::string> &ident, const boost::optional<std::string> &parentIdent,
91 bool ref, bool anonymous);
92
93 virtual void collectGeometry(boost::optional<ID_t> &id,
94 boost::optional<KEYSize> &naturalSize, boost::optional<KEYSize> &size,
95 boost::optional<KEYPosition> &position, boost::optional<double> &angle,
96 boost::optional<double> &shearXAngle, boost::optional<double> &shearYAngle,
97 boost::optional<bool> &horizontalFlip, boost::optional<bool> &verticalFlip,
98 boost::optional<bool> &aspectRatioLocked, boost::optional<bool> &sizesLocked);
99
100 virtual void collectBezier(const boost::optional<ID_t> &id, const KEYPathPtr_t &path, bool ref);
101 virtual void collectGroup(const boost::optional<ID_t> &id, const KEYGroupPtr_t &group);
102 virtual void collectImage(const boost::optional<ID_t> &id, const KEYImagePtr_t &image);
103 virtual void collectLine(const boost::optional<ID_t> &id, const KEYLinePtr_t &line);
104 virtual void collectShape(const boost::optional<ID_t> &id);
105
106 virtual void collectBezierPath(const boost::optional<ID_t> &id);
107 virtual void collectPolygonPath(const boost::optional<ID_t> &id, const KEYSize &size, unsigned edges);
108 virtual void collectRoundedRectanglePath(const boost::optional<ID_t> &id, const KEYSize &size, double radius);
109 virtual void collectArrowPath(const boost::optional<ID_t> &id, const KEYSize &size, double headWidth, double stemRelYPos, bool doubleSided);
110 virtual void collectStarPath(const boost::optional<ID_t> &id, const KEYSize &size, unsigned points, double innerRadius);
111 virtual void collectConnectionPath(const boost::optional<ID_t> &id, const KEYSize &size, double middleX, double middleY);
112 virtual void collectCalloutPath(const boost::optional<ID_t> &id, const KEYSize &size, double radius, double tailSize, double tailX, double tailY, bool quoteBubble);
113
114 virtual void collectData(const boost::optional<ID_t> &id, const RVNGInputStreamPtr_t &stream, const boost::optional<std::string> &displayName, const boost::optional<unsigned> &type, bool ref);
115 virtual void collectUnfiltered(const boost::optional<ID_t> &id, const boost::optional<KEYSize> &size, bool ref);
116 virtual void collectFiltered(const boost::optional<ID_t> &id, const boost::optional<KEYSize> &size);
117 virtual void collectLeveled(const boost::optional<ID_t> &id, const boost::optional<KEYSize> &size);
118 virtual void collectFilteredImage(const boost::optional<ID_t> &id, bool ref);
119 virtual void collectMovieMedia(const boost::optional<ID_t> &id);
120 virtual void collectMedia(const boost::optional<ID_t> &id);
121
122 virtual void collectLayer(const boost::optional<ID_t> &id, bool ref);
123 virtual void collectStylesheet(const boost::optional<ID_t> &id, const boost::optional<ID_t> &parent);
124
125 virtual void collectText(const boost::optional<ID_t> &style, const std::string &text);
126 virtual void collectTab();
127 virtual void collectLineBreak();
128
129 virtual void collectTextPlaceholder(const boost::optional<ID_t> &id, bool title, bool ref);
130
131 virtual void collectTableSizes(const KEYTable::RowSizes_t &rowSizes, const KEYTable::ColumnSizes_t &columnSizes);
132 virtual void collectTableCell(unsigned row, unsigned column, const boost::optional<std::string> &content, unsigned rowSpan, unsigned columnSpan);
133 virtual void collectCoveredTableCell(unsigned row, unsigned column);
134 virtual void collectTableRow();
135 virtual void collectTable();
136
137 virtual void collectNote();
138
139 virtual void collectStickyNote();
140
141 virtual void startPage();
142 virtual void endPage();
143 virtual void startLayer();
144 virtual void endLayer();
145 virtual void startGroup();
146 virtual void endGroup();
147
148 virtual void startParagraph(const boost::optional<ID_t> &style);
149 virtual void endParagraph();
150 virtual void startText(bool object);
151 virtual void endText();
152
153 virtual void startLevel();
154 virtual void endLevel();
155
156protected:
157 bool isCollecting() const;
158 void setCollecting(bool collecting);
159
160 const KEYDefaults &getDefaults() const;
161
162 const KEYLayerPtr_t &getLayer() const;
163 const KEYObjectList_t &getNotes() const;
164 const KEYStickyNotes_t &getStickyNotes() const;
165
166private:
169
171
172 std::stack<Level> m_levelStack;
173 std::stack<KEYObjectList_t> m_objectsStack;
175
177
179
181 std::deque<KEYStylePtr_t> m_newStyles;
182
188
190
192
194
198};
199
200} // namespace libetonyek
201
202#endif // KEYCOLLECTORBASE_H_INCLUDED
203
204/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
EtonyekDocument::Type type
Definition: EtonyekDocument.cpp:62
Implementation of common parts of styles and content collector.
Definition: KEYCollectorBase.h:33
KEYMediaContentPtr_t m_currentUnfiltered
Definition: KEYCollectorBase.h:184
virtual void startText(bool object)
Start of a block that can contain text.
Definition: KEYCollectorBase.cpp:926
virtual void collectCharacterStyle(const boost::optional< ID_t > &id, const boost::optional< KEYPropertyMap > &props, const boost::optional< std::string > &ident, const boost::optional< std::string > &parentIdent, bool ref, bool anonymous)
Definition: KEYCollectorBase.cpp:148
virtual void collectTextPlaceholder(const boost::optional< ID_t > &id, bool title, bool ref)
Definition: KEYCollectorBase.cpp:709
virtual void collectPolygonPath(const boost::optional< ID_t > &id, const KEYSize &size, unsigned edges)
Definition: KEYCollectorBase.cpp:466
virtual void collectCoveredTableCell(unsigned row, unsigned column)
Definition: KEYCollectorBase.cpp:788
virtual void collectSlideStyle(const boost::optional< ID_t > &id, const boost::optional< KEYPropertyMap > &props, const boost::optional< std::string > &ident, const boost::optional< std::string > &parentIdent, bool ref, bool anonymous)
Definition: KEYCollectorBase.cpp:309
KEYMediaContentPtr_t m_currentLeveled
Definition: KEYCollectorBase.h:186
void setCollecting(bool collecting)
Definition: KEYCollectorBase.cpp:969
virtual void endLevel()
Definition: KEYCollectorBase.cpp:955
virtual void endGroup()
Definition: KEYCollectorBase.cpp:893
virtual void endLayer()
Definition: KEYCollectorBase.cpp:864
virtual void endPage()
Definition: KEYCollectorBase.cpp:841
virtual void collectListStyle(const boost::optional< ID_t > &id, const boost::optional< KEYPropertyMap > &props, const boost::optional< std::string > &ident, const boost::optional< std::string > &parentIdent, bool ref, bool anonymous)
Definition: KEYCollectorBase.cpp:245
virtual void collectMedia(const boost::optional< ID_t > &id)
Definition: KEYCollectorBase.cpp:626
virtual void collectStickyNote()
Definition: KEYCollectorBase.cpp:823
const KEYDefaults & getDefaults() const
Definition: KEYCollectorBase.cpp:974
int m_groupLevel
Definition: KEYCollectorBase.h:197
virtual void collectGeometry(boost::optional< ID_t > &id, boost::optional< KEYSize > &naturalSize, boost::optional< KEYSize > &size, boost::optional< KEYPosition > &position, boost::optional< double > &angle, boost::optional< double > &shearXAngle, boost::optional< double > &shearYAngle, boost::optional< bool > &horizontalFlip, boost::optional< bool > &verticalFlip, boost::optional< bool > &aspectRatioLocked, boost::optional< bool > &sizesLocked)
Definition: KEYCollectorBase.cpp:351
KEYObjectList_t m_notes
Definition: KEYCollectorBase.h:191
virtual void collectFiltered(const boost::optional< ID_t > &id, const boost::optional< KEYSize > &size)
Definition: KEYCollectorBase.cpp:551
virtual void startParagraph(const boost::optional< ID_t > &style)
Definition: KEYCollectorBase.cpp:906
virtual void collectCalloutPath(const boost::optional< ID_t > &id, const KEYSize &size, double radius, double tailSize, double tailX, double tailY, bool quoteBubble)
Definition: KEYCollectorBase.cpp:501
const KEYObjectList_t & getNotes() const
Definition: KEYCollectorBase.cpp:984
virtual void collectLeveled(const boost::optional< ID_t > &id, const boost::optional< KEYSize > &size)
Definition: KEYCollectorBase.cpp:566
KEYDataPtr_t m_currentData
Definition: KEYCollectorBase.h:183
virtual void collectData(const boost::optional< ID_t > &id, const RVNGInputStreamPtr_t &stream, const boost::optional< std::string > &displayName, const boost::optional< unsigned > &type, bool ref)
Definition: KEYCollectorBase.cpp:512
virtual void collectTableSizes(const KEYTable::RowSizes_t &rowSizes, const KEYTable::ColumnSizes_t &columnSizes)
Definition: KEYCollectorBase.cpp:755
KEYDictionary & m_dict
Definition: KEYCollectorBase.h:167
virtual void collectRoundedRectanglePath(const boost::optional< ID_t > &id, const KEYSize &size, double radius)
Definition: KEYCollectorBase.cpp:472
virtual void collectNote()
Definition: KEYCollectorBase.cpp:814
virtual void collectLineBreak()
Definition: KEYCollectorBase.cpp:699
KEYStylesheetPtr_t m_currentStylesheet
Definition: KEYCollectorBase.h:180
virtual void collectStylesheet(const boost::optional< ID_t > &id, const boost::optional< ID_t > &parent)
Definition: KEYCollectorBase.cpp:659
virtual void collectBezier(const boost::optional< ID_t > &id, const KEYPathPtr_t &path, bool ref)
Definition: KEYCollectorBase.cpp:381
virtual void collectConnectionPath(const boost::optional< ID_t > &id, const KEYSize &size, double middleX, double middleY)
Definition: KEYCollectorBase.cpp:495
virtual void collectTableCell(unsigned row, unsigned column, const boost::optional< std::string > &content, unsigned rowSpan, unsigned columnSpan)
Definition: KEYCollectorBase.cpp:761
virtual void collectLayoutStyle(const boost::optional< ID_t > &id, const boost::optional< KEYPropertyMap > &props, const boost::optional< std::string > &ident, const boost::optional< std::string > &parentIdent, bool ref, bool anonymous)
Definition: KEYCollectorBase.cpp:218
virtual void collectPlaceholderStyle(const boost::optional< ID_t > &id, const boost::optional< KEYPropertyMap > &props, const boost::optional< std::string > &ident, const boost::optional< std::string > &parentIdent, bool ref, bool anonymous)
Definition: KEYCollectorBase.cpp:283
const KEYStickyNotes_t & getStickyNotes() const
Definition: KEYCollectorBase.cpp:989
virtual void startLayer()
Definition: KEYCollectorBase.cpp:847
virtual void collectFilteredImage(const boost::optional< ID_t > &id, bool ref)
Definition: KEYCollectorBase.cpp:581
virtual void collectLayer(const boost::optional< ID_t > &id, bool ref)
Definition: KEYCollectorBase.cpp:646
virtual void collectParagraphStyle(const boost::optional< ID_t > &id, const boost::optional< KEYPropertyMap > &props, const boost::optional< std::string > &ident, const boost::optional< std::string > &parentIdent, bool ref, bool anonymous)
Definition: KEYCollectorBase.cpp:259
virtual void endParagraph()
Definition: KEYCollectorBase.cpp:916
virtual void startLevel()
Definition: KEYCollectorBase.cpp:949
virtual void collectShape(const boost::optional< ID_t > &id)
Definition: KEYCollectorBase.cpp:428
KEYLayerPtr_t m_currentLayer
Definition: KEYCollectorBase.h:170
const KEYDefaults & m_defaults
Definition: KEYCollectorBase.h:168
virtual void collectConnectionStyle(const boost::optional< ID_t > &id, const boost::optional< KEYPropertyMap > &props, const boost::optional< std::string > &ident, const boost::optional< std::string > &parentIdent, bool ref, bool anonymous)
Definition: KEYCollectorBase.cpp:173
virtual void collectVectorStyle(const boost::optional< ID_t > &id, const boost::optional< KEYPropertyMap > &props, const boost::optional< std::string > &ident, const boost::optional< std::string > &parentIdent, bool ref, bool anonymous)
Definition: KEYCollectorBase.cpp:337
virtual void collectBezierPath(const boost::optional< ID_t > &id)
Definition: KEYCollectorBase.cpp:461
virtual void collectMovieMedia(const boost::optional< ID_t > &id)
Definition: KEYCollectorBase.cpp:611
bool m_collecting
Definition: KEYCollectorBase.h:195
bool m_layerOpened
Definition: KEYCollectorBase.h:196
std::deque< KEYStylePtr_t > m_newStyles
Definition: KEYCollectorBase.h:181
virtual void startPage()
Definition: KEYCollectorBase.cpp:835
virtual void collectTabularStyle(const boost::optional< ID_t > &id, const boost::optional< KEYPropertyMap > &props, const boost::optional< std::string > &ident, const boost::optional< std::string > &parentIdent, bool ref, bool anonymous)
Definition: KEYCollectorBase.cpp:323
const KEYLayerPtr_t & getLayer() const
Definition: KEYCollectorBase.cpp:979
virtual void collectImage(const boost::optional< ID_t > &id, const KEYImagePtr_t &image)
Definition: KEYCollectorBase.cpp:400
KEYMediaContentPtr_t m_currentContent
Definition: KEYCollectorBase.h:187
std::stack< Level > m_levelStack
Definition: KEYCollectorBase.h:172
virtual void endText()
End of a text block.
Definition: KEYCollectorBase.cpp:938
virtual void collectTableRow()
Definition: KEYCollectorBase.cpp:794
std::stack< KEYObjectList_t > m_objectsStack
Definition: KEYCollectorBase.h:173
virtual void collectUnfiltered(const boost::optional< ID_t > &id, const boost::optional< KEYSize > &size, bool ref)
Definition: KEYCollectorBase.cpp:531
~KEYCollectorBase()
Definition: KEYCollectorBase.cpp:121
KEYTable m_currentTable
Definition: KEYCollectorBase.h:189
virtual void collectCellStyle(const boost::optional< ID_t > &id, const boost::optional< KEYPropertyMap > &props, const boost::optional< std::string > &ident, const boost::optional< std::string > &parentIdent, bool ref, bool anonymous)
Definition: KEYCollectorBase.cpp:134
virtual void collectTab()
Definition: KEYCollectorBase.cpp:689
virtual void collectText(const boost::optional< ID_t > &style, const std::string &text)
Definition: KEYCollectorBase.cpp:679
KEYTextPtr_t m_currentText
Definition: KEYCollectorBase.h:176
virtual void collectStarPath(const boost::optional< ID_t > &id, const KEYSize &size, unsigned points, double innerRadius)
Definition: KEYCollectorBase.cpp:489
virtual void collectArrowPath(const boost::optional< ID_t > &id, const KEYSize &size, double headWidth, double stemRelYPos, bool doubleSided)
Definition: KEYCollectorBase.cpp:478
virtual void collectGraphicStyle(const boost::optional< ID_t > &id, const boost::optional< KEYPropertyMap > &props, const boost::optional< std::string > &ident, const boost::optional< std::string > &parentIdent, bool ref, bool anonymous)
Definition: KEYCollectorBase.cpp:187
virtual void collectGroup(const boost::optional< ID_t > &id, const KEYGroupPtr_t &group)
Definition: KEYCollectorBase.cpp:387
virtual void startGroup()
Definition: KEYCollectorBase.cpp:881
virtual void collectLine(const boost::optional< ID_t > &id, const KEYLinePtr_t &line)
Definition: KEYCollectorBase.cpp:415
KEYCollectorBase(KEYDictionary &dict, const KEYDefaults &defaults)
Definition: KEYCollectorBase.cpp:97
KEYPlaceholderStylePtr_t m_currentPlaceholderStyle
Definition: KEYCollectorBase.h:178
KEYPathPtr_t m_currentPath
Definition: KEYCollectorBase.h:174
bool isCollecting() const
Definition: KEYCollectorBase.cpp:964
virtual void collectTable()
Definition: KEYCollectorBase.cpp:799
KEYStickyNotes_t m_stickyNotes
Definition: KEYCollectorBase.h:193
KEYMediaContentPtr_t m_currentFiltered
Definition: KEYCollectorBase.h:185
Definition: KEYCollector.h:30
A representation of default values for various parts of the format.
Definition: KEYDefaults.h:31
Definition: KEYTable.h:21
std::deque< double > ColumnSizes_t
Definition: KEYTable.h:36
std::deque< double > RowSizes_t
Definition: KEYTable.h:37
@ radius
Definition: KEY1Token.h:149
@ dict
Definition: KEY1Token.h:42
@ image
Definition: KEY1Token.h:49
@ string
Definition: KEY1Token.h:75
@ size
Definition: KEY1Token.h:72
@ line
Definition: KEY1Token.h:51
@ content
Definition: KEY1Token.h:39
@ angle
Definition: KEY1Token.h:92
@ title
Definition: KEY1Token.h:85
@ ident
Definition: KEY2Token.h:997
@ path
Definition: KEY2Token.h:357
@ naturalSize
Definition: KEY2Token.h:325
@ shearYAngle
Definition: KEY2Token.h:1078
@ aspectRatioLocked
Definition: KEY2Token.h:910
@ group
Definition: KEY2Token.h:220
@ horizontalFlip
Definition: KEY2Token.h:992
@ shearXAngle
Definition: KEY2Token.h:1077
@ style
Definition: KEY2Token.h:796
@ verticalFlip
Definition: KEY2Token.h:1113
@ text
Definition: KEY2Token.h:854
@ position
Definition: KEY2Token.h:366
@ row
Definition: KEY2Token.h:1069
@ sizesLocked
Definition: KEY2Token.h:1079
@ column
Definition: KEY2Token.h:140
@ tailSize
Definition: KEY2Token.h:1103
Definition: EtonyekDocument.cpp:41
boost::shared_ptr< KEYPlaceholderStyle > KEYPlaceholderStylePtr_t
Definition: KEYStyles_fwd.h:56
boost::shared_ptr< KEYStylesheet > KEYStylesheetPtr_t
Definition: KEYStylesheet.h:19
boost::shared_ptr< KEYGraphicStyle > KEYGraphicStylePtr_t
Definition: KEYStyles_fwd.h:36
boost::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr_t
Definition: libetonyek_utils.h:88
boost::shared_ptr< KEYGeometry > KEYGeometryPtr_t
Definition: KEYTypes_fwd.h:25
boost::shared_ptr< KEYText > KEYTextPtr_t
Definition: KEYText_fwd.h:16
boost::shared_ptr< KEYData > KEYDataPtr_t
Definition: KEYTypes_fwd.h:33
std::deque< KEYObjectPtr_t > KEYObjectList_t
A list of presentation objects.
Definition: KEYObject.h:48
boost::shared_ptr< KEYLine > KEYLinePtr_t
Definition: KEYTypes_fwd.h:29
boost::shared_ptr< KEYImage > KEYImagePtr_t
Definition: KEYTypes_fwd.h:43
boost::shared_ptr< KEYLayer > KEYLayerPtr_t
Definition: KEYTypes_fwd.h:60
boost::shared_ptr< KEYPath > KEYPathPtr_t
Definition: KEYPath_fwd.h:17
std::deque< KEYStickyNote > KEYStickyNotes_t
Definition: KEYTypes.h:184
boost::shared_ptr< KEYMediaContent > KEYMediaContentPtr_t
Definition: KEYTypes_fwd.h:38
boost::shared_ptr< KEYGroup > KEYGroupPtr_t
Definition: KEYTypes_fwd.h:56
Definition: KEYCollectorBase.h:35
KEYGraphicStylePtr_t graphicStyle
Definition: KEYCollectorBase.h:37
Level()
Definition: KEYCollectorBase.cpp:91
KEYGeometryPtr_t geometry
Definition: KEYCollectorBase.h:36
A dictionary of all referenceable entities in the presentation.
Definition: KEYDictionary.h:36
Definition: KEYTypes.h:28

Generated for libetonyek by doxygen 1.9.3