pub struct TextBox { /* private fields */ }Expand description
文本框(python-pptx 的 shapes.add_textbox 对应)。
Implementations§
Source§impl TextBox
impl TextBox
Sourcepub fn text_frame(&self) -> &TextBody
pub fn text_frame(&self) -> &TextBody
文本帧不可变引用。
Sourcepub fn text_frame_mut(&mut self) -> &mut TextBody
pub fn text_frame_mut(&mut self) -> &mut TextBody
文本帧可变引用。
Sourcepub fn set_text(&mut self, text: &str) -> &mut TextBody
pub fn set_text(&mut self, text: &str) -> &mut TextBody
替换全部文本(每行一个段落)。
替换后旧的 Run 属性(字体、颜色、加粗)会被清除;如需保留请直接操作
TextBox::text_frame_mut。
Sourcepub fn set_word_wrap(&mut self, v: bool)
pub fn set_word_wrap(&mut self, v: bool)
单词换行便捷方法。
Sourcepub fn set_auto_size(&mut self, v: MsoAutoSize)
pub fn set_auto_size(&mut self, v: MsoAutoSize)
自动调整便捷方法。
Sourcepub fn set_vertical_anchor(&mut self, v: MsoAnchor)
pub fn set_vertical_anchor(&mut self, v: MsoAnchor)
垂直对齐便捷方法。
Sourcepub fn set_outer_shadow(&mut self, shadow: ShadowEffect)
pub fn set_outer_shadow(&mut self, shadow: ShadowEffect)
设置外阴影(<a:outerShdw>)。详见 crate::shape::AutoShape::set_outer_shadow。
Sourcepub fn set_inner_shadow(&mut self, shadow: ShadowEffect)
pub fn set_inner_shadow(&mut self, shadow: ShadowEffect)
设置内阴影(<a:innerShdw>)。详见 crate::shape::AutoShape::set_inner_shadow。
Sourcepub fn set_glow(&mut self, glow: GlowEffect)
pub fn set_glow(&mut self, glow: GlowEffect)
设置发光(<a:glow>)。详见 crate::shape::AutoShape::set_glow。
Sourcepub fn set_soft_edge(&mut self, rad: i64)
pub fn set_soft_edge(&mut self, rad: i64)
设置柔化边缘(<a:softEdge>)。详见 crate::shape::AutoShape::set_soft_edge。
Sourcepub fn set_reflection(&mut self, reflection: ReflectionEffect)
pub fn set_reflection(&mut self, reflection: ReflectionEffect)
设置反射(<a:reflection>)。详见 crate::shape::AutoShape::set_reflection。
Sourcepub fn clear_effects(&mut self)
pub fn clear_effects(&mut self)
清除所有效果。详见 crate::shape::AutoShape::clear_effects。
Sourcepub fn set_3d_rotation(&mut self, lat_deg: f64, lon_deg: f64, rev_deg: f64)
pub fn set_3d_rotation(&mut self, lat_deg: f64, lon_deg: f64, rev_deg: f64)
设置三维旋转。详见 crate::shape::AutoShape::set_3d_rotation。
Sourcepub fn set_3d_extrusion(&mut self, height_emu: i32, color: Option<Color>)
pub fn set_3d_extrusion(&mut self, height_emu: i32, color: Option<Color>)
设置三维拉伸。详见 crate::shape::AutoShape::set_3d_extrusion。
Sourcepub fn set_3d_bevel(
&mut self,
top_w: i32,
top_h: i32,
bottom_w: i32,
bottom_h: i32,
)
pub fn set_3d_bevel( &mut self, top_w: i32, top_h: i32, bottom_w: i32, bottom_h: i32, )
设置三维棱台。详见 crate::shape::AutoShape::set_3d_bevel。
Sourcepub fn set_3d_material(&mut self, material: MaterialPreset)
pub fn set_3d_material(&mut self, material: MaterialPreset)
设置三维材质预设。详见 crate::shape::AutoShape::set_3d_material。
Sourcepub fn clear_3d(&mut self)
pub fn clear_3d(&mut self)
清除所有三维效果。详见 crate::shape::AutoShape::clear_3d。
Sourcepub fn scene_3d(&self) -> Option<&Scene3d>
pub fn scene_3d(&self) -> Option<&Scene3d>
取三维场景引用。详见 crate::shape::AutoShape::scene_3d。
Sourcepub fn scene_3d_mut(&mut self) -> &mut Option<Scene3d>
pub fn scene_3d_mut(&mut self) -> &mut Option<Scene3d>
取三维场景可变引用。详见 crate::shape::AutoShape::scene_3d_mut。
Sourcepub fn sp_3d(&self) -> Option<&Sp3d>
pub fn sp_3d(&self) -> Option<&Sp3d>
取形状三维属性引用。详见 crate::shape::AutoShape::sp_3d。
Sourcepub fn sp_3d_mut(&mut self) -> &mut Option<Sp3d>
pub fn sp_3d_mut(&mut self) -> &mut Option<Sp3d>
取形状三维属性可变引用。详见 crate::shape::AutoShape::sp_3d_mut。
Sourcepub fn locks(&self) -> Option<&ShapeLocks>
pub fn locks(&self) -> Option<&ShapeLocks>
读取形状锁定(<a:spLocks>)。详见 crate::shape::AutoShape::locks。
Sourcepub fn locks_mut(&mut self) -> &mut ShapeLocks
pub fn locks_mut(&mut self) -> &mut ShapeLocks
读取形状锁定的可变引用。详见 crate::shape::AutoShape::locks_mut。
Sourcepub fn lock_select(&mut self, locked: bool)
pub fn lock_select(&mut self, locked: bool)
便捷锁定:禁止选中。详见 crate::shape::AutoShape::lock_select。
Sourcepub fn lock_move(&mut self, locked: bool)
pub fn lock_move(&mut self, locked: bool)
便捷锁定:禁止移动。详见 crate::shape::AutoShape::lock_move。
Sourcepub fn lock_resize(&mut self, locked: bool)
pub fn lock_resize(&mut self, locked: bool)
便捷锁定:禁止缩放。详见 crate::shape::AutoShape::lock_resize。
Sourcepub fn lock_rotate(&mut self, locked: bool)
pub fn lock_rotate(&mut self, locked: bool)
便捷锁定:禁止旋转。详见 crate::shape::AutoShape::lock_rotate。
Sourcepub fn lock_group(&mut self, locked: bool)
pub fn lock_group(&mut self, locked: bool)
便捷锁定:禁止组合。详见 crate::shape::AutoShape::lock_group。
Sourcepub fn clear_locks(&mut self)
pub fn clear_locks(&mut self)
清除所有锁定。详见 crate::shape::AutoShape::clear_locks。
Sourcepub fn set_lock(&mut self, lock_type: LockType, locked: bool)
pub fn set_lock(&mut self, lock_type: LockType, locked: bool)
统一锁定入口:按 crate::LockType 设置指定锁定。
详见 crate::shape::AutoShape::set_lock。
Sourcepub fn style(&self) -> Option<&ShapeStyle>
pub fn style(&self) -> Option<&ShapeStyle>
读取主题样式引用(<p:style>)。详见 crate::shape::AutoShape::style。
Sourcepub fn set_style(&mut self, style: ShapeStyle)
pub fn set_style(&mut self, style: ShapeStyle)
设置主题样式引用。详见 crate::shape::AutoShape::set_style。
Sourcepub fn clear_style(&mut self)
pub fn clear_style(&mut self)
清除主题样式引用。详见 crate::shape::AutoShape::clear_style。