Skip to main content

CT_TextBody

Struct CT_TextBody 

Source
pub struct CT_TextBody {
    pub body_properties: CT_TextBodyProperties,
    /* private fields */
}
Expand description

The a:txBody shell with typed body properties and opaque later text stages.

Fields§

§body_properties: CT_TextBodyProperties

Implementations§

Source§

impl CT_TextBody

Source

pub fn new() -> Self

Creates a minimal valid text body with one empty paragraph.

Source

pub fn from_xml(xml: &[u8]) -> Result<Self>

Parses a complete a:txBody while retaining later text stages.

Source

pub fn from_xml_as(xml: &[u8], root_local_name: &[u8]) -> Result<Self>

Parses a complete text body under a caller-selected root local name.

Source

pub fn from_xml_with_inherited_namespaces( xml: &[u8], inherited: &[(String, String)], ) -> Result<Self>

Parses a text-body fragment in its actual enclosing namespace scope.

Source

pub fn from_xml_as_with_namespaces( xml: &[u8], root_local_name: &[u8], inherited: &[(String, String)], ) -> Result<Self>

Parses a caller-selected text-body root in its actual enclosing namespace scope. Retained source declarations stay separate from inherited lookup bindings.

Source

pub fn to_xml(&self) -> Result<Vec<u8>>

Writes the shell with canonical outer prefixes and schema order.

Source

pub fn write_xml<W: Write>(&self, writer: &mut Writer<W>) -> Result<()>

Writes the shell into an existing XML writer.

Source

pub fn write_xml_as<W: Write>( &self, writer: &mut Writer<W>, tag: &str, ) -> Result<()>

Writes the text body using a caller-selected OOXML wrapper tag.

Source

pub fn plain_text(&self) -> String

Returns plain text in paragraph and text-content order.

Source

pub fn has_list_style(&self) -> bool

Source

pub fn list_style(&self) -> Option<&CT_TextListStyle>

Source

pub fn paragraph_count(&self) -> usize

Source

pub fn paragraphs(&self) -> &[CT_TextParagraph]

Source

pub fn set_text(&mut self, text: &str)

Replaces all text content while retaining body-level state.

Each line feed or CRLF pair starts a paragraph, and a vertical tab creates an a:br. New paragraphs copy the first paragraph’s formatting.

Source

pub fn empty_like(&self) -> Self

Returns an empty body that keeps this body’s properties and list style and the formatting of its first paragraph, as PowerPoint fills the cells of a new table row or column.

The one paragraph keeps the first paragraph’s properties. The character properties of that paragraph’s first regular run, or its end properties when the run is missing or has none, become the new end properties without their hyperlinks. Unmodelled body and paragraph children are not copied.

Source

pub fn paragraph_mut(&mut self, index: usize) -> Option<&mut CT_TextParagraph>

Returns one paragraph for in-place mutation.

Source

pub fn add_paragraph(&mut self) -> &mut CT_TextParagraph

Appends one empty paragraph after all existing paragraphs.

Source

pub fn move_content_to(&mut self, destination: &mut Self)

Moves visible typed paragraphs to destination, retaining body-level state and leaving one empty paragraph in this body.

Source

pub fn raw_children(&self) -> &OrderedRawChildren

Trait Implementations§

Source§

impl Clone for CT_TextBody

Source§

fn clone(&self) -> Self

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 CT_TextBody

Source§

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

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

impl Default for CT_TextBody

Source§

fn default() -> Self

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

impl Eq for CT_TextBody

Source§

impl PartialEq for CT_TextBody

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. 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<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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.