pub struct OleObject {
pub rid: String,
pub image_rid: String,
pub prog_id: String,
pub name: String,
pub show_as_icon: bool,
pub image_width: Emu,
pub image_height: Emu,
pub pic_id: u32,
pub pic_name: String,
}Expand description
OLE 对象模型(<p:oleObj>)。
一个完整的 OLE 嵌入对象,引用独立的 /ppt/embeddings/oleObjectN.bin part。
§字段说明
rid:指向oleObjectN.bin的关系 id(由ShapesMut::add_ole_object分配,to_opc_package在 slideN.xml.rels 中注册)。image_rid:指向图标图片的关系 id(与image_rid共用 slide rels 命名空间)。 为空字符串时表示无图标图片,PowerPoint 会用默认图标显示。prog_id:OLE 程序标识符(如"Excel.Sheet.12"/"Word.Document.12"/"Package")。PowerPoint 通过 progId 决定双击时调用哪个 OLE 服务器。name:显示名(在 PowerPoint 中作为对象名)。show_as_icon:是否以图标形式显示(true时写出showAsIcon="1")。image_width/image_height:图标显示尺寸(EMU)。pic_id/pic_name:图标图片 Pic 形状的 id 与 name。
Fields§
§rid: String指向 oleObjectN.bin 的关系 id。
image_rid: String指向图标图片的关系 id(空字符串表示无图标)。
prog_id: StringOLE 程序标识符(如 "Excel.Sheet.12")。
name: String显示名(如 "Worksheet" / "Document")。
show_as_icon: bool是否以图标形式显示。
image_width: Emu图标宽度(EMU)。
image_height: Emu图标高度(EMU)。
pic_id: u32图标 Pic 形状的 id。
pic_name: String图标 Pic 形状的 name。
Implementations§
Source§impl OleObject
impl OleObject
Sourcepub fn new(prog_id: impl Into<String>, name: impl Into<String>) -> Self
pub fn new(prog_id: impl Into<String>, name: impl Into<String>) -> Self
构造一个指定 progId 与显示名的 OLE 对象(rid/image_rid 留空,由 presentation 层填充)。
§参数
prog_id:OLE 程序标识符(如"Excel.Sheet.12"/"Package")。name:显示名(如"Worksheet")。
Sourcepub fn write_xml(&self, w: &mut XmlWriter)
pub fn write_xml(&self, w: &mut XmlWriter)
写出 <p:oleObj> 完整 XML(含 <p:embed/> 与可选 <p:pic>)。
§元素结构
<p:oleObj spid="..." name="..." r:id="..." imgW="..." imgH="..." progId="..." showAsIcon="1">
<p:embed/>
<p:pic> ← 仅当 image_rid 非空时写出
<p:nvPicPr>...
<p:blipFill>...
<p:spPr>...
</p:pic>
</p:oleObj>§注意
本方法只写出 <p:oleObj> 元素本身;外层的 <a:graphicData uri="...">
由 crate::oxml::shape::GraphicFrame::write_xml 负责包裹。
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OleObject
impl RefUnwindSafe for OleObject
impl Send for OleObject
impl Sync for OleObject
impl Unpin for OleObject
impl UnsafeUnpin for OleObject
impl UnwindSafe for OleObject
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