umya_spreadsheet/structs/vml/spreadsheet/
object_values.rs1use super::super::super::EnumTrait;
2use std::str::FromStr;
3#[derive(Clone, Debug)]
4pub enum ObjectValues {
5 AuditingLine,
6 AuditingRectangle,
7 Button,
8 Checkbox,
9 Dialog,
10 Drop,
11 Edit,
12 Group,
13 GroupBox,
14 Label,
15 List,
16 Movie,
17 Note,
18 Picture,
19 Radio,
20 Rectangle,
21 Scroll,
22 Shape,
23 Spin,
24}
25impl Default for ObjectValues {
26 #[inline]
27 fn default() -> Self {
28 Self::Note
29 }
30}
31impl EnumTrait for ObjectValues {
32 #[inline]
33 fn get_value_string(&self) -> &str {
34 match &self {
35 Self::AuditingLine => "LineA",
36 Self::AuditingRectangle => "RectA",
37 Self::Button => "Button",
38 Self::Checkbox => "Checkbox",
39 Self::Dialog => "Dialog",
40 Self::Drop => "Drop",
41 Self::Edit => "Edit",
42 Self::Group => "Group",
43 Self::GroupBox => "GBox",
44 Self::Label => "Label",
45 Self::List => "List",
46 Self::Movie => "Movie",
47 Self::Note => "Note",
48 Self::Picture => "Pict",
49 Self::Radio => "Radio",
50 Self::Rectangle => "Rect",
51 Self::Scroll => "Scroll",
52 Self::Shape => "Shape",
53 Self::Spin => "Spin",
54 }
55 }
56}
57impl FromStr for ObjectValues {
58 type Err = ();
59 #[inline]
60 fn from_str(input: &str) -> Result<Self, Self::Err> {
61 match input {
62 "LineA" => Ok(Self::AuditingLine),
63 "RectA" => Ok(Self::AuditingRectangle),
64 "Button" => Ok(Self::Button),
65 "Checkbox" => Ok(Self::Checkbox),
66 "Dialog" => Ok(Self::Dialog),
67 "Drop" => Ok(Self::Drop),
68 "Edit" => Ok(Self::Edit),
69 "Group" => Ok(Self::Group),
70 "GBox" => Ok(Self::GroupBox),
71 "Label" => Ok(Self::Label),
72 "List" => Ok(Self::List),
73 "Movie" => Ok(Self::Movie),
74 "Note" => Ok(Self::Note),
75 "Pict" => Ok(Self::Picture),
76 "Radio" => Ok(Self::Radio),
77 "Rect" => Ok(Self::Rectangle),
78 "Scroll" => Ok(Self::Scroll),
79 "Shape" => Ok(Self::Shape),
80 "Spin" => Ok(Self::Spin),
81 _ => Err(()),
82 }
83 }
84}