ColStyle

Struct ColStyle 

Source
pub struct ColStyle { /* private fields */ }
Expand description

Describes the style information for a table column. Hardly ever used. It’s easier to set the col_width via Sheet::set_col_width

Implementations§

Source§

impl ColStyle

Source

pub fn origin(&self) -> StyleOrigin

Origin of the style, either styles.xml oder content.xml

Source

pub fn set_origin(&mut self, origin: StyleOrigin)

Changes the origin.

Source

pub fn styleuse(&self) -> StyleUse

Usage for the style.

Source

pub fn set_styleuse(&mut self, styleuse: StyleUse)

Usage for the style.

Source

pub fn name(&self) -> &str

Stylename

Source

pub fn set_name<S: AsRef<str>>(&mut self, name: S)

Stylename

Source

pub fn style_ref(&self) -> ColStyleRef

Returns the name as a style reference.

Source

pub fn set_auto_update(&mut self, auto: bool)

The style:auto-update attribute specifies whether styles are automatically updated when the formatting properties of an object that has the style assigned to it are changed.

The defined values for the style:auto-update attribute are:

  • false: a change to a formatting property is applied for the object where the change was made. If necessary, a new automatic style will be created which is applied to the object where the change was made.
  • true: a change to a formatting property results in the updating of the common style that is applied to an object. The formatting change is applied to all objects subject to the common style where the change was made.

The default value for this attribute is false.

Source

pub fn set_class(&mut self, class: &str)

The style:class attribute specifies a style class name. A style may belong to an arbitrary class of styles. The style class name is an arbitrary string. The style class name has no meaning within the file format itself, but it can for instance be evaluated by user interfaces to show a list of styles where the styles are grouped by its name.

Source

pub fn set_display_name<S: Into<String>>(&mut self, name: S)

The style:display-name attribute specifies the name of a style as it should appear in the user interface. If this attribute is not present, the display name should be the same as the style name.

Source

pub fn set_parent_style(&mut self, name: &ColStyleRef)

The style:parent-style-name attribute specifies the name of a parent style. The parent style cannot be an automatic style and shall exist. If a parent style is not specified, the default style which has the same style:family 19.480 attribute value as the current style is used.

Source§

impl ColStyle

Source

pub fn new_empty() -> Self

empty

Source

pub fn new<S: AsRef<str>>(name: S) -> Self

New Style.

Source

pub fn attrmap(&self) -> &AttrMap2

Attributes

Source

pub fn attrmap_mut(&mut self) -> &mut AttrMap2

Attributes

Source

pub fn colstyle(&self) -> &AttrMap2

Style attributes

Source

pub fn colstyle_mut(&mut self) -> &mut AttrMap2

Style attributes

Source

pub fn set_break_before(&mut self, pagebreak: PageBreak)

See §7.19.2 of XSL. The values odd-page and even-page are not supported. This attribute shall not be used at the same time as fo:break-after. In the OpenDocument XSL-compatible namespace, the fo:break-before attribute does not support even-page, inherit and odd-page values.

Source

pub fn set_break_after(&mut self, pagebreak: PageBreak)

See §7.19.1 of XSL. The values odd-page and even-page are not supported. This attribute shall not be used at the same time as fo:break-before. In the OpenDocument XSL-compatible namespace, the fo:break-after attribute does not support even-page, inherit and odd-page values.

Source

pub fn set_col_width(&mut self, width: Length)

The style:column-width attribute specifies a fixed width for a column.

Source

pub fn col_width(&self) -> Result<Length, OdsError>

Parses the column width.

Source

pub fn set_rel_col_width(&mut self, rel: f64)

The style:rel-column-width attribute specifies a relative width of a column with a number value, followed by a ”*” (U+002A, ASTERISK) character. If rc is the relative with of the column, rs the sum of all relative columns widths, and ws the absolute width that is available for these columns the absolute width wc of the column is wc=rcws/rs.

Source

pub fn set_use_optimal_col_width(&mut self, opt: bool)

The style:use-optimal-column-width attribute specifies that a column width should be recalculated automatically if content in the column changes.

Source

pub fn use_optimal_col_width(&self) -> Result<bool, OdsError>

Parses the flag.

Trait Implementations§

Source§

impl Clone for ColStyle

Source§

fn clone(&self) -> ColStyle

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ColStyle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl GetSize for ColStyle

Source§

fn get_heap_size(&self) -> usize

Determines how many bytes this object occupies inside the heap. Read more
Source§

fn get_heap_size_with_tracker<TRACKER: GetSizeTracker>( &self, tracker: TRACKER, ) -> (usize, TRACKER)

Determines how many bytes this object occupies inside the heap while using a tracker. Read more
Source§

fn get_stack_size() -> usize

Determines how may bytes this object occupies inside the stack. Read more
Source§

fn get_size(&self) -> usize

Determines the total size of the object. Read more
Source§

fn get_size_with_tracker<T>(&self, tracker: T) -> (usize, T)
where T: GetSizeTracker,

Determines the total size of the object while using a tracker. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.