[−][src]Struct spreadsheet_ods::style::PageLayout
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.
pub fn set_footer(&mut self, footer: HeaderFooter)
[src]
Footer.
pub fn footer(&self) -> &HeaderFooter
[src]
Footer.
pub fn footer_mut(&mut self) -> &mut HeaderFooter
[src]
Footer.
pub fn set_footer_left(&mut self, footer: HeaderFooter)
[src]
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]
fn set_background_color(&mut self, color: Rgb<u8>)
[src]
impl AttrFoBorder for PageLayout
[src]
fn set_border(&mut self, width: Length, border: Border, color: Rgb<u8>)
[src]
fn set_border_bottom(&mut self, width: Length, border: Border, color: Rgb<u8>)
[src]
fn set_border_top(&mut self, width: Length, border: Border, color: Rgb<u8>)
[src]
fn set_border_left(&mut self, width: Length, border: Border, color: Rgb<u8>)
[src]
fn set_border_right(&mut self, width: Length, border: Border, color: Rgb<u8>)
[src]
fn set_border_line_width(
&mut self,
inner: Length,
spacing: Length,
outer: Length
)
[src]
&mut self,
inner: Length,
spacing: Length,
outer: Length
)
fn set_border_line_width_bottom(
&mut self,
inner: Length,
spacing: Length,
outer: Length
)
[src]
&mut self,
inner: Length,
spacing: Length,
outer: Length
)
fn set_border_line_width_left(
&mut self,
inner: Length,
spacing: Length,
outer: Length
)
[src]
&mut self,
inner: Length,
spacing: Length,
outer: Length
)
fn set_border_line_width_right(
&mut self,
inner: Length,
spacing: Length,
outer: Length
)
[src]
&mut self,
inner: Length,
spacing: Length,
outer: Length
)
fn set_border_line_width_top(
&mut self,
inner: Length,
spacing: Length,
outer: Length
)
[src]
&mut self,
inner: Length,
spacing: Length,
outer: Length
)
impl AttrFoMargin for PageLayout
[src]
fn set_margin(&mut self, margin: Length)
[src]
fn set_margin_bottom(&mut self, margin: Length)
[src]
fn set_margin_left(&mut self, margin: Length)
[src]
fn set_margin_right(&mut self, margin: Length)
[src]
fn set_margin_top(&mut self, margin: Length)
[src]
impl AttrFoPadding for PageLayout
[src]
fn set_padding(&mut self, padding: Length)
[src]
fn set_padding_bottom(&mut self, padding: Length)
[src]
fn set_padding_left(&mut self, padding: Length)
[src]
fn set_padding_right(&mut self, padding: Length)
[src]
fn set_padding_top(&mut self, padding: Length)
[src]
impl AttrMap for PageLayout
[src]
fn attr_map(&self) -> &AttrMapType
[src]
fn attr_map_mut(&mut self) -> &mut AttrMapType
[src]
fn has_attr(&self) -> bool
[src]
fn add_all(&mut self, data: Vec<(&str, String)>)
[src]
fn set_attr(&mut self, name: &str, value: String)
[src]
fn clear_attr(&mut self, name: &str) -> Option<String>
[src]
fn attr(&self, name: &str) -> Option<&String>
[src]
impl AttrStyleDynamicSpacing for PageLayout
[src]
fn set_dynamic_spacing(&mut self, dynamic: bool)
[src]
impl AttrStyleShadow for PageLayout
[src]
fn set_shadow(
&mut self,
x_offset: Length,
y_offset: Length,
blur: Option<Length>,
color: Rgb<u8>
)
[src]
&mut self,
x_offset: Length,
y_offset: Length,
blur: Option<Length>,
color: Rgb<u8>
)
impl AttrSvgHeight for PageLayout
[src]
fn set_height(&mut self, height: Length)
[src]
impl Clone for PageLayout
[src]
fn clone(&self) -> PageLayout
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for PageLayout
[src]
impl Default for PageLayout
[src]
fn default() -> PageLayout
[src]
Auto Trait Implementations
impl RefUnwindSafe for PageLayout
impl Send for PageLayout
impl Sync for PageLayout
impl Unpin for PageLayout
impl UnwindSafe for PageLayout
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,