Skip to main content

PageStyle

Struct PageStyle 

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

The style:page-layout element represents the styles that specify the formatting properties of a page.

For an example see MasterPage.

Implementations§

Source§

impl PageStyle

Source

pub fn new_empty() -> Self

New pagestyle.

Source

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

New pagestyle.

Source

pub fn style_ref(&self) -> PageStyleRef

Style reference.

Source

pub fn name(&self) -> &str

Style name

Source

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

Style name

Source

pub fn set_page_usage(&mut self, usage: MasterPageUsage)

The style:page-usage attribute specifies the type of pages that a page master should generate. The defined values for the style:page-usage attribute are:

The default value for this attribute is all.

Source

pub fn clear_page_usage(&mut self)

Remove page-usage flag.

Source

pub fn page_usage(&self) -> OdsResult<Option<MasterPageUsage>>

The style:page-usage attribute specifies the type of pages that a page master should generate.

Source

pub fn headerstyle(&self) -> &HeaderFooterStyle

Attributes for header.

Source

pub fn headerstyle_mut(&mut self) -> &mut HeaderFooterStyle

Attributes for header.

Source

pub fn footerstyle(&self) -> &HeaderFooterStyle

Attributes for footer.

Source

pub fn footerstyle_mut(&mut self) -> &mut HeaderFooterStyle

Attributes for footer.

Source

pub fn style(&self) -> &AttrMap2

Access to all style attributes.

Source

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

Access to all style attributes.

Source

pub fn set_page_height(&mut self, height: Length)

Page Height

Source

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

Page Width

Source

pub fn set_first_page_number(&mut self, number: u32)

The style:first-page-number attribute specifies the number of a document. The value of this attribute can be an integer or continue. If the value is continue, the page number is the preceding page number incremented by 1. The default first page number is 1.

Source

pub fn set_footnote_max_height(&mut self, height: Length)

The style:footnote-max-height attribute specifies the maximum amount of space on a page that a footnote can occupy. The value of the attribute is a length, which determines the maximum height of a footnote area. If the value of this attribute is set to 0cm, there is no limit to the amount of space that the footnote can occupy.

Source

pub fn set_num_format(&mut self, format: StyleNumFormat)

The style:num-format attribute specifies a numbering sequence. If no value is given, no number sequence is displayed.

The defined values for the style:num-format attribute are:

  • 1: number sequence starts with “1”.
  • a: number sequence starts with “a”.
  • A: number sequence starts with “A”.
  • empty string: no number sequence displayed.
  • i: number sequence starts with “i”.
  • I: number sequence start with “I”.
  • a value of type string 18.2
Source

pub fn set_num_letter_sync(&mut self, sync: bool)

The style:num-letter-sync attribute specifies whether letter synchronization shall take place. If letters are used in alphabetical order for numbering, there are two ways to process overflows within a digit, as follows:

  • false: A new digit is inserted that always has the same value as the following digit. The numbering sequence (for lower case numberings) in that case is a, b, c, …, z, aa, bb, cc, …, zz, aaa, …, and so on.
  • true: A new digit is inserted. Its start value is ”a” or ”A”, and it is incremented every time an overflow occurs in the following digit. The numbering sequence (for lower case numberings) in that case is a,b,c, …, z, aa, ab, ac, …,az, ba, …, and so on
Source

pub fn set_num_prefix<S: Into<String>>(&mut self, prefix: S)

The style:num-prefix attribute specifies what to display before a number. If the style:num-prefix and style:num-suffix values do not contain any character that has a Unicode category of Nd, Nl, No, Lu, Ll, Lt, Lm or Lo, an XSLT format attribute can be created from the OpenDocument attributes by concatenating the values of the style:num-prefix, style:num-format, and style:num-suffix attributes.

Source

pub fn set_num_suffix<S: Into<String>>(&mut self, suffix: S)

The style:num-prefix and style:num-suffix attributes specify what to display before and after a number. If the style:num-prefix and style:num-suffix values do not contain any character that has a Unicode category of Nd, Nl, No, Lu, Ll, Lt, Lm or Lo, an XSLT format attribute can be created from the OpenDocument attributes by concatenating the values of the style:numprefix, style:num-format, and style:num-suffix attributes.

