Skip to main content

gtk/auto/
plug_accessible.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4
5use crate::ffi;
6use glib::{prelude::*, translate::*};
7
8glib::wrapper! {
9    ///
10    ///
11    /// # Implements
12    ///
13    /// [`PlugAccessibleExt`][trait@crate::prelude::PlugAccessibleExt], [`trait@atk::prelude::ObjectExt`], [`trait@glib::ObjectExt`]
14    #[doc(alias = "GtkPlugAccessible")]
15    pub struct PlugAccessible(Object<ffi::GtkPlugAccessible, ffi::GtkPlugAccessibleClass>) @extends atk::Object;
16
17    match fn {
18        type_ => || ffi::gtk_plug_accessible_get_type(),
19    }
20}
21
22impl PlugAccessible {
23    pub const NONE: Option<&'static PlugAccessible> = None;
24
25    // rustdoc-stripper-ignore-next
26    /// Creates a new builder-pattern struct instance to construct [`PlugAccessible`] objects.
27    ///
28    /// This method returns an instance of [`PlugAccessibleBuilder`](crate::builders::PlugAccessibleBuilder) which can be used to create [`PlugAccessible`] objects.
29    pub fn builder() -> PlugAccessibleBuilder {
30        PlugAccessibleBuilder::new()
31    }
32}
33
34// rustdoc-stripper-ignore-next
35/// A [builder-pattern] type to construct [`PlugAccessible`] objects.
36///
37/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
38#[must_use = "The builder must be built to be used"]
39pub struct PlugAccessibleBuilder {
40    builder: glib::object::ObjectBuilder<'static, PlugAccessible>,
41}
42
43impl PlugAccessibleBuilder {
44    fn new() -> Self {
45        Self {
46            builder: glib::object::Object::builder(),
47        }
48    }
49
50    pub fn accessible_description(self, accessible_description: impl Into<glib::GString>) -> Self {
51        Self {
52            builder: self
53                .builder
54                .property("accessible-description", accessible_description.into()),
55        }
56    }
57
58    pub fn accessible_help_text(self, accessible_help_text: impl Into<glib::GString>) -> Self {
59        Self {
60            builder: self
61                .builder
62                .property("accessible-help-text", accessible_help_text.into()),
63        }
64    }
65
66    pub fn accessible_id(self, accessible_id: impl Into<glib::GString>) -> Self {
67        Self {
68            builder: self.builder.property("accessible-id", accessible_id.into()),
69        }
70    }
71
72    pub fn accessible_name(self, accessible_name: impl Into<glib::GString>) -> Self {
73        Self {
74            builder: self
75                .builder
76                .property("accessible-name", accessible_name.into()),
77        }
78    }
79
80    pub fn accessible_parent(self, accessible_parent: &impl IsA<atk::Object>) -> Self {
81        Self {
82            builder: self
83                .builder
84                .property("accessible-parent", accessible_parent.clone().upcast()),
85        }
86    }
87
88    pub fn accessible_role(self, accessible_role: atk::Role) -> Self {
89        Self {
90            builder: self.builder.property("accessible-role", accessible_role),
91        }
92    }
93
94    /// Table caption.
95    /// Since 1.3. Use table-caption-object instead.
96    pub fn accessible_table_caption(
97        self,
98        accessible_table_caption: impl Into<glib::GString>,
99    ) -> Self {
100        Self {
101            builder: self
102                .builder
103                .property("accessible-table-caption", accessible_table_caption.into()),
104        }
105    }
106
107    pub fn accessible_table_caption_object(
108        self,
109        accessible_table_caption_object: &impl IsA<atk::Object>,
110    ) -> Self {
111        Self {
112            builder: self.builder.property(
113                "accessible-table-caption-object",
114                accessible_table_caption_object.clone().upcast(),
115            ),
116        }
117    }
118
119    /// Accessible table column description.
120    /// Since 2.12. Use `atk_table_get_column_description()`
121    /// and `atk_table_set_column_description()` instead.
122    pub fn accessible_table_column_description(
123        self,
124        accessible_table_column_description: impl Into<glib::GString>,
125    ) -> Self {
126        Self {
127            builder: self.builder.property(
128                "accessible-table-column-description",
129                accessible_table_column_description.into(),
130            ),
131        }
132    }
133
134    /// Accessible table column header.
135    /// Since 2.12. Use `atk_table_get_column_header()` and
136    /// `atk_table_set_column_header()` instead.
137    pub fn accessible_table_column_header(
138        self,
139        accessible_table_column_header: &impl IsA<atk::Object>,
140    ) -> Self {
141        Self {
142            builder: self.builder.property(
143                "accessible-table-column-header",
144                accessible_table_column_header.clone().upcast(),
145            ),
146        }
147    }
148
149    /// Accessible table row description.
150    /// Since 2.12. Use `atk_table_get_row_description()` and
151    /// `atk_table_set_row_description()` instead.
152    pub fn accessible_table_row_description(
153        self,
154        accessible_table_row_description: impl Into<glib::GString>,
155    ) -> Self {
156        Self {
157            builder: self.builder.property(
158                "accessible-table-row-description",
159                accessible_table_row_description.into(),
160            ),
161        }
162    }
163
164    /// Accessible table row header.
165    /// Since 2.12. Use `atk_table_get_row_header()` and
166    /// `atk_table_set_row_header()` instead.
167    pub fn accessible_table_row_header(
168        self,
169        accessible_table_row_header: &impl IsA<atk::Object>,
170    ) -> Self {
171        Self {
172            builder: self.builder.property(
173                "accessible-table-row-header",
174                accessible_table_row_header.clone().upcast(),
175            ),
176        }
177    }
178
179    pub fn accessible_table_summary(
180        self,
181        accessible_table_summary: &impl IsA<atk::Object>,
182    ) -> Self {
183        Self {
184            builder: self.builder.property(
185                "accessible-table-summary",
186                accessible_table_summary.clone().upcast(),
187            ),
188        }
189    }
190
191    /// Numeric value of this object, in case being and AtkValue.
192    /// Since 2.12. Use `atk_value_get_value_and_text()` to get
193    /// the value, and value-changed signal to be notified on their value
194    /// changes.
195    pub fn accessible_value(self, accessible_value: f64) -> Self {
196        Self {
197            builder: self.builder.property("accessible-value", accessible_value),
198        }
199    }
200
201    // rustdoc-stripper-ignore-next
202    /// Build the [`PlugAccessible`].
203    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
204    pub fn build(self) -> PlugAccessible {
205        assert_initialized_main_thread!();
206        self.builder.build()
207    }
208}
209
210/// Trait containing all [`struct@PlugAccessible`] methods.
211///
212/// # Implementors
213///
214/// [`PlugAccessible`][struct@crate::PlugAccessible]
215pub trait PlugAccessibleExt: IsA<PlugAccessible> + 'static {
216    #[doc(alias = "gtk_plug_accessible_get_id")]
217    #[doc(alias = "get_id")]
218    fn id(&self) -> Option<glib::GString> {
219        unsafe {
220            from_glib_full(ffi::gtk_plug_accessible_get_id(
221                self.as_ref().to_glib_none().0,
222            ))
223        }
224    }
225}
226
227impl<O: IsA<PlugAccessible>> PlugAccessibleExt for O {}