Orcus
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 
13 namespace orcus { namespace spreadsheet {
14 
19 struct ORCUS_SPM_DLLPUBLIC color_t
20 {
21  color_elem_t alpha;
22  color_elem_t red;
23  color_elem_t green;
24  color_elem_t blue;
25 
26  color_t();
27  color_t(color_elem_t _red, color_elem_t _green, color_elem_t _blue);
28  color_t(color_elem_t _alpha, color_elem_t _red, color_elem_t _green, color_elem_t _blue);
29 
30  void reset();
31 
32  bool operator==(const color_t& other) const;
33  bool operator!=(const color_t& other) const;
34 };
35 
40 struct ORCUS_SPM_DLLPUBLIC format_run
41 {
43  std::size_t pos;
45  std::size_t size;
47  std::string_view font;
49  double font_size;
53  bool bold:1;
55  bool italic:1;
56 
57  format_run();
58 
62  void reset();
63 
69  bool formatted() const;
70 };
71 
73 using format_runs_t = std::vector<format_run>;
74 
75 }} // namespace orcus::spreadsheet
76 
77 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: document_types.hpp:20
Definition: document_types.hpp:41
bool italic
Definition: document_types.hpp:55
std::string_view font
Definition: document_types.hpp:47
color_t color
Definition: document_types.hpp:51
std::size_t size
Definition: document_types.hpp:45
double font_size
Definition: document_types.hpp:49
bool bold
Definition: document_types.hpp:53
std::size_t pos
Definition: document_types.hpp:43