Source

pub fn set_paper_tray_name<S: Into<String>>(&mut self, tray: S)

The style:paper-tray-name attribute specifies the paper tray to use when printing a document. The names assigned to the paper trays depends upon the printer.

The defined values for the style:paper-tray-name attribute are:

  • default: the default tray specified by printer configuration settings.
  • a value of type string
Source

pub fn set_print(&mut self, print: &[PrintContent])

The style:print attribute specifies the components in a spreadsheet document to print. The value of the style:print attribute is a white space separated list of one or more of these values: headers, grid, annotations, objects, charts, drawings, formulas, zerovalues, or the empty list.

The defined values for the style:print attribute are:

  • annotations: annotations should be printed.
  • charts: charts should be printed.
  • drawings: drawings should be printed.
  • formulas: formulas should be printed.
  • headers: headers should be printed.
  • grid: grid lines should be printed.
  • objects: (including graphics): objects should be printed.
  • zero-values: zero-values should be printed.
Source

pub fn set_print_orientation(&mut self, orientation: PrintOrientation)

The style:print-orientation attribute specifies the orientation of the printed page. The value of this attribute can be portrait or landscape.

The defined values for the style:print-orientation attribute are:

  • landscape: a page is printed in landscape orientation.
  • portrait: a page is printed in portrait orientation.
Source

pub fn set_print_page_order(&mut self, order: PrintOrder)

The style:print-page-order attribute specifies the order in which data in a spreadsheet is numbered and printed when the data does not fit on one printed page.

The defined values for the style:print-page-order attribute are:

  • ltr: create pages from the first column to the last column before continuing with the next set of rows.
  • ttb: create pages from the top row to the bottom row before continuing with the next set of columns.
Source

pub fn set_scale_to(&mut self, percent: Percent)

The style:scale-to attribute specifies that a document is to be scaled to a percentage value. A value of 100% means no scaling. If this attribute and style:scale-to-pages are absent, a document is not scaled.

Source

pub fn set_scale_to_pages(&mut self, pages: u32)

The style:scale-to-pages attribute specifies the number of pages on which a document should be printed. The document is scaled to fit a specified number of pages. If this attribute and style:scale-to are absent, a document is not scaled.

Source

pub fn set_table_centering(&mut self, center: PrintCentering)

The style:table-centering attribute specifies whether tables are centered horizontally and/or vertically on the page. This attribute only applies to spreadsheet documents. The default is to align the table to the top-left or top-right corner of the page, depending of its writing direction.

The defined values for the style:table-centering attribute are:

  • both: tables should be centered both horizontally and vertically on the pages where they appear.
  • horizontal: tables should be centered horizontally on the pages where they appear.
  • none: tables should not be centered both horizontally or vertically on the pages where they appear.
  • vertical: tables should be centered vertically on the pages where they appear.
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_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_border(&mut self, width: Length, border: Border, color: Rgb<u8>)

Border style all four sides. See §7.29.3 of XSL.

Source

pub fn set_border_bottom( &mut self, width: Length, border: Border, color: Rgb<u8>, )

Border style. See §7.29.4 of XSL

Source

pub fn set_border_left(&mut self, width: Length, border: Border, color: Rgb<u8>)

Border style. See §7.29.6 of XSL.

Source

pub fn set_border_right( &mut self, width: Length, border: Border, color: Rgb<u8>, )

Border style. See §7.29.7 of XSL.

Source

pub fn set_border_top(&mut self, width: Length, border: Border, color: Rgb<u8>)

Border style. See §7.29.10 of XSL.

Source

pub fn set_border_line_width( &mut self, inner: Length, spacing: Length, outer: Length, )

The style:border-line-width attribute specifies the widths of borders defined by the FO border properties (see 20.183) for borders where the value of these properties is double. The value of the style:border-line-width attribute is a list of three white space-separated lengths, as follows:

  • The first value specifies the width of the inner line
  • The second value specifies the distance between the two lines
  • The third value specifies the width of the outer line

