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_TextBodyPropertiesImplementations§
Source§impl CT_TextBody
impl CT_TextBody
Sourcepub fn from_xml(xml: &[u8]) -> Result<Self>
pub fn from_xml(xml: &[u8]) -> Result<Self>
Parses a complete a:txBody while retaining later text stages.
Sourcepub fn from_xml_as(xml: &[u8], root_local_name: &[u8]) -> Result<Self>
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.
Sourcepub fn from_xml_with_inherited_namespaces(
xml: &[u8],
inherited: &[(String, String)],
) -> Result<Self>
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.
Sourcepub fn from_xml_as_with_namespaces(
xml: &[u8],
root_local_name: &[u8],
inherited: &[(String, String)],
) -> Result<Self>
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.
Sourcepub fn to_xml(&self) -> Result<Vec<u8>>
pub fn to_xml(&self) -> Result<Vec<u8>>
Writes the shell with canonical outer prefixes and schema order.
Sourcepub fn write_xml<W: Write>(&self, writer: &mut Writer<W>) -> Result<()>
pub fn write_xml<W: Write>(&self, writer: &mut Writer<W>) -> Result<()>
Writes the shell into an existing XML writer.
Sourcepub fn write_xml_as<W: Write>(
&self,
writer: &mut Writer<W>,
tag: &str,
) -> Result<()>
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.
Sourcepub fn plain_text(&self) -> String
pub fn plain_text(&self) -> String
Returns plain text in paragraph and text-content order.
pub fn has_list_style(&self) -> bool
pub fn list_style(&self) -> Option<&CT_TextListStyle>
pub fn paragraph_count(&self) -> usize
pub fn paragraphs(&self) -> &[CT_TextParagraph]
Sourcepub fn set_text(&mut self, text: &str)
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.
Sourcepub fn empty_like(&self) -> Self
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.
Sourcepub fn paragraph_mut(&mut self, index: usize) -> Option<&mut CT_TextParagraph>
pub fn paragraph_mut(&mut self, index: usize) -> Option<&mut CT_TextParagraph>
Returns one paragraph for in-place mutation.
Sourcepub fn add_paragraph(&mut self) -> &mut CT_TextParagraph
pub fn add_paragraph(&mut self) -> &mut CT_TextParagraph
Appends one empty paragraph after all existing paragraphs.
Sourcepub fn move_content_to(&mut self, destination: &mut Self)
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.