Orcus
Loading...
Searching...
No Matches
document_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#pragma once
9
10#include "types.hpp"
11#include <vector>
12#include <optional>
13
14namespace orcus { namespace spreadsheet {
15
20struct ORCUS_SPM_DLLPUBLIC color_t
21{
22 color_elem_t alpha;
23 color_elem_t red;
24 color_elem_t green;
25 color_elem_t blue;
26
27 color_t();
28 color_t(const color_t& other);
29 color_t(color_elem_t _red, color_elem_t _green, color_elem_t _blue);
30 color_t(color_elem_t _alpha, color_elem_t _red, color_elem_t _green, color_elem_t _blue);
31
32 color_t& operator=(const color_t& other);
33
34 void reset();
35
36 bool operator==(const color_t& other) const;
37 bool operator!=(const color_t& other) const;
38};
39
40struct ORCUS_SPM_DLLPUBLIC strikethrough_t
41{
42 std::optional<strikethrough_style_t> style;
43 std::optional<strikethrough_type_t> type;
44 std::optional<strikethrough_width_t> width;
45 std::optional<strikethrough_text_t> text;
46
47 strikethrough_t();
48 strikethrough_t(const strikethrough_t& other);
49 ~strikethrough_t();
50
51 strikethrough_t& operator=(const strikethrough_t& other);
52
53 bool operator==(const strikethrough_t& other) const;
54 bool operator!=(const strikethrough_t& other) const;
55
56 void reset();
57
58 bool has_value() const;
59};
60
61struct ORCUS_SPM_DLLPUBLIC underline_t
62{
63 std::optional<underline_style_t> style;
64 std::optional<underline_thickness_t> thickness;
65 std::optional<underline_spacing_t> spacing;
66 std::optional<underline_count_t> count;
67 std::optional<color_t> color;
68
69 underline_t();
70 underline_t(const underline_t& other);
71 ~underline_t();
72
73 underline_t& operator=(const underline_t& other);
74
75 bool operator==(const underline_t& other) const;
76 bool operator!=(const underline_t& other) const;
77
78 void reset();
79
80 bool has_value() const;
81};
82
87struct ORCUS_SPM_DLLPUBLIC format_run_t
88{
90 std::size_t pos = 0;
92 std::size_t size = 0;
94 std::optional<std::string_view> font;
96 std::optional<double> font_size;
98 std::optional<color_t> color;
100 std::optional<bool> bold;
102 std::optional<bool> italic;
104 std::optional<bool> superscript;
106 std::optional<bool> subscript;
109 underline_t underline;
110
111 format_run_t();
112 format_run_t(const format_run_t& other);
113 ~format_run_t();
114
115 format_run_t& operator=(const format_run_t& other);
116
120 void reset();
121
127 bool formatted() const;
128};
129
131using format_runs_t = std::vector<format_run_t>;
132
133}} // namespace orcus::spreadsheet
134
135/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
strikethrough_t strikethrough
Definition document_types.hpp:108
std::optional< bool > italic
Definition document_types.hpp:102
std::size_t pos
Definition document_types.hpp:90
std::optional< bool > subscript
Definition document_types.hpp:106
std::optional< std::string_view > font
Definition document_types.hpp:94
std::optional< double > font_size
Definition document_types.hpp:96
std::optional< color_t > color
Definition document_types.hpp:98
std::size_t size
Definition document_types.hpp:92
std::optional< bool > superscript
Definition document_types.hpp:104
std::optional< bool > bold
Definition document_types.hpp:100
Definition document_types.hpp:41
Definition document_types.hpp:62