The style:border-line-width attribute is usable with the following elements: style:graphic-properties 17.21, style:header-footer-properties 17.5, style:page-layout-properties 17.2, style:paragraph-properties 17.6 and style:table-cell-properties 17.18.

Source

pub fn set_border_line_width_bottom( &mut self, inner: Length, spacing: Length, outer: Length, )

The style:border-line-width-bottom attribute specifies the widths of the bottom border for borders defined by the FO border properties (see 20.183) if the property for the bottom border has the value double. The value of the style:border-line-width-bottom attribute is a list of three white spaceseparated lengths, as follows:

  • The first value specifies the width of the inner line
  • The second value specifies the distance between the two lines
  • The third value specifies the width of the outer line

The style:border-line-width attribute is usable with the following elements: style:graphic-properties 17.21, style:header-footer-properties 17.5, style:page-layout-properties 17.2, style:paragraph-properties 17.6 and style:table-cell-properties 17.18.

Source

pub fn set_border_line_width_left( &mut self, inner: Length, spacing: Length, outer: Length, )

The style:border-line-width-left attribute specifies the widths of the left border for borders defined by the FO border properties (see 20.183) if the property for the left border has the value double. The value of the style:border-line-width-left attribute is a list of three white spaceseparated lengths, as follows:

  • The first value specifies the width of the inner line
  • The second value specified the distance between the two lines
  • The third value specifies the width of the outer line

The style:border-line-width attribute is usable with the following elements: style:graphic-properties 17.21, style:header-footer-properties 17.5, style:page-layout-properties 17.2, style:paragraph-properties 17.6 and style:table-cell-properties 17.18.

Source

pub fn set_border_line_width_right( &mut self, inner: Length, spacing: Length, outer: Length, )

The style:border-line-width-right attribute specifies the widths of the right border for borders defined by the FO border properties (see 20.183) if the property for the right border has the value double. The value of the style:border-line-width-right attribute is a list of three white spaceseparated lengths, as follows:

  • The first value specifies the width of the inner line
  • The second value specified the distance between the two lines
  • The third value specifies the width of the outer line

The style:border-line-width attribute is usable with the following elements: style:graphic-properties 17.21, style:header-footer-properties 17.5, style:page-layout-properties 17.2, style:paragraph-properties 17.6 and style:table-cell-properties 17.18.

Source

pub fn set_border_line_width_top( &mut self, inner: Length, spacing: Length, outer: Length, )

The style:border-line-width-top attribute specifies the widths of the top border for borders defined by the FO border properties (see 20.183) if the property for the top border has the value double. The value of the style:border-line-width-top attribute is a list of three white spaceseparated lengths, as follows:

  • The first value specifies the width of the inner line
  • The second value specified the distance between the two lines
  • The third value specifies the width of the outer line

The style:border-line-width attribute is usable with the following elements: style:graphic-properties 17.21, style:header-footer-properties 17.5, style:page-layout-properties 17.2, style:paragraph-properties 17.6 and style:table-cell-properties 17.18.

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_padding(&mut self, padding: Length)

Padding for all sides. See §7.29.15 of XSL.

The fo:padding 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:tablecell-properties 17.18.

Source

pub fn set_padding_bottom(&mut self, padding: Length)

Padding. See §7.7.36 of XSL.

The fo:padding-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:tablecell-properties 17.18.

Source

pub fn set_padding_left(&mut self, padding: Length)

Padding. See §7.7.37 of XSL.

The fo:padding-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 and style:tablecell-properties 17.18.

Source

pub fn set_padding_right(&mut self, padding: Length)

Padding. See §7.7.38 of XSL.

The fo:padding-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 and style:tablecell-properties 17.18.

Source

pub fn set_padding_top(&mut self, padding: Length)

Padding. See §7.7.35 of XSL.

The fo:padding-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:tablecell-properties 17.18.

Source

pub fn set_dynamic_spacing(&mut self, dynamic: bool)

Dynamic spacing

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.

Trait Implementations§

Source§

impl Clone for PageStyle

Source§

fn clone(&self) -> PageStyle

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 PageStyle

Source§

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

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

impl GetSize for PageStyle

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.