1 // Copyright (c) 2014-2020 Thomas Fussell
2 //
3 // Permission is hereby granted, free of charge, to any person obtaining a copy
4 // of this software and associated documentation files (the "Software"), to deal
5 // in the Software without restriction, including without limitation the rights
6 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 // copies of the Software, and to permit persons to whom the Software is
8 // furnished to do so, subject to the following conditions:
9 //
10 // The above copyright notice and this permission notice shall be included in
11 // all copies or substantial portions of the Software.
12 //
13 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, WRISING FROM,
18 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 // THE SOFTWARE
20 //
21 // @license: http://www.opensource.org/licenses/mit-license.php
22 // @author: see AUTHORS file
23 
24 #pragma once
25 
26 #include <string>
27 
28 #include <xlnt/xlnt_config.hpp>
29 #include <xlnt/cell/cell_reference.hpp>
30 #include <xlnt/utils/optional.hpp>
31 
32 namespace xlnt {
33 
34 struct XLNT_API sheet_pr
35 {
36     /// <summary>
37     /// is horizontally synced to the anchor point
38     /// </summary>
39     optional<bool> sync_horizontal;
40 
41     /// <summary>
42     /// is vertically synced to the anchor point
43     /// </summary>
44     optional<bool> sync_vertical;
45 
46     /// <summary>
47     /// Anchor point for worksheet's window
48     /// </summary>
49     optional<cell_reference> sync_ref;
50 
51     /// <summary>
52     /// Lotus compatibility option
53     /// </summary>
54     optional<bool> transition_evaluation;
55 
56     /// <summary>
57     /// Lotus compatibility option
58     /// </summary>
59     optional<bool> transition_entry;
60 
61     /// <summary>
62     /// worksheet is published
63     /// </summary>
64     optional<bool> published;
65 
66     /// <summary>
67     /// stable name of the sheet
68     /// </summary>
69     optional<std::string> code_name;
70 
71     /// <summary>
72     /// worksheet has one or more autofilters or advanced filters on
73     /// </summary>
74     optional<bool> filter_mode;
75 
76     /// <summary>
77     /// whether the conditional formatting calculations shall be evaluated
78     /// </summary>
79     optional<bool> enable_format_condition_calculation;
80 };
81 
operator ==(const sheet_pr & lhs,const sheet_pr & rhs)82 inline bool operator==(const sheet_pr &lhs, const sheet_pr &rhs)
83 {
84     return lhs.sync_horizontal == rhs.sync_horizontal
85         && lhs.sync_vertical == rhs.sync_vertical
86         && lhs.sync_ref == rhs.sync_ref
87         && lhs.transition_evaluation == rhs.transition_evaluation
88         && lhs.transition_entry == rhs.transition_entry
89         && lhs.published == rhs.published
90         && lhs.code_name == rhs.code_name
91         && lhs.filter_mode == rhs.filter_mode
92         && lhs.enable_format_condition_calculation == rhs.enable_format_condition_calculation;
93 }
94 } // namespace xlnt
95