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
use super::super::super::EnumTrait;
use std::str::FromStr;
#[derive(Clone, Debug)]
pub enum PresetLineDashValues {
    Dash,
    DashDot,
    Dot,
    LargeDash,
    LargeDashDot,
    LargeDashDotDot,
    Solid,
    SystemDash,
    SystemDashDot,
    SystemDashDotDot,
    SystemDot,
}
impl Default for PresetLineDashValues {
    fn default() -> Self {
        Self::Solid
    }
}
impl EnumTrait for PresetLineDashValues {
    fn get_value_string(&self) -> &str {
        match &self {
            Self::Dash => "dash",
            Self::DashDot => "dashDot",
            Self::Dot => "dot",
            Self::LargeDash => "lgDash",
            Self::LargeDashDot => "lgDashDot",
            Self::LargeDashDotDot => "lgDashDotDot",
            Self::Solid => "solid",
            Self::SystemDash => "sysDash",
            Self::SystemDashDot => "sysDashDot",
            Self::SystemDashDotDot => "sysDashDotDot",
            Self::SystemDot => "sysDot",
        }
    }
}
impl FromStr for PresetLineDashValues {
    type Err = ();
    fn from_str(input: &str) -> Result<Self, Self::Err> {
        match input {
            "dash" => Ok(Self::Dash),
            "dashDot" => Ok(Self::DashDot),
            "dot" => Ok(Self::Dot),
            "lgDash" => Ok(Self::LargeDash),
            "lgDashDot" => Ok(Self::LargeDashDot),
            "lgDashDotDot" => Ok(Self::LargeDashDotDot),
            "solid" => Ok(Self::Solid),
            "sysDash" => Ok(Self::SystemDash),
            "sysDashDot" => Ok(Self::SystemDashDot),
            "sysDashDotDot" => Ok(Self::SystemDashDotDot),
            "sysDot" => Ok(Self::SystemDot),
            _ => Err(()),
        }
    }
}