Skip to main content

OleObject

Struct OleObject 

Source
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: String

OLE 程序标识符(如 "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

Source

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")。
Source

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§

Source§

impl Clone for OleObject

Source§

fn clone(&self) -> OleObject

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for OleObject

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for OleObject

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V