docx_reader/documents/elements/
wp_anchor.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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![] }
	}
}