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 gir-files (https://github.com/gtk-rs/gir-files.git)
// from webkit2gtk-gir-files
// DO NOT EDIT

use glib::translate::*;

glib::wrapper! {
    /// Information about a MIME type.
    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
    pub struct MimeInfo(Shared<ffi::WebKitMimeInfo>);

    match fn {
        ref => |ptr| ffi::webkit_mime_info_ref(ptr),
        unref => |ptr| ffi::webkit_mime_info_unref(ptr),
        type_ => || ffi::webkit_mime_info_get_type(),
    }
}

impl MimeInfo {
    /// Gets the description of the MIME type.
    ///
    /// # Deprecated since 2.32
    ///
    ///
    /// # Returns
    ///
    /// description, as a string.
    #[cfg_attr(feature = "v2_32", deprecated = "Since 2.32")]
    #[doc(alias = "webkit_mime_info_get_description")]
    #[doc(alias = "get_description")]
    pub fn description(&self) -> Option<glib::GString> {
        unsafe { from_glib_none(ffi::webkit_mime_info_get_description(self.to_glib_none().0)) }
    }

    /// Get the list of file extensions associated to the MIME type.
    ///
    /// # Deprecated since 2.32
    ///
    ///
    /// # Returns
    ///
    /// a
    ///  [`None`]-terminated array of strings
    #[cfg_attr(feature = "v2_32", deprecated = "Since 2.32")]
    #[doc(alias = "webkit_mime_info_get_extensions")]
    #[doc(alias = "get_extensions")]
    pub fn extensions(&self) -> Vec<glib::GString> {
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::webkit_mime_info_get_extensions(
                self.to_glib_none().0,
            ))
        }
    }

    /// Gets the MIME type.
    ///
    /// # Deprecated since 2.32
    ///
    ///
    /// # Returns
    ///
    /// MIME type, as a string.
    #[cfg_attr(feature = "v2_32", deprecated = "Since 2.32")]
    #[doc(alias = "webkit_mime_info_get_mime_type")]
    #[doc(alias = "get_mime_type")]
    pub fn mime_type(&self) -> Option<glib::GString> {
        unsafe { from_glib_none(ffi::webkit_mime_info_get_mime_type(self.to_glib_none().0)) }
    }
}