pub struct SlideMasterRef { /* private fields */ }Expand description
单个母版引用。
与 crate::slide_layouts::SlideLayoutRef 同样使用 Rc<RefCell<OxmlSldMaster>>
共享 oxml 模型,方便母版与版式双向引用时仍能通过编译期借用检查。
Implementations§
Source§impl SlideMasterRef
impl SlideMasterRef
Sourcepub fn shapes_mut(&self) -> RefMut<'_, Vec<OxmlSp>>
pub fn shapes_mut(&self) -> RefMut<'_, Vec<OxmlSp>>
shape 可变视图(返回 RefMut)。
Sourcepub fn placeholders(&self) -> Vec<Placeholder>
pub fn placeholders(&self) -> Vec<Placeholder>
占位符列表(母版的占位符会被版式继承)。
Sourcepub fn background(&self) -> Option<SlideBackground>
pub fn background(&self) -> Option<SlideBackground>
读取母版背景的可变引用。None 表示未设置独立背景。
Sourcepub fn set_background(&self, bg: Option<SlideBackground>)
pub fn set_background(&self, bg: Option<SlideBackground>)
设置母版背景。bg = None 等价于 Self::clear_background。
Sourcepub fn set_background_solid(&self, color: Color)
pub fn set_background_solid(&self, color: Color)
设置母版背景为纯色(便捷方法)。
对标 python-pptx slide_master.background.fill.solid() +
slide_master.background.fill.fore_color.rgb = ...。
Sourcepub fn clear_background(&self)
pub fn clear_background(&self)
清除母版背景(让母版走默认背景)。
Sourcepub fn add_shape(&self, sp: OxmlSp)
pub fn add_shape(&self, sp: OxmlSp)
追加一个 shape 到母版 spTree 末尾。
对标 python-pptx slide_master.shapes._spTree.append(sp)。
调用方需自行保证 sp.id 在母版内唯一。
Sourcepub fn remove_shape(&self, id: u32) -> Option<OxmlSp>
pub fn remove_shape(&self, id: u32) -> Option<OxmlSp>
移除母版中指定 ID 的 shape,返回被移除的 shape。None 表示未找到。
Trait Implementations§
Source§impl Clone for SlideMasterRef
impl Clone for SlideMasterRef
Source§fn clone(&self) -> SlideMasterRef
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for SlideMasterRef
impl !Send for SlideMasterRef
impl !Sync for SlideMasterRef
impl !UnwindSafe for SlideMasterRef
impl Freeze for SlideMasterRef
impl Unpin for SlideMasterRef
impl UnsafeUnpin for SlideMasterRef
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more