pub struct CT_Composite {
pub id: u32,
pub boundary: String,
pub name: Option<String>,
pub visible: bool,
pub children: Vec<CompositeChild>,
}Expand description
对应 Java: org.ofdrw.core.compositeObj.CT_Composite
复合对象容器。用于将多个页面对象组合为一个逻辑单元, 支持统一的位置变换、裁剪等操作。
Fields§
§id: u32对象 ID,在页面内唯一。
boundary: String对象边界框,格式为 “x y width height”(单位 mm)。
name: Option<String>对象名称(可选),用于标识复合对象。
visible: bool可见性。true 表示可见(默认),false 表示隐藏。
children: Vec<CompositeChild>子对象列表,按绘制顺序排列。
Implementations§
Source§impl CT_Composite
impl CT_Composite
Sourcepub fn add_text(
&mut self,
content: impl Into<String>,
x: f64,
y: f64,
font_size: f64,
)
pub fn add_text( &mut self, content: impl Into<String>, x: f64, y: f64, font_size: f64, )
添加文本子对象。
Sourcepub fn add_composite(&mut self, child: CT_Composite)
pub fn add_composite(&mut self, child: CT_Composite)
添加嵌套复合对象。
Sourcepub fn child_count(&self) -> usize
pub fn child_count(&self) -> usize
子对象数量。
Sourcepub fn to_xml_string(&self) -> String
pub fn to_xml_string(&self) -> String
序列化为 OFD XML 字符串。
Trait Implementations§
Source§impl Clone for CT_Composite
impl Clone for CT_Composite
Source§fn clone(&self) -> CT_Composite
fn clone(&self) -> CT_Composite
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 Freeze for CT_Composite
impl RefUnwindSafe for CT_Composite
impl Send for CT_Composite
impl Sync for CT_Composite
impl Unpin for CT_Composite
impl UnsafeUnpin for CT_Composite
impl UnwindSafe for CT_Composite
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