Orcus
types.hpp
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This Source Code Form is subject to the terms of the Mozilla Public
4  * License, v. 2.0. If a copy of the MPL was not distributed with this
5  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6  */
7 
8 #ifndef ORCUS_SPREADSHEET_TYPES_HPP
9 #define ORCUS_SPREADSHEET_TYPES_HPP
10 
11 #include "orcus/env.hpp"
12 #include <cstdlib>
13 #include <cstdint>
14 
15 // NB: This header should only use primitive data types and enums.
16 
17 namespace orcus { namespace spreadsheet {
18 
19 typedef int32_t row_t;
20 typedef int32_t col_t;
21 typedef int32_t sheet_t;
22 typedef uint8_t color_elem_t;
23 typedef uint16_t col_width_t;
24 typedef uint16_t row_height_t;
25 
26 ORCUS_DLLPUBLIC col_width_t get_default_column_width();
27 ORCUS_DLLPUBLIC row_height_t get_default_row_height();
28 
29 enum class border_direction_t
30 {
31  unknown = 0,
32  top,
33  bottom,
34  left,
35  right,
36  diagonal,
37  diagonal_bl_tr,
38  diagonal_tl_br
39 };
40 
41 enum class border_style_t
42 {
43  unknown = 0,
44  none,
45  solid,
46  dash_dot,
47  dash_dot_dot,
48  dashed,
49  dotted,
50  double_border,
51  hair,
52  medium,
53  medium_dash_dot,
54  medium_dash_dot_dot,
55  medium_dashed,
56  slant_dash_dot,
57  thick,
58  thin,
59  double_thin,
60  fine_dashed
61 };
62 
63 enum class strikethrough_style_t
64 {
65  none = 0,
66  solid,
67  dash,
68  dot_dash,
69  dot_dot_dash,
70  dotted,
71  long_dash,
72  wave
73 };
74 
75 enum class strikethrough_type_t
76 {
77  unknown = 0,
78  none,
79  single,
80  double_type
81 };
82 
83 enum class strikethrough_width_t
84 {
85  unknown = 0,
86  width_auto,
87  thin,
88  medium,
89  thick,
90  bold
91 };
92 
93 enum class strikethrough_text_t
94 {
95  unknown = 0,
96  slash,
97  cross
98 };
99 
100 enum class formula_grammar_t
101 {
102  unknown = 0,
103  xlsx_2007,
104  xlsx_2010,
105  ods,
106  gnumeric
107 };
108 
109 enum class formula_t
110 {
111  array,
112  data_table,
113  normal,
114  shared
115 };
116 
117 enum class underline_t
118 {
119  none = 0,
120  single_line,
121  single_accounting, // unique to xlsx
122  double_line,
123  double_accounting, // unique to xlsx
124  dotted,
125  dash,
126  long_dash,
127  dot_dash,
128  dot_dot_dot_dash,
129  wave
130 };
131 
132 enum class underline_width_t
133 {
134  none = 0,
135  normal,
136  bold,
137  thin,
138  medium,
139  thick,
140  positive_integer,
141  percent,
142  positive_length
143 };
144 
145 enum class underline_mode_t
146 {
147  continuos = 0,
148  skip_white_space
149 };
150 
151 enum class underline_type_t
152 {
153  none = 0,
154  single,
155  double_type //necessary to not call it "double", since it is a reserved word
156 };
157 
159 {
160  underline_t underline_style;
161  underline_width_t underline_width;
162  underline_mode_t underline_mode;
163  underline_type_t underline_type;
164 };
165 
166 enum class hor_alignment_t
167 {
168  unknown = 0,
169  left,
170  center,
171  right,
172  justified,
173  distributed,
174  filled
175 };
176 
177 enum class ver_alignment_t
178 {
179  unknown = 0,
180  top,
181  middle,
182  bottom,
183  justified,
184  distributed
185 };
186 
192 enum class data_table_type_t
193 {
194  column,
195  row,
196  both
197 };
198 
202 enum class totals_row_function_t
203 {
204  none = 0,
205  sum,
206  minimum,
207  maximum,
208  average,
209  count,
210  count_numbers,
211  standard_deviation,
212  variance,
213  custom
214 };
215 
216 enum class conditional_format_t
217 {
218  unknown = 0,
219  condition,
220  date,
221  formula,
222  colorscale,
223  databar,
224  iconset
225 };
226 
227 enum class condition_operator_t
228 {
229  unknown = 0,
230  equal,
231  less,
232  greater,
233  greater_equal,
234  less_equal,
235  not_equal,
236  between,
237  not_between,
238  duplicate,
239  unique,
240  top_n,
241  bottom_n,
242  above_average,
243  below_average,
244  above_equal_average,
245  below_equal_average,
246  contains_error,
247  contains_no_error,
248  begins_with,
249  ends_with,
250  contains,
251  contains_blanks,
252  not_contains,
253  expression
254 };
255 
256 enum class condition_type_t
257 {
258  unknown = 0,
259  value,
260  automatic,
261  max,
262  min,
263  formula,
264  percent,
265  percentile
266 };
267 
268 enum class condition_date_t
269 {
270  unknown = 0,
271  today,
272  yesterday,
273  tomorrow,
274  last_7_days,
275  this_week,
276  next_week,
277  last_week,
278  this_month,
279  next_month,
280  last_month,
281  this_year,
282  next_year,
283  last_year,
284 };
285 
286 enum class databar_axis_t
287 {
288  none = 0,
289  middle,
290  automatic
291 };
292 
297 ORCUS_DLLPUBLIC totals_row_function_t to_totals_row_function_enum(const char* p, size_t n);
298 
299 }}
300 
301 #endif
302 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: types.hpp:158
Definition: base64.hpp:15