IWORKTypes.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 IWORKTYPES_H_INCLUDED
11 #define IWORKTYPES_H_INCLUDED
12 
13 #include "IWORKTypes_fwd.h"
14 
15 #include <deque>
16 #include <map>
17 #include <string>
18 
19 #include <boost/optional.hpp>
20 #include <boost/variant.hpp>
21 
22 #include <mdds/flat_segment_tree.hpp>
23 
24 #include "libetonyek_utils.h"
25 #include "IWORKEnum.h"
26 #include "IWORKPath_fwd.h"
27 #include "IWORKStyle_fwd.h"
28 #include "IWORKFormula.h"
29 
30 namespace libetonyek
31 {
32 
34 
35 typedef std::unordered_map<std::string, IWORKOutputElements> IWORKHeaderFooterMap_t;
36 
37 struct IWORKSize
38 {
39  double m_width;
40  double m_height;
41 
42  IWORKSize();
43  IWORKSize(double w, double h);
44 };
45 
47 {
48  double m_x;
49  double m_y;
50 
51  IWORKPosition();
52  IWORKPosition(double x_, double y_);
53 };
54 
56 {
60  boost::optional<double> m_angle;
61  boost::optional<double> m_shearXAngle;
62  boost::optional<double> m_shearYAngle;
63  boost::optional<bool> m_horizontalFlip;
64  boost::optional<bool> m_verticalFlip;
65  boost::optional<bool> m_aspectRatioLocked;
66  boost::optional<bool> m_sizesLocked;
67 
68  IWORKGeometry();
69 };
70 
71 struct IWORKColor
72 {
73  double m_red;
74  double m_green;
75  double m_blue;
76  double m_alpha;
77 
78  IWORKColor();
79  IWORKColor(double r, double g, double b, double a);
80 };
81 
83 {
84  boost::optional<double> m_top;
85  boost::optional<double> m_right;
86  boost::optional<double> m_bottom;
87  boost::optional<double> m_left;
88 
89  IWORKPadding();
90 };
91 
93 {
94  double m_pos;
95 
96  explicit IWORKTabStop(double pos_);
97 };
98 
99 typedef std::deque<IWORKTabStop> IWORKTabStops_t;
100 typedef std::unordered_map<ID_t, IWORKTabStops_t> IWORKTabStopsMap_t;
101 typedef mdds::flat_segment_tree<unsigned, IWORKStylePtr_t> IWORKGridLine_t;
102 typedef std::map<unsigned,IWORKGridLine_t> IWORKGridLineMap_t;
103 
104 struct IWORKLine
105 {
108  boost::optional<double> m_x1;
109  boost::optional<double> m_y1;
110  boost::optional<double> m_x2;
111  boost::optional<double> m_y2;
112 
113  IWORKLine();
114 };
115 
116 struct IWORKData
117 {
119  boost::optional<std::string> m_displayName;
121 
122  IWORKData();
123 };
124 
126 {
127  boost::optional<IWORKSize> m_size;
129 
131 };
132 
134 {
135  boost::optional<IWORKSize> m_size;
136  boost::optional<std::string> m_path;
137  boost::optional<std::string> m_type;
138  boost::optional<unsigned> m_dataSize;
139 
140  IWORKBinary();
141 };
142 
144 {
145  boost::optional<bool> m_locked;
147  boost::optional<IWORKBinary> m_binary;
148 
149  IWORKImage();
150 };
151 
153 {
156  boost::optional<bool> m_placeholder;
157  boost::optional<IWORKSize> m_placeholderSize;
159 
160  IWORKMedia();
161 };
162 
163 struct IWORKWrap
164 {
167 
168  IWORKWrap();
169 };
170 
172 {
173  IWORKLineSpacing(double amount, bool relative);
174 
175  double m_amount;
177 };
178 
180 {
181  IWORKTableData();
182 
185 
186  unsigned m_column;
187  unsigned m_row;
188  unsigned m_numColumns;
189  unsigned m_numRows;
190 
191  boost::optional<unsigned> m_columnSpan;
192  boost::optional<unsigned> m_rowSpan;
193  boost::optional<unsigned> m_cellMove;
194  boost::optional<std::string> m_content;
195  boost::optional<IWORKFormula> m_formula;
196  IWORKGridLineMap_t m_horizontalLines;
197  IWORKGridLineMap_t m_verticalLines;
200 };
201 
203 {
204  IWORKStroke();
205 
207  double m_width;
211  std::deque<double> m_pattern;
212 };
213 
215 {
217 
219  double m_fraction;
220  double m_inflection;
221 };
222 
224 {
225  IWORKGradient();
226 
228  std::deque<IWORKGradientStop> m_stops;
229  double m_angle;
230 };
231 
233 {
234  IWORKFillImage();
235 
237  boost::optional<IWORKColor> m_color;
241 };
242 
243 typedef boost::variant<IWORKColor, IWORKGradient, IWORKFillImage> IWORKFill;
244 
246 {
247  IWORKShadow();
248 
250  double m_angle;
251  double m_offset;
252  double m_opacity;
253 };
254 
256 {
257  IWORKMetadata();
258 
263 };
264 
266 {
267  struct Column
268  {
269  Column();
270 
271  double m_width;
272  double m_spacing;
273  };
274 
275  typedef std::deque<Column> Columns_t;
276 
277  IWORKColumns();
278 
279  bool m_equal;
280  Columns_t m_columns;
281 };
282 
284 {
286 
295  int m_base;
297 };
298 
300 {
302 
304 };
305 
307 {
309 
311 };
312 
314 {
316 
318 };
319 
320 typedef std::unordered_map<ID_t, IWORKFilterDescriptor> IWORKFilterDescriptorMap_t;
321 
323 {
325 
327  double m_scale;
328  double m_offset;
330 };
331 
332 typedef std::unordered_map<ID_t, IWORKListLabelGeometry> IWORKListLabelGeometryMap_t;
333 
335 {
337 
341 };
342 
344 {
345  IWORKTextLabel();
346 
348  bool m_tiered;
349  unsigned m_first;
350 };
351 
352 // Type of list label. One of: none, bullet, text, image.
353 // Note: The bool type, representing 'none', is just a placeholder. The
354 // value is not important.
355 typedef boost::variant<bool, std::string, IWORKTextLabel, IWORKMediaContentPtr_t> IWORKListLabelTypeInfo_t;
356 typedef std::unordered_map<ID_t, IWORKListLabelTypeInfo_t> IWORKListLabelTypeInfoMap_t;
357 
358 typedef std::map<unsigned, IWORKStylePtr_t> IWORKListStyle_t;
359 typedef std::unordered_map<ID_t, IWORKListStyle_t> IWORKListStyleMap_t;
360 
361 }
362 
363 #endif // IWORKTYPES_H_INCLUDED
364 
365 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
boost::variant< bool, std::string, IWORKTextLabel, IWORKMediaContentPtr_t > IWORKListLabelTypeInfo_t
Definition: IWORKTypes.h:355
std::string m_keywords
Definition: IWORKTypes.h:261
std::shared_ptr< IWORKGeometry > IWORKGeometryPtr_t
Definition: IWORKTypes_fwd.h:39
boost::optional< double > m_x1
Definition: IWORKTypes.h:108
Definition: IWORKBezierElement.cpp:18
double m_blue
Definition: IWORKTypes.h:75
Definition: IWORKTypes.h:223
Definition: IWORKOutputElements.h:29
boost::optional< double > m_left
Definition: IWORKTypes.h:87
boost::optional< double > m_angle
Definition: IWORKTypes.h:60
boost::optional< double > m_shearXAngle
Definition: IWORKTypes.h:61
IWORKColor m_color
Definition: IWORKTypes.h:218
std::string m_comment
Definition: IWORKTypes.h:262
IWORKFillImageType
Definition: IWORKEnum.h:87
unsigned m_numRows
Definition: IWORKTypes.h:189
double m_width
Definition: IWORKTypes.h:207
double m_offset
Definition: IWORKTypes.h:328
boost::optional< unsigned > m_columnSpan
Definition: IWORKTypes.h:191
boost::optional< bool > m_horizontalFlip
Definition: IWORKTypes.h:63
Definition: IWORKTypes.h:202
IWORKLineJoin m_join
Definition: IWORKTypes.h:209
Definition: IWORKTypes.h:71
boost::optional< bool > m_sizesLocked
Definition: IWORKTypes.h:66
Definition: IWORKTypes.h:322
double m_inflection
Definition: IWORKTypes.h:220
IWORKMediaContentPtr_t m_content
Definition: IWORKTypes.h:158
double m_width
Definition: IWORKTypes.h:271
IWORKCellNumberType
Definition: IWORKEnum.h:79
IWORKCellType m_type
Definition: IWORKTypes.h:199
Definition: IWORKTypes.h:143
IWORKStylePtr_t m_style
Definition: IWORKTypes.h:107
boost::optional< double > m_right
Definition: IWORKTypes.h:85
IWORKLabelNumFormatSurrounding
Definition: IWORKEnum.h:126
Definition: IWORKTypes.h:116
Definition: IWORKTypes.h:283
IWORKLineJoin
Definition: IWORKEnum.h:63
boost::optional< IWORKSize > m_placeholderSize
Definition: IWORKTypes.h:157
std::deque< double > m_pattern
Definition: IWORKTypes.h:211
unsigned m_numColumns
Definition: IWORKTypes.h:188
IWORKSize()
Definition: IWORKTypes.cpp:17
Definition: IWORKTypes.h:265
double m_angle
Definition: IWORKTypes.h:229
IWORKSize m_naturalSize
Definition: IWORKTypes.h:57
boost::optional< IWORKSize > m_size
Definition: IWORKTypes.h:135
std::shared_ptr< IWORKStyle > IWORKStylePtr_t
Definition: IWORKStyle_fwd.h:21
Definition: IWORKTypes.h:306
mdds::flat_segment_tree< unsigned, IWORKStylePtr_t > IWORKGridLine_t
Definition: IWORKTypes.h:101
IWORKStylePtr_t m_style
Definition: IWORKTypes.h:155
boost::optional< std::string > m_content
Definition: IWORKTypes.h:194
std::map< unsigned, IWORKStylePtr_t > IWORKListStyle_t
Definition: IWORKTypes.h:358
Definition: IWORKTypes.h:313
IWORKStrokeType m_type
Definition: IWORKTypes.h:206
Definition: IWORKToken.h:328
Definition: IWORKTypes.h:163
Definition: IWORKToken.h:312
Definition: IWORKTypes.h:104
Definition: IWORKTypes.h:37
bool m_isShadow
Definition: IWORKTypes.h:317
std::unordered_map< ID_t, IWORKTabStops_t > IWORKTabStopsMap_t
Definition: IWORKTypes.h:100
int m_fractionAccuracy
Definition: IWORKTypes.h:293
double m_width
Definition: IWORKTypes.h:39
IWORKAlignment m_align
Definition: IWORKTypes.h:326
Definition: IWORKToken.h:240
boost::optional< IWORKColor > m_color
Definition: IWORKTypes.h:237
int m_decimalPlaces
Definition: IWORKTypes.h:289
Definition: IWORKTypes.h:171
bool m_accountingStyle
Definition: IWORKTypes.h:294
double m_x
Definition: IWORKTypes.h:48
Columns_t m_columns
Definition: IWORKTypes.h:280
unsigned m_first
Definition: IWORKTypes.h:349
std::string m_format
Definition: IWORKTypes.h:303
std::shared_ptr< IWORKData > IWORKDataPtr_t
Definition: IWORKTypes_fwd.h:47
IWORKStylePtr_t m_style
Definition: IWORKTypes.h:198
boost::optional< unsigned > m_cellMove
Definition: IWORKTypes.h:193
boost::optional< unsigned > m_dataSize
Definition: IWORKTypes.h:138
IWORKGeometryPtr_t m_geometry
Definition: IWORKTypes.h:146
double m_amount
Definition: IWORKTypes.h:175
IWORKSize m_size
Definition: IWORKTypes.h:58
std::deque< IWORKTabStop > IWORKTabStops_t
Definition: IWORKTypes.h:99
std::unordered_map< std::string, IWORKOutputElements > IWORKHeaderFooterMap_t
Definition: IWORKTypes.h:33
Definition: IWORKTypes.h:82
unsigned m_column
Definition: IWORKTypes.h:186
IWORKGeometryPtr_t m_geometry
Definition: IWORKTypes.h:106
std::deque< IWORKGradientStop > m_stops
Definition: IWORKTypes.h:228
Definition: IWORKTypes.h:299
IWORKColor m_color
Definition: IWORKTypes.h:249
Definition: IWORKTypes.h:92
double m_fraction
Definition: IWORKTypes.h:219
int m_negativeStyle
Definition: IWORKTypes.h:291
IWORKDataPtr_t m_data
Definition: IWORKTypes.h:128
boost::optional< IWORKFormula > m_formula
Definition: IWORKTypes.h:195
boost::optional< bool > m_placeholder
Definition: IWORKTypes.h:156
Definition: IWORKTypes.h:334
IWORKAlignment
Definition: IWORKEnum.h:16
Definition: IWORKTypes.h:179
IWORKPosition m_position
Definition: IWORKTypes.h:59
bool m_relative
Definition: IWORKTypes.h:176
boost::optional< unsigned > m_rowSpan
Definition: IWORKTypes.h:192
IWORKSize m_size
Definition: IWORKTypes.h:238
boost::optional< IWORKSize > m_size
Definition: IWORKTypes.h:127
Definition: IWORKTypes.h:125
IWORKLineCap m_cap
Definition: IWORKTypes.h:210
Definition: IWORKTypes.h:245
boost::optional< bool > m_aspectRatioLocked
Definition: IWORKTypes.h:65
IWORKGradientType
Definition: IWORKEnum.h:96
boost::variant< IWORKColor, IWORKGradient, IWORKFillImage > IWORKFill
Definition: IWORKTypes.h:243
Definition: IWORKTypes.h:133
Definition: IWORKTypes.h:232
Definition: IWORKToken.h:307
int m_base
Definition: IWORKTypes.h:295
RVNGInputStreamPtr_t m_stream
Definition: IWORKTypes.h:118
Definition: IWORKToken.h:373
std::deque< double > IWORKColumnSizes_t
Definition: IWORKTypes_fwd.h:22
bool m_equal
Definition: IWORKTypes.h:279
std::unordered_map< ID_t, IWORKListLabelGeometry > IWORKListLabelGeometryMap_t
Definition: IWORKTypes.h:332
Definition: IWORKToken.h:401
std::deque< double > IWORKRowSizes_t
Definition: IWORKTypes_fwd.h:24
boost::optional< std::string > m_type
Definition: IWORKTypes.h:137
bool m_scaleWithText
Definition: IWORKTypes.h:329
Definition: IWORKTypes.h:46
std::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr_t
Definition: libetonyek_utils.h:82
std::string m_string
Definition: IWORKTypes.h:288
boost::optional< bool > m_verticalFlip
Definition: IWORKTypes.h:64
double m_height
Definition: IWORKTypes.h:40
IWORKLabelNumFormatSurrounding m_prefix
Definition: IWORKTypes.h:338
boost::optional< double > m_y2
Definition: IWORKTypes.h:111
std::unordered_map< ID_t, IWORKListLabelTypeInfo_t > IWORKListLabelTypeInfoMap_t
Definition: IWORKTypes.h:356
std::map< unsigned, IWORKGridLine_t > IWORKGridLineMap_t
Definition: IWORKTypes.h:102
boost::optional< std::string > m_displayName
Definition: IWORKTypes.h:119
Definition: IWORKTypes.h:214
IWORKGeometryPtr_t m_geometry
Definition: IWORKTypes.h:166
double m_offset
Definition: IWORKTypes.h:251
IWORKGridLineMap_t m_verticalLines
Definition: IWORKTypes.h:197
double m_spacing
Definition: IWORKTypes.h:272
Definition: IWORKTypes.h:343
boost::optional< double > m_shearYAngle
Definition: IWORKTypes.h:62
IWORKLabelNumFormat
Definition: IWORKEnum.h:117
double m_opacity
Definition: IWORKTypes.h:252
IWORKLineCap
Definition: IWORKEnum.h:56
IWORKRowSizes_t m_rowSizes
Definition: IWORKTypes.h:184
std::unordered_map< ID_t, IWORKFilterDescriptor > IWORKFilterDescriptorMap_t
Definition: IWORKTypes.h:320
bool m_tiered
Definition: IWORKTypes.h:348
Definition: IWORKTypes.h:55
std::string m_author
Definition: IWORKTypes.h:260
std::string m_mimeType
Definition: IWORKTypes.h:120
IWORKPathPtr_t m_path
Definition: IWORKTypes.h:165
int m_basePlaces
Definition: IWORKTypes.h:296
Definition: IWORKToken.h:266
Definition: IWORKTypes.h:267
RVNGInputStreamPtr_t m_stream
Definition: IWORKTypes.h:239
std::string m_mimeType
Definition: IWORKTypes.h:240
IWORKFillImageType m_type
Definition: IWORKTypes.h:236
double m_angle
Definition: IWORKTypes.h:250
std::shared_ptr< IWORKPath > IWORKPathPtr_t
Definition: IWORKPath_fwd.h:20
IWORKColumnSizes_t m_columnSizes
Definition: IWORKTypes.h:183
std::string m_currencyCode
Definition: IWORKTypes.h:290
boost::optional< IWORKBinary > m_binary
Definition: IWORKTypes.h:147
std::deque< Column > Columns_t
Definition: IWORKTypes.h:275
boost::optional< double > m_y1
Definition: IWORKTypes.h:109
double m_y
Definition: IWORKTypes.h:49
IWORKLabelNumFormatSurrounding m_suffix
Definition: IWORKTypes.h:340
unsigned m_row
Definition: IWORKTypes.h:187
boost::optional< std::string > m_path
Definition: IWORKTypes.h:136
bool m_thousandsSeperator
Definition: IWORKTypes.h:292
IWORKGradientType m_type
Definition: IWORKTypes.h:227
IWORKTextLabelFormat m_format
Definition: IWORKTypes.h:347
std::unordered_map< ID_t, IWORKListStyle_t > IWORKListStyleMap_t
Definition: IWORKTypes.h:359
double m_green
Definition: IWORKTypes.h:74
IWORKGridLineMap_t m_horizontalLines
Definition: IWORKTypes.h:196
IWORKLabelNumFormat m_format
Definition: IWORKTypes.h:339
double m_scale
Definition: IWORKTypes.h:327
boost::optional< double > m_top
Definition: IWORKTypes.h:84
boost::optional< bool > m_locked
Definition: IWORKTypes.h:145
IWORKColor m_color
Definition: IWORKTypes.h:208
double m_alpha
Definition: IWORKTypes.h:76
std::string m_title
Definition: IWORKTypes.h:259
boost::optional< double > m_x2
Definition: IWORKTypes.h:110
double m_pos
Definition: IWORKTypes.h:94
double m_red
Definition: IWORKTypes.h:73
IWORKGeometryPtr_t m_geometry
Definition: IWORKTypes.h:154
IWORKCellType
Definition: IWORKEnum.h:70
std::string m_format
Definition: IWORKTypes.h:310
std::shared_ptr< IWORKMediaContent > IWORKMediaContentPtr_t
Definition: IWORKTypes_fwd.h:52
Definition: IWORKTypes.h:255
Definition: IWORKToken.h:147
IWORKCellNumberType m_type
Definition: IWORKTypes.h:287
Definition: IWORKTypes.h:152
boost::optional< double > m_bottom
Definition: IWORKTypes.h:86
IWORKStrokeType
Definition: IWORKEnum.h:109

Generated for libetonyek by doxygen 1.8.13