docx_rust/formatting/
page_grid.rs1use hard_xml::{XmlRead, XmlWrite};
2
3use crate::__string_enum;
4
5#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
13#[cfg_attr(test, derive(PartialEq))]
14#[xml(tag = "w:docGrid")]
15pub struct PageGrid {
16 #[xml(attr = "w:type")]
17 pub ty: Option<GridType>,
18 #[xml(attr = "w:linePitch")]
19 pub line_pitch: Option<isize>,
20 #[xml(attr = "w:charSpace")]
21 pub char_space: Option<isize>,
22}
23
24#[derive(Debug, Clone)]
25#[cfg_attr(test, derive(PartialEq))]
26pub enum GridType {
27 Default, Lines, LinesAndChars, SnapToChars, }
32
33__string_enum! {
34 GridType {
35 Default = "default",
36 Lines = "lines",
37 LinesAndChars = "linesAndChars",
38 SnapToChars = "snapToChars",
39 }
40}
41
42