TableStyle

Struct TableStyle 

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

Describes the style information for a table.

Implementations§

Source§

impl TableStyle

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) -> TableStyleRef

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: &TableStyleRef)

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 TableStyle

Source

pub fn new_empty() -> Self

empty

Source

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

Creates a new Style.

Source

pub fn set_master_page(&mut self, masterpage: &MasterPageRef)

The style:master-page-name attribute defines a master page for a paragraph or table style. This applies to automatic and common styles.

If this attribute is associated with a style, a page break is inserted when the style is applied and the specified master page is applied to the resulting page.

This attribute is ignored if it is associated with a paragraph style that is applied to a paragraph within a table.

Source

pub fn attrmap(&self) -> &AttrMap2

Access to all stored attributes.

Source

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

Access to all stored attributes.

Source

pub fn tablestyle(&self) -> &AttrMap2

Access to all style attributes.

Source

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

Access to all style attributes.

Source

pub fn set_background_color(&mut self, color: Rgb<u8>)

The fo:background-color attribute specifies a background color for characters, paragraphs, text sections, frames, page bodies, headers, footers, table cells, table rows and tables. This can be transparent or a color. If the value is set to transparent, it switches off any background image that is specified by a style:background-image 17.3.

If a value for a draw:fill attribute is provided in a style, any background image that is specified by a style:background-image element and any background color that is specified with the fo:background-color attribute are switched off.

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_keep_with_next(&mut self, keep_with_next: TextKeep)

See §7.19.4 of XSL. In the OpenDocument XSL-compatible namespace, the fo:keep-with-next attribute does not support the integer value.

Source

pub fn set_margin(&mut self, margin: Margin)

See §7.29.14 of XSL. In the OpenDocument XSL-compatible namespace, the fo:margin attribute does not support auto and inherit values.

The fo:margin attribute is usable with the following elements: style:graphicproperties 17.21, style:header-footer-properties 17.5, style:pagelayout-properties 17.2, style:paragraph-properties 17.6 and style:tableproperties 17.15.

Source

pub fn set_margin_bottom(&mut self, margin: Margin)

See §7.10.2 of XSL. If this attribute is contained in a style:paragraph-properties 17.6 element, its value may be a percentage that refers to the corresponding margin of a parent style. In the OpenDocument XSL-compatible namespace, the fo:margin-bottom attribute does not support the auto and inherit values.

The fo:margin-bottom attribute is usable with the following elements: style:graphicproperties 17.21, style:header-footer-properties 17.5, style:pagelayout-properties 17.2, style:paragraph-properties 17.6 and style:tableproperties 17.15.

Source

pub fn set_margin_left(&mut self, margin: Margin)

See §7.10.3 of XSL. If this attribute is contained in a style:paragraph-properties 17.6 element, its value may be a percentage that refers to the corresponding margin of a parent style. Tables that align to the left or to the center ignore right margins, and tables that align to the right or to the center ignore left margins.

The fo:margin-left attribute is usable with the following elements: style:graphicproperties 17.21, style:header-footer-properties 17.5, style:pagelayout-properties 17.2, style:paragraph-properties 17.6, style:sectionproperties 17.11 and style:table-properties 17.15.

Source

pub fn set_margin_right(&mut self, margin: Margin)

See §7.10.4 of XSL. If this attribute is contained in a style:paragraph-properties 17.6 element, its value may be a percentage that refers to the corresponding margin of a parent style. Tables that align to the left or to the center ignore right margins, and tables that align to the right or to the center ignore left margins.

The fo:margin-right attribute is usable with the following elements: style:graphicproperties 17.21, style:header-footer-properties 17.5, style:pagelayout-properties 17.2, style:paragraph-properties 17.6, style:sectionproperties 17.11 and style:table-properties 17.15.

Source

pub fn set_margin_top(&mut self, margin: Margin)

See §7.10.1 of XSL. If this attribute is contained in a style:paragraph-properties 17.6 element, its value may be a percentage that refers to the corresponding margin of a parent style. In the OpenDocument XSL-compatible namespace, the fo:margin-top attribute does not support the inherit value.

The fo:margin-top attribute is usable with the following elements: style:graphicproperties 17.21, style:header-footer-properties 17.5, style:pagelayout-properties 17.2, style:paragraph-properties 17.6 and style:tableproperties 17.15.

