import_xf

Defined in header: <orcus/spreadsheet/import_interface_styles.hpp>

class import_xf

This interface is used to import cell format records for direct cell formats, named cell style formats, and differential cell formats.

The following cell format types:

  • font

  • fill

  • border

  • protection

  • number format

use indices to reference their records in their respective record pools.

The horizontal and vertical alignments are specified directly.

Public Functions

virtual ~import_xf()
virtual void set_font(size_t index) = 0

Set the index of the font record, as returned from the import_font_style::commit() method.

Parameters:

index – index of the font record to reference.

virtual void set_fill(size_t index) = 0

Set the index of the fill record, as returned from the import_fill_style::commit() method.

Parameters:

index – index of the fill record to reference.

virtual void set_border(size_t index) = 0

Set the index of the border record, as returned from the import_border_style::commit() method.

Parameters:

index – index of the border record to reference.

virtual void set_protection(size_t index) = 0

Set the index of the cell protection record, as returned from the import_cell_protection::commit() method.

Parameters:

index – index of the cell protection record to reference.

virtual void set_number_format(size_t index) = 0

Set the index of the number format record, as returned from the import_number_format::commit() method.

Parameters:

index – index of the number format record to reference.

virtual void set_style_xf(size_t index) = 0

Set the index into the cell style record to specify a named cell style it uses as its base format in case the cell has an underlying style applied. This can be used for a direct cell format i.e. when the xf category is xf_category_t::cell or for a cell style format i.e. the xf category is xf_category_t::cell_style. In a cell style format, this can be used to reference a parent style.

Parameters:

index – index into the cell style record it uses as its basis.

virtual void set_apply_alignment(bool b) = 0

Set the flag indicating whether or not to apply the alignment attribute.

Note

This is specific to Excel format.

Parameters:

b – flag indicating whether or not to apply the alignment attribute.

virtual void set_horizontal_alignment(hor_alignment_t align) = 0

Set the horizontal alignment of a style.

Parameters:

align – horizontal alignment of a style.

virtual void set_vertical_alignment(ver_alignment_t align) = 0

Set the vertical alignment of a style.

Parameters:

align – vertical alignment of a style.

virtual void set_wrap_text(bool b) = 0

Specify whether or not to wrap text when the text spills over the cell region.

Parameters:

b – whether or not to wrap text when the text spills over the cell region.

virtual void set_shrink_to_fit(bool b) = 0

Specify whether or not to shrink the text within cell until it fits inside the cell.

Parameters:

b – whether or not to shrink the text.

virtual size_t commit() = 0

Commit the cell format in the current buffer to the storage.

Returns:

index of the cell format data in the storage. This index may be passed to the import_cell_style::set_xf() method.