pub struct DrawFrame { /* private fields */ }
Expand description

The draw:frame element represents a frame and serves as the container for elements that may occur in a frame. Frame formatting properties are stored in styles belonging to the graphic family.

Implementations§

source§

impl DrawFrame

source

pub fn new() -> Self

New.

source

pub fn attrmap(&self) -> &AttrMap2

Allows access to all attributes of the style itself.

source

pub fn attrmap_mut(&mut self) -> &mut AttrMap2

Allows access to all attributes of the style itself.

source

pub fn desc(&self) -> Option<&String>

Desc

source

pub fn set_desc<S: Into<String>>(&mut self, desc: S)

Desc

source

pub fn clear_desc(&mut self)

Desc

source

pub fn title(&self) -> Option<&String>

Title

source

pub fn set_title<S: Into<String>>(&mut self, title: S)

Name

source

pub fn clear_title(&mut self)

Name

source

pub fn set_content(&mut self, content: Vec<DrawFrameContent>)

Frame content.

source

pub fn push_content(&mut self, content: DrawFrameContent)

Frame content.

source

pub fn clear_content(&mut self)

Frame content.

source

pub fn content_ref(&self) -> &Vec<DrawFrameContent>

Frame content.

source

pub fn content_mut(&mut self) -> &mut Vec<DrawFrameContent>

Frame content.

source

pub fn set_draw_name<S: Into<String>>(&mut self, id: S)

The draw:name attribute specifies a name by which a draw:frame element can be referenced.

source

pub fn set_draw_caption_id<S: Into<String>>(&mut self, id: S)

The draw:caption-id attribute establishes a relationship between a drawing shape and its caption. It takes a value of type IDREF. The value for the draw:caption-id attribute is the target ID assigned to the draw:text-box 10.4.3 element that contains the caption. Note: When a caption is assigned to a drawing shape, an id shall be assigned to the element containing the text used to caption a drawing shape. Removing the caption should result in removing the draw:caption-id attribute of the drawing shape that was being captioned

source

pub fn set_draw_class_names(&mut self, names: &[GraphicStyleRef])

The draw:class-names attribute specifies a white-space-separated list of styles with the family value of graphic. The referenced styles are applied in the order they are contained in the list. If both draw:style-name and draw:class-names are present, the style referenced by the draw:style-name attribute is applied before the styles referenced by the draw:class-names attribute.

source

pub fn set_draw_corner_radius(&mut self, radius: u32)

The draw:corner-radius attribute specifies the radius of the circle used to round off the corners of a caption draw:caption, rectangle draw:rect, or a text-box draw:textbox. The svg:rx 19.554 and svg:ry 19.555 attributes can also be used to round off the corners of a rectangle draw:rect.

If svg:rx and/or svg:ry and draw:corner-radius attributes are present on an element, the svg:rx and svg:ry attributes control the rounding applied to the shape defined by the element. If one or both of svg:rx and svg:ry attributes are present, any draw:corner-radius attribute is ignored.

source

pub fn set_draw_copy_of<S: Into<String>>(&mut self, name: S)

The draw:copy-of attribute specifies that a frame displays the contents of another frame. This does not effect style and position information. The style and position information of the frame with the draw:copy-of attribute is used to render the copied contents. Note: Multiple frames can be set to display the exact same underlying data: for instance for a company logo, that that is to appear somewhere on every page, without being part of a header or footer.

source

pub fn set_draw_id<S: Into<String>>(&mut self, id: S)

The draw:id attribute specifies identifiers for draw elements. OpenDocument consumers shall ignore a draw:id attribute if it occurs on a draw element with an xml:id attribute value. OpenDocument producers may write draw:id attributes for any draw element in addition to an xml:id attribute. The value of a draw:id attribute shall equal the value of an xml:id attribute on the same element.

The draw:id attribute is deprecated in favor of xml:id

source

pub fn set_draw_layer<S: Into<String>>(&mut self, layer: S)

The draw:layer attribute specifies the name of a layer in the layer-set of a document.

Note: The effect of this attribute is to assign a shape to a particular layer.

source

pub fn set_draw_style_name(&mut self, style: GraphicStyleRef)

The draw:style-name attribute specifies the name of a style:style element with a style:family attribute value value of graphic.

source

pub fn set_draw_text_style_name(&mut self, style: ParagraphStyleRef)

The draw:text-style-name attribute specifies a style for formatting of text in a shape. The value of this attribute is the name of a style:style 16.2 element with a style:family 19.480 attribute value of paragraph.

source

pub fn set_draw_transform<S: AsRef<str>>(&mut self, transform: &[S])

The draw:transform attribute specifies a list of transformations that can be applied to a drawing shape. The value of this attribute is a list of transform definitions, which are applied to the drawing shape in the order in which they are listed. The transform definitions in the list shall be separated by a white space and/or a comma “,” (U+002C, COMMA). Unless otherwise stated, the parameters of the transform definitions are double values (18.2)

