docx_reader/documents/elements/wp_anchor.rs
use super::*;
use serde::Serialize;
#[derive(Debug, Clone, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct WpAnchor {
pub children: Vec<AGraphic>,
}
/*
20.4.2.3
anchor (WpAnchor for Floating DrawingML Object)
This element specifies that the DrawingML object located at this position in the document is a floating object.
Within a WordprocessingML document, drawing objects can exist in two states:
- Inline - The drawing object is in line with the text, and affects the line height and layout of its line (like a
- character glyph of similar size).
Floating - The drawing object is anchored within the text, but can be absolutely positioned in the
document relative to the page.
When this element encapsulates the DrawingML object's i
*/
impl WpAnchor {
pub fn new() -> WpAnchor {
Default::default()
}
pub fn add_graphic(mut self, g: AGraphic) -> WpAnchor {
self.children.push(g);
self
}
}
impl Default for WpAnchor {
fn default() -> Self {
WpAnchor { children: vec![] }
}
}