docx_reader/types/
drawing_position.rs

1use serde::Serialize;
2use std::fmt;
3
4#[derive(Debug, Clone, Copy, Serialize, PartialEq)]
5#[serde(rename_all = "camelCase")]
6pub enum DrawingPositionType {
7	Anchor,
8	Inline,
9}
10
11#[derive(Debug, Clone, Copy, Serialize, PartialEq)]
12#[serde(rename_all = "camelCase")]
13pub enum PicAlign {
14	Left,
15	Right,
16	Center,
17	Bottom,
18	Top,
19}
20
21impl fmt::Display for PicAlign {
22	fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
23		match *self {
24			PicAlign::Left => write!(f, "left"),
25			PicAlign::Right => write!(f, "right"),
26			PicAlign::Center => write!(f, "center"),
27			PicAlign::Bottom => write!(f, "bottom"),
28			PicAlign::Top => write!(f, "top"),
29		}
30	}
31}
32
33#[derive(Debug, Clone, Copy, Serialize, PartialEq)]
34#[serde(rename_all = "camelCase")]
35pub enum DrawingPosition {
36	Offset(i32),
37	Align(PicAlign),
38}