docx_reader/documents/elements/
table_row_property.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
use serde::Serialize;

use super::*;
use crate::HeightRule;

#[derive(Debug, Clone, PartialEq, Serialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct TableRowProperty {
	grid_after: Option<u32>,
	width_after: Option<f32>,
	grid_before: Option<u32>,
	width_before: Option<f32>,
	#[serde(skip_serializing_if = "Option::is_none")]
	row_height: Option<f32>,
	#[serde(skip_serializing_if = "Option::is_none")]
	height_rule: Option<HeightRule>,
	#[serde(skip_serializing_if = "Option::is_none")]
	pub del: Option<Delete>,
	#[serde(skip_serializing_if = "Option::is_none")]
	pub ins: Option<Insert>,
}

impl TableRowProperty {
	pub fn new() -> TableRowProperty {
		Default::default()
	}

	pub fn grid_after(mut self, after: u32) -> Self {
		self.grid_after = Some(after);
		self
	}

	pub fn width_after(mut self, w: f32) -> Self {
		self.width_after = Some(w);
		self
	}

	pub fn grid_before(mut self, before: u32) -> Self {
		self.grid_before = Some(before);
		self
	}

	pub fn width_before(mut self, w: f32) -> Self {
		self.width_before = Some(w);
		self
	}

	pub fn row_height(mut self, h: f32) -> Self {
		self.row_height = Some(h);
		self
	}

	pub fn height_rule(mut self, r: HeightRule) -> Self {
		self.height_rule = Some(r);
		self
	}

	pub fn delete(mut self, d: Delete) -> Self {
		self.del = Some(d);
		self
	}

	pub fn insert(mut self, i: Insert) -> Self {
		self.ins = Some(i);
		self
	}
}