[][src]Struct spreadsheet_ods::style::PageLayout

pub struct PageLayout { /* fields omitted */ }

Page layout. Contains all header and footer information.

use spreadsheet_ods::{write_ods, WorkBook};
use spreadsheet_ods::{cm};
use spreadsheet_ods::style::{HeaderFooter, PageLayout, Length};
use color::Rgb;
use spreadsheet_ods::style::{AttrFoBackgroundColor, AttrFoMinHeight, AttrFoMargin};

let mut wb = WorkBook::new();

let mut pl = PageLayout::new_default();

pl.set_background_color(Rgb::new(12, 129, 252));

pl.header_attr_mut().set_min_height(cm!(0.75));
pl.header_attr_mut().set_margin_left(cm!(0.15));
pl.header_attr_mut().set_margin_right(cm!(0.15));
pl.header_attr_mut().set_margin_bottom(Length::Cm(0.75));

pl.header_mut().center_mut().push_text("middle ground");
pl.header_mut().left_mut().push_text("left wing");
pl.header_mut().right_mut().push_text("right wing");

wb.add_pagelayout(pl);

write_ods(&wb, "test_out/hf0.ods").unwrap();

Implementations

impl PageLayout[src]

pub fn new_default() -> Self[src]

Create with name "Mpm1" and masterpage-name "Default".

pub fn new_report() -> Self[src]

Create with name "Mpm2" and masterpage-name "Report".

pub fn set_name(&mut self, name: String)[src]

Name.

pub fn name(&self) -> &String[src]

Name.

pub fn set_master_page_name(&mut self, name: String)[src]

In the xml pagelayout is split in two pieces. Each has a name.

pub fn master_page_name(&self) -> &String[src]

In the xml pagelayout is split in two pieces. Each has a name.

pub fn attr_iter(&self) -> AttrMapIter[src]

Iterator over the attributes of this pagelayout.

pub fn set_header(&mut self, header: HeaderFooter)[src]

Left side header.

pub fn header(&self) -> &HeaderFooter[src]

Left side header.

pub fn header_mut(&mut self) -> &mut HeaderFooter[src]

Header.

pub fn set_header_left(&mut self, header: HeaderFooter)[src]

Left side header.

pub fn header_left(&self) -> &HeaderFooter[src]

Left side header.

pub fn header_left_mut(&mut self) -> &mut HeaderFooter[src]

Left side header.

pub fn header_attr(&self) -> &HeaderFooterAttr[src]

Attributes for header.

pub fn header_attr_mut(&mut self) -> &mut HeaderFooterAttr[src]

Attributes for header.

Footer.

pub fn footer(&self) -> &HeaderFooter[src]

Footer.

pub fn footer_mut(&mut self) -> &mut HeaderFooter[src]

Footer.

Left side footer.

pub fn footer_left(&self) -> &HeaderFooter[src]

Left side footer.

pub fn footer_left_mut(&mut self) -> &mut HeaderFooter[src]

Left side footer.

pub fn footer_attr(&self) -> &HeaderFooterAttr[src]

Attributes for footer.

pub fn footer_attr_mut(&mut self) -> &mut HeaderFooterAttr[src]

Attributes for footer.

Trait Implementations

impl AttrFoBackgroundColor for PageLayout[src]

impl AttrFoBorder for PageLayout[src]

impl AttrFoMargin for PageLayout[src]

impl AttrFoPadding for PageLayout[src]

impl AttrMap for PageLayout[src]

impl AttrStyleDynamicSpacing for PageLayout[src]

impl AttrStyleShadow for PageLayout[src]

impl AttrSvgHeight for PageLayout[src]

impl Clone for PageLayout[src]

impl Debug for PageLayout[src]

impl Default for PageLayout[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.