The defined transforms are: • matrix(a b c d e f), specifies a transformation in the form of a transformation matrix of six values. “The values describe a standard 3x2 homogeneous transformation matrix in column-major order, where the right column (e, f) describes the translation. • rotate(rotate-angle), specifies a rotation by rotate-angle degrees about the origin of the shape’s coordinate system. • scale(sx [sy]), specifies a scale operation by sx and sy. If sy is not provided, it is assumed to be equal to sx. • skewX(skew-angle), specifies a skew transformation by skew-angle degrees along the x-axis. • skewY(skew-angle), specifies a skew transformation by skew-angle degrees along the y-axis. • translate(tx [ty]), specifies a translation by tx and ty, where tx and ty are lengths (18.3.18). If ty is not provided, it is assumed to be zero.

source

pub fn set_draw_z_index(&mut self, z_index: u32)

The draw:z-index attribute defines a rendering order for shapes in a document instance. In the absence of this attribute, shapes are rendered in the order in which they appear in the document. The draw:z-index values increase from back to front.

For a shape on which the style:run-through 20.351 attribute with value foreground is in effect, producers should not generate a draw:z-index value that is smaller than the value of any draw:z-index on a shape on which the style:run-through attribute with value background is in effect.

Producers shall not generate a draw:z-index for shapes that are children of a draw:g element 10.3.15 or a dr3d:scene element 10.5.2.

source

pub fn set_rel_height(&mut self, rel_height: RelativeScale)

The style:rel-height attribute specifies height of a drawing object as a relative value within a frame. The defined values for the style:rel-height attribute are: • scale: the height should be calculated depending on the width, so that the ratio of width and height of the original image or object size is preserved. • scale-min: the height should be calculated as for value scale, but the calculated height is a minimum height rather than an absolute one. • a value of type percent 18.3.23. The interpretation of percentage values depends on the anchor of the drawing object. If the anchor for the drawing object is in a table cell, the percentage value is relative to the surrounding table box. If the anchor for the drawing object is in a text box, the percentage value is relative to the surrounding text box. In other cases, the percentage values is relative to the width of the page or window. To support consumers that do not support relative width and heights, producers should also provide the height in svg:height and fo:min-height attributes.

source

pub fn set_rel_width(&mut self, rel_width: RelativeScale)

The style:rel-width attribute specifies the relative width of a drawing object. The defined values for the style:rel-width attribute are:

  • scale: the width should be calculated depending on the height, so that the ratio of width and height of the original image or object size is preserved.
  • scale-min: the width should be calculated as for value scale, but the calculated width is a minimum width rather than an absolute one.
  • a value of type percent 18.3.23. The interpretation of the percent value depends on the anchor of the drawing object. If the anchor for the drawing object is in a table cell, the percent value of the surrounding table box. If the anchor for the drawing object is in a text box, the percentage value of the surrounding text box. In all other cases, the percent value of the containing page or window To support consumers that do not support relative width, producers should also provide the width in a svg:width 19.575 attribute.
source

pub fn set_height(&mut self, height: Length)

Height.

source

pub fn set_width(&mut self, width: Length)

Width.

source

pub fn svg_x(&mut self, x: Length)

See §5.1.2 of SVG. For drawing shapes that have a non-rectangular shape, the coordinate refers to the drawing shape’s bounding box.

source

pub fn svg_y(&mut self, y: Length)

See §5.1.2 of SVG. For drawing shapes that have a non-rectangular shape, the coordinate refers to the drawing shape’s bounding box.

source

pub fn set_table_end_cell_address(&mut self, cellref: CellRef)

The table:end-cell-address attribute specifies the end position of the shape if it is included in a spreadsheet document.

source

pub fn set_table_end_x(&mut self, x: Length)

The table:end-x attribute specifies the x-coordinate of the end position of a shape relative to the top-left edge of a cell. The size attributes of the shape are ignored.

source

pub fn set_table_end_y(&mut self, y: Length)

The table:end-y attribute specifies the y-coordinate of the end position of a shape relative to the top-left edge of a cell. The size attributes of the shape are ignored.

source

pub fn set_table_table_background(&mut self, is_bg: bool)

The table:table-background attribute specifies whether a shape is in the table background if the drawing shape is included in a spreadsheet document. The defined values for the table:table-background attribute are: • false: shape is included in foreground of a table. • true: shape is included in background of a table.

source

pub fn set_xml_id<S: Into<String>>(&mut self, id: S)

The table:end-y attribute specifies the y-coordinate of the end position of a shape relative to the top-left edge of a cell. The size attributes of the shape are ignored.

Trait Implementations§

source§

impl Clone for DrawFrame

source§

fn clone(&self) -> DrawFrame

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for DrawFrame

source§

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

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

impl Default for DrawFrame

source§

fn default() -> DrawFrame

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<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,

§

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>,

§

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>,

§

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.