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(color_elem_t _red, color_elem_t _green, color_elem_t _blue);
29 color_t(color_elem_t _alpha, color_elem_t _red, color_elem_t _green, color_elem_t _blue);
30
31 void reset();
32
33 bool operator==(const color_t& other) const;
34 bool operator!=(const color_t& other) const;
35};
36
37struct ORCUS_SPM_DLLPUBLIC strikethrough_t
38{
39 std::optional<strikethrough_style_t> style;
40 std::optional<strikethrough_type_t> type;
41 std::optional<strikethrough_width_t> width;
42 std::optional<strikethrough_text_t> text;
43
45 strikethrough_t(const strikethrough_t& other);
47
48 strikethrough_t& operator=(const strikethrough_t& other);
49
50 bool operator==(const strikethrough_t& other) const;
51 bool operator!=(const strikethrough_t& other) const;
52
53 void reset();
54
55 bool has_value() const;
56};
57
58struct ORCUS_SPM_DLLPUBLIC underline_t
59{
60 std::optional<underline_style_t> style;
61 std::optional<underline_thickness_t> thickness;
62 std::optional<underline_spacing_t> spacing;
63 std::optional<underline_count_t> count;
64 std::optional<color_t> color;
65
67 underline_t(const underline_t& other);
69
70 underline_t& operator=(const underline_t& other);
71
72 bool operator==(const underline_t& other) const;
73 bool operator!=(const underline_t& other) const;
74
75 void reset();
76
77 bool has_value() const;
78};
79
84struct ORCUS_SPM_DLLPUBLIC format_run_t
85{
87 std::size_t pos = 0;
89 std::size_t size = 0;
91 std::optional<std::string_view> font;
93 std::optional<double> font_size;
95 std::optional<color_t> color;
97 std::optional<bool> bold;
99 std::optional<bool> italic;
101 std::optional<bool> superscript;
103 std::optional<bool> subscript;
106 underline_t underline;
107
108 format_run_t();
109 format_run_t(const format_run_t& other);
111
112 format_run_t& operator=(const format_run_t& other);
113
117 void reset();
118
124 bool formatted() const;
125};
126
128using format_runs_t = std::vector<format_run_t>;
129
130}} // namespace orcus::spreadsheet
131
132/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition document_types.hpp:21
Definition document_types.hpp:85
strikethrough_t strikethrough
Definition document_types.hpp:105
std::optional< bool > italic
Definition document_types.hpp:99
std::optional< bool > subscript
Definition document_types.hpp:103
std::optional< std::string_view > font
Definition document_types.hpp:91
std::optional< double > font_size
Definition document_types.hpp:93
std::optional< color_t > color
Definition document_types.hpp:95
std::optional< bool > superscript
Definition document_types.hpp:101
std::optional< bool > bold
Definition document_types.hpp:97
Definition document_types.hpp:38
Definition document_types.hpp:59