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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

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

glib::wrapper! {
    ///
    #[doc(alias = "PopplerLayer")]
    pub struct Layer(Object<ffi::PopplerLayer>);

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

impl Layer {
    /// Returns the numeric ID the radio button group associated with `self`.
    ///
    /// # Returns
    ///
    /// the ID of the radio button group associated with `self`,
    /// or 0 if the layer is not associated to any radio button group
    #[doc(alias = "poppler_layer_get_radio_button_group_id")]
    #[doc(alias = "get_radio_button_group_id")]
    pub fn radio_button_group_id(&self) -> i32 {
        unsafe { ffi::poppler_layer_get_radio_button_group_id(self.to_glib_none().0) }
    }

    /// Returns the name of the layer suitable for
    /// presentation as a title in a viewer's GUI
    ///
    /// # Returns
    ///
    /// a string containing the title of the layer
    #[doc(alias = "poppler_layer_get_title")]
    #[doc(alias = "get_title")]
    pub fn title(&self) -> Option<glib::GString> {
        unsafe { from_glib_none(ffi::poppler_layer_get_title(self.to_glib_none().0)) }
    }

    /// Hides `self`. If `self` is the parent of other nested layers,
    /// such layers will be also hidden and will be blocked until `self`
    /// is shown again
    #[doc(alias = "poppler_layer_hide")]
    pub fn hide(&self) {
        unsafe {
            ffi::poppler_layer_hide(self.to_glib_none().0);
        }
    }

    /// Returns whether `self` is parent of other nested layers.
    ///
    /// # Returns
    ///
    /// [`true`] if `self` is a parent layer
    #[doc(alias = "poppler_layer_is_parent")]
    pub fn is_parent(&self) -> bool {
        unsafe { from_glib(ffi::poppler_layer_is_parent(self.to_glib_none().0)) }
    }

    /// Returns whether `self` is visible
    ///
    /// # Returns
    ///
    /// [`true`] if `self` is visible
    #[doc(alias = "poppler_layer_is_visible")]
    pub fn is_visible(&self) -> bool {
        unsafe { from_glib(ffi::poppler_layer_is_visible(self.to_glib_none().0)) }
    }

    /// Shows `self`
    #[doc(alias = "poppler_layer_show")]
    pub fn show(&self) {
        unsafe {
            ffi::poppler_layer_show(self.to_glib_none().0);
        }
    }
}

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