xlnt
pane.hpp
1 // Copyright (c) 2014-2022 Thomas Fussell
2 // Copyright (c) 2010-2015 openpyxl
3 // Copyright (c) 2024-2025 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 #include <xlnt/utils/optional.hpp>
32 
33 namespace xlnt {
34 
38 enum class pane_state
39 {
40  frozen,
41  frozen_split,
42  split
43 };
44 
48 enum class pane_corner
49 {
50  top_left,
51  top_right,
52  bottom_left,
53  bottom_right
54 };
55 
59 struct XLNT_API pane
60 {
65 
69  pane_state state = pane_state::split;
70 
74  pane_corner active_pane = pane_corner::top_left;
75 
79  row_t y_split = 1;
80 
84  column_t x_split = 1;
85 
90  bool operator==(const pane &rhs) const
91  {
92  return top_left_cell == rhs.top_left_cell
93  && state == rhs.state
94  && active_pane == rhs.active_pane
95  && y_split == rhs.y_split
96  && x_split == rhs.x_split;
97  }
98 };
99 
100 } // 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:69
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:79
optional< cell_reference > top_left_cell
The optional top left cell
Definition: pane.hpp:64
pane_corner active_pane
The pane which contains the active cell
Definition: pane.hpp:74
A fixed portion of a worksheet.
Definition: pane.hpp:59
pane_corner
Enumeration of the four quadrants of a worksheet
Definition: pane.hpp:48
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:90
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:38
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:84