use f_office_xml::enumeration::{Values, another, own};
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
pub enum Anchor {
Page,
Margin,
#[default]
Text,
}
pub(crate) const ANCHOR: &Values<Anchor> = &Values::new(&[
own("text", Anchor::Text),
own("margin", Anchor::Margin),
own("page", Anchor::Page),
]);
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub(crate) enum XAlign {
Left,
Center,
Right,
Inside,
Outside,
}
impl XAlign {
pub(crate) const fn align(self) -> Align {
match self {
Self::Left | Self::Inside => Align::Start,
Self::Center => Align::Center,
Self::Right | Self::Outside => Align::End,
}
}
}
pub(crate) const X_ALIGN: &Values<XAlign> = &Values::new(&[
own("left", XAlign::Left),
own("center", XAlign::Center),
own("right", XAlign::Right),
another("inside", XAlign::Inside),
another("outside", XAlign::Outside),
]);
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub(crate) enum YAlign {
Inline,
Align(Align),
}
pub(crate) const Y_ALIGN: &Values<YAlign> = &Values::new(&[
own("inline", YAlign::Inline),
own("top", YAlign::Align(Align::Start)),
own("center", YAlign::Align(Align::Center)),
own("bottom", YAlign::Align(Align::End)),
another("inside", YAlign::Align(Align::Start)),
another("outside", YAlign::Align(Align::End)),
]);
impl YAlign {
pub(crate) const fn align(self) -> Option<Align> {
match self {
Self::Inline => None,
Self::Align(align) => Some(align),
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Align {
Start,
Center,
End,
}