import_sheet
Defined in header: <orcus/spreadsheet/import_interface.hpp>
-
class import_sheet
Interface for importing the content and properties of a sheet.
Public Functions
-
virtual ~import_sheet()
-
virtual import_sheet_view *get_sheet_view()
Get an optional interface for importing properties that are specific to a view of a sheet.
- Returns:
pointer to the interface for importing view properties, or a
nullptrif the implementor doesn’t support it.
-
virtual import_sheet_properties *get_sheet_properties()
Get an optional interface for importing sheet properties.
- Returns:
pointer to the interface for importing sheet properties, or a
nullptrif the implementor doesn’t support it.
-
virtual import_data_table *get_data_table()
Get an optional interface for importing data tables. Note that the implementer may decide not to support this feature in which case this method should return a
nullptr.The implementor should initialize the internal state of the temporary data table object when this method is called.
- Returns:
pointer to the data table interface object, or a
nullptrif the implementor doesn’t support it.
-
virtual import_auto_filter *start_auto_filter(const range_t &range)
Get an optional interface for importing auto filter data.
The implementor should initialize the internal buffer to store the auto filter data when this method is called.
- Parameters:
range – Filtered range.
- Returns:
Pointer to an auto filter interface object, or a
nullptrif the implementor doesn’t support it.
-
virtual import_table *start_table()
Get an interface for importing tables.
The implementor should initialize the internal state of the temporary table object when this method is called.
- Returns:
pointer to a table interface object, or
nullptrif the implementer doesn’t support importing of tables.
-
virtual import_conditional_format *get_conditional_format()
Get an optional interface for importing conditional formats.
- Returns:
pointer to the conditional format interface object, or
nullptrif the implementer doesn’t support importing conditional formats.
-
virtual import_named_expression *get_named_expression()
Get an optional interface for importing sheet-local named expressions.
- Returns:
pointer to the sheet-local named expression interface, or a
nullptrif the implementor doesn’t support it.
-
virtual import_array_formula *get_array_formula()
Get an optional interface for importing array formulas. An array formula is a formula expression applied to a range of cells where each cell may have a different result value.
- Returns:
pointer to the array formula import interface, or a
nullptrif the implementor doesn’t support it.
-
virtual import_formula *get_formula()
Get an optional interface for importing formula cells.
- Returns:
pointer to the formula interface object, or a
nullptrif the implementer doesn’t support importing of formula cells.
-
virtual void set_auto(row_t row, col_t col, std::string_view s) = 0
Set raw string value to a cell and have the implementation auto-recognize its data type.
- Parameters:
row – row ID
col – column ID
s – raw string value.
-
virtual void set_string(row_t row, col_t col, string_id_t sindex) = 0
Set string value to a cell.
- Parameters:
row – row ID
col – column ID
sindex – 0-based string index in the shared string table.
-
virtual void set_string(row_t row, col_t col, std::string_view s)
Set string value to a cell when string is not in the pool.
Used in cases when parser cannot quarentee that string pools indexes and in document references are consistent if pushed to pool.
Implementing this allowed document backend to handle these best way possible but primarily strings are pushed to the string pool.
- Parameters:
row – row ID @oaram col column ID
s – inline string found while parsing.
-
virtual void set_value(row_t row, col_t col, double value) = 0
Set numerical value to a cell.
- Parameters:
row – row ID
col – column ID
value – value being assigned to the cell.
-
virtual void set_bool(row_t row, col_t col, bool value) = 0
Set a boolean value to a cell.
- Parameters:
row – row ID
col – col ID
value – boolean value being assigned to the cell
-
virtual void set_date_time(row_t row, col_t col, int year, int month, int day, int hour, int minute, double second) = 0
Set date and time value to a cell.
- Parameters:
row – row ID
col – column ID
year – 1-based value representing year
month – 1-based value representing month, varying from 1 through 12.
day – 1-based value representing day, varying from 1 through 31.
hour – the hour of a day, ranging from 0 through 23.
minute – the minute of an hour, ranging from 0 through 59.
second – the second of a minute, ranging from 0 through 59.
-
virtual void set_format(row_t row, col_t col, size_t xf_index) = 0
Set cell format to specified cell. The cell format is referred to by the xf (cell format) index in the styles table.
Note
This method gets called after both set_column_format() and set_row_format().
- Parameters:
row – row ID
col – column ID
xf_index – 0-based xf (cell format) index
-
virtual void set_format(row_t row_start, col_t col_start, row_t row_end, col_t col_end, size_t xf_index) = 0
Set cell format to specified cell range. The cell format is referred to by the xf (cell format) index in the styles table.
- Parameters:
row_start – start row ID
col_start – start column ID
row_end – end row ID
col_end – end column ID
xf_index – 0-based xf (cell format) index
-
virtual void set_column_format(col_t col, col_t col_span, std::size_t xf_index) = 0
Set cell format to a specified column. The cell format is referred to by the xf (cell format) index in the styles table.
Note
This method gets called first before set_row_format() or set_format() variants.
- Parameters:
col – column ID
col_span – number of contiguous columns to apply the format to. It must be at least one.
xf_index – 0-based xf (cell format) index
-
virtual void set_row_format(row_t row, std::size_t xf_index) = 0
Set cell format to a specified row. The cell format is referred to by the xf (cell format) index in the styles table.
Note
This method gets called after set_column_format() but before set_format().
- Parameters:
row – row ID
xf_index – 0-based xf (cell format) index
-
virtual void fill_down_cells(row_t src_row, col_t src_col, row_t range_size) = 0
Duplicate the value of the source cell to one or more cells located immediately below it.
- Parameters:
src_row – row ID of the source cell
src_col – column ID of the source cell
range_size – number of cells below the source cell to copy the source cell value to. It must be at least one.
-
virtual range_size_t get_sheet_size() const = 0
Get the maximum dimension of a sheet.
Note
The implementer should return a fixed dimension that does not change at least during import. All sheets belonging to the same document should have the same maximum dimension.
- Returns:
Structure containing the maximum numbers of rows and columns in a sheet.
-
virtual ~import_sheet()