28 #include <xlnt/xlnt_config.hpp> 29 #include <xlnt/utils/optional.hpp> 30 #include <xlnt/worksheet/pane.hpp> 31 #include <xlnt/worksheet/selection.hpp> 55 void id(std::size_t new_id)
63 std::size_t
id()
const 73 return pane_.is_set();
113 return !selections_.empty();
121 selections_.push_back(new_selection);
145 return selections_.at(index);
153 show_grid_lines_ = show;
161 return show_grid_lines_;
169 default_grid_color_ = is_default;
177 return default_grid_color_;
201 return top_left_cell_.is_set();
209 top_left_cell_.set(ref);
217 return top_left_cell_.get();
226 return id_ == rhs.id_
227 && show_grid_lines_ == rhs.show_grid_lines_
228 && default_grid_color_ == rhs.default_grid_color_
229 && pane_ == rhs.pane_
230 && selections_ == rhs.selections_
231 && top_left_cell_ == rhs.top_left_cell_;
243 bool show_grid_lines_ =
true;
248 bool default_grid_color_ =
true;
268 std::vector<xlnt::selection> selections_;
void clear_selections()
Removes all selections.
Definition: sheet_view.hpp:127
void top_left_cell(const cell_reference &ref)
Sets the top left cell of this view.
Definition: sheet_view.hpp:207
bool show_grid_lines() const
Returns true if grid lines will be shown for sheets using this view.
Definition: sheet_view.hpp:159
class xlnt::selection & selection(std::size_t index)
Returns the selection at the given index.
Definition: sheet_view.hpp:143
struct pane & pane()
Returns a reference to this view's pane.
Definition: sheet_view.hpp:79
std::size_t id() const
Returns the ID of this view.
Definition: sheet_view.hpp:63
void add_selection(const class selection &new_selection)
Adds the given selection to the collection of selections.
Definition: sheet_view.hpp:119
bool has_top_left_cell() const
has a top left cell?
Definition: sheet_view.hpp:199
void pane(const struct pane &new_pane)
Sets the pane of this view to new_pane.
Definition: sheet_view.hpp:103
cell_reference top_left_cell() const
Returns the top left cell of this view.
Definition: sheet_view.hpp:215
sheet_view_type type() const
Returns the type of this view.
Definition: sheet_view.hpp:191
The selected area of a worksheet.
Definition: selection.hpp:37
Enumerates the possible types a cell can be determined by it's current value.
Definition: cell.hpp:37
void show_grid_lines(bool show)
If show is true, grid lines will be shown for sheets using this view.
Definition: sheet_view.hpp:151
sheet_view_type
Enumeration of possible types of sheet views
Definition: sheet_view.hpp:38
bool has_selections() const
Returns true if this view has any selections.
Definition: sheet_view.hpp:111
bool operator==(const sheet_view &rhs) const
Returns true if this view is equal to rhs based on its id, grid lines setting, default grid color...
Definition: sheet_view.hpp:224
An object used to refer to a cell. References have two parts, the column and the row. In Excel, the reference string A1 refers to the top-left-most cell. A cell_reference can be initialized from a string of this form or a 1-indexed ordered pair of the form column, row.
Definition: cell_reference.hpp:60
std::vector< xlnt::selection > selections() const
Returns the collection of selections as a vector.
Definition: sheet_view.hpp:135
Describes a view of a worksheet. Worksheets can have multiple views which show the data differently...
Definition: sheet_view.hpp:49
void default_grid_color(bool is_default)
If is_default is true, the default grid color will be used.
Definition: sheet_view.hpp:167
bool has_pane() const
Returns true if this view has a pane defined.
Definition: sheet_view.hpp:71
void type(sheet_view_type new_type)
Sets the type of this view.
Definition: sheet_view.hpp:183
A fixed portion of a worksheet.
Definition: pane.hpp:58
void clear_pane()
Removes the defined pane from this view.
Definition: sheet_view.hpp:95
void id(std::size_t new_id)
Sets the ID of this view to new_id.
Definition: sheet_view.hpp:55
const struct pane & pane() const
Returns a reference to this view's pane.
Definition: sheet_view.hpp:87
bool default_grid_color() const
Returns true if the default grid color will be used.
Definition: sheet_view.hpp:175