Source

pub fn set_may_break_between_rows(&mut self, br: bool)

The style:may-break-between-rows attribute specifies that a page break may occur inside a table.

The defined values for the style:may-break-between-rows attribute are:

  • false: page break shall not occur inside a table.
  • true: page break may occur inside a table
Source

pub fn set_page_number(&mut self, page_number: PageNumber)

The style:page-number attribute specifies the page number that should be used for a new page when either a paragraph or table style specifies a master page that should be applied beginning from the start of a paragraph or table.

The defined values for the style:page-number attribute are:

  • auto: a page has the page number of the previous page, incremented by one.
  • a value of type nonNegativeInteger 18.2: specifies a page number.

The style:page-number attribute is usable with the following elements: style:paragraph-properties 17.6 and style:table-properties 17.15.

The values of the style:page-number attribute are a value of type nonNegativeInteger 18.2 or auto.

Source

pub fn set_rel_width(&mut self, rel_width: RelativeScale)

The style:rel-width attribute specifies the relative width of a drawing object.

The defined values for the style:rel-width attribute are:

  • scale: the width should be calculated depending on the height, so that the ratio of width and height of the original image or object size is preserved.
  • scale-min: the width should be calculated as for value scale, but the calculated width is a minimum width rather than an absolute one.
  • a value of type percent 18.3.23.

The interpretation of the percent value depends on the anchor of the drawing object. If the anchor for the drawing object is in a table cell, the percent value of the surrounding table box. If the anchor for the drawing object is in a text box, the percentage value of the surrounding text box. In all other cases, the percent value of the containing page or window To support consumers that do not support relative width, producers should also provide the width in a svg:width 19.575 attribute.

Source

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

The style:width attribute specifies the fixed width of a table. Every table shall have a fixed width.

Source

pub fn set_shadow( &mut self, x_offset: Length, y_offset: Length, blur: Option<Length>, color: Rgb<u8>, )

The style:shadow attribute specifies a shadow effect. The defined values for this attribute are those defined in §7.16.5 of XSL, except the value inherit.

The shadow effect is not applied to the text content of an element, but depending on the element where the attribute appears, to a paragraph, a text box, a page body, a header, a footer, a table or a table cell.

The style:shadow attribute is usable with the following elements: style:graphicproperties 17.21, style:header-footer-properties 17.5, style:pagelayout-properties 17.2, style:paragraph-properties 17.6, style:tablecell-properties 17.18 and style:table-properties 17.15.

Source

pub fn set_writing_mode(&mut self, writing_mode: WritingMode)

See §7.27.7 of XSL.

The defined value for the style:writing-mode attribute is page: writing mode is inherited from the page that contains the element where this attribute appears.

Source

pub fn set_align(&mut self, align: TableAlign)

The table:align attribute specifies the horizontal alignment of a table.

The defined values for the table:align attribute are:

  • center: table aligns to the center between left and right margins.
  • left: table aligns to the left margin.
  • margins: table fills all the space between the left and right margins.
  • right: table aligns to the right margin.

Consumers that do not support the margins value, may treat this value as left.

Source

pub fn set_border_model(&mut self, border: TableBorderModel)

The table:border-model attribute specifies what border model to use when creating a table with a border.

The defined values for the table:border-model attribute are:

  • collapsing: when two adjacent cells have different borders, the wider border appears as the border between the cells. Each cell receives half of the width of the border.
  • separating: borders appear within the cell that specifies the border.

In OpenDocument, a row height or column width includes any space required to display borders or padding. This means that, while the width and height of the content area is less than the column width and row height, the sum of the widths of all columns is equal to the total width of the table.

Source

pub fn set_display(&mut self, display: bool)

The table:display attribute specifies whether a table is displayed.

The defined values for the table:display attribute are:

  • false: table should not be displayed.
  • true: table should be displayed.
Source

pub fn set_tab_color(&mut self, color: Rgb<u8>)

The table:tab-color attribute specifies the color of the tab associated with a sheet. When this attribute is missing, the application should use the default color used for sheet tabs.

Trait Implementations§

Source§

impl Clone for TableStyle

Source§

fn clone(&self) -> TableStyle

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 TableStyle

Source§

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

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

impl GetSize for TableStyle

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.