Skip to main content

SlideMasterRef

Struct SlideMasterRef 

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

单个母版引用。

crate::slide_layouts::SlideLayoutRef 同样使用 Rc<RefCell<OxmlSldMaster>> 共享 oxml 模型,方便母版与版式双向引用时仍能通过编译期借用检查。

Implementations§

Source§

impl SlideMasterRef

Source

pub fn partname(&self) -> &str

取出 part 路径(如 /ppt/slideMasters/slideMaster1.xml)。

Source

pub fn rid(&self) -> &str

取出关系 id(如 rIdMaster1)。

Source

pub fn shapes(&self) -> Vec<OxmlSp>

shape 不可变快照(python-pptx slide_master.shapes 风格)。

Source

pub fn shapes_mut(&self) -> RefMut<'_, Vec<OxmlSp>>

shape 可变视图(返回 RefMut)。

Source

pub fn placeholders(&self) -> Vec<Placeholder>

占位符列表(母版的占位符会被版式继承)。

Source

pub fn background(&self) -> Option<SlideBackground>

读取母版背景的可变引用。None 表示未设置独立背景。

Source

pub fn set_background(&self, bg: Option<SlideBackground>)

设置母版背景。bg = None 等价于 Self::clear_background

Source

pub fn set_background_solid(&self, color: Color)

设置母版背景为纯色(便捷方法)。

对标 python-pptx slide_master.background.fill.solid() + slide_master.background.fill.fore_color.rgb = ...

Source

pub fn clear_background(&self)

清除母版背景(让母版走默认背景)。

Source

pub fn add_shape(&self, sp: OxmlSp)

追加一个 shape 到母版 spTree 末尾。

对标 python-pptx slide_master.shapes._spTree.append(sp)。 调用方需自行保证 sp.id 在母版内唯一。

Source

pub fn remove_shape(&self, id: u32) -> Option<OxmlSp>

移除母版中指定 ID 的 shape,返回被移除的 shape。None 表示未找到。

Trait Implementations§

Source§

impl Clone for SlideMasterRef

Source§

fn clone(&self) -> SlideMasterRef

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SlideMasterRef

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V