Orcus
Loading...
Searching...
No Matches
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 "../env.hpp"
12
13#include <cstdlib>
14#include <cstdint>
15#include <iosfwd>
16#include <initializer_list>
17#include <string_view>
18#include <vector>
19
20// NB: This header should only define primitive data types, enums and structs
21// that have linkage to liborcus.
22
23namespace orcus { namespace spreadsheet {
24
26using row_t = int32_t;
28using col_t = int32_t;
30using sheet_t = int32_t;
32using color_elem_t = uint8_t;
34using col_width_t = uint16_t;
36using row_height_t = uint16_t;
38using string_id_t = uint32_t;
40using pivot_cache_id_t = uint32_t;
41
48ORCUS_DLLPUBLIC col_width_t get_default_column_width();
49
56ORCUS_DLLPUBLIC row_height_t get_default_row_height();
57
61enum class error_value_t
62{
67 unknown = 0,
69 null,
71 div0,
73 value,
75 ref,
77 name,
79 num,
81 na
82};
83
88enum class border_direction_t
89{
91 unknown = 0,
93 top,
95 bottom,
97 left,
99 right,
104 diagonal,
106 diagonal_bl_tr,
108 diagonal_tl_br
109};
110
114enum class border_style_t
115{
116 unknown = 0,
117 none,
118 solid,
119 dash_dot,
120 dash_dot_dot,
121 dashed,
122 dotted,
123 double_border,
124 hair,
125 medium,
126 medium_dash_dot,
127 medium_dash_dot_dot,
128 medium_dashed,
129 slant_dash_dot,
130 thick,
131 thin,
132 double_thin,
133 fine_dashed
134};
135
139enum class fill_pattern_t
140{
141 none = 0,
142 solid,
143 dark_down,
144 dark_gray,
145 dark_grid,
146 dark_horizontal,
147 dark_trellis,
148 dark_up,
149 dark_vertical,
150 gray_0625,
151 gray_125,
152 light_down,
153 light_gray,
154 light_grid,
155 light_horizontal,
156 light_trellis,
157 light_up,
158 light_vertical,
159 medium_gray
160};
161
167enum class strikethrough_style_t
168{
169 none = 0,
170 solid,
171 dash,
172 dot_dash,
173 dot_dot_dash,
174 dotted,
175 long_dash,
176 wave
177};
178
184enum class strikethrough_type_t
185{
186 unknown = 0,
187 none,
188 single_type,
189 double_type
190};
191
197enum class strikethrough_width_t
198{
199 unknown = 0,
200 width_auto,
201 thin,
202 medium,
203 thick,
204 bold
205};
206
212enum class strikethrough_text_t
213{
214 unknown = 0,
216 slash,
218 cross
219};
220
225enum class formula_grammar_t
226{
228 unknown = 0,
230 xls_xml,
232 xlsx,
234 ods,
236 gnumeric
237};
238
242enum class formula_t
243{
245 unknown = 0,
247 array,
249 data_table,
251 normal,
253 shared
254};
255
261enum class formula_ref_context_t
262{
267 global = 0,
268
270 named_expression_base,
271
277 named_range,
278
283 table_range,
284};
285
290enum class formula_error_policy_t
291{
292 unknown,
294 fail,
296 skip
297};
298
302enum class underline_style_t
303{
305 none = 0,
307 solid,
309 dotted,
311 dash,
313 long_dash,
315 dot_dash,
317 dot_dot_dash,
319 wave
320};
321
332enum class underline_thickness_t
333{
334 none = 0,
335 automatic,
336 bold,
337 dash,
338 medium,
339 thick,
340 thin,
341 percent,
342 positive_integer,
343 positive_length
344};
345
352enum class underline_spacing_t
353{
355 continuous = 0,
360 skip_white_space,
367 continuous_over_field,
368};
369
374enum class underline_count_t
375{
376 none = 0,
378 single_count,
380 double_count
381};
382
386enum class hor_alignment_t
387{
388 unknown = 0,
389 left,
390 center,
391 right,
392 justified,
393 distributed,
394 filled
395};
396
400enum class ver_alignment_t
401{
402 unknown = 0,
403 top,
404 middle,
405 bottom,
406 justified,
407 distributed
408};
409
414enum class xf_category_t
415{
416 unknown,
418 cell,
420 cell_style,
422 differential,
423};
424
430enum class data_table_type_t
431{
432 column,
433 row,
434 both
435};
436
440enum class totals_row_function_t
441{
442 none = 0,
443 sum,
444 minimum,
445 maximum,
446 average,
447 count,
448 count_numbers,
449 standard_deviation,
450 variance,
451 custom
452};
453
454enum class auto_filter_node_op_t
455{
456 unspecified,
457 op_and,
458 op_or
459};
460
461enum class auto_filter_op_t
462{
463 unspecified,
464 empty,
465 not_empty,
466 equal,
467 not_equal,
468 contain,
469 not_contain,
470 begin_with,
471 not_begin_with,
472 end_with,
473 not_end_with,
474 greater,
475 greater_equal,
476 less,
477 less_equal,
478 top,
479 bottom,
480 top_percent,
481 bottom_percent,
482 top_percent_range,
483 bottom_percent_range,
484};
485
489enum class conditional_format_t
490{
491 unknown = 0,
492 condition,
493 date,
494 formula,
495 colorscale,
496 databar,
497 iconset
498};
499
503enum class condition_operator_t
504{
505 unknown = 0,
506 equal,
507 less,
508 greater,
509 greater_equal,
510 less_equal,
511 not_equal,
512 between,
513 not_between,
514 duplicate,
515 unique,
516 top_n,
517 bottom_n,
518 above_average,
519 below_average,
520 above_equal_average,
521 below_equal_average,
522 contains_error,
523 contains_no_error,
524 begins_with,
525 ends_with,
526 contains,
527 contains_blanks,
528 not_contains,
529 expression
530};
531
540enum class condition_type_t
541{
542 unknown = 0,
543 value,
544 automatic,
545 max,
546 min,
547 formula,
548 percent,
549 percentile
550};
551
556enum class condition_date_t
557{
558 unknown = 0,
559 today,
560 yesterday,
561 tomorrow,
562 last_7_days,
563 this_week,
564 next_week,
565 last_week,
566 this_month,
567 next_month,
568 last_month,
569 this_year,
570 next_year,
571 last_year,
572};
573
578enum class databar_axis_t
579{
580 none = 0,
581 middle,
582 automatic
583};
584
588enum class pivot_cache_group_by_t
589{
595 unknown = 0,
597 days,
599 hours,
601 minutes,
603 months,
605 quarters,
607 range,
609 seconds,
611 years
612};
613
618{
619 row_t row;
620 col_t column;
621};
622
627{
628 row_t rows;
629 col_t columns;
630};
631
637{
638 address_t first;
639 address_t last;
640};
641
647{
648 sheet_t sheet;
649 row_t row;
650 col_t column;
651};
652
658{
659 src_address_t first;
660 src_address_t last;
661};
662
667ORCUS_DLLPUBLIC address_t to_rc_address(const src_address_t& r);
668
673ORCUS_DLLPUBLIC range_t to_rc_range(const src_range_t& r);
674
675ORCUS_DLLPUBLIC bool operator== (const address_t& left, const address_t& right);
676ORCUS_DLLPUBLIC bool operator!= (const address_t& left, const address_t& right);
677
678ORCUS_DLLPUBLIC bool operator== (const src_address_t& left, const src_address_t& right);
679ORCUS_DLLPUBLIC bool operator!= (const src_address_t& left, const src_address_t& right);
680
681ORCUS_DLLPUBLIC bool operator== (const range_t& left, const range_t& right);
682ORCUS_DLLPUBLIC bool operator!= (const range_t& left, const range_t& right);
683
684ORCUS_DLLPUBLIC bool operator== (const src_range_t& left, const src_range_t& right);
685ORCUS_DLLPUBLIC bool operator!= (const src_range_t& left, const src_range_t& right);
686
687ORCUS_DLLPUBLIC bool operator< (const range_t& left, const range_t& right);
688ORCUS_DLLPUBLIC bool operator> (const range_t& left, const range_t& right);
689
690ORCUS_DLLPUBLIC range_t& operator+= (range_t& left, const address_t& right);
691ORCUS_DLLPUBLIC range_t& operator-= (range_t& left, const address_t& right);
692
693ORCUS_DLLPUBLIC std::ostream& operator<< (std::ostream& os, const address_t& v);
694ORCUS_DLLPUBLIC std::ostream& operator<< (std::ostream& os, const src_address_t& v);
695ORCUS_DLLPUBLIC std::ostream& operator<< (std::ostream& os, const src_range_t& v);
696ORCUS_DLLPUBLIC std::ostream& operator<< (std::ostream& os, const range_t& v);
697
702{
703 color_elem_t red;
704 color_elem_t green;
705 color_elem_t blue;
706};
707
716ORCUS_DLLPUBLIC totals_row_function_t to_totals_row_function_enum(std::string_view s);
717
726ORCUS_DLLPUBLIC pivot_cache_group_by_t to_pivot_cache_group_by_enum(std::string_view s);
727
736ORCUS_DLLPUBLIC error_value_t to_error_value_enum(std::string_view s);
737
747ORCUS_DLLPUBLIC color_rgb_t to_color_rgb(std::string_view s);
748
758ORCUS_DLLPUBLIC color_rgb_t to_color_rgb_from_name(std::string_view s);
759
767ORCUS_DLLPUBLIC formula_error_policy_t to_formula_error_policy(std::string_view s);
768
769ORCUS_DLLPUBLIC std::ostream& operator<< (std::ostream& os, error_value_t ev);
770ORCUS_DLLPUBLIC std::ostream& operator<< (std::ostream& os, border_style_t border);
771ORCUS_DLLPUBLIC std::ostream& operator<< (std::ostream& os, formula_grammar_t grammar);
772ORCUS_DLLPUBLIC std::ostream& operator<< (std::ostream& os, underline_style_t uline);
773ORCUS_DLLPUBLIC std::ostream& operator<< (std::ostream& os, underline_thickness_t ulwidth);
774ORCUS_DLLPUBLIC std::ostream& operator<< (std::ostream& os, underline_spacing_t ulmode);
775ORCUS_DLLPUBLIC std::ostream& operator<< (std::ostream& os, underline_count_t ultype);
776ORCUS_DLLPUBLIC std::ostream& operator<< (std::ostream& os, hor_alignment_t halign);
777ORCUS_DLLPUBLIC std::ostream& operator<< (std::ostream& os, ver_alignment_t valign);
778ORCUS_DLLPUBLIC std::ostream& operator<< (std::ostream& os, auto_filter_node_op_t op);
779ORCUS_DLLPUBLIC std::ostream& operator<< (std::ostream& os, auto_filter_op_t op);
780ORCUS_DLLPUBLIC std::ostream& operator<< (std::ostream& os, const color_rgb_t& color);
781ORCUS_DLLPUBLIC std::ostream& operator<< (std::ostream& os, const fill_pattern_t& fill);
782ORCUS_DLLPUBLIC std::ostream& operator<< (std::ostream& os, const strikethrough_style_t& ss);
783ORCUS_DLLPUBLIC std::ostream& operator<< (std::ostream& os, const strikethrough_type_t& st);
784ORCUS_DLLPUBLIC std::ostream& operator<< (std::ostream& os, const strikethrough_width_t& sw);
785ORCUS_DLLPUBLIC std::ostream& operator<< (std::ostream& os, const strikethrough_text_t& st);
786
787}}
788
789#endif
790
791/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition sheet.hpp:42
Definition types.hpp:618
Definition types.hpp:702
Definition types.hpp:627
Definition types.hpp:637
Definition types.hpp:647
Definition types.hpp:658