Orcus
Public Member Functions | Friends | List of all members
orcus::spreadsheet::sheet Class Reference

#include <sheet.hpp>

Inheritance diagram for orcus::spreadsheet::sheet:
orcus::spreadsheet::iface::import_sheet orcus::spreadsheet::iface::export_sheet

Public Member Functions

 sheet (document &doc, sheet_t sheet_index, row_t row_size, col_t col_size)
 
virtual iface::import_sheet_propertiesget_sheet_properties ()
 
virtual iface::import_data_tableget_data_table ()
 
virtual iface::import_tableget_table ()
 
virtual iface::import_auto_filterget_auto_filter ()
 
virtual void set_auto (row_t row, col_t col, const char *p, size_t n)
 
virtual void set_string (row_t row, col_t col, size_t sindex)
 
virtual void set_value (row_t row, col_t col, double value)
 
virtual void set_bool (row_t row, col_t col, bool value)
 
virtual void set_date_time (row_t row, col_t col, int year, int month, int day, int hour, int minute, double second)
 
virtual void set_format (row_t row, col_t col, size_t index)
 
virtual void set_format (row_t row_start, col_t col_start, row_t row_end, col_t col_end, size_t index)
 
virtual void set_formula (row_t row, col_t col, formula_grammar_t grammar, const char *p, size_t n)
 
virtual void set_shared_formula (row_t row, col_t col, formula_grammar_t grammar, size_t sindex, const char *p_formula, size_t n_formula, const char *p_range, size_t n_range)
 
virtual void set_shared_formula (row_t row, col_t col, formula_grammar_t grammar, size_t sindex, const char *p_formula, size_t n_formula)
 
virtual void set_shared_formula (row_t row, col_t col, size_t sindex)
 
virtual void set_formula_result (row_t row, col_t col, double value)
 
virtual void set_formula_result (row_t row, col_t col, const char *p, size_t n)
 
virtual void set_array_formula (row_t, col_t, formula_grammar_t, const char *, size_t, row_t, col_t)
 
virtual void set_array_formula (row_t, col_t, formula_grammar_t, const char *, size_t, const char *, size_t)
 
virtual void write_string (std::ostream &os, row_t row, col_t col) const
 
void set_col_width (col_t col, col_width_t width)
 
col_width_t get_col_width (col_t col, col_t *col_start, col_t *col_end) const
 
void set_col_hidden (col_t col, bool hidden)
 
void set_row_height (row_t row, row_height_t height)
 
row_height_t get_row_height (row_t row, row_t *row_start, row_t *row_end) const
 
void set_row_hidden (row_t row, bool hidden)
 
void set_merge_cell_range (const char *p_ref, size_t p_ref_len)
 
size_t get_string_identifier (row_t row, col_t col) const
 
auto_filter_tget_auto_filter_data ()
 
const auto_filter_tget_auto_filter_data () const
 
void set_auto_filter_data (auto_filter_t *p)
 
row_t row_size () const
 
col_t col_size () const
 
sheet_t get_index () const
 
void finalize ()
 
void dump_flat (std::ostream &os) const
 
void dump_check (std::ostream &os, const pstring &sheet_name) const
 
void dump_html (const ::std::string &filepath) const
 
size_t get_cell_format (row_t row, col_t col) const
 
- Public Member Functions inherited from orcus::spreadsheet::iface::import_sheet
virtual import_conditional_formatget_conditional_format ()
 

Friends

struct sheet_impl
 

Detailed Description

This class represents a single sheet instance in the internal document model.

Member Function Documentation

virtual iface::import_auto_filter* orcus::spreadsheet::sheet::get_auto_filter ( )
virtual

Get an interface for importing auto filter ranges.

The implementor should also initialize the internal state of the temporary auto filter object when this method is called.

Returns
pointer to the auto filter interface object.

Reimplemented from orcus::spreadsheet::iface::import_sheet.

size_t orcus::spreadsheet::sheet::get_cell_format ( row_t  row,
col_t  col 
) const

Get the cell format ID of specified cell.

virtual iface::import_data_table* orcus::spreadsheet::sheet::get_data_table ( )
virtual

Get an interface for importing data tables. Note that the implementer may decide not to support this feature in which case this method returns NULL. The implementer is responsible for managing the life cycle of the returned interface object.

The implementor should also initialize the internal state of the temporary data table object when this method is called.

Returns
pointer to the data table interface object.

Reimplemented from orcus::spreadsheet::iface::import_sheet.

virtual iface::import_table* orcus::spreadsheet::sheet::get_table ( )
virtual

Get an interface for importing tables. The implementer is responsible for managing the life cycle of the returned interface object.

The implementor should also initialize the internal state of the temporary table object when this method is called.

Returns
pointer to the table interface object, or NULL if the implementer doesn't support importing of tables.

Reimplemented from orcus::spreadsheet::iface::import_sheet.

virtual void orcus::spreadsheet::sheet::set_array_formula ( row_t  row,
col_t  col,
formula_grammar_t  grammar,
const char *  p,
size_t  n,
row_t  array_rows,
col_t  array_cols 
)
virtual

Set a array formula to the specified cells. The formula covers an area specified by array_rows and array_cols beginning from the base cell.

Parameters
rowrow ID
colcolumn ID
grammargrammar used in the formula expression
ppointer to the first character of the raw formula expression string.
nsize of the raw formula expression string
array_rowsnumber of rows the array formula covers
array_colsnumber of columns the array formula covers

