pub trait Shape {
Show 15 methods
// Required methods
fn id(&self) -> u32;
fn set_id(&mut self, id: u32);
fn name(&self) -> &str;
fn set_name(&mut self, name: String);
fn shape_type(&self) -> &'static str;
fn left(&self) -> Emu;
fn set_left(&mut self, emu: Emu);
fn top(&self) -> Emu;
fn set_top(&mut self, emu: Emu);
fn width(&self) -> Emu;
fn set_width(&mut self, emu: Emu);
fn height(&self) -> Emu;
fn set_height(&mut self, emu: Emu);
fn rotation(&self) -> f64;
fn set_rotation(&mut self, deg: f64);
}Expand description
高阶形状的抽象接口。
调用方拿到一个 Shape(trait object)或具体类型时,可通过此 trait
访问“位置 / 尺寸 / 旋转“等通用属性。具体类型特有属性需用具体类型
句柄访问。
Required Methods§
Sourcefn shape_type(&self) -> &'static str
fn shape_type(&self) -> &'static str
形状类型(如 "text_box" / "picture" / …)。
返回值与 crate::shape::ShapeKind::shape_type 保持一致。
Sourcefn set_height(&mut self, emu: Emu)
fn set_height(&mut self, emu: Emu)
设置高。
Sourcefn rotation(&self) -> f64
fn rotation(&self) -> f64
旋转角度(度数,正向顺时针)。
与 OOXML 规范的“60000 分之一度“通过 set_rotation 自动转换;
读取时返回度数。
Sourcefn set_rotation(&mut self, deg: f64)
fn set_rotation(&mut self, deg: f64)
设置旋转角度。
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".