Struct OfficeStyleSheet

Source
pub struct OfficeStyleSheet {
    pub name: Option<String>,
    pub theme_elements: Box<BaseStyles>,
    pub object_defaults: Option<ObjectStyleDefaults>,
    pub extra_color_scheme_list: Vec<ColorSchemeAndMapping>,
    pub custom_color_list: Vec<CustomColor>,
}

Fields§

§name: Option<String>§theme_elements: Box<BaseStyles>

This element defines the theme formatting options for the theme and is the workhorse of the theme. This is where the bulk of the shared theme information is contained and used by a document. This element contains the color scheme, font scheme, and format scheme elements which define the different formatting aspects of what a theme defines.

§Xml example

<themeElements>
  <clrScheme name="sample">
    ...
  </clrScheme>
  <fontScheme name="sample">
    ...
  </fontScheme>
  <fmtScheme name="sample">
    <fillStyleLst>
      ...
    </fillStyleLst>
    <lnStyleLst>
      ...
    </lnStyleLst>
    <effectStyleLst>
      ...
    </effectStyleLst>
    <bgFillStyleLst>
      ...
    </bgFillStyleLst>
  </fmtScheme>
</themeElements>

In this example, we see the basic structure of how a theme elements is defined and have left out the true guts of each individual piece to save room. Each part (color scheme, font scheme, format scheme) is defined elsewhere within DrawingML.

§object_defaults: Option<ObjectStyleDefaults>

This element allows for the definition of default shape, line, and textbox formatting properties. An application can use this information to format a shape (or text) initially on insertion into a document.

§extra_color_scheme_list: Vec<ColorSchemeAndMapping>

This element is a container for the list of extra color schemes present in a document.

An ColorSchemeAndMapping element defines an auxiliary color scheme, which includes both a color scheme and color mapping. This is mainly used for backward compatibility concerns and roundtrips information required by earlier versions.

§Xml example

<extraClrScheme>
  <clrScheme name="extraColorSchemeSample">
    <dk1>
      <sysClr val="windowText"/>
    </dk1>
    <lt1>
      <sysClr val="window"/>
    </lt1>
    <dk2>
      <srgbClr val="04617B"/>
    </dk2>
    <lt2>
      <srgbClr val="DBF5F9"/>
    </lt2>
    <accent1>
      <srgbClr val="0F6FC6"/>
    </accent1>
    <accent2>
      <srgbClr val="009DD9"/>
    </accent2>
    <accent3>
      <srgbClr val="0BD0D9"/>
    </accent3>
    <accent4>
      <srgbClr val="10CF9B"/>
    </accent4>
    <accent5>
      <srgbClr val="7CCA62"/>
    </accent5>
    <accent6>
      <srgbClr val="A5C249"/>
    </accent6>
    <hlink>
      <srgbClr val="FF9800"/>
    </hlink>
    <folHlink>
      <srgbClr val="F45511"/>
    </folHlink>
  </clrScheme>
  <clrMap bg1="lt1" tx1="dk1" bg2="lt2" tx2="dk2" accent1="accent1"
    accent2="accent2" accent3="accent3" accent4="accent4" accent5="accent5"
    accent6="accent6" hlink="hlink" folHlink="folHlink"/>
</extraClrScheme>
§custom_color_list: Vec<CustomColor>

This element allows for a custom color palette to be created and which shows up alongside other color schemes. This can be very useful, for example, when someone would like to maintain a corporate color palette.

Implementations§

Source§

impl OfficeStyleSheet

Source

pub fn from_zip_file(zip_file: &mut ZipFile<'_>) -> Result<Self, Box<dyn Error>>

Source

pub fn from_xml_element(xml_node: &XmlNode) -> Result<Self, Box<dyn Error>>

Trait Implementations§

Source§

impl Clone for OfficeStyleSheet

Source§

fn clone(&self) -> OfficeStyleSheet

Returns a copy 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 OfficeStyleSheet

Source§

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

Formats the value using the given formatter. 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.