31 #include <unordered_map> 34 #include <xlnt/xlnt_config.hpp> 35 #include <xlnt/cell/index_types.hpp> 36 #include <xlnt/packaging/relationship.hpp> 37 #include <xlnt/worksheet/page_margins.hpp> 38 #include <xlnt/worksheet/page_setup.hpp> 39 #include <xlnt/worksheet/sheet_view.hpp> 46 class column_properties;
49 class conditional_format;
50 class const_range_iterator;
55 class range_reference;
58 class sheet_format_properties;
69 struct worksheet_impl;
124 void garbage_collect();
132 std::size_t id()
const;
138 void id(std::size_t
id);
143 std::string title()
const;
148 void title(
const std::string &title);
160 void freeze_panes(
cell top_left_cell);
170 void unfreeze_panes();
175 bool has_frozen_panes()
const;
218 const class
range range(const std::string &reference_string) const;
223 class
range range(const range_reference &reference);
228 const class
range range(const range_reference &reference) const;
236 class
range rows(bool skip_null = true);
244 const class
range rows(bool skip_null = true) const;
252 class
range columns(bool skip_null = true);
260 const class
range columns(bool skip_null = true) const;
271 void clear_cell(const cell_reference &ref);
276 void clear_row(row_t row);
281 void insert_rows(row_t row, std::uint32_t amount);
286 void insert_columns(column_t column, std::uint32_t amount);
291 void delete_rows(row_t row, std::uint32_t amount);
296 void delete_columns(column_t column, std::uint32_t amount);
313 bool has_column_properties(column_t column) const;
318 void add_column_properties(column_t column, const class column_properties &props);
324 double column_width(column_t column) const;
339 bool has_row_properties(row_t row) const;
344 void add_row_properties(row_t row, const class row_properties &props);
350 double row_height(row_t row) const;
364 void create_named_range(const std::string &name, const std::string &reference_string);
369 void create_named_range(const std::string &name, const range_reference &reference);
374 bool has_named_range(const std::string &name) const;
391 void remove_named_range(const std::string &name);
398 row_t lowest_row() const;
403 row_t lowest_row_or_props() const;
408 row_t highest_row() const;
413 row_t highest_row_or_props() const;
418 row_t next_row() const;
428 column_t lowest_column_or_props() const;
438 column_t highest_column_or_props() const;
446 range_reference calculate_dimension(bool skip_null=true, bool skip_row_props=false) const;
453 void merge_cells(const std::string &reference_string);
458 void merge_cells(const range_reference &reference);
463 void unmerge_cells(const std::string &reference_string);
468 void unmerge_cells(const range_reference &reference);
473 std::vector<range_reference> merged_ranges() const;
480 bool operator==(const worksheet &other) const;
485 bool operator!=(const worksheet &other) const;
490 bool operator==(std::nullptr_t) const;
495 bool operator!=(std::nullptr_t) const;
500 void operator=(const worksheet &other);
505 class
cell operator[](const cell_reference &reference);
510 const class
cell operator[](const cell_reference &reference) const;
516 bool compare(const worksheet &other, bool reference) const;
523 bool has_page_setup() const;
533 void
page_setup(const struct page_setup &setup);
538 bool has_page_margins() const;
560 void auto_filter(const std::string &range_string);
565 void auto_filter(const xlnt::range &range);
570 void auto_filter(const range_reference &reference);
575 void clear_auto_filter();
580 bool has_auto_filter() const;
586 void reserve(std::size_t n);
591 bool has_phonetic_properties() const;
601 void phonetic_properties(const phonetic_pr &phonetic_props);
606 bool has_header_footer() const;
616 void
header_footer(const class header_footer &new_header_footer);
661 void print_title_rows(row_t start, row_t end);
666 optional<std::pair<row_t, row_t>> print_title_rows() const;
671 void print_title_cols(column_t start, column_t end);
676 optional<std::pair<column_t, column_t>> print_title_cols() const;
681 bool has_print_titles() const;
686 void clear_print_titles();
691 void print_area(const std::string &print_area);
696 void clear_print_area();
706 bool has_print_area() const;
711 bool has_view() const;
716 sheet_view &view(std::size_t index = 0) const;
721 void add_view(const sheet_view &new_view);
726 void active_cell(const cell_reference &ref);
731 bool has_active_cell() const;
744 void clear_page_breaks();
749 const std::vector<row_t> &page_break_rows() const;
754 void page_break_at_row(row_t row);
759 const std::vector<column_t> &page_break_columns() const;
764 void page_break_at_column(column_t column);
789 void format_properties(const sheet_format_properties &properties);
794 bool has_drawing() const;
800 bool is_empty() const;
807 friend class detail::xlsx_consumer;
808 friend class detail::xlsx_producer;
818 void register_comments_in_manifest();
823 void register_calc_chain_in_manifest();
828 void garbage_collect_formulae();
833 void parent(class workbook &wb);
839 void move_cells(std::uint32_t index, std::uint32_t amount, row_or_col_t row_or_col, bool reverse = false);
844 detail::worksheet_impl *d_;
A range is a 2D collection of cells with defined extens that can be iterated upon.
Definition: range.hpp:55
A const version of range_iterator which does not allow modification to the dereferenced cell_vector...
Definition: range_iterator.hpp:163
Represents an association between a source Package or part, and a target object which can be a part o...
Definition: relationship.hpp:103
std::uint32_t row_t
All rows should be referred to by an instance of this type.
Definition: index_types.hpp:41
Definition: cell_reference.hpp:262
Describes the margins around a worksheet for printing.
Definition: page_margins.hpp:35
Enumerates the possible types a cell can be determined by it's current value.
Definition: cell.hpp:37
The properties of a row in a worksheet.
Definition: row_properties.hpp:35
A worksheet is a 2D array of cells starting with cell A1 in the top-left corner and extending indefin...
Definition: worksheet.hpp:77
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
Describes a unit of data in a worksheet at a specific coordinate and its associated properties...
Definition: cell.hpp:84
sheet_state
Defines how a worksheet appears in the workbook. A workbook must have at least one sheet which is vis...
Definition: page_setup.hpp:75
Describes a view of a worksheet. Worksheets can have multiple views which show the data differently...
Definition: sheet_view.hpp:49
std::reverse_iterator< const_iterator > const_reverse_iterator
Iterate in reverse order over a const worksheet with an iterator of this type.
Definition: worksheet.hpp:98
value is an ISO 8601 formatted date
Encapsulates a path that points to location in a filesystem.
Definition: path.hpp:38
Many settings in xlnt are allowed to not have a value set. This class encapsulates a value which may ...
Definition: format.hpp:44
An iterator used by worksheet and range for traversing a 2D grid of cells by row/column then across t...
Definition: range_iterator.hpp:43
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
A 2D range of cells in a worksheet that is referred to by name. ws->range("A1:B2") could be replaced ...
Definition: named_range.hpp:42
Describes how a worksheet will be converted into a page during printing.
Definition: page_setup.hpp:85
Properties applied to a column in a worksheet. Columns can have a size and a style.
Definition: column_properties.hpp:36
std::reverse_iterator< iterator > reverse_iterator
Iterate in reverse over a non-const worksheet with an iterator of this type.
Definition: worksheet.hpp:93
A range_reference describes a rectangular area of a worksheet with positive width and height defined ...
Definition: range_reference.hpp:36
workbook is the container for all other parts of the document.
Definition: workbook.hpp:92
Phonetic properties Element provides a collection of properties that affect display of East Asian Lan...
Definition: phonetic_pr.hpp:39