umya_spreadsheet/structs/drawing/
text_alignment_type_values.rs1use super::super::super::EnumTrait;
2use std::str::FromStr;
3#[derive(Clone, Debug)]
4pub enum TextAlignmentTypeValues {
5 Center,
6 Distributed,
7 Justified,
8 JustifiedLow,
9 Left,
10 Right,
11 ThaiDistributed,
12}
13impl Default for TextAlignmentTypeValues {
14 #[inline]
15 fn default() -> Self {
16 Self::Left
17 }
18}
19impl EnumTrait for TextAlignmentTypeValues {
20 #[inline]
21 fn get_value_string(&self) -> &str {
22 match &self {
23 Self::Center => "ctr",
24 Self::Distributed => "dist",
25 Self::Justified => "just",
26 Self::JustifiedLow => "justLow",
27 Self::Left => "l",
28 Self::Right => "r",
29 Self::ThaiDistributed => "thaiDist",
30 }
31 }
32}
33impl FromStr for TextAlignmentTypeValues {
34 type Err = ();
35
36 #[inline]
37 fn from_str(input: &str) -> Result<Self, Self::Err> {
38 match input {
39 "ctr" => Ok(Self::Center),
40 "dist" => Ok(Self::Distributed),
41 "just" => Ok(Self::Justified),
42 "justLow" => Ok(Self::JustifiedLow),
43 "l" => Ok(Self::Left),
44 "r" => Ok(Self::Right),
45 "thaiDist" => Ok(Self::ThaiDistributed),
46 _ => Err(()),
47 }
48 }
49}