pub struct TextDocument {
pub document: Document,
}Expand description
An OpenDocument text document.
The body is a flow of block elements — paragraphs, headings, lists, tables,
sections, frames — in the order they are read, which is the order they are
drawn. Nothing here paginates: a page layout says how wide a line may be, and
that is what Self::page_layout is for.
Fields§
§document: DocumentThe package and everything shared with the other two formats.
Implementations§
Source§impl TextDocument
impl TextDocument
Sourcepub fn body(&self) -> Option<&Element>
pub fn body(&self) -> Option<&Element>
The office:text element: the flow.
None for a package that declares itself a text document and carries no
text body, which is a broken document rather than an empty one.
Sourcepub fn page_layout(&self) -> PageLayout
pub fn page_layout(&self) -> PageLayout
The page layout the document’s first master page points at.
A text document has one master page per page style, and the first is the
one the body starts on. Where there is none, or no styles.xml at all,
the default of PageLayout applies.
Sourcepub fn text_width(&self) -> f32
pub fn text_width(&self) -> f32
The width a line of body text may be: the page less its side margins.
Sourcepub fn outline(&self) -> Vec<Heading>
pub fn outline(&self) -> Vec<Heading>
The document’s headings, as an outline for navigating it: each heading’s level, its text, and its position among the body’s children.
Only the top level of the body is walked. A heading inside a table cell or a frame is not a heading in the outline — ODF permits one and no application lists it — and a heading inside a section is, which is why sections are descended into.
Sourcepub fn paragraph_style(&self, element: &Element) -> Rc<Properties>
pub fn paragraph_style(&self, element: &Element) -> Rc<Properties>
The style a block element asks for, resolved.
The family is the one the element belongs to, which for everything in a
text flow is Family::Paragraph except a table and its parts.