xlnt
workbook_view.hpp
1 // Copyright (c) 2014-2022 Thomas Fussell
2 // Copyright (c) 2024 xlnt-community
3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a copy
5 // of this software and associated documentation files (the "Software"), to deal
6 // in the Software without restriction, including without limitation the rights
7 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 // copies of the Software, and to permit persons to whom the Software is
9 // furnished to do so, subject to the following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included in
12 // all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 // THE SOFTWARE
21 //
22 // @license: http://www.opensource.org/licenses/mit-license.php
23 // @author: see AUTHORS file
24 #pragma once
25 
26 #include <cstddef>
27 
28 #include <xlnt/xlnt_config.hpp>
29 #include <xlnt/utils/optional.hpp>
30 
31 namespace xlnt {
32 
37 class XLNT_API workbook_view
38 {
39 public:
43  bool auto_filter_date_grouping = true;
44 
48  bool minimized = false;
49 
53  bool show_horizontal_scroll = true;
54 
58  bool show_sheet_tabs = true;
59 
63  bool show_vertical_scroll = true;
64 
68  bool visible = true;
69 
74 
79 
84 
89 
94 
99 
104 };
105 
106 inline bool operator==(const workbook_view &lhs, const workbook_view &rhs)
107 {
108  return lhs.active_tab == rhs.active_tab
110  && lhs.first_sheet == rhs.first_sheet
111  && lhs.minimized == rhs.minimized
113  && lhs.show_sheet_tabs == rhs.show_sheet_tabs
115  && lhs.tab_ratio == rhs.tab_ratio
116  && lhs.visible == rhs.visible;
117 }
118 
119 } // namespace xlnt
optional< std::size_t > active_tab
The optional index to the active sheet in this view.
Definition: workbook_view.hpp:73
optional< int > y_window
The distance of the workbook window from the top of the screen in twips.
Definition: workbook_view.hpp:103
bool visible
If true, the workbook window will be visible.
Definition: workbook_view.hpp:68
bool show_vertical_scroll
If true, the vertical scroll bar will be displayed.
Definition: workbook_view.hpp:63
A workbook can be opened in multiple windows with different views. This class represents a particular...
Definition: workbook_view.hpp:37
Enumerates the possible types a cell can be determined by it&#39;s current value.
Definition: cell.hpp:37
bool show_horizontal_scroll
If true, the horizontal scroll bar will be displayed.
Definition: workbook_view.hpp:53
bool operator==(std::nullptr_t, const cell &cell)
Returns true if this cell is uninitialized.
bool minimized
If true, the view will be minimized.
Definition: workbook_view.hpp:48
bool auto_filter_date_grouping
If true, dates will be grouped when presenting the user with filtering options.
Definition: workbook_view.hpp:43
optional< int > x_window
The distance of the workbook window from the left side of the screen in twips.
Definition: workbook_view.hpp:98
bool show_sheet_tabs
If true, the sheet tabs will be displayed.
Definition: workbook_view.hpp:58
optional< std::size_t > window_height
The height of the workbook window in twips.
Definition: workbook_view.hpp:93
optional< std::size_t > window_width
The width of the workbook window in twips.
Definition: workbook_view.hpp:88
optional< std::size_t > tab_ratio
The optional ratio between the tabs bar and the horizontal scroll bar.
Definition: workbook_view.hpp:83
optional< std::size_t > first_sheet
The optional index to the first sheet in this view.
Definition: workbook_view.hpp:78