Implements orcus::spreadsheet::iface::import_sheet.

virtual void orcus::spreadsheet::sheet::set_array_formula ( row_t  row,
col_t  col,
formula_grammar_t  grammar,
const char *  p,
size_t  n,
const char *  p_range,
size_t  n_range 
)
virtual

Set a array formula to the specified cells. The formula covers an area specified by the range string.

Parameters
rowrow ID
colcolumn ID
grammargrammar used in the formula expression
ppointer to the first character of the raw formula expression string.
nsize of the raw formula expression string
p_rangepointer to the first character of the range string
n_rangeisze of the range string

Implements orcus::spreadsheet::iface::import_sheet.

virtual void orcus::spreadsheet::sheet::set_auto ( row_t  row,
col_t  col,
const char *  p,
size_t  n 
)
virtual

Set raw string value to a cell and have the implementation auto-recognize its data type.

Parameters
rowrow ID
colcolumn ID
ppointer to the first character of the raw string value.
nsize of the raw string value.

Implements orcus::spreadsheet::iface::import_sheet.

virtual void orcus::spreadsheet::sheet::set_bool ( row_t  row,
col_t  col,
bool  value 
)
virtual

Set a boolean value to a cell.

Parameters
rowrow ID
colcol ID
valueboolean value being assigned to the cell

Implements orcus::spreadsheet::iface::import_sheet.

virtual void orcus::spreadsheet::sheet::set_date_time ( row_t  row,
col_t  col,
int  year,
int  month,
int  day,
int  hour,
int  minute,
double  second 
)
virtual

Set date and time value to a cell.

Parameters
rowrow ID
colcolumn ID

Implements orcus::spreadsheet::iface::import_sheet.

virtual void orcus::spreadsheet::sheet::set_format ( row_t  row,
col_t  col,
size_t  xf_index 
)
virtual

Set cell format to specified cell. The cell format is referred to by the xf (cell format) index in the styles table.

Parameters
rowrow ID
colcolumn ID
index0-based xf (cell format) index

Implements orcus::spreadsheet::iface::import_sheet.

virtual void orcus::spreadsheet::sheet::set_format ( row_t  row_start,
col_t  col_start,
row_t  row_end,
col_t  col_end,
size_t  xf_index 
)
virtual

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_startstart row ID
col_startstart column ID
row_endend row ID
col_endend column ID
index0-based xf (cell format) index

Implements orcus::spreadsheet::iface::import_sheet.

virtual void orcus::spreadsheet::sheet::set_formula ( row_t  row,
col_t  col,
formula_grammar_t  grammar,
const char *  p,
size_t  n 
)
virtual

Set normal, non-shared formula expression to specified cell.

Parameters
rowrow ID
colcolumn ID
grammargrammar used in the formula expression
ppointer to the first character of the raw formula expression string.
nsize of the raw formula expression string.

Implements orcus::spreadsheet::iface::import_sheet.

virtual void orcus::spreadsheet::sheet::set_shared_formula ( row_t  row,
col_t  col,
formula_grammar_t  grammar,
size_t  sindex,
const char *  p_formula,
size_t  n_formula,
const char *  p_range,
size_t  n_range 
)
virtual

Set shared formula expression to specified cell. This call also registers the formula expression to a common formula expression pool to allow it to be looked up by the specified index later.

Parameters
rowrow ID
colcolumn ID
grammargrammar used in the formula expression
sindexshared formula index (0-based)
p_formulapointer to the first character of the raw formula expression string.
n_formulasize of the raw formula expression string.
p_rangepointer to the first character of the range string
n_rangesize of the raw range string

Implements orcus::spreadsheet::iface::import_sheet.

virtual void orcus::spreadsheet::sheet::set_shared_formula ( row_t  row,
col_t  col,
formula_grammar_t  grammar,
size_t  sindex,
const char *  p_formula,
size_t  n_formula 
)
virtual

Set shared formula expression to specified cell. This call also registers the formula expression to a common formula expression pool to allow it to be looked up by the specified index later.

Parameters
rowrow ID
colcolumn ID
grammargrammar used in the formula expression
sindexshared formula index (0-based)
p_formulapointer to the first character of the raw formula expression string.
n_formulasize of the raw formula expression string.

Implements orcus::spreadsheet::iface::import_sheet.

virtual void orcus::spreadsheet::sheet::set_shared_formula ( row_t  row,
col_t  col,
size_t  sindex 
)
virtual

Set shared formula to specified cell by shared formula index. The formula expression itself associated with the index must be defined.

Parameters
rowrow ID
colcolumn ID
grammargrammar used in the formula expression
sindexshared formula index (0-based)
ppointer to the first character of the raw formula expression string.
nsize of the raw formula expression string.

Implements orcus::spreadsheet::iface::import_sheet.

virtual void orcus::spreadsheet::sheet::set_string ( row_t  row,
col_t  col,
size_t  sindex 
)
virtual

Set string value to a cell.

Parameters
rowrow ID
colcolumn ID
sindex0-based string index in the shared string table.

Implements orcus::spreadsheet::iface::import_sheet.

virtual void orcus::spreadsheet::sheet::set_value ( row_t  row,
col_t  col,
double  value 
)
virtual

Set numerical value to a cell.

Parameters
rowrow ID
colcolumn ID
valuevalue being assigned to the cell.

Implements orcus::spreadsheet::iface::import_sheet.