|
xlnt - community edition
|
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. Returns a wrapper pointing to this style. 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. Returns a wrapper pointing to this style. 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 a copy of the alignment of this style. If no alignment has been set (has_alignment() returns false), a default-constructed alignment will be returned. More... | |
| bool | has_alignment () const |
| Returns true if an alignment has been set for 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. Returns a wrapper pointing to this style. More... | |
| class border | border () const |
| Returns a copy of the border of this style. If no border has been set (has_border() returns false), a default-constructed border will be returned. More... | |
| bool | has_border () const |
| Returns true if a border has been set for 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. Returns a wrapper pointing to this style. More... | |
| class fill | fill () const |
| Returns a copy of the fill of this style. If no fill has been set (has_fill() returns false), a default-constructed fill will be returned. More... | |
| bool | has_fill () const |
| Returns true if a fill has been set for 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 a copy of the font of this style. If no font has been set (has_font() returns false), a default-constructed font will be returned. More... | |
| bool | has_font () const |
| Returns true if a font has been set for 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. Returns a wrapper pointing to this style. More... | |
| class number_format | number_format () const |
| Returns a copy of the number_format of this style. If no number format has been set (has_number_format() returns false), a default-constructed number format will be returned. More... | |
| bool | has_number_format () const |
| Returns true if a number format has been set for 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. Returns a wrapper pointing to this style. More... | |
| class protection | protection () const |
| Returns a copy of the protection of this style. If no protection has been set (has_protection() returns false), a default-constructed protection will be returned. More... | |
| bool | has_protection () const |
| Returns true if protection has been set for 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. Returns a wrapper pointing to 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 a copy of the alignment of this style. If no alignment has been set (has_alignment() returns false), a default-constructed alignment will be returned.
| 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. Returns a wrapper pointing to 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 a copy of the border of this style. If no border has been set (has_border() returns false), a default-constructed border will be returned.
| 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. Returns a wrapper pointing to 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 a copy of the fill of this style. If no fill has been set (has_fill() returns false), a default-constructed fill will be returned.
| 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 a copy of the font of this style. If no font has been set (has_font() returns false), a default-constructed font will be returned.
| 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. Returns a wrapper pointing to 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::has_alignment | ( | ) | const |
Returns true if an alignment has been set for this style.
| bool xlnt::style::has_border | ( | ) | const |
Returns true if a border has been set for this style.
| bool xlnt::style::has_fill | ( | ) | const |
Returns true if a fill has been set for this style.
| bool xlnt::style::has_font | ( | ) | const |
Returns true if a font has been set for this style.
| bool xlnt::style::has_number_format | ( | ) | const |
Returns true if a number format has been set for this style.
| bool xlnt::style::has_protection | ( | ) | const |
Returns true if protection has been set for this 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. Returns a wrapper pointing to this style.
| 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. Returns a wrapper pointing to this style.
| class number_format xlnt::style::number_format | ( | ) | const |
Returns a copy of the number_format of this style. If no number format has been set (has_number_format() returns false), a default-constructed number format will be returned.
| 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. Returns a wrapper pointing to 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 a copy of the protection of this style. If no protection has been set (has_protection() returns false), a default-constructed protection will be returned.
| 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. Returns a wrapper pointing to 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.
1.8.13