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
58
59
60
61
62
63
64
65
66
67
68
69
70
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from
// from gir-files (https://github.com/gtk-rs/gir-files.git)
// DO NOT EDIT

use glib::translate::*;
use std::fmt;

glib::wrapper! {
    /// An object representing an `GObject::EnumValue`.
    ///
    /// The [`EnumValueObject`][crate::EnumValueObject] object represents a `GObject::EnumValue`,
    /// allowing it to be used with [`gio::ListModel`][crate::gio::ListModel].
    ///
    /// # Implements
    ///
    /// [`trait@glib::ObjectExt`]
    #[doc(alias = "HdyEnumValueObject")]
    pub struct EnumValueObject(Object<ffi::HdyEnumValueObject, ffi::HdyEnumValueObjectClass>);

    match fn {
        type_ => || ffi::hdy_enum_value_object_get_type(),
    }
}

impl EnumValueObject {
    //#[doc(alias = "hdy_enum_value_object_new")]
    //pub fn new(enum_value: /*Ignored*/&mut glib::EnumValue) -> EnumValueObject {
    //    unsafe { TODO: call ffi:hdy_enum_value_object_new() }
    //}

    /// Gets the name of @self.
    ///
    /// # Returns
    ///
    /// the name of @self
    #[doc(alias = "hdy_enum_value_object_get_name")]
    #[doc(alias = "get_name")]
    pub fn name(&self) -> Option<glib::GString> {
        unsafe { from_glib_none(ffi::hdy_enum_value_object_get_name(self.to_glib_none().0)) }
    }

    /// Gets the nick of @self.
    ///
    /// # Returns
    ///
    /// the nick of @self
    #[doc(alias = "hdy_enum_value_object_get_nick")]
    #[doc(alias = "get_nick")]
    pub fn nick(&self) -> Option<glib::GString> {
        unsafe { from_glib_none(ffi::hdy_enum_value_object_get_nick(self.to_glib_none().0)) }
    }

    /// Gets the value of @self.
    ///
    /// # Returns
    ///
    /// the value of @self
    #[doc(alias = "hdy_enum_value_object_get_value")]
    #[doc(alias = "get_value")]
    pub fn value(&self) -> i32 {
        unsafe { ffi::hdy_enum_value_object_get_value(self.to_glib_none().0) }
    }
}

impl fmt::Display for EnumValueObject {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        f.write_str("EnumValueObject")
    }
}