xlnt
pane.hpp
1 // Copyright (c) 2014-2022 Thomas Fussell
2 // Copyright (c) 2010-2015 openpyxl
3 // Copyright (c) 2024 xlnt-community
4 //
5 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 // of this software and associated documentation files (the "Software"), to deal
7 // in the Software without restriction, including without limitation the rights
8 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 // copies of the Software, and to permit persons to whom the Software is
10 // furnished to do so, subject to the following conditions:
11 //
12 // The above copyright notice and this permission notice shall be included in
13 // all copies or substantial portions of the Software.
14 //
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 // THE SOFTWARE
22 //
23 // @license: http://www.opensource.org/licenses/mit-license.php
24 // @author: see AUTHORS file
25 
26 #pragma once
27 
28 #include <xlnt/xlnt_config.hpp>
29 #include <xlnt/cell/cell_reference.hpp>
30 #include <xlnt/cell/index_types.hpp>
31 
32 namespace xlnt {
33 
37 enum class XLNT_API pane_state
38 {
39  frozen,
40  frozen_split,
41  split
42 };
43 
47 enum class XLNT_API pane_corner
48 {
49  top_left,
50  top_right,
51  bottom_left,
52  bottom_right
53 };
54 
58 struct XLNT_API pane
59 {
64 
68  pane_state state = pane_state::split;
69 
73  pane_corner active_pane = pane_corner::top_left;
74 
78  row_t y_split = 1;
79 
83  column_t x_split = 1;
84 
89  bool operator==(const pane &rhs) const
90  {
91  return top_left_cell == rhs.top_left_cell
92  && state == rhs.state
93  && active_pane == rhs.active_pane
94  && y_split == rhs.y_split
95  && x_split == rhs.x_split;
96  }
97 };
98 
99 } // namespace xlnt
std::uint32_t row_t
All rows should be referred to by an instance of this type.
Definition: index_types.hpp:41
pane_state state
The state of the pane
Definition: pane.hpp:68
Enumerates the possible types a cell can be determined by it&#39;s current value.
Definition: cell.hpp:37
row_t y_split
The row where the split should take place
Definition: pane.hpp:78
optional< cell_reference > top_left_cell
The optional top left cell
Definition: pane.hpp:63
pane_corner active_pane
The pane which contains the active cell
Definition: pane.hpp:73
A fixed portion of a worksheet.
Definition: pane.hpp:58
pane_corner
Enumeration of the four quadrants of a worksheet
Definition: pane.hpp:47
bool operator==(const pane &rhs) const
Returns true if this pane is equal to rhs based on its top-left cell, state, active pane...
Definition: pane.hpp:89
Many settings in xlnt are allowed to not have a value set. This class encapsulates a value which may ...
Definition: format.hpp:44
pane_state
Enumeration of possible states of a pane
Definition: pane.hpp:37
Columns can be referred to as a string A,B,...Z,AA,AB,..,ZZ,AAA,...,ZZZ or as a 1-indexed index...
Definition: index_types.hpp:48
column_t x_split
The column where the split should take place
Definition: pane.hpp:83