xlnt
|
Describes a style which has a name and can be applied to multiple individual formats. In Excel this is a "Cell Style". More...
#include <style.hpp>
Public Member Functions | |
style ()=delete | |
Delete zero-argument constructor More... | |
style (const style &other)=default | |
Default copy constructor. Constructs a style using the same PIMPL as other. More... | |
std::string | name () const |
Returns the name of this style. More... | |
style | name (const std::string &name) |
Sets the name of this style to name. More... | |
bool | hidden () const |
Returns true if this style is hidden. More... | |
style | hidden (bool value) |
Sets the hidden state of this style to value. A hidden style will not be shown in the list of selectable styles in the UI, but will still apply its formatting to cells using it. More... | |
bool | custom_builtin () const |
Returns true if this is a builtin style that has been customized and should therefore be persisted in the workbook. More... | |
std::size_t | builtin_id () const |
Returns the index of the builtin style that this style is an instance of or is a customized version thereof. If style::builtin() is false, this will throw an invalid_attribute exception. More... | |
bool | builtin () const |
Returns true if this is a builtin style. More... | |
class alignment | alignment () const |
Returns the alignment of this style. More... | |
bool | alignment_applied () const |
Returns true if the alignment of this style should be applied to cells using it. More... | |
style | alignment (const xlnt::alignment &new_alignment, optional< bool > applied={}) |
Sets the alignment of this style to new_alignment. Applied, which defaults to true, determines whether the alignment should be enabled for cells using this style. More... | |
class border | border () const |
Returns the border of this style. More... | |
bool | border_applied () const |
Returns true if the border set for this style should be applied to cells using the style. More... | |
style | border (const xlnt::border &new_border, optional< bool > applied={}) |
Sets the border of this style to new_border. Applied, which defaults to true, determines whether the border should be enabled for cells using this style. More... | |
class fill | fill () const |
Returns the fill of this style. More... | |
bool | fill_applied () const |
Returns true if the fill set for this style should be applied to cells using the style. More... | |
style | fill (const xlnt::fill &new_fill, optional< bool > applied={}) |
Sets the fill of this style to new_fill. Applied, which defaults to true, determines whether the border should be enabled for cells using this style. More... | |
class font | font () const |
Returns the font of this style. More... | |
bool | font_applied () const |
Returns true if the font set for this style should be applied to cells using the style. More... | |
style | font (const xlnt::font &new_font, optional< bool > applied={}) |
Sets the font of this style to new_font. Applied, which defaults to true, determines whether the font should be enabled for cells using this style. More... | |
class number_format | number_format () const |
Returns the number_format of this style. More... | |
bool | number_format_applied () const |
Returns true if the number_format set for this style should be applied to cells using the style. More... | |
style | number_format (const xlnt::number_format &new_number_format, optional< bool > applied={}) |
Sets the number format of this style to new_number_format. Applied, which defaults to true, determines whether the number format should be enabled for cells using this style. More... | |
class protection | protection () const |
Returns the protection of this style. More... | |
bool | protection_applied () const |
Returns true if the protection set for this style should be applied to cells using the style. More... | |
style | protection (const xlnt::protection &new_protection, optional< bool > applied={}) |
Sets the border of this style to new_protection. Applied, which defaults to true, determines whether the protection should be enabled for cells using this style. More... | |
bool | pivot_button () const |
Returns true if the pivot table interface is enabled for this style. More... | |
void | pivot_button (bool show) |
If show is true, a pivot table interface will be displayed for cells using this style. More... | |
bool | quote_prefix () const |
Returns true if this style should add a single-quote prefix for all text values. More... | |
void | quote_prefix (bool quote) |
If quote is true, enables a single-quote prefix for all text values in cells using this style (e.g. "abc" will appear as "'abc"). The text will also not be stored in sharedStrings when this is enabled. More... | |
bool | operator== (const style &other) const |
Returns true if this style is equivalent to other. More... | |
bool | operator!= (const style &other) const |
Returns true if this style is not equivalent to other. More... | |
Friends | |
struct | detail::stylesheet |
class | detail::xlsx_consumer |
Describes a style which has a name and can be applied to multiple individual formats. In Excel this is a "Cell Style".
|
delete |
Delete zero-argument constructor
|
default |
Default copy constructor. Constructs a style using the same PIMPL as other.
class alignment xlnt::style::alignment | ( | ) | const |
Returns the alignment of this style.
style xlnt::style::alignment | ( | const xlnt::alignment & | new_alignment, |
optional< bool > | applied = {} |
||
) |
Sets the alignment of this style to new_alignment. Applied, which defaults to true, determines whether the alignment should be enabled for cells using this style.
bool xlnt::style::alignment_applied | ( | ) | const |
Returns true if the alignment of this style should be applied to cells using it.
class border xlnt::style::border | ( | ) | const |
Returns the border of this style.
style xlnt::style::border | ( | const xlnt::border & | new_border, |
optional< bool > | applied = {} |
||
) |
Sets the border of this style to new_border. Applied, which defaults to true, determines whether the border should be enabled for cells using this style.
bool xlnt::style::border_applied | ( | ) | const |
Returns true if the border set for this style should be applied to cells using the style.
bool xlnt::style::builtin | ( | ) | const |
Returns true if this is a builtin style.
std::size_t xlnt::style::builtin_id | ( | ) | const |
Returns the index of the builtin style that this style is an instance of or is a customized version thereof. If style::builtin() is false, this will throw an invalid_attribute exception.
bool xlnt::style::custom_builtin | ( | ) | const |
Returns true if this is a builtin style that has been customized and should therefore be persisted in the workbook.
class fill xlnt::style::fill | ( | ) | const |
Returns the fill of this style.
style xlnt::style::fill | ( | const xlnt::fill & | new_fill, |
optional< bool > | applied = {} |
||
) |
Sets the fill of this style to new_fill. Applied, which defaults to true, determines whether the border should be enabled for cells using this style.
bool xlnt::style::fill_applied | ( | ) | const |
Returns true if the fill set for this style should be applied to cells using the style.
class font xlnt::style::font | ( | ) | const |
Returns the font of this style.
style xlnt::style::font | ( | const xlnt::font & | new_font, |
optional< bool > | applied = {} |
||
) |
Sets the font of this style to new_font. Applied, which defaults to true, determines whether the font should be enabled for cells using this style.
bool xlnt::style::font_applied | ( | ) | const |
Returns true if the font set for this style should be applied to cells using the style.
bool xlnt::style::hidden | ( | ) | const |
Returns true if this style is hidden.
style xlnt::style::hidden | ( | bool | value | ) |
Sets the hidden state of this style to value. A hidden style will not be shown in the list of selectable styles in the UI, but will still apply its formatting to cells using it.
std::string xlnt::style::name | ( | ) | const |
Returns the name of this style.
style xlnt::style::name | ( | const std::string & | name | ) |
Sets the name of this style to name.
class number_format xlnt::style::number_format | ( | ) | const |
Returns the number_format of this style.
style xlnt::style::number_format | ( | const xlnt::number_format & | new_number_format, |
optional< bool > | applied = {} |
||
) |
Sets the number format of this style to new_number_format. Applied, which defaults to true, determines whether the number format should be enabled for cells using this style.
bool xlnt::style::number_format_applied | ( | ) | const |
Returns true if the number_format set for this style should be applied to cells using the style.
bool xlnt::style::operator!= | ( | const style & | other | ) | const |
Returns true if this style is not equivalent to other.
bool xlnt::style::operator== | ( | const style & | other | ) | const |
Returns true if this style is equivalent to other.
bool xlnt::style::pivot_button | ( | ) | const |
Returns true if the pivot table interface is enabled for this style.
void xlnt::style::pivot_button | ( | bool | show | ) |
If show is true, a pivot table interface will be displayed for cells using this style.
class protection xlnt::style::protection | ( | ) | const |
Returns the protection of this style.
style xlnt::style::protection | ( | const xlnt::protection & | new_protection, |
optional< bool > | applied = {} |
||
) |
Sets the border of this style to new_protection. Applied, which defaults to true, determines whether the protection should be enabled for cells using this style.
bool xlnt::style::protection_applied | ( | ) | const |
Returns true if the protection set for this style should be applied to cells using the style.
bool xlnt::style::quote_prefix | ( | ) | const |
Returns true if this style should add a single-quote prefix for all text values.
void xlnt::style::quote_prefix | ( | bool | quote | ) |
If quote is true, enables a single-quote prefix for all text values in cells using this style (e.g. "abc" will appear as "'abc"). The text will also not be stored in sharedStrings when this is enabled.