Skip to main content

atk/auto/
enums.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
8/// Specifies how xy coordinates are to be interpreted. Used by functions such
9/// as [`ComponentExt::position()`][crate::prelude::ComponentExt::position()] and [`TextExt::character_extents()`][crate::prelude::TextExt::character_extents()]
10#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
11#[non_exhaustive]
12#[doc(alias = "AtkCoordType")]
13pub enum CoordType {
14    /// specifies xy coordinates relative to the screen
15    #[doc(alias = "ATK_XY_SCREEN")]
16    Screen,
17    /// specifies xy coordinates relative to the widget's
18    /// top-level window
19    #[doc(alias = "ATK_XY_WINDOW")]
20    Window,
21    /// specifies xy coordinates relative to the widget's
22    /// immediate parent. Since: 2.30
23    #[doc(alias = "ATK_XY_PARENT")]
24    Parent,
25    #[doc(hidden)]
26    __Unknown(i32),
27}
28
29#[doc(hidden)]
30impl IntoGlib for CoordType {
31    type GlibType = ffi::AtkCoordType;
32
33    #[inline]
34    fn into_glib(self) -> ffi::AtkCoordType {
35        match self {
36            Self::Screen => ffi::ATK_XY_SCREEN,
37            Self::Window => ffi::ATK_XY_WINDOW,
38            Self::Parent => ffi::ATK_XY_PARENT,
39            Self::__Unknown(value) => value,
40        }
41    }
42}
43
44#[doc(hidden)]
45impl FromGlib<ffi::AtkCoordType> for CoordType {
46    #[inline]
47    unsafe fn from_glib(value: ffi::AtkCoordType) -> Self {
48        skip_assert_initialized!();
49
50        match value {
51            ffi::ATK_XY_SCREEN => Self::Screen,
52            ffi::ATK_XY_WINDOW => Self::Window,
53            ffi::ATK_XY_PARENT => Self::Parent,
54            value => Self::__Unknown(value),
55        }
56    }
57}
58
59impl StaticType for CoordType {
60    #[inline]
61    #[doc(alias = "atk_coord_type_get_type")]
62    fn static_type() -> glib::Type {
63        unsafe { from_glib(ffi::atk_coord_type_get_type()) }
64    }
65}
66
67impl glib::HasParamSpec for CoordType {
68    type ParamSpec = glib::ParamSpecEnum;
69    type SetValue = Self;
70    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
71
72    fn param_spec_builder() -> Self::BuilderFn {
73        Self::ParamSpec::builder_with_default
74    }
75}
76
77impl glib::value::ValueType for CoordType {
78    type Type = Self;
79}
80
81unsafe impl<'a> glib::value::FromValue<'a> for CoordType {
82    type Checker = glib::value::GenericValueTypeChecker<Self>;
83
84    #[inline]
85    unsafe fn from_value(value: &'a glib::Value) -> Self {
86        skip_assert_initialized!();
87        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
88    }
89}
90
91impl ToValue for CoordType {
92    #[inline]
93    fn to_value(&self) -> glib::Value {
94        let mut value = glib::Value::for_value_type::<Self>();
95        unsafe {
96            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
97        }
98        value
99    }
100
101    #[inline]
102    fn value_type(&self) -> glib::Type {
103        Self::static_type()
104    }
105}
106
107impl From<CoordType> for glib::Value {
108    #[inline]
109    fn from(v: CoordType) -> Self {
110        skip_assert_initialized!();
111        ToValue::to_value(&v)
112    }
113}
114
115/// Describes the layer of a component
116///
117/// These enumerated "layer values" are used when determining which UI
118/// rendering layer a component is drawn into, which can help in making
119/// determinations of when components occlude one another.
120#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
121#[non_exhaustive]
122#[doc(alias = "AtkLayer")]
123pub enum Layer {
124    /// The object does not have a layer
125    #[doc(alias = "ATK_LAYER_INVALID")]
126    Invalid,
127    /// This layer is reserved for the desktop background
128    #[doc(alias = "ATK_LAYER_BACKGROUND")]
129    Background,
130    /// This layer is used for Canvas components
131    #[doc(alias = "ATK_LAYER_CANVAS")]
132    Canvas,
133    /// This layer is normally used for components
134    #[doc(alias = "ATK_LAYER_WIDGET")]
135    Widget,
136    /// This layer is used for layered components
137    #[doc(alias = "ATK_LAYER_MDI")]
138    Mdi,
139    /// This layer is used for popup components, such as menus
140    #[doc(alias = "ATK_LAYER_POPUP")]
141    Popup,
142    /// This layer is reserved for future use.
143    #[doc(alias = "ATK_LAYER_OVERLAY")]
144    Overlay,
145    /// This layer is used for toplevel windows.
146    #[doc(alias = "ATK_LAYER_WINDOW")]
147    Window,
148    #[doc(hidden)]
149    __Unknown(i32),
150}
151
152#[doc(hidden)]
153impl IntoGlib for Layer {
154    type GlibType = ffi::AtkLayer;
155
156    #[inline]
157    fn into_glib(self) -> ffi::AtkLayer {
158        match self {
159            Self::Invalid => ffi::ATK_LAYER_INVALID,
160            Self::Background => ffi::ATK_LAYER_BACKGROUND,
161            Self::Canvas => ffi::ATK_LAYER_CANVAS,
162            Self::Widget => ffi::ATK_LAYER_WIDGET,
163            Self::Mdi => ffi::ATK_LAYER_MDI,
164            Self::Popup => ffi::ATK_LAYER_POPUP,
165            Self::Overlay => ffi::ATK_LAYER_OVERLAY,
166            Self::Window => ffi::ATK_LAYER_WINDOW,
167            Self::__Unknown(value) => value,
168        }
169    }
170}
171
172#[doc(hidden)]
173impl FromGlib<ffi::AtkLayer> for Layer {
174    #[inline]
175    unsafe fn from_glib(value: ffi::AtkLayer) -> Self {
176        skip_assert_initialized!();
177
178        match value {
179            ffi::ATK_LAYER_INVALID => Self::Invalid,
180            ffi::ATK_LAYER_BACKGROUND => Self::Background,
181            ffi::ATK_LAYER_CANVAS => Self::Canvas,
182            ffi::ATK_LAYER_WIDGET => Self::Widget,
183            ffi::ATK_LAYER_MDI => Self::Mdi,
184            ffi::ATK_LAYER_POPUP => Self::Popup,
185            ffi::ATK_LAYER_OVERLAY => Self::Overlay,
186            ffi::ATK_LAYER_WINDOW => Self::Window,
187            value => Self::__Unknown(value),
188        }
189    }
190}
191
192impl StaticType for Layer {
193    #[inline]
194    #[doc(alias = "atk_layer_get_type")]
195    fn static_type() -> glib::Type {
196        unsafe { from_glib(ffi::atk_layer_get_type()) }
197    }
198}
199
200impl glib::HasParamSpec for Layer {
201    type ParamSpec = glib::ParamSpecEnum;
202    type SetValue = Self;
203    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
204
205    fn param_spec_builder() -> Self::BuilderFn {
206        Self::ParamSpec::builder_with_default
207    }
208}
209
210impl glib::value::ValueType for Layer {
211    type Type = Self;
212}
213
214unsafe impl<'a> glib::value::FromValue<'a> for Layer {
215    type Checker = glib::value::GenericValueTypeChecker<Self>;
216
217    #[inline]
218    unsafe fn from_value(value: &'a glib::Value) -> Self {
219        skip_assert_initialized!();
220        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
221    }
222}
223
224impl ToValue for Layer {
225    #[inline]
226    fn to_value(&self) -> glib::Value {
227        let mut value = glib::Value::for_value_type::<Self>();
228        unsafe {
229            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
230        }
231        value
232    }
233
234    #[inline]
235    fn value_type(&self) -> glib::Type {
236        Self::static_type()
237    }
238}
239
240impl From<Layer> for glib::Value {
241    #[inline]
242    fn from(v: Layer) -> Self {
243        skip_assert_initialized!();
244        ToValue::to_value(&v)
245    }
246}
247
248/// Enumeration used to indicate a type of live region and how assertive it
249/// should be in terms of speaking notifications. Currently, this is only used
250/// for "notification" events, but it may be used for additional purposes
251/// in the future.
252#[cfg(feature = "v2_50")]
253#[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))]
254#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
255#[non_exhaustive]
256#[doc(alias = "AtkLive")]
257pub enum Live {
258    /// No live region.
259    #[doc(alias = "ATK_LIVE_NONE")]
260    None,
261    /// This live region should be considered polite.
262    #[doc(alias = "ATK_LIVE_POLITE")]
263    Polite,
264    /// This live region should be considered assertive.
265    #[doc(alias = "ATK_LIVE_ASSERTIVE")]
266    Assertive,
267    #[doc(hidden)]
268    __Unknown(i32),
269}
270
271#[cfg(feature = "v2_50")]
272#[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))]
273#[doc(hidden)]
274impl IntoGlib for Live {
275    type GlibType = ffi::AtkLive;
276
277    #[inline]
278    fn into_glib(self) -> ffi::AtkLive {
279        match self {
280            Self::None => ffi::ATK_LIVE_NONE,
281            Self::Polite => ffi::ATK_LIVE_POLITE,
282            Self::Assertive => ffi::ATK_LIVE_ASSERTIVE,
283            Self::__Unknown(value) => value,
284        }
285    }
286}
287
288#[cfg(feature = "v2_50")]
289#[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))]
290#[doc(hidden)]
291impl FromGlib<ffi::AtkLive> for Live {
292    #[inline]
293    unsafe fn from_glib(value: ffi::AtkLive) -> Self {
294        skip_assert_initialized!();
295
296        match value {
297            ffi::ATK_LIVE_NONE => Self::None,
298            ffi::ATK_LIVE_POLITE => Self::Polite,
299            ffi::ATK_LIVE_ASSERTIVE => Self::Assertive,
300            value => Self::__Unknown(value),
301        }
302    }
303}
304
305#[cfg(feature = "v2_50")]
306#[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))]
307impl StaticType for Live {
308    #[inline]
309    #[doc(alias = "atk_live_get_type")]
310    fn static_type() -> glib::Type {
311        unsafe { from_glib(ffi::atk_live_get_type()) }
312    }
313}
314
315#[cfg(feature = "v2_50")]
316#[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))]
317impl glib::HasParamSpec for Live {
318    type ParamSpec = glib::ParamSpecEnum;
319    type SetValue = Self;
320    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
321
322    fn param_spec_builder() -> Self::BuilderFn {
323        Self::ParamSpec::builder_with_default
324    }
325}
326
327#[cfg(feature = "v2_50")]
328#[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))]
329impl glib::value::ValueType for Live {
330    type Type = Self;
331}
332
333#[cfg(feature = "v2_50")]
334#[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))]
335unsafe impl<'a> glib::value::FromValue<'a> for Live {
336    type Checker = glib::value::GenericValueTypeChecker<Self>;
337
338    #[inline]
339    unsafe fn from_value(value: &'a glib::Value) -> Self {
340        skip_assert_initialized!();
341        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
342    }
343}
344
345#[cfg(feature = "v2_50")]
346#[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))]
347impl ToValue for Live {
348    #[inline]
349    fn to_value(&self) -> glib::Value {
350        let mut value = glib::Value::for_value_type::<Self>();
351        unsafe {
352            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
353        }
354        value
355    }
356
357    #[inline]
358    fn value_type(&self) -> glib::Type {
359        Self::static_type()
360    }
361}
362
363#[cfg(feature = "v2_50")]
364#[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))]
365impl From<Live> for glib::Value {
366    #[inline]
367    fn from(v: Live) -> Self {
368        skip_assert_initialized!();
369        ToValue::to_value(&v)
370    }
371}
372
373/// Describes the type of the relation
374#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
375#[non_exhaustive]
376#[doc(alias = "AtkRelationType")]
377pub enum RelationType {
378    /// Not used, represens "no relationship" or an error condition.
379    #[doc(alias = "ATK_RELATION_NULL")]
380    Null,
381    /// Indicates an object controlled by one or more target objects.
382    #[doc(alias = "ATK_RELATION_CONTROLLED_BY")]
383    ControlledBy,
384    /// Indicates an object is an controller for one or more target objects.
385    #[doc(alias = "ATK_RELATION_CONTROLLER_FOR")]
386    ControllerFor,
387    /// Indicates an object is a label for one or more target objects.
388    #[doc(alias = "ATK_RELATION_LABEL_FOR")]
389    LabelFor,
390    /// Indicates an object is labelled by one or more target objects.
391    #[doc(alias = "ATK_RELATION_LABELLED_BY")]
392    LabelledBy,
393    /// Indicates an object is a member of a group of one or more target objects.
394    #[doc(alias = "ATK_RELATION_MEMBER_OF")]
395    MemberOf,
396    /// Indicates an object is a cell in a treetable which is displayed because a cell in the same column is expanded and identifies that cell.
397    #[doc(alias = "ATK_RELATION_NODE_CHILD_OF")]
398    NodeChildOf,
399    /// Indicates that the object has content that flows logically to another
400    ///  AtkObject in a sequential way, (for instance text-flow).
401    #[doc(alias = "ATK_RELATION_FLOWS_TO")]
402    FlowsTo,
403    /// Indicates that the object has content that flows logically from
404    ///  another AtkObject in a sequential way, (for instance text-flow).
405    #[doc(alias = "ATK_RELATION_FLOWS_FROM")]
406    FlowsFrom,
407    /// Indicates a subwindow attached to a component but otherwise has no connection in the UI heirarchy to that component.
408    #[doc(alias = "ATK_RELATION_SUBWINDOW_OF")]
409    SubwindowOf,
410    /// Indicates that the object visually embeds
411    ///  another object's content, i.e. this object's content flows around
412    ///  another's content.
413    #[doc(alias = "ATK_RELATION_EMBEDS")]
414    Embeds,
415    /// Reciprocal of [`Embeds`][Self::Embeds], indicates that
416    ///  this object's content is visualy embedded in another object.
417    #[doc(alias = "ATK_RELATION_EMBEDDED_BY")]
418    EmbeddedBy,
419    /// Indicates that an object is a popup for another object.
420    #[doc(alias = "ATK_RELATION_POPUP_FOR")]
421    PopupFor,
422    /// Indicates that an object is a parent window of another object.
423    #[doc(alias = "ATK_RELATION_PARENT_WINDOW_OF")]
424    ParentWindowOf,
425    /// Reciprocal of [`DescriptionFor`][Self::DescriptionFor]. Indicates that one
426    /// or more target objects provide descriptive information about this object. This relation
427    /// type is most appropriate for information that is not essential as its presentation may
428    /// be user-configurable and/or limited to an on-demand mechanism such as an assistive
429    /// technology command. For brief, essential information such as can be found in a widget's
430    /// on-screen label, use [`LabelledBy`][Self::LabelledBy]. For an on-screen error message, use
431    /// [`ErrorMessage`][Self::ErrorMessage]. For lengthy extended descriptive information contained in
432    /// an on-screen object, consider using [`Details`][Self::Details] as assistive technologies may
433    /// provide a means for the user to navigate to objects containing detailed descriptions so
434    /// that their content can be more closely reviewed.
435    #[doc(alias = "ATK_RELATION_DESCRIBED_BY")]
436    DescribedBy,
437    /// Reciprocal of [`DescribedBy`][Self::DescribedBy]. Indicates that this
438    /// object provides descriptive information about the target object(s). See also
439    /// [`DetailsFor`][Self::DetailsFor] and [`ErrorFor`][Self::ErrorFor].
440    #[doc(alias = "ATK_RELATION_DESCRIPTION_FOR")]
441    DescriptionFor,
442    /// Indicates an object is a cell in a treetable and is expanded to display other cells in the same column.
443    #[doc(alias = "ATK_RELATION_NODE_PARENT_OF")]
444    NodeParentOf,
445    /// Reciprocal of [`DetailsFor`][Self::DetailsFor]. Indicates that this object
446    /// has a detailed or extended description, the contents of which can be found in the target
447    /// object(s). This relation type is most appropriate for information that is sufficiently
448    /// lengthy as to make navigation to the container of that information desirable. For less
449    /// verbose information suitable for announcement only, see [`DescribedBy`][Self::DescribedBy]. If
450    /// the detailed information describes an error condition, [`ErrorFor`][Self::ErrorFor] should be
451    /// used instead. `Since`: ATK-2.26.
452    #[doc(alias = "ATK_RELATION_DETAILS")]
453    Details,
454    /// Reciprocal of [`Details`][Self::Details]. Indicates that this object
455    /// provides a detailed or extended description about the target object(s). See also
456    /// [`DescriptionFor`][Self::DescriptionFor] and [`ErrorFor`][Self::ErrorFor]. `Since`: ATK-2.26.
457    #[doc(alias = "ATK_RELATION_DETAILS_FOR")]
458    DetailsFor,
459    /// Reciprocal of [`ErrorFor`][Self::ErrorFor]. Indicates that this object
460    /// has one or more errors, the nature of which is described in the contents of the target
461    /// object(s). Objects that have this relation type should also contain [`StateType::InvalidEntry`][crate::StateType::InvalidEntry]
462    /// in their [`StateSet`][crate::StateSet]. `Since`: ATK-2.26.
463    #[doc(alias = "ATK_RELATION_ERROR_MESSAGE")]
464    ErrorMessage,
465    /// Reciprocal of [`ErrorMessage`][Self::ErrorMessage]. Indicates that this object
466    /// contains an error message describing an invalid condition in the target object(s). `Since`:
467    /// ATK_2.26.
468    #[doc(alias = "ATK_RELATION_ERROR_FOR")]
469    ErrorFor,
470    /// Not used, this value indicates the end of the enumeration.
471    #[doc(alias = "ATK_RELATION_LAST_DEFINED")]
472    LastDefined,
473    #[doc(hidden)]
474    __Unknown(i32),
475}
476
477impl RelationType {
478    #[doc(alias = "atk_relation_type_for_name")]
479    pub fn for_name(name: &str) -> RelationType {
480        assert_initialized_main_thread!();
481        unsafe { from_glib(ffi::atk_relation_type_for_name(name.to_glib_none().0)) }
482    }
483
484    #[doc(alias = "atk_relation_type_get_name")]
485    #[doc(alias = "get_name")]
486    pub fn name(self) -> Option<glib::GString> {
487        assert_initialized_main_thread!();
488        unsafe { from_glib_none(ffi::atk_relation_type_get_name(self.into_glib())) }
489    }
490}
491
492#[doc(hidden)]
493impl IntoGlib for RelationType {
494    type GlibType = ffi::AtkRelationType;
495
496    fn into_glib(self) -> ffi::AtkRelationType {
497        match self {
498            Self::Null => ffi::ATK_RELATION_NULL,
499            Self::ControlledBy => ffi::ATK_RELATION_CONTROLLED_BY,
500            Self::ControllerFor => ffi::ATK_RELATION_CONTROLLER_FOR,
501            Self::LabelFor => ffi::ATK_RELATION_LABEL_FOR,
502            Self::LabelledBy => ffi::ATK_RELATION_LABELLED_BY,
503            Self::MemberOf => ffi::ATK_RELATION_MEMBER_OF,
504            Self::NodeChildOf => ffi::ATK_RELATION_NODE_CHILD_OF,
505            Self::FlowsTo => ffi::ATK_RELATION_FLOWS_TO,
506            Self::FlowsFrom => ffi::ATK_RELATION_FLOWS_FROM,
507            Self::SubwindowOf => ffi::ATK_RELATION_SUBWINDOW_OF,
508            Self::Embeds => ffi::ATK_RELATION_EMBEDS,
509            Self::EmbeddedBy => ffi::ATK_RELATION_EMBEDDED_BY,
510            Self::PopupFor => ffi::ATK_RELATION_POPUP_FOR,
511            Self::ParentWindowOf => ffi::ATK_RELATION_PARENT_WINDOW_OF,
512            Self::DescribedBy => ffi::ATK_RELATION_DESCRIBED_BY,
513            Self::DescriptionFor => ffi::ATK_RELATION_DESCRIPTION_FOR,
514            Self::NodeParentOf => ffi::ATK_RELATION_NODE_PARENT_OF,
515            Self::Details => ffi::ATK_RELATION_DETAILS,
516            Self::DetailsFor => ffi::ATK_RELATION_DETAILS_FOR,
517            Self::ErrorMessage => ffi::ATK_RELATION_ERROR_MESSAGE,
518            Self::ErrorFor => ffi::ATK_RELATION_ERROR_FOR,
519            Self::LastDefined => ffi::ATK_RELATION_LAST_DEFINED,
520            Self::__Unknown(value) => value,
521        }
522    }
523}
524
525#[doc(hidden)]
526impl FromGlib<ffi::AtkRelationType> for RelationType {
527    unsafe fn from_glib(value: ffi::AtkRelationType) -> Self {
528        skip_assert_initialized!();
529
530        match value {
531            ffi::ATK_RELATION_NULL => Self::Null,
532            ffi::ATK_RELATION_CONTROLLED_BY => Self::ControlledBy,
533            ffi::ATK_RELATION_CONTROLLER_FOR => Self::ControllerFor,
534            ffi::ATK_RELATION_LABEL_FOR => Self::LabelFor,
535            ffi::ATK_RELATION_LABELLED_BY => Self::LabelledBy,
536            ffi::ATK_RELATION_MEMBER_OF => Self::MemberOf,
537            ffi::ATK_RELATION_NODE_CHILD_OF => Self::NodeChildOf,
538            ffi::ATK_RELATION_FLOWS_TO => Self::FlowsTo,
539            ffi::ATK_RELATION_FLOWS_FROM => Self::FlowsFrom,
540            ffi::ATK_RELATION_SUBWINDOW_OF => Self::SubwindowOf,
541            ffi::ATK_RELATION_EMBEDS => Self::Embeds,
542            ffi::ATK_RELATION_EMBEDDED_BY => Self::EmbeddedBy,
543            ffi::ATK_RELATION_POPUP_FOR => Self::PopupFor,
544            ffi::ATK_RELATION_PARENT_WINDOW_OF => Self::ParentWindowOf,
545            ffi::ATK_RELATION_DESCRIBED_BY => Self::DescribedBy,
546            ffi::ATK_RELATION_DESCRIPTION_FOR => Self::DescriptionFor,
547            ffi::ATK_RELATION_NODE_PARENT_OF => Self::NodeParentOf,
548            ffi::ATK_RELATION_DETAILS => Self::Details,
549            ffi::ATK_RELATION_DETAILS_FOR => Self::DetailsFor,
550            ffi::ATK_RELATION_ERROR_MESSAGE => Self::ErrorMessage,
551            ffi::ATK_RELATION_ERROR_FOR => Self::ErrorFor,
552            ffi::ATK_RELATION_LAST_DEFINED => Self::LastDefined,
553            value => Self::__Unknown(value),
554        }
555    }
556}
557
558impl StaticType for RelationType {
559    #[inline]
560    #[doc(alias = "atk_relation_type_get_type")]
561    fn static_type() -> glib::Type {
562        unsafe { from_glib(ffi::atk_relation_type_get_type()) }
563    }
564}
565
566impl glib::HasParamSpec for RelationType {
567    type ParamSpec = glib::ParamSpecEnum;
568    type SetValue = Self;
569    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
570
571    fn param_spec_builder() -> Self::BuilderFn {
572        Self::ParamSpec::builder_with_default
573    }
574}
575
576impl glib::value::ValueType for RelationType {
577    type Type = Self;
578}
579
580unsafe impl<'a> glib::value::FromValue<'a> for RelationType {
581    type Checker = glib::value::GenericValueTypeChecker<Self>;
582
583    #[inline]
584    unsafe fn from_value(value: &'a glib::Value) -> Self {
585        skip_assert_initialized!();
586        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
587    }
588}
589
590impl ToValue for RelationType {
591    #[inline]
592    fn to_value(&self) -> glib::Value {
593        let mut value = glib::Value::for_value_type::<Self>();
594        unsafe {
595            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
596        }
597        value
598    }
599
600    #[inline]
601    fn value_type(&self) -> glib::Type {
602        Self::static_type()
603    }
604}
605
606impl From<RelationType> for glib::Value {
607    #[inline]
608    fn from(v: RelationType) -> Self {
609        skip_assert_initialized!();
610        ToValue::to_value(&v)
611    }
612}
613
614/// =
615/// [`LastDefined`][Self::LastDefined] is not necessarily an error.
616#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
617#[non_exhaustive]
618#[doc(alias = "AtkRole")]
619pub enum Role {
620    /// Invalid role
621    #[doc(alias = "ATK_ROLE_INVALID")]
622    Invalid,
623    /// A label which represents an accelerator
624    #[doc(alias = "ATK_ROLE_ACCEL_LABEL")]
625    AcceleratorLabel,
626    /// An object which is an alert to the user. Assistive Technologies typically respond to ATK_ROLE_ALERT by reading the entire onscreen contents of containers advertising this role. Should be used for warning dialogs, etc.
627    #[doc(alias = "ATK_ROLE_ALERT")]
628    Alert,
629    /// An object which is an animated image
630    #[doc(alias = "ATK_ROLE_ANIMATION")]
631    Animation,
632    /// An arrow in one of the four cardinal directions
633    #[doc(alias = "ATK_ROLE_ARROW")]
634    Arrow,
635    /// An object that displays a calendar and allows the user to select a date
636    #[doc(alias = "ATK_ROLE_CALENDAR")]
637    Calendar,
638    /// An object that can be drawn into and is used to trap events
639    #[doc(alias = "ATK_ROLE_CANVAS")]
640    Canvas,
641    /// A choice that can be checked or unchecked and provides a separate indicator for the current state
642    #[doc(alias = "ATK_ROLE_CHECK_BOX")]
643    CheckBox,
644    /// A menu item with a check box
645    #[doc(alias = "ATK_ROLE_CHECK_MENU_ITEM")]
646    CheckMenuItem,
647    /// A specialized dialog that lets the user choose a color
648    #[doc(alias = "ATK_ROLE_COLOR_CHOOSER")]
649    ColorChooser,
650    /// The header for a column of data
651    #[doc(alias = "ATK_ROLE_COLUMN_HEADER")]
652    ColumnHeader,
653    /// A collapsible list of choices the user can select from
654    #[doc(alias = "ATK_ROLE_COMBO_BOX")]
655    ComboBox,
656    /// An object whose purpose is to allow a user to edit a date
657    #[doc(alias = "ATK_ROLE_DATE_EDITOR")]
658    DateEditor,
659    /// An inconifed internal frame within a DESKTOP_PANE
660    #[doc(alias = "ATK_ROLE_DESKTOP_ICON")]
661    DesktopIcon,
662    /// A pane that supports internal frames and iconified versions of those internal frames
663    #[doc(alias = "ATK_ROLE_DESKTOP_FRAME")]
664    DesktopFrame,
665    /// An object whose purpose is to allow a user to set a value
666    #[doc(alias = "ATK_ROLE_DIAL")]
667    Dial,
668    /// A top level window with title bar and a border
669    #[doc(alias = "ATK_ROLE_DIALOG")]
670    Dialog,
671    /// A pane that allows the user to navigate through and select the contents of a directory
672    #[doc(alias = "ATK_ROLE_DIRECTORY_PANE")]
673    DirectoryPane,
674    /// An object used for drawing custom user interface elements
675    #[doc(alias = "ATK_ROLE_DRAWING_AREA")]
676    DrawingArea,
677    /// A specialized dialog that lets the user choose a file
678    #[doc(alias = "ATK_ROLE_FILE_CHOOSER")]
679    FileChooser,
680    /// A object that fills up space in a user interface
681    #[doc(alias = "ATK_ROLE_FILLER")]
682    Filler,
683    /// A specialized dialog that lets the user choose a font
684    #[doc(alias = "ATK_ROLE_FONT_CHOOSER")]
685    FontChooser,
686    /// A top level window with a title bar, border, menubar, etc.
687    #[doc(alias = "ATK_ROLE_FRAME")]
688    Frame,
689    /// A pane that is guaranteed to be painted on top of all panes beneath it
690    #[doc(alias = "ATK_ROLE_GLASS_PANE")]
691    GlassPane,
692    /// A document container for HTML, whose children represent the document content
693    #[doc(alias = "ATK_ROLE_HTML_CONTAINER")]
694    HtmlContainer,
695    /// A small fixed size picture, typically used to decorate components
696    #[doc(alias = "ATK_ROLE_ICON")]
697    Icon,
698    /// An object whose primary purpose is to display an image
699    #[doc(alias = "ATK_ROLE_IMAGE")]
700    Image,
701    /// A frame-like object that is clipped by a desktop pane
702    #[doc(alias = "ATK_ROLE_INTERNAL_FRAME")]
703    InternalFrame,
704    /// An object used to present an icon or short string in an interface
705    #[doc(alias = "ATK_ROLE_LABEL")]
706    Label,
707    /// A specialized pane that allows its children to be drawn in layers, providing a form of stacking order
708    #[doc(alias = "ATK_ROLE_LAYERED_PANE")]
709    LayeredPane,
710    /// An object that presents a list of objects to the user and allows the user to select one or more of them
711    #[doc(alias = "ATK_ROLE_LIST")]
712    List,
713    /// An object that represents an element of a list
714    #[doc(alias = "ATK_ROLE_LIST_ITEM")]
715    ListItem,
716    /// An object usually found inside a menu bar that contains a list of actions the user can choose from
717    #[doc(alias = "ATK_ROLE_MENU")]
718    Menu,
719    /// An object usually drawn at the top of the primary dialog box of an application that contains a list of menus the user can choose from
720    #[doc(alias = "ATK_ROLE_MENU_BAR")]
721    MenuBar,
722    /// An object usually contained in a menu that presents an action the user can choose
723    #[doc(alias = "ATK_ROLE_MENU_ITEM")]
724    MenuItem,
725    /// A specialized pane whose primary use is inside a DIALOG
726    #[doc(alias = "ATK_ROLE_OPTION_PANE")]
727    OptionPane,
728    /// An object that is a child of a page tab list
729    #[doc(alias = "ATK_ROLE_PAGE_TAB")]
730    PageTab,
731    /// An object that presents a series of panels (or page tabs), one at a time, through some mechanism provided by the object
732    #[doc(alias = "ATK_ROLE_PAGE_TAB_LIST")]
733    PageTabList,
734    /// A generic container that is often used to group objects
735    #[doc(alias = "ATK_ROLE_PANEL")]
736    Panel,
737    /// A text object uses for passwords, or other places where the text content is not shown visibly to the user
738    #[doc(alias = "ATK_ROLE_PASSWORD_TEXT")]
739    PasswordText,
740    /// A temporary window that is usually used to offer the user a list of choices, and then hides when the user selects one of those choices
741    #[doc(alias = "ATK_ROLE_POPUP_MENU")]
742    PopupMenu,
743    /// An object used to indicate how much of a task has been completed
744    #[doc(alias = "ATK_ROLE_PROGRESS_BAR")]
745    ProgressBar,
746    /// An object the user can manipulate to tell the application to do something
747    #[doc(alias = "ATK_ROLE_BUTTON")]
748    Button,
749    /// A specialized check box that will cause other radio buttons in the same group to become unchecked when this one is checked
750    #[doc(alias = "ATK_ROLE_RADIO_BUTTON")]
751    RadioButton,
752    /// A check menu item which belongs to a group. At each instant exactly one of the radio menu items from a group is selected
753    #[doc(alias = "ATK_ROLE_RADIO_MENU_ITEM")]
754    RadioMenuItem,
755    /// A specialized pane that has a glass pane and a layered pane as its children
756    #[doc(alias = "ATK_ROLE_ROOT_PANE")]
757    RootPane,
758    /// The header for a row of data
759    #[doc(alias = "ATK_ROLE_ROW_HEADER")]
760    RowHeader,
761    /// An object usually used to allow a user to incrementally view a large amount of data.
762    #[doc(alias = "ATK_ROLE_SCROLL_BAR")]
763    ScrollBar,
764    /// An object that allows a user to incrementally view a large amount of information
765    #[doc(alias = "ATK_ROLE_SCROLL_PANE")]
766    ScrollPane,
767    /// An object usually contained in a menu to provide a visible and logical separation of the contents in a menu
768    #[doc(alias = "ATK_ROLE_SEPARATOR")]
769    Separator,
770    /// An object that allows the user to select from a bounded range
771    #[doc(alias = "ATK_ROLE_SLIDER")]
772    Slider,
773    /// A specialized panel that presents two other panels at the same time
774    #[doc(alias = "ATK_ROLE_SPLIT_PANE")]
775    SplitPane,
776    /// An object used to get an integer or floating point number from the user
777    #[doc(alias = "ATK_ROLE_SPIN_BUTTON")]
778    SpinButton,
779    /// An object which reports messages of minor importance to the user
780    #[doc(alias = "ATK_ROLE_STATUSBAR")]
781    Statusbar,
782    /// An object used to represent information in terms of rows and columns
783    #[doc(alias = "ATK_ROLE_TABLE")]
784    Table,
785    /// A cell in a table
786    #[doc(alias = "ATK_ROLE_TABLE_CELL")]
787    TableCell,
788    /// The header for a column of a table
789    #[doc(alias = "ATK_ROLE_TABLE_COLUMN_HEADER")]
790    TableColumnHeader,
791    /// The header for a row of a table
792    #[doc(alias = "ATK_ROLE_TABLE_ROW_HEADER")]
793    TableRowHeader,
794    /// A menu item used to tear off and reattach its menu
795    #[doc(alias = "ATK_ROLE_TEAR_OFF_MENU_ITEM")]
796    TearOffMenuItem,
797    /// An object that represents an accessible terminal. (Since: 0.6)
798    #[doc(alias = "ATK_ROLE_TERMINAL")]
799    Terminal,
800    /// An interactive widget that supports multiple lines of text and
801    /// optionally accepts user input, but whose purpose is not to solicit user input.
802    /// Thus ATK_ROLE_TEXT is appropriate for the text view in a plain text editor
803    /// but inappropriate for an input field in a dialog box or web form. For widgets
804    /// whose purpose is to solicit input from the user, see ATK_ROLE_ENTRY and
805    /// ATK_ROLE_PASSWORD_TEXT. For generic objects which display a brief amount of
806    /// textual information, see ATK_ROLE_STATIC.
807    #[doc(alias = "ATK_ROLE_TEXT")]
808    Text,
809    /// A specialized push button that can be checked or unchecked, but does not provide a separate indicator for the current state
810    #[doc(alias = "ATK_ROLE_TOGGLE_BUTTON")]
811    ToggleButton,
812    /// A bar or palette usually composed of push buttons or toggle buttons
813    #[doc(alias = "ATK_ROLE_TOOL_BAR")]
814    ToolBar,
815    /// An object that provides information about another object
816    #[doc(alias = "ATK_ROLE_TOOL_TIP")]
817    ToolTip,
818    /// An object used to represent hierarchical information to the user
819    #[doc(alias = "ATK_ROLE_TREE")]
820    Tree,
821    /// An object capable of expanding and collapsing rows as well as showing multiple columns of data. (Since: 0.7)
822    #[doc(alias = "ATK_ROLE_TREE_TABLE")]
823    TreeTable,
824    /// The object contains some Accessible information, but its role is not known
825    #[doc(alias = "ATK_ROLE_UNKNOWN")]
826    Unknown,
827    /// An object usually used in a scroll pane
828    #[doc(alias = "ATK_ROLE_VIEWPORT")]
829    Viewport,
830    /// A top level window with no title or border.
831    #[doc(alias = "ATK_ROLE_WINDOW")]
832    Window,
833    /// An object that serves as a document header. (Since: 1.1.1)
834    #[doc(alias = "ATK_ROLE_HEADER")]
835    Header,
836    /// An object that serves as a document footer. (Since: 1.1.1)
837    #[doc(alias = "ATK_ROLE_FOOTER")]
838    Footer,
839    /// An object which is contains a paragraph of text content. (Since: 1.1.1)
840    #[doc(alias = "ATK_ROLE_PARAGRAPH")]
841    Paragraph,
842    /// An object which describes margins and tab stops, etc. for text objects which it controls (should have CONTROLLER_FOR relation to such). (Since: 1.1.1)
843    #[doc(alias = "ATK_ROLE_RULER")]
844    Ruler,
845    /// The object is an application object, which may contain [`Frame`][Self::Frame] objects or other types of accessibles. The root accessible of any application's ATK hierarchy should have ATK_ROLE_APPLICATION. (Since: 1.1.4)
846    #[doc(alias = "ATK_ROLE_APPLICATION")]
847    Application,
848    /// The object is a dialog or list containing items for insertion into an entry widget, for instance a list of words for completion of a text entry. (Since: 1.3)
849    #[doc(alias = "ATK_ROLE_AUTOCOMPLETE")]
850    Autocomplete,
851    /// The object is an editable text object in a toolbar. (Since: 1.5)
852    #[doc(alias = "ATK_ROLE_EDITBAR")]
853    EditBar,
854    /// The object is an embedded container within a document or panel. This role is a grouping "hint" indicating that the contained objects share a context. (Since: 1.7.2)
855    #[doc(alias = "ATK_ROLE_EMBEDDED")]
856    Embedded,
857    /// The object is a component whose textual content may be entered or modified by the user, provided [`StateType::Editable`][crate::StateType::Editable] is present. (Since: 1.11)
858    #[doc(alias = "ATK_ROLE_ENTRY")]
859    Entry,
860    /// The object is a graphical depiction of quantitative data. It may contain multiple subelements whose attributes and/or description may be queried to obtain both the quantitative data and information about how the data is being presented. The LABELLED_BY relation is particularly important in interpreting objects of this type, as is the accessible-description property. (Since: 1.11)
861    #[doc(alias = "ATK_ROLE_CHART")]
862    Chart,
863    /// The object contains descriptive information, usually textual, about another user interface element such as a table, chart, or image. (Since: 1.11)
864    #[doc(alias = "ATK_ROLE_CAPTION")]
865    Caption,
866    /// The object is a visual frame or container which contains a view of document content. Document frames may occur within another Document instance, in which case the second document may be said to be embedded in the containing instance. HTML frames are often ROLE_DOCUMENT_FRAME. Either this object, or a singleton descendant, should implement the Document interface. (Since: 1.11)
867    #[doc(alias = "ATK_ROLE_DOCUMENT_FRAME")]
868    DocumentFrame,
869    /// The object serves as a heading for content which follows it in a document. The 'heading level' of the heading, if availabe, may be obtained by querying the object's attributes.
870    #[doc(alias = "ATK_ROLE_HEADING")]
871    Heading,
872    /// The object is a containing instance which encapsulates a page of information. [`Page`][Self::Page] is used in documents and content which support a paginated navigation model. (Since: 1.11)
873    #[doc(alias = "ATK_ROLE_PAGE")]
874    Page,
875    /// The object is a containing instance of document content which constitutes a particular 'logical' section of the document. The type of content within a section, and the nature of the section division itself, may be obtained by querying the object's attributes. Sections may be nested. (Since: 1.11)
876    #[doc(alias = "ATK_ROLE_SECTION")]
877    Section,
878    /// The object is redundant with another object in the hierarchy, and is exposed for purely technical reasons. Objects of this role should normally be ignored by clients. (Since: 1.11)
879    #[doc(alias = "ATK_ROLE_REDUNDANT_OBJECT")]
880    RedundantObject,
881    /// The object is a container for form controls, for instance as part of a
882    /// web form or user-input form within a document. This role is primarily a tag/convenience for
883    /// clients when navigating complex documents, it is not expected that ordinary GUI containers will
884    /// always have ATK_ROLE_FORM. (Since: 1.12.0)
885    #[doc(alias = "ATK_ROLE_FORM")]
886    Form,
887    /// The object is a hypertext anchor, i.e. a "link" in a
888    /// hypertext document. Such objects are distinct from 'inline'
889    /// content which may also use the Hypertext/Hyperlink interfaces
890    /// to indicate the range/location within a text object where
891    /// an inline or embedded object lies. (Since: 1.12.1)
892    #[doc(alias = "ATK_ROLE_LINK")]
893    Link,
894    /// The object is a window or similar viewport
895    /// which is used to allow composition or input of a 'complex character',
896    /// in other words it is an "input method window." (Since: 1.12.1)
897    #[doc(alias = "ATK_ROLE_INPUT_METHOD_WINDOW")]
898    InputMethodWindow,
899    /// A row in a table. (Since: 2.1.0)
900    #[doc(alias = "ATK_ROLE_TABLE_ROW")]
901    TableRow,
902    /// An object that represents an element of a tree. (Since: 2.1.0)
903    #[doc(alias = "ATK_ROLE_TREE_ITEM")]
904    TreeItem,
905    /// A document frame which contains a spreadsheet. (Since: 2.1.0)
906    #[doc(alias = "ATK_ROLE_DOCUMENT_SPREADSHEET")]
907    DocumentSpreadsheet,
908    /// A document frame which contains a presentation or slide content. (Since: 2.1.0)
909    #[doc(alias = "ATK_ROLE_DOCUMENT_PRESENTATION")]
910    DocumentPresentation,
911    /// A document frame which contains textual content, such as found in a word processing application. (Since: 2.1.0)
912    #[doc(alias = "ATK_ROLE_DOCUMENT_TEXT")]
913    DocumentText,
914    /// A document frame which contains HTML or other markup suitable for display in a web browser. (Since: 2.1.0)
915    #[doc(alias = "ATK_ROLE_DOCUMENT_WEB")]
916    DocumentWeb,
917    /// A document frame which contains email content to be displayed or composed either in plain text or HTML. (Since: 2.1.0)
918    #[doc(alias = "ATK_ROLE_DOCUMENT_EMAIL")]
919    DocumentEmail,
920    /// An object found within a document and designed to present a comment, note, or other annotation. In some cases, this object might not be visible until activated. (Since: 2.1.0)
921    #[doc(alias = "ATK_ROLE_COMMENT")]
922    Comment,
923    /// A non-collapsible list of choices the user can select from. (Since: 2.1.0)
924    #[doc(alias = "ATK_ROLE_LIST_BOX")]
925    ListBox,
926    /// A group of related widgets. This group typically has a label. (Since: 2.1.0)
927    #[doc(alias = "ATK_ROLE_GROUPING")]
928    Grouping,
929    /// An image map object. Usually a graphic with multiple hotspots, where each hotspot can be activated resulting in the loading of another document or section of a document. (Since: 2.1.0)
930    #[doc(alias = "ATK_ROLE_IMAGE_MAP")]
931    ImageMap,
932    /// A transitory object designed to present a message to the user, typically at the desktop level rather than inside a particular application. (Since: 2.1.0)
933    #[doc(alias = "ATK_ROLE_NOTIFICATION")]
934    Notification,
935    /// An object designed to present a message to the user within an existing window. (Since: 2.1.0)
936    #[doc(alias = "ATK_ROLE_INFO_BAR")]
937    InfoBar,
938    /// A bar that serves as a level indicator to, for instance, show the strength of a password or the state of a battery. (Since: 2.7.3)
939    #[doc(alias = "ATK_ROLE_LEVEL_BAR")]
940    LevelBar,
941    /// A bar that serves as the title of a window or a
942    /// dialog. (Since: 2.12)
943    #[doc(alias = "ATK_ROLE_TITLE_BAR")]
944    TitleBar,
945    /// An object which contains a text section
946    /// that is quoted from another source. (Since: 2.12)
947    #[doc(alias = "ATK_ROLE_BLOCK_QUOTE")]
948    BlockQuote,
949    /// An object which represents an audio element. (Since: 2.12)
950    #[doc(alias = "ATK_ROLE_AUDIO")]
951    Audio,
952    /// An object which represents a video element. (Since: 2.12)
953    #[doc(alias = "ATK_ROLE_VIDEO")]
954    Video,
955    /// A definition of a term or concept. (Since: 2.12)
956    #[doc(alias = "ATK_ROLE_DEFINITION")]
957    Definition,
958    /// A section of a page that consists of a
959    /// composition that forms an independent part of a document, page, or
960    /// site. Examples: A blog entry, a news story, a forum post. (Since: 2.12)
961    #[doc(alias = "ATK_ROLE_ARTICLE")]
962    Article,
963    /// A region of a web page intended as a
964    /// navigational landmark. This is designed to allow Assistive
965    /// Technologies to provide quick navigation among key regions within a
966    /// document. (Since: 2.12)
967    #[doc(alias = "ATK_ROLE_LANDMARK")]
968    Landmark,
969    /// A text widget or container holding log content, such
970    /// as chat history and error logs. In this role there is a
971    /// relationship between the arrival of new items in the log and the
972    /// reading order. The log contains a meaningful sequence and new
973    /// information is added only to the end of the log, not at arbitrary
974    /// points. (Since: 2.12)
975    #[doc(alias = "ATK_ROLE_LOG")]
976    Log,
977    /// A container where non-essential information
978    /// changes frequently. Common usages of marquee include stock tickers
979    /// and ad banners. The primary difference between a marquee and a log
980    /// is that logs usually have a meaningful order or sequence of
981    /// important content changes. (Since: 2.12)
982    #[doc(alias = "ATK_ROLE_MARQUEE")]
983    Marquee,
984    /// A text widget or container that holds a mathematical
985    /// expression. (Since: 2.12)
986    #[doc(alias = "ATK_ROLE_MATH")]
987    Math,
988    /// A widget whose purpose is to display a rating,
989    /// such as the number of stars associated with a song in a media
990    /// player. Objects of this role should also implement
991    /// AtkValue. (Since: 2.12)
992    #[doc(alias = "ATK_ROLE_RATING")]
993    Rating,
994    /// An object containing a numerical counter which
995    /// indicates an amount of elapsed time from a start point, or the time
996    /// remaining until an end point. (Since: 2.12)
997    #[doc(alias = "ATK_ROLE_TIMER")]
998    Timer,
999    /// An object that represents a list of
1000    /// term-value groups. A term-value group represents a individual
1001    /// description and consist of one or more names
1002    /// (ATK_ROLE_DESCRIPTION_TERM) followed by one or more values
1003    /// (ATK_ROLE_DESCRIPTION_VALUE). For each list, there should not be
1004    /// more than one group with the same term name. (Since: 2.12)
1005    #[doc(alias = "ATK_ROLE_DESCRIPTION_LIST")]
1006    DescriptionList,
1007    /// An object that represents a term or phrase
1008    /// with a corresponding definition. (Since: 2.12)
1009    #[doc(alias = "ATK_ROLE_DESCRIPTION_TERM")]
1010    DescriptionTerm,
1011    /// An object that represents the
1012    /// description, definition or value of a term. (Since: 2.12)
1013    #[doc(alias = "ATK_ROLE_DESCRIPTION_VALUE")]
1014    DescriptionValue,
1015    /// A generic non-container object whose purpose is to display a
1016    /// brief amount of information to the user and whose role is known by the
1017    /// implementor but lacks semantic value for the user. Examples in which
1018    /// [`Static`][Self::Static] is appropriate include the message displayed in a message box
1019    /// and an image used as an alternative means to display text. [`Static`][Self::Static]
1020    /// should not be applied to widgets which are traditionally interactive, objects
1021    /// which display a significant amount of content, or any object which has an
1022    /// accessible relation pointing to another object. Implementors should expose the
1023    /// displayed information through the accessible name of the object. If doing so seems
1024    /// inappropriate, it may indicate that a different role should be used. For
1025    /// labels which describe another widget, see [`Label`][Self::Label]. For text views, see
1026    /// [`Text`][Self::Text]. For generic containers, see [`Panel`][Self::Panel]. For objects whose
1027    /// role is not known by the implementor, see [`Unknown`][Self::Unknown]. (Since: 2.16)
1028    #[doc(alias = "ATK_ROLE_STATIC")]
1029    Static,
1030    /// An object that represents a mathematical fraction.
1031    /// (Since: 2.16)
1032    #[doc(alias = "ATK_ROLE_MATH_FRACTION")]
1033    MathFraction,
1034    /// An object that represents a mathematical expression
1035    /// displayed with a radical. (Since: 2.16)
1036    #[doc(alias = "ATK_ROLE_MATH_ROOT")]
1037    MathRoot,
1038    /// An object that contains text that is displayed as a
1039    /// subscript. (Since: 2.16)
1040    #[doc(alias = "ATK_ROLE_SUBSCRIPT")]
1041    Subscript,
1042    /// An object that contains text that is displayed as a
1043    /// superscript. (Since: 2.16)
1044    #[doc(alias = "ATK_ROLE_SUPERSCRIPT")]
1045    Superscript,
1046    /// An object that contains the text of a footnote. (Since: 2.26)
1047    #[doc(alias = "ATK_ROLE_FOOTNOTE")]
1048    Footnote,
1049    /// Content previously deleted or proposed to be
1050    /// deleted, e.g. in revision history or a content view providing suggestions
1051    /// from reviewers. (Since: 2.34)
1052    #[doc(alias = "ATK_ROLE_CONTENT_DELETION")]
1053    ContentDeletion,
1054    /// Content previously inserted or proposed to be
1055    /// inserted, e.g. in revision history or a content view providing suggestions
1056    /// from reviewers. (Since: 2.34)
1057    #[doc(alias = "ATK_ROLE_CONTENT_INSERTION")]
1058    ContentInsertion,
1059    /// A run of content that is marked or highlighted, such as for
1060    /// reference purposes, or to call it out as having a special purpose. If the
1061    /// marked content has an associated section in the document elaborating on the
1062    /// reason for the mark, then [`RelationType::Details`][crate::RelationType::Details] should be used on the mark
1063    /// to point to that associated section. In addition, the reciprocal relation
1064    /// [`RelationType::DetailsFor`][crate::RelationType::DetailsFor] should be used on the associated content section
1065    /// to point back to the mark. (Since: 2.36)
1066    #[doc(alias = "ATK_ROLE_MARK")]
1067    Mark,
1068    /// A container for content that is called out as a proposed
1069    /// change from the current version of the document, such as by a reviewer of the
1070    /// content. This role should include either [`ContentDeletion`][Self::ContentDeletion] and/or
1071    /// [`ContentInsertion`][Self::ContentInsertion] children, in any order, to indicate what the
1072    /// actual change is. (Since: 2.36)
1073    #[doc(alias = "ATK_ROLE_SUGGESTION")]
1074    Suggestion,
1075    /// A specialized push button to open a menu.
1076    /// (Since: 2.46)
1077    #[doc(alias = "ATK_ROLE_PUSH_BUTTON_MENU")]
1078    PushButtonMenu,
1079    /// A switch that can be toggled on/off.
1080    /// (Since: 2.56)
1081    #[doc(alias = "ATK_ROLE_SWITCH")]
1082    Switch,
1083    /// not a valid role, used for finding end of the enumeration
1084    #[doc(alias = "ATK_ROLE_LAST_DEFINED")]
1085    LastDefined,
1086    #[doc(hidden)]
1087    __Unknown(i32),
1088}
1089
1090impl Role {
1091    #[doc(alias = "atk_role_for_name")]
1092    pub fn for_name(name: &str) -> Role {
1093        assert_initialized_main_thread!();
1094        unsafe { from_glib(ffi::atk_role_for_name(name.to_glib_none().0)) }
1095    }
1096
1097    #[doc(alias = "atk_role_get_localized_name")]
1098    #[doc(alias = "get_localized_name")]
1099    pub fn localized_name(self) -> Option<glib::GString> {
1100        assert_initialized_main_thread!();
1101        unsafe { from_glib_none(ffi::atk_role_get_localized_name(self.into_glib())) }
1102    }
1103
1104    #[doc(alias = "atk_role_get_name")]
1105    #[doc(alias = "get_name")]
1106    pub fn name(self) -> Option<glib::GString> {
1107        assert_initialized_main_thread!();
1108        unsafe { from_glib_none(ffi::atk_role_get_name(self.into_glib())) }
1109    }
1110}
1111
1112#[doc(hidden)]
1113impl IntoGlib for Role {
1114    type GlibType = ffi::AtkRole;
1115
1116    fn into_glib(self) -> ffi::AtkRole {
1117        match self {
1118            Self::Invalid => ffi::ATK_ROLE_INVALID,
1119            Self::AcceleratorLabel => ffi::ATK_ROLE_ACCEL_LABEL,
1120            Self::Alert => ffi::ATK_ROLE_ALERT,
1121            Self::Animation => ffi::ATK_ROLE_ANIMATION,
1122            Self::Arrow => ffi::ATK_ROLE_ARROW,
1123            Self::Calendar => ffi::ATK_ROLE_CALENDAR,
1124            Self::Canvas => ffi::ATK_ROLE_CANVAS,
1125            Self::CheckBox => ffi::ATK_ROLE_CHECK_BOX,
1126            Self::CheckMenuItem => ffi::ATK_ROLE_CHECK_MENU_ITEM,
1127            Self::ColorChooser => ffi::ATK_ROLE_COLOR_CHOOSER,
1128            Self::ColumnHeader => ffi::ATK_ROLE_COLUMN_HEADER,
1129            Self::ComboBox => ffi::ATK_ROLE_COMBO_BOX,
1130            Self::DateEditor => ffi::ATK_ROLE_DATE_EDITOR,
1131            Self::DesktopIcon => ffi::ATK_ROLE_DESKTOP_ICON,
1132            Self::DesktopFrame => ffi::ATK_ROLE_DESKTOP_FRAME,
1133            Self::Dial => ffi::ATK_ROLE_DIAL,
1134            Self::Dialog => ffi::ATK_ROLE_DIALOG,
1135            Self::DirectoryPane => ffi::ATK_ROLE_DIRECTORY_PANE,
1136            Self::DrawingArea => ffi::ATK_ROLE_DRAWING_AREA,
1137            Self::FileChooser => ffi::ATK_ROLE_FILE_CHOOSER,
1138            Self::Filler => ffi::ATK_ROLE_FILLER,
1139            Self::FontChooser => ffi::ATK_ROLE_FONT_CHOOSER,
1140            Self::Frame => ffi::ATK_ROLE_FRAME,
1141            Self::GlassPane => ffi::ATK_ROLE_GLASS_PANE,
1142            Self::HtmlContainer => ffi::ATK_ROLE_HTML_CONTAINER,
1143            Self::Icon => ffi::ATK_ROLE_ICON,
1144            Self::Image => ffi::ATK_ROLE_IMAGE,
1145            Self::InternalFrame => ffi::ATK_ROLE_INTERNAL_FRAME,
1146            Self::Label => ffi::ATK_ROLE_LABEL,
1147            Self::LayeredPane => ffi::ATK_ROLE_LAYERED_PANE,
1148            Self::List => ffi::ATK_ROLE_LIST,
1149            Self::ListItem => ffi::ATK_ROLE_LIST_ITEM,
1150            Self::Menu => ffi::ATK_ROLE_MENU,
1151            Self::MenuBar => ffi::ATK_ROLE_MENU_BAR,
1152            Self::MenuItem => ffi::ATK_ROLE_MENU_ITEM,
1153            Self::OptionPane => ffi::ATK_ROLE_OPTION_PANE,
1154            Self::PageTab => ffi::ATK_ROLE_PAGE_TAB,
1155            Self::PageTabList => ffi::ATK_ROLE_PAGE_TAB_LIST,
1156            Self::Panel => ffi::ATK_ROLE_PANEL,
1157            Self::PasswordText => ffi::ATK_ROLE_PASSWORD_TEXT,
1158            Self::PopupMenu => ffi::ATK_ROLE_POPUP_MENU,
1159            Self::ProgressBar => ffi::ATK_ROLE_PROGRESS_BAR,
1160            Self::Button => ffi::ATK_ROLE_BUTTON,
1161            Self::RadioButton => ffi::ATK_ROLE_RADIO_BUTTON,
1162            Self::RadioMenuItem => ffi::ATK_ROLE_RADIO_MENU_ITEM,
1163            Self::RootPane => ffi::ATK_ROLE_ROOT_PANE,
1164            Self::RowHeader => ffi::ATK_ROLE_ROW_HEADER,
1165            Self::ScrollBar => ffi::ATK_ROLE_SCROLL_BAR,
1166            Self::ScrollPane => ffi::ATK_ROLE_SCROLL_PANE,
1167            Self::Separator => ffi::ATK_ROLE_SEPARATOR,
1168            Self::Slider => ffi::ATK_ROLE_SLIDER,
1169            Self::SplitPane => ffi::ATK_ROLE_SPLIT_PANE,
1170            Self::SpinButton => ffi::ATK_ROLE_SPIN_BUTTON,
1171            Self::Statusbar => ffi::ATK_ROLE_STATUSBAR,
1172            Self::Table => ffi::ATK_ROLE_TABLE,
1173            Self::TableCell => ffi::ATK_ROLE_TABLE_CELL,
1174            Self::TableColumnHeader => ffi::ATK_ROLE_TABLE_COLUMN_HEADER,
1175            Self::TableRowHeader => ffi::ATK_ROLE_TABLE_ROW_HEADER,
1176            Self::TearOffMenuItem => ffi::ATK_ROLE_TEAR_OFF_MENU_ITEM,
1177            Self::Terminal => ffi::ATK_ROLE_TERMINAL,
1178            Self::Text => ffi::ATK_ROLE_TEXT,
1179            Self::ToggleButton => ffi::ATK_ROLE_TOGGLE_BUTTON,
1180            Self::ToolBar => ffi::ATK_ROLE_TOOL_BAR,
1181            Self::ToolTip => ffi::ATK_ROLE_TOOL_TIP,
1182            Self::Tree => ffi::ATK_ROLE_TREE,
1183            Self::TreeTable => ffi::ATK_ROLE_TREE_TABLE,
1184            Self::Unknown => ffi::ATK_ROLE_UNKNOWN,
1185            Self::Viewport => ffi::ATK_ROLE_VIEWPORT,
1186            Self::Window => ffi::ATK_ROLE_WINDOW,
1187            Self::Header => ffi::ATK_ROLE_HEADER,
1188            Self::Footer => ffi::ATK_ROLE_FOOTER,
1189            Self::Paragraph => ffi::ATK_ROLE_PARAGRAPH,
1190            Self::Ruler => ffi::ATK_ROLE_RULER,
1191            Self::Application => ffi::ATK_ROLE_APPLICATION,
1192            Self::Autocomplete => ffi::ATK_ROLE_AUTOCOMPLETE,
1193            Self::EditBar => ffi::ATK_ROLE_EDITBAR,
1194            Self::Embedded => ffi::ATK_ROLE_EMBEDDED,
1195            Self::Entry => ffi::ATK_ROLE_ENTRY,
1196            Self::Chart => ffi::ATK_ROLE_CHART,
1197            Self::Caption => ffi::ATK_ROLE_CAPTION,
1198            Self::DocumentFrame => ffi::ATK_ROLE_DOCUMENT_FRAME,
1199            Self::Heading => ffi::ATK_ROLE_HEADING,
1200            Self::Page => ffi::ATK_ROLE_PAGE,
1201            Self::Section => ffi::ATK_ROLE_SECTION,
1202            Self::RedundantObject => ffi::ATK_ROLE_REDUNDANT_OBJECT,
1203            Self::Form => ffi::ATK_ROLE_FORM,
1204            Self::Link => ffi::ATK_ROLE_LINK,
1205            Self::InputMethodWindow => ffi::ATK_ROLE_INPUT_METHOD_WINDOW,
1206            Self::TableRow => ffi::ATK_ROLE_TABLE_ROW,
1207            Self::TreeItem => ffi::ATK_ROLE_TREE_ITEM,
1208            Self::DocumentSpreadsheet => ffi::ATK_ROLE_DOCUMENT_SPREADSHEET,
1209            Self::DocumentPresentation => ffi::ATK_ROLE_DOCUMENT_PRESENTATION,
1210            Self::DocumentText => ffi::ATK_ROLE_DOCUMENT_TEXT,
1211            Self::DocumentWeb => ffi::ATK_ROLE_DOCUMENT_WEB,
1212            Self::DocumentEmail => ffi::ATK_ROLE_DOCUMENT_EMAIL,
1213            Self::Comment => ffi::ATK_ROLE_COMMENT,
1214            Self::ListBox => ffi::ATK_ROLE_LIST_BOX,
1215            Self::Grouping => ffi::ATK_ROLE_GROUPING,
1216            Self::ImageMap => ffi::ATK_ROLE_IMAGE_MAP,
1217            Self::Notification => ffi::ATK_ROLE_NOTIFICATION,
1218            Self::InfoBar => ffi::ATK_ROLE_INFO_BAR,
1219            Self::LevelBar => ffi::ATK_ROLE_LEVEL_BAR,
1220            Self::TitleBar => ffi::ATK_ROLE_TITLE_BAR,
1221            Self::BlockQuote => ffi::ATK_ROLE_BLOCK_QUOTE,
1222            Self::Audio => ffi::ATK_ROLE_AUDIO,
1223            Self::Video => ffi::ATK_ROLE_VIDEO,
1224            Self::Definition => ffi::ATK_ROLE_DEFINITION,
1225            Self::Article => ffi::ATK_ROLE_ARTICLE,
1226            Self::Landmark => ffi::ATK_ROLE_LANDMARK,
1227            Self::Log => ffi::ATK_ROLE_LOG,
1228            Self::Marquee => ffi::ATK_ROLE_MARQUEE,
1229            Self::Math => ffi::ATK_ROLE_MATH,
1230            Self::Rating => ffi::ATK_ROLE_RATING,
1231            Self::Timer => ffi::ATK_ROLE_TIMER,
1232            Self::DescriptionList => ffi::ATK_ROLE_DESCRIPTION_LIST,
1233            Self::DescriptionTerm => ffi::ATK_ROLE_DESCRIPTION_TERM,
1234            Self::DescriptionValue => ffi::ATK_ROLE_DESCRIPTION_VALUE,
1235            Self::Static => ffi::ATK_ROLE_STATIC,
1236            Self::MathFraction => ffi::ATK_ROLE_MATH_FRACTION,
1237            Self::MathRoot => ffi::ATK_ROLE_MATH_ROOT,
1238            Self::Subscript => ffi::ATK_ROLE_SUBSCRIPT,
1239            Self::Superscript => ffi::ATK_ROLE_SUPERSCRIPT,
1240            Self::Footnote => ffi::ATK_ROLE_FOOTNOTE,
1241            Self::ContentDeletion => ffi::ATK_ROLE_CONTENT_DELETION,
1242            Self::ContentInsertion => ffi::ATK_ROLE_CONTENT_INSERTION,
1243            Self::Mark => ffi::ATK_ROLE_MARK,
1244            Self::Suggestion => ffi::ATK_ROLE_SUGGESTION,
1245            Self::PushButtonMenu => ffi::ATK_ROLE_PUSH_BUTTON_MENU,
1246            Self::Switch => ffi::ATK_ROLE_SWITCH,
1247            Self::LastDefined => ffi::ATK_ROLE_LAST_DEFINED,
1248            Self::__Unknown(value) => value,
1249        }
1250    }
1251}
1252
1253#[doc(hidden)]
1254impl FromGlib<ffi::AtkRole> for Role {
1255    unsafe fn from_glib(value: ffi::AtkRole) -> Self {
1256        skip_assert_initialized!();
1257
1258        match value {
1259            ffi::ATK_ROLE_INVALID => Self::Invalid,
1260            ffi::ATK_ROLE_ACCEL_LABEL => Self::AcceleratorLabel,
1261            ffi::ATK_ROLE_ALERT => Self::Alert,
1262            ffi::ATK_ROLE_ANIMATION => Self::Animation,
1263            ffi::ATK_ROLE_ARROW => Self::Arrow,
1264            ffi::ATK_ROLE_CALENDAR => Self::Calendar,
1265            ffi::ATK_ROLE_CANVAS => Self::Canvas,
1266            ffi::ATK_ROLE_CHECK_BOX => Self::CheckBox,
1267            ffi::ATK_ROLE_CHECK_MENU_ITEM => Self::CheckMenuItem,
1268            ffi::ATK_ROLE_COLOR_CHOOSER => Self::ColorChooser,
1269            ffi::ATK_ROLE_COLUMN_HEADER => Self::ColumnHeader,
1270            ffi::ATK_ROLE_COMBO_BOX => Self::ComboBox,
1271            ffi::ATK_ROLE_DATE_EDITOR => Self::DateEditor,
1272            ffi::ATK_ROLE_DESKTOP_ICON => Self::DesktopIcon,
1273            ffi::ATK_ROLE_DESKTOP_FRAME => Self::DesktopFrame,
1274            ffi::ATK_ROLE_DIAL => Self::Dial,
1275            ffi::ATK_ROLE_DIALOG => Self::Dialog,
1276            ffi::ATK_ROLE_DIRECTORY_PANE => Self::DirectoryPane,
1277            ffi::ATK_ROLE_DRAWING_AREA => Self::DrawingArea,
1278            ffi::ATK_ROLE_FILE_CHOOSER => Self::FileChooser,
1279            ffi::ATK_ROLE_FILLER => Self::Filler,
1280            ffi::ATK_ROLE_FONT_CHOOSER => Self::FontChooser,
1281            ffi::ATK_ROLE_FRAME => Self::Frame,
1282            ffi::ATK_ROLE_GLASS_PANE => Self::GlassPane,
1283            ffi::ATK_ROLE_HTML_CONTAINER => Self::HtmlContainer,
1284            ffi::ATK_ROLE_ICON => Self::Icon,
1285            ffi::ATK_ROLE_IMAGE => Self::Image,
1286            ffi::ATK_ROLE_INTERNAL_FRAME => Self::InternalFrame,
1287            ffi::ATK_ROLE_LABEL => Self::Label,
1288            ffi::ATK_ROLE_LAYERED_PANE => Self::LayeredPane,
1289            ffi::ATK_ROLE_LIST => Self::List,
1290            ffi::ATK_ROLE_LIST_ITEM => Self::ListItem,
1291            ffi::ATK_ROLE_MENU => Self::Menu,
1292            ffi::ATK_ROLE_MENU_BAR => Self::MenuBar,
1293            ffi::ATK_ROLE_MENU_ITEM => Self::MenuItem,
1294            ffi::ATK_ROLE_OPTION_PANE => Self::OptionPane,
1295            ffi::ATK_ROLE_PAGE_TAB => Self::PageTab,
1296            ffi::ATK_ROLE_PAGE_TAB_LIST => Self::PageTabList,
1297            ffi::ATK_ROLE_PANEL => Self::Panel,
1298            ffi::ATK_ROLE_PASSWORD_TEXT => Self::PasswordText,
1299            ffi::ATK_ROLE_POPUP_MENU => Self::PopupMenu,
1300            ffi::ATK_ROLE_PROGRESS_BAR => Self::ProgressBar,
1301            ffi::ATK_ROLE_BUTTON => Self::Button,
1302            ffi::ATK_ROLE_RADIO_BUTTON => Self::RadioButton,
1303            ffi::ATK_ROLE_RADIO_MENU_ITEM => Self::RadioMenuItem,
1304            ffi::ATK_ROLE_ROOT_PANE => Self::RootPane,
1305            ffi::ATK_ROLE_ROW_HEADER => Self::RowHeader,
1306            ffi::ATK_ROLE_SCROLL_BAR => Self::ScrollBar,
1307            ffi::ATK_ROLE_SCROLL_PANE => Self::ScrollPane,
1308            ffi::ATK_ROLE_SEPARATOR => Self::Separator,
1309            ffi::ATK_ROLE_SLIDER => Self::Slider,
1310            ffi::ATK_ROLE_SPLIT_PANE => Self::SplitPane,
1311            ffi::ATK_ROLE_SPIN_BUTTON => Self::SpinButton,
1312            ffi::ATK_ROLE_STATUSBAR => Self::Statusbar,
1313            ffi::ATK_ROLE_TABLE => Self::Table,
1314            ffi::ATK_ROLE_TABLE_CELL => Self::TableCell,
1315            ffi::ATK_ROLE_TABLE_COLUMN_HEADER => Self::TableColumnHeader,
1316            ffi::ATK_ROLE_TABLE_ROW_HEADER => Self::TableRowHeader,
1317            ffi::ATK_ROLE_TEAR_OFF_MENU_ITEM => Self::TearOffMenuItem,
1318            ffi::ATK_ROLE_TERMINAL => Self::Terminal,
1319            ffi::ATK_ROLE_TEXT => Self::Text,
1320            ffi::ATK_ROLE_TOGGLE_BUTTON => Self::ToggleButton,
1321            ffi::ATK_ROLE_TOOL_BAR => Self::ToolBar,
1322            ffi::ATK_ROLE_TOOL_TIP => Self::ToolTip,
1323            ffi::ATK_ROLE_TREE => Self::Tree,
1324            ffi::ATK_ROLE_TREE_TABLE => Self::TreeTable,
1325            ffi::ATK_ROLE_UNKNOWN => Self::Unknown,
1326            ffi::ATK_ROLE_VIEWPORT => Self::Viewport,
1327            ffi::ATK_ROLE_WINDOW => Self::Window,
1328            ffi::ATK_ROLE_HEADER => Self::Header,
1329            ffi::ATK_ROLE_FOOTER => Self::Footer,
1330            ffi::ATK_ROLE_PARAGRAPH => Self::Paragraph,
1331            ffi::ATK_ROLE_RULER => Self::Ruler,
1332            ffi::ATK_ROLE_APPLICATION => Self::Application,
1333            ffi::ATK_ROLE_AUTOCOMPLETE => Self::Autocomplete,
1334            ffi::ATK_ROLE_EDITBAR => Self::EditBar,
1335            ffi::ATK_ROLE_EMBEDDED => Self::Embedded,
1336            ffi::ATK_ROLE_ENTRY => Self::Entry,
1337            ffi::ATK_ROLE_CHART => Self::Chart,
1338            ffi::ATK_ROLE_CAPTION => Self::Caption,
1339            ffi::ATK_ROLE_DOCUMENT_FRAME => Self::DocumentFrame,
1340            ffi::ATK_ROLE_HEADING => Self::Heading,
1341            ffi::ATK_ROLE_PAGE => Self::Page,
1342            ffi::ATK_ROLE_SECTION => Self::Section,
1343            ffi::ATK_ROLE_REDUNDANT_OBJECT => Self::RedundantObject,
1344            ffi::ATK_ROLE_FORM => Self::Form,
1345            ffi::ATK_ROLE_LINK => Self::Link,
1346            ffi::ATK_ROLE_INPUT_METHOD_WINDOW => Self::InputMethodWindow,
1347            ffi::ATK_ROLE_TABLE_ROW => Self::TableRow,
1348            ffi::ATK_ROLE_TREE_ITEM => Self::TreeItem,
1349            ffi::ATK_ROLE_DOCUMENT_SPREADSHEET => Self::DocumentSpreadsheet,
1350            ffi::ATK_ROLE_DOCUMENT_PRESENTATION => Self::DocumentPresentation,
1351            ffi::ATK_ROLE_DOCUMENT_TEXT => Self::DocumentText,
1352            ffi::ATK_ROLE_DOCUMENT_WEB => Self::DocumentWeb,
1353            ffi::ATK_ROLE_DOCUMENT_EMAIL => Self::DocumentEmail,
1354            ffi::ATK_ROLE_COMMENT => Self::Comment,
1355            ffi::ATK_ROLE_LIST_BOX => Self::ListBox,
1356            ffi::ATK_ROLE_GROUPING => Self::Grouping,
1357            ffi::ATK_ROLE_IMAGE_MAP => Self::ImageMap,
1358            ffi::ATK_ROLE_NOTIFICATION => Self::Notification,
1359            ffi::ATK_ROLE_INFO_BAR => Self::InfoBar,
1360            ffi::ATK_ROLE_LEVEL_BAR => Self::LevelBar,
1361            ffi::ATK_ROLE_TITLE_BAR => Self::TitleBar,
1362            ffi::ATK_ROLE_BLOCK_QUOTE => Self::BlockQuote,
1363            ffi::ATK_ROLE_AUDIO => Self::Audio,
1364            ffi::ATK_ROLE_VIDEO => Self::Video,
1365            ffi::ATK_ROLE_DEFINITION => Self::Definition,
1366            ffi::ATK_ROLE_ARTICLE => Self::Article,
1367            ffi::ATK_ROLE_LANDMARK => Self::Landmark,
1368            ffi::ATK_ROLE_LOG => Self::Log,
1369            ffi::ATK_ROLE_MARQUEE => Self::Marquee,
1370            ffi::ATK_ROLE_MATH => Self::Math,
1371            ffi::ATK_ROLE_RATING => Self::Rating,
1372            ffi::ATK_ROLE_TIMER => Self::Timer,
1373            ffi::ATK_ROLE_DESCRIPTION_LIST => Self::DescriptionList,
1374            ffi::ATK_ROLE_DESCRIPTION_TERM => Self::DescriptionTerm,
1375            ffi::ATK_ROLE_DESCRIPTION_VALUE => Self::DescriptionValue,
1376            ffi::ATK_ROLE_STATIC => Self::Static,
1377            ffi::ATK_ROLE_MATH_FRACTION => Self::MathFraction,
1378            ffi::ATK_ROLE_MATH_ROOT => Self::MathRoot,
1379            ffi::ATK_ROLE_SUBSCRIPT => Self::Subscript,
1380            ffi::ATK_ROLE_SUPERSCRIPT => Self::Superscript,
1381            ffi::ATK_ROLE_FOOTNOTE => Self::Footnote,
1382            ffi::ATK_ROLE_CONTENT_DELETION => Self::ContentDeletion,
1383            ffi::ATK_ROLE_CONTENT_INSERTION => Self::ContentInsertion,
1384            ffi::ATK_ROLE_MARK => Self::Mark,
1385            ffi::ATK_ROLE_SUGGESTION => Self::Suggestion,
1386            ffi::ATK_ROLE_PUSH_BUTTON_MENU => Self::PushButtonMenu,
1387            ffi::ATK_ROLE_SWITCH => Self::Switch,
1388            ffi::ATK_ROLE_LAST_DEFINED => Self::LastDefined,
1389            value => Self::__Unknown(value),
1390        }
1391    }
1392}
1393
1394impl StaticType for Role {
1395    #[inline]
1396    #[doc(alias = "atk_role_get_type")]
1397    fn static_type() -> glib::Type {
1398        unsafe { from_glib(ffi::atk_role_get_type()) }
1399    }
1400}
1401
1402impl glib::HasParamSpec for Role {
1403    type ParamSpec = glib::ParamSpecEnum;
1404    type SetValue = Self;
1405    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1406
1407    fn param_spec_builder() -> Self::BuilderFn {
1408        Self::ParamSpec::builder_with_default
1409    }
1410}
1411
1412impl glib::value::ValueType for Role {
1413    type Type = Self;
1414}
1415
1416unsafe impl<'a> glib::value::FromValue<'a> for Role {
1417    type Checker = glib::value::GenericValueTypeChecker<Self>;
1418
1419    #[inline]
1420    unsafe fn from_value(value: &'a glib::Value) -> Self {
1421        skip_assert_initialized!();
1422        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
1423    }
1424}
1425
1426impl ToValue for Role {
1427    #[inline]
1428    fn to_value(&self) -> glib::Value {
1429        let mut value = glib::Value::for_value_type::<Self>();
1430        unsafe {
1431            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1432        }
1433        value
1434    }
1435
1436    #[inline]
1437    fn value_type(&self) -> glib::Type {
1438        Self::static_type()
1439    }
1440}
1441
1442impl From<Role> for glib::Value {
1443    #[inline]
1444    fn from(v: Role) -> Self {
1445        skip_assert_initialized!();
1446        ToValue::to_value(&v)
1447    }
1448}
1449
1450/// Specifies where an object should be placed on the screen when using scroll_to.
1451#[cfg(feature = "v2_30")]
1452#[cfg_attr(docsrs, doc(cfg(feature = "v2_30")))]
1453#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1454#[non_exhaustive]
1455#[doc(alias = "AtkScrollType")]
1456pub enum ScrollType {
1457    /// Scroll the object vertically and horizontally to bring
1458    ///  its top left corner to the top left corner of the window.
1459    #[doc(alias = "ATK_SCROLL_TOP_LEFT")]
1460    TopLeft,
1461    /// Scroll the object vertically and horizontally to
1462    ///  bring its bottom right corner to the bottom right corner of the window.
1463    #[doc(alias = "ATK_SCROLL_BOTTOM_RIGHT")]
1464    BottomRight,
1465    /// Scroll the object vertically to bring its top edge to
1466    ///  the top edge of the window.
1467    #[doc(alias = "ATK_SCROLL_TOP_EDGE")]
1468    TopEdge,
1469    /// Scroll the object vertically to bring its bottom
1470    ///  edge to the bottom edge of the window.
1471    #[doc(alias = "ATK_SCROLL_BOTTOM_EDGE")]
1472    BottomEdge,
1473    /// Scroll the object vertically and horizontally to bring
1474    ///  its left edge to the left edge of the window.
1475    #[doc(alias = "ATK_SCROLL_LEFT_EDGE")]
1476    LeftEdge,
1477    /// Scroll the object vertically and horizontally to
1478    ///  bring its right edge to the right edge of the window.
1479    #[doc(alias = "ATK_SCROLL_RIGHT_EDGE")]
1480    RightEdge,
1481    /// Scroll the object vertically and horizontally so that
1482    ///  as much as possible of the object becomes visible. The exact placement is
1483    ///  determined by the application.
1484    #[doc(alias = "ATK_SCROLL_ANYWHERE")]
1485    Anywhere,
1486    #[doc(hidden)]
1487    __Unknown(i32),
1488}
1489
1490#[cfg(feature = "v2_30")]
1491#[cfg_attr(docsrs, doc(cfg(feature = "v2_30")))]
1492#[doc(hidden)]
1493impl IntoGlib for ScrollType {
1494    type GlibType = ffi::AtkScrollType;
1495
1496    #[inline]
1497    fn into_glib(self) -> ffi::AtkScrollType {
1498        match self {
1499            Self::TopLeft => ffi::ATK_SCROLL_TOP_LEFT,
1500            Self::BottomRight => ffi::ATK_SCROLL_BOTTOM_RIGHT,
1501            Self::TopEdge => ffi::ATK_SCROLL_TOP_EDGE,
1502            Self::BottomEdge => ffi::ATK_SCROLL_BOTTOM_EDGE,
1503            Self::LeftEdge => ffi::ATK_SCROLL_LEFT_EDGE,
1504            Self::RightEdge => ffi::ATK_SCROLL_RIGHT_EDGE,
1505            Self::Anywhere => ffi::ATK_SCROLL_ANYWHERE,
1506            Self::__Unknown(value) => value,
1507        }
1508    }
1509}
1510
1511#[cfg(feature = "v2_30")]
1512#[cfg_attr(docsrs, doc(cfg(feature = "v2_30")))]
1513#[doc(hidden)]
1514impl FromGlib<ffi::AtkScrollType> for ScrollType {
1515    #[inline]
1516    unsafe fn from_glib(value: ffi::AtkScrollType) -> Self {
1517        skip_assert_initialized!();
1518
1519        match value {
1520            ffi::ATK_SCROLL_TOP_LEFT => Self::TopLeft,
1521            ffi::ATK_SCROLL_BOTTOM_RIGHT => Self::BottomRight,
1522            ffi::ATK_SCROLL_TOP_EDGE => Self::TopEdge,
1523            ffi::ATK_SCROLL_BOTTOM_EDGE => Self::BottomEdge,
1524            ffi::ATK_SCROLL_LEFT_EDGE => Self::LeftEdge,
1525            ffi::ATK_SCROLL_RIGHT_EDGE => Self::RightEdge,
1526            ffi::ATK_SCROLL_ANYWHERE => Self::Anywhere,
1527            value => Self::__Unknown(value),
1528        }
1529    }
1530}
1531
1532#[cfg(feature = "v2_30")]
1533#[cfg_attr(docsrs, doc(cfg(feature = "v2_30")))]
1534impl StaticType for ScrollType {
1535    #[inline]
1536    #[doc(alias = "atk_scroll_type_get_type")]
1537    fn static_type() -> glib::Type {
1538        unsafe { from_glib(ffi::atk_scroll_type_get_type()) }
1539    }
1540}
1541
1542#[cfg(feature = "v2_30")]
1543#[cfg_attr(docsrs, doc(cfg(feature = "v2_30")))]
1544impl glib::HasParamSpec for ScrollType {
1545    type ParamSpec = glib::ParamSpecEnum;
1546    type SetValue = Self;
1547    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1548
1549    fn param_spec_builder() -> Self::BuilderFn {
1550        Self::ParamSpec::builder_with_default
1551    }
1552}
1553
1554#[cfg(feature = "v2_30")]
1555#[cfg_attr(docsrs, doc(cfg(feature = "v2_30")))]
1556impl glib::value::ValueType for ScrollType {
1557    type Type = Self;
1558}
1559
1560#[cfg(feature = "v2_30")]
1561#[cfg_attr(docsrs, doc(cfg(feature = "v2_30")))]
1562unsafe impl<'a> glib::value::FromValue<'a> for ScrollType {
1563    type Checker = glib::value::GenericValueTypeChecker<Self>;
1564
1565    #[inline]
1566    unsafe fn from_value(value: &'a glib::Value) -> Self {
1567        skip_assert_initialized!();
1568        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
1569    }
1570}
1571
1572#[cfg(feature = "v2_30")]
1573#[cfg_attr(docsrs, doc(cfg(feature = "v2_30")))]
1574impl ToValue for ScrollType {
1575    #[inline]
1576    fn to_value(&self) -> glib::Value {
1577        let mut value = glib::Value::for_value_type::<Self>();
1578        unsafe {
1579            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1580        }
1581        value
1582    }
1583
1584    #[inline]
1585    fn value_type(&self) -> glib::Type {
1586        Self::static_type()
1587    }
1588}
1589
1590#[cfg(feature = "v2_30")]
1591#[cfg_attr(docsrs, doc(cfg(feature = "v2_30")))]
1592impl From<ScrollType> for glib::Value {
1593    #[inline]
1594    fn from(v: ScrollType) -> Self {
1595        skip_assert_initialized!();
1596        ToValue::to_value(&v)
1597    }
1598}
1599
1600/// The possible types of states of an object
1601#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1602#[non_exhaustive]
1603#[doc(alias = "AtkStateType")]
1604pub enum StateType {
1605    /// Indicates an invalid state - probably an error condition.
1606    #[doc(alias = "ATK_STATE_INVALID")]
1607    Invalid,
1608    /// Indicates a window is currently the active window, or an object is the active subelement within a container or table. ATK_STATE_ACTIVE should not be used for objects which have ATK_STATE_FOCUSABLE or ATK_STATE_SELECTABLE: Those objects should use ATK_STATE_FOCUSED and ATK_STATE_SELECTED respectively. ATK_STATE_ACTIVE is a means to indicate that an object which is not focusable and not selectable is the currently-active item within its parent container.
1609    #[doc(alias = "ATK_STATE_ACTIVE")]
1610    Active,
1611    /// Indicates that the object is 'armed', i.e. will be activated by if a pointer button-release event occurs within its bounds. Buttons often enter this state when a pointer click occurs within their bounds, as a precursor to activation. ATK_STATE_ARMED has been deprecated since ATK-2.16 and should not be used in newly-written code.
1612    #[doc(alias = "ATK_STATE_ARMED")]
1613    Armed,
1614    /// Indicates the current object is busy, i.e. onscreen representation is in the process of changing, or the object is temporarily unavailable for interaction due to activity already in progress. This state may be used by implementors of Document to indicate that content loading is underway. It also may indicate other 'pending' conditions; clients may wish to interrogate this object when the ATK_STATE_BUSY flag is removed.
1615    #[doc(alias = "ATK_STATE_BUSY")]
1616    Busy,
1617    /// Indicates this object is currently checked, for instance a checkbox is 'non-empty'.
1618    #[doc(alias = "ATK_STATE_CHECKED")]
1619    Checked,
1620    /// Indicates that this object no longer has a valid backing widget (for instance, if its peer object has been destroyed)
1621    #[doc(alias = "ATK_STATE_DEFUNCT")]
1622    Defunct,
1623    /// Indicates that this object can contain text, and that the
1624    /// user can change the textual contents of this object by editing those contents
1625    /// directly. For an object which is expected to be editable due to its type, but
1626    /// which cannot be edited due to the application or platform preventing the user
1627    /// from doing so, that object's [`StateSet`][crate::StateSet] should lack ATK_STATE_EDITABLE and
1628    /// should contain ATK_STATE_READ_ONLY.
1629    #[doc(alias = "ATK_STATE_EDITABLE")]
1630    Editable,
1631    /// Indicates that this object is enabled, i.e. that it currently reflects some application state. Objects that are "greyed out" may lack this state, and may lack the STATE_SENSITIVE if direct user interaction cannot cause them to acquire STATE_ENABLED. See also: ATK_STATE_SENSITIVE
1632    #[doc(alias = "ATK_STATE_ENABLED")]
1633    Enabled,
1634    /// Indicates this object allows progressive disclosure of its children
1635    #[doc(alias = "ATK_STATE_EXPANDABLE")]
1636    Expandable,
1637    /// Indicates this object its expanded - see ATK_STATE_EXPANDABLE above
1638    #[doc(alias = "ATK_STATE_EXPANDED")]
1639    Expanded,
1640    /// Indicates this object can accept keyboard focus, which means all events resulting from typing on the keyboard will normally be passed to it when it has focus
1641    #[doc(alias = "ATK_STATE_FOCUSABLE")]
1642    Focusable,
1643    /// Indicates this object currently has the keyboard focus
1644    #[doc(alias = "ATK_STATE_FOCUSED")]
1645    Focused,
1646    /// Indicates the orientation of this object is horizontal; used, for instance, by objects of ATK_ROLE_SCROLL_BAR. For objects where vertical/horizontal orientation is especially meaningful.
1647    #[doc(alias = "ATK_STATE_HORIZONTAL")]
1648    Horizontal,
1649    /// Indicates this object is minimized and is represented only by an icon
1650    #[doc(alias = "ATK_STATE_ICONIFIED")]
1651    Iconified,
1652    /// Indicates something must be done with this object before the user can interact with an object in a different window
1653    #[doc(alias = "ATK_STATE_MODAL")]
1654    Modal,
1655    /// Indicates this (text) object can contain multiple lines of text
1656    #[doc(alias = "ATK_STATE_MULTI_LINE")]
1657    MultiLine,
1658    /// Indicates this object allows more than one of its children to be selected at the same time, or in the case of text objects, that the object supports non-contiguous text selections.
1659    #[doc(alias = "ATK_STATE_MULTISELECTABLE")]
1660    Multiselectable,
1661    /// Indicates this object paints every pixel within its rectangular region.
1662    #[doc(alias = "ATK_STATE_OPAQUE")]
1663    Opaque,
1664    /// Indicates this object is currently pressed.
1665    #[doc(alias = "ATK_STATE_PRESSED")]
1666    Pressed,
1667    /// Indicates the size of this object is not fixed
1668    #[doc(alias = "ATK_STATE_RESIZABLE")]
1669    Resizable,
1670    /// Indicates this object is the child of an object that allows its children to be selected and that this child is one of those children that can be selected
1671    #[doc(alias = "ATK_STATE_SELECTABLE")]
1672    Selectable,
1673    /// Indicates this object is the child of an object that allows its children to be selected and that this child is one of those children that has been selected
1674    #[doc(alias = "ATK_STATE_SELECTED")]
1675    Selected,
1676    /// Indicates this object is sensitive, e.g. to user interaction.
1677    /// STATE_SENSITIVE usually accompanies STATE_ENABLED for user-actionable controls,
1678    /// but may be found in the absence of STATE_ENABLED if the current visible state of the
1679    /// control is "disconnected" from the application state. In such cases, direct user interaction
1680    /// can often result in the object gaining STATE_SENSITIVE, for instance if a user makes
1681    /// an explicit selection using an object whose current state is ambiguous or undefined.
1682    /// `see` STATE_ENABLED, STATE_INDETERMINATE.
1683    #[doc(alias = "ATK_STATE_SENSITIVE")]
1684    Sensitive,
1685    /// Indicates this object, the object's parent, the object's parent's parent, and so on,
1686    /// are all 'shown' to the end-user, i.e. subject to "exposure" if blocking or obscuring objects do not interpose
1687    /// between this object and the top of the window stack.
1688    #[doc(alias = "ATK_STATE_SHOWING")]
1689    Showing,
1690    /// Indicates this (text) object can contain only a single line of text
1691    #[doc(alias = "ATK_STATE_SINGLE_LINE")]
1692    SingleLine,
1693    /// Indicates that the information returned for this object may no longer be
1694    /// synchronized with the application state. This is implied if the object has STATE_TRANSIENT,
1695    /// and can also occur towards the end of the object peer's lifecycle. It can also be used to indicate that
1696    /// the index associated with this object has changed since the user accessed the object (in lieu of
1697    /// "index-in-parent-changed" events).
1698    #[doc(alias = "ATK_STATE_STALE")]
1699    Stale,
1700    /// Indicates this object is transient, i.e. a snapshot which may not emit events when its
1701    /// state changes. Data from objects with ATK_STATE_TRANSIENT should not be cached, since there may be no
1702    /// notification given when the cached data becomes obsolete.
1703    #[doc(alias = "ATK_STATE_TRANSIENT")]
1704    Transient,
1705    /// Indicates the orientation of this object is vertical
1706    #[doc(alias = "ATK_STATE_VERTICAL")]
1707    Vertical,
1708    /// Indicates this object is visible, e.g. has been explicitly marked for exposure to the user.
1709    /// **note**: [`Visible`][Self::Visible] is no guarantee that the object is actually unobscured on the screen, only
1710    /// that it is 'potentially' visible, barring obstruction, being scrolled or clipped out of the
1711    /// field of view, or having an ancestor container that has not yet made visible.
1712    /// A widget is potentially onscreen if it has both [`Visible`][Self::Visible] and [`Showing`][Self::Showing].
1713    /// The absence of [`Visible`][Self::Visible] and [`Showing`][Self::Showing] is semantically equivalent to saying
1714    /// that an object is 'hidden'. See also [`Truncated`][Self::Truncated], which applies if an object with
1715    /// [`Visible`][Self::Visible] and [`Showing`][Self::Showing] set lies within a viewport which means that its
1716    /// contents are clipped, e.g. a truncated spreadsheet cell or
1717    /// an image within a scrolling viewport. Mostly useful for screen-review and magnification
1718    /// algorithms.
1719    #[doc(alias = "ATK_STATE_VISIBLE")]
1720    Visible,
1721    /// Indicates that "active-descendant-changed" event
1722    /// is sent when children become 'active' (i.e. are selected or navigated to onscreen).
1723    /// Used to prevent need to enumerate all children in very large containers, like tables.
1724    /// The presence of STATE_MANAGES_DESCENDANTS is an indication to the client.
1725    /// that the children should not, and need not, be enumerated by the client.
1726    /// Objects implementing this state are expected to provide relevant state
1727    /// notifications to listening clients, for instance notifications of visibility
1728    /// changes and activation of their contained child objects, without the client
1729    /// having previously requested references to those children.
1730    #[doc(alias = "ATK_STATE_MANAGES_DESCENDANTS")]
1731    ManagesDescendants,
1732    /// Indicates that the value, or some other quantifiable
1733    /// property, of this AtkObject cannot be fully determined. In the case of a large
1734    /// data set in which the total number of items in that set is unknown (e.g. 1 of
1735    /// 999+), implementors should expose the currently-known set size (999) along
1736    /// with this state. In the case of a check box, this state should be used to
1737    /// indicate that the check box is a tri-state check box which is currently
1738    /// neither checked nor unchecked.
1739    #[doc(alias = "ATK_STATE_INDETERMINATE")]
1740    Indeterminate,
1741    /// Indicates that an object is truncated, e.g. a text value in a speradsheet cell.
1742    #[doc(alias = "ATK_STATE_TRUNCATED")]
1743    Truncated,
1744    /// Indicates that explicit user interaction with an object is required by the user interface, e.g. a required field in a "web-form" interface.
1745    #[doc(alias = "ATK_STATE_REQUIRED")]
1746    Required,
1747    /// Indicates that the object has encountered an error condition due to failure of input validation. For instance, a form control may acquire this state in response to invalid or malformed user input.
1748    #[doc(alias = "ATK_STATE_INVALID_ENTRY")]
1749    InvalidEntry,
1750    /// Indicates that the object in question implements some form of ¨typeahead¨ or
1751    /// pre-selection behavior whereby entering the first character of one or more sub-elements
1752    /// causes those elements to scroll into view or become selected. Subsequent character input
1753    /// may narrow the selection further as long as one or more sub-elements match the string.
1754    /// This state is normally only useful and encountered on objects that implement Selection.
1755    /// In some cases the typeahead behavior may result in full or partial ¨completion¨ of
1756    /// the data in the input field, in which case these input events may trigger text-changed
1757    /// events from the AtkText interface. This state supplants [`Role::Autocomplete`][crate::Role::Autocomplete].
1758    #[doc(alias = "ATK_STATE_SUPPORTS_AUTOCOMPLETION")]
1759    SupportsAutocompletion,
1760    /// Indicates that the object in question supports text selection. It should only be exposed on objects which implement the Text interface, in order to distinguish this state from [`Selectable`][Self::Selectable], which infers that the object in question is a selectable child of an object which implements Selection. While similar, text selection and subelement selection are distinct operations.
1761    #[doc(alias = "ATK_STATE_SELECTABLE_TEXT")]
1762    SelectableText,
1763    /// Indicates that the object is the "default" active component, i.e. the object which is activated by an end-user press of the "Enter" or "Return" key. Typically a "close" or "submit" button.
1764    #[doc(alias = "ATK_STATE_DEFAULT")]
1765    Default,
1766    /// Indicates that the object changes its appearance dynamically as an inherent part of its presentation. This state may come and go if an object is only temporarily animated on the way to a 'final' onscreen presentation.
1767    /// **note**: some applications, notably content viewers, may not be able to detect
1768    /// all kinds of animated content. Therefore the absence of this state should not
1769    /// be taken as definitive evidence that the object's visual representation is
1770    /// static; this state is advisory.
1771    #[doc(alias = "ATK_STATE_ANIMATED")]
1772    Animated,
1773    /// Indicates that the object (typically a hyperlink) has already been 'activated', and/or its backing data has already been downloaded, rendered, or otherwise "visited".
1774    #[doc(alias = "ATK_STATE_VISITED")]
1775    Visited,
1776    /// Indicates this object has the potential to be
1777    ///  checked, such as a checkbox or toggle-able table cell. `Since`:
1778    ///  ATK-2.12
1779    #[doc(alias = "ATK_STATE_CHECKABLE")]
1780    Checkable,
1781    /// Indicates that the object has a popup context
1782    /// menu or sub-level menu which may or may not be showing. This means
1783    /// that activation renders conditional content. Note that ordinary
1784    /// tooltips are not considered popups in this context. `Since`: ATK-2.12
1785    #[doc(alias = "ATK_STATE_HAS_POPUP")]
1786    HasPopup,
1787    /// Indicates this object has a tooltip. `Since`: ATK-2.16
1788    #[doc(alias = "ATK_STATE_HAS_TOOLTIP")]
1789    HasTooltip,
1790    /// Indicates that a widget which is ENABLED and SENSITIVE
1791    /// has a value which can be read, but not modified, by the user. Note that this
1792    /// state should only be applied to widget types whose value is normally directly
1793    /// user modifiable, such as check boxes, radio buttons, spin buttons, text input
1794    /// fields, and combo boxes, as a means to convey that the expected interaction
1795    /// with that widget is not possible. When the expected interaction with a
1796    /// widget does not include modification by the user, as is the case with
1797    /// labels and containers, ATK_STATE_READ_ONLY should not be applied. See also
1798    /// ATK_STATE_EDITABLE. `Since`: ATK-2-16
1799    #[doc(alias = "ATK_STATE_READ_ONLY")]
1800    ReadOnly,
1801    /// Indicates this object is collapsed. `Since`: ATK-2.38
1802    #[cfg(feature = "v2_38")]
1803    #[cfg_attr(docsrs, doc(cfg(feature = "v2_38")))]
1804    #[doc(alias = "ATK_STATE_COLLAPSED")]
1805    Collapsed,
1806    /// Not a valid state, used for finding end of enumeration
1807    #[doc(alias = "ATK_STATE_LAST_DEFINED")]
1808    LastDefined,
1809    #[doc(hidden)]
1810    __Unknown(i32),
1811}
1812
1813impl StateType {
1814    #[doc(alias = "atk_state_type_for_name")]
1815    pub fn for_name(name: &str) -> StateType {
1816        assert_initialized_main_thread!();
1817        unsafe { from_glib(ffi::atk_state_type_for_name(name.to_glib_none().0)) }
1818    }
1819
1820    #[doc(alias = "atk_state_type_get_name")]
1821    #[doc(alias = "get_name")]
1822    pub fn name(self) -> Option<glib::GString> {
1823        assert_initialized_main_thread!();
1824        unsafe { from_glib_none(ffi::atk_state_type_get_name(self.into_glib())) }
1825    }
1826}
1827
1828#[doc(hidden)]
1829impl IntoGlib for StateType {
1830    type GlibType = ffi::AtkStateType;
1831
1832    fn into_glib(self) -> ffi::AtkStateType {
1833        match self {
1834            Self::Invalid => ffi::ATK_STATE_INVALID,
1835            Self::Active => ffi::ATK_STATE_ACTIVE,
1836            Self::Armed => ffi::ATK_STATE_ARMED,
1837            Self::Busy => ffi::ATK_STATE_BUSY,
1838            Self::Checked => ffi::ATK_STATE_CHECKED,
1839            Self::Defunct => ffi::ATK_STATE_DEFUNCT,
1840            Self::Editable => ffi::ATK_STATE_EDITABLE,
1841            Self::Enabled => ffi::ATK_STATE_ENABLED,
1842            Self::Expandable => ffi::ATK_STATE_EXPANDABLE,
1843            Self::Expanded => ffi::ATK_STATE_EXPANDED,
1844            Self::Focusable => ffi::ATK_STATE_FOCUSABLE,
1845            Self::Focused => ffi::ATK_STATE_FOCUSED,
1846            Self::Horizontal => ffi::ATK_STATE_HORIZONTAL,
1847            Self::Iconified => ffi::ATK_STATE_ICONIFIED,
1848            Self::Modal => ffi::ATK_STATE_MODAL,
1849            Self::MultiLine => ffi::ATK_STATE_MULTI_LINE,
1850            Self::Multiselectable => ffi::ATK_STATE_MULTISELECTABLE,
1851            Self::Opaque => ffi::ATK_STATE_OPAQUE,
1852            Self::Pressed => ffi::ATK_STATE_PRESSED,
1853            Self::Resizable => ffi::ATK_STATE_RESIZABLE,
1854            Self::Selectable => ffi::ATK_STATE_SELECTABLE,
1855            Self::Selected => ffi::ATK_STATE_SELECTED,
1856            Self::Sensitive => ffi::ATK_STATE_SENSITIVE,
1857            Self::Showing => ffi::ATK_STATE_SHOWING,
1858            Self::SingleLine => ffi::ATK_STATE_SINGLE_LINE,
1859            Self::Stale => ffi::ATK_STATE_STALE,
1860            Self::Transient => ffi::ATK_STATE_TRANSIENT,
1861            Self::Vertical => ffi::ATK_STATE_VERTICAL,
1862            Self::Visible => ffi::ATK_STATE_VISIBLE,
1863            Self::ManagesDescendants => ffi::ATK_STATE_MANAGES_DESCENDANTS,
1864            Self::Indeterminate => ffi::ATK_STATE_INDETERMINATE,
1865            Self::Truncated => ffi::ATK_STATE_TRUNCATED,
1866            Self::Required => ffi::ATK_STATE_REQUIRED,
1867            Self::InvalidEntry => ffi::ATK_STATE_INVALID_ENTRY,
1868            Self::SupportsAutocompletion => ffi::ATK_STATE_SUPPORTS_AUTOCOMPLETION,
1869            Self::SelectableText => ffi::ATK_STATE_SELECTABLE_TEXT,
1870            Self::Default => ffi::ATK_STATE_DEFAULT,
1871            Self::Animated => ffi::ATK_STATE_ANIMATED,
1872            Self::Visited => ffi::ATK_STATE_VISITED,
1873            Self::Checkable => ffi::ATK_STATE_CHECKABLE,
1874            Self::HasPopup => ffi::ATK_STATE_HAS_POPUP,
1875            Self::HasTooltip => ffi::ATK_STATE_HAS_TOOLTIP,
1876            Self::ReadOnly => ffi::ATK_STATE_READ_ONLY,
1877            #[cfg(feature = "v2_38")]
1878            Self::Collapsed => ffi::ATK_STATE_COLLAPSED,
1879            Self::LastDefined => ffi::ATK_STATE_LAST_DEFINED,
1880            Self::__Unknown(value) => value,
1881        }
1882    }
1883}
1884
1885#[doc(hidden)]
1886impl FromGlib<ffi::AtkStateType> for StateType {
1887    unsafe fn from_glib(value: ffi::AtkStateType) -> Self {
1888        skip_assert_initialized!();
1889
1890        match value {
1891            ffi::ATK_STATE_INVALID => Self::Invalid,
1892            ffi::ATK_STATE_ACTIVE => Self::Active,
1893            ffi::ATK_STATE_ARMED => Self::Armed,
1894            ffi::ATK_STATE_BUSY => Self::Busy,
1895            ffi::ATK_STATE_CHECKED => Self::Checked,
1896            ffi::ATK_STATE_DEFUNCT => Self::Defunct,
1897            ffi::ATK_STATE_EDITABLE => Self::Editable,
1898            ffi::ATK_STATE_ENABLED => Self::Enabled,
1899            ffi::ATK_STATE_EXPANDABLE => Self::Expandable,
1900            ffi::ATK_STATE_EXPANDED => Self::Expanded,
1901            ffi::ATK_STATE_FOCUSABLE => Self::Focusable,
1902            ffi::ATK_STATE_FOCUSED => Self::Focused,
1903            ffi::ATK_STATE_HORIZONTAL => Self::Horizontal,
1904            ffi::ATK_STATE_ICONIFIED => Self::Iconified,
1905            ffi::ATK_STATE_MODAL => Self::Modal,
1906            ffi::ATK_STATE_MULTI_LINE => Self::MultiLine,
1907            ffi::ATK_STATE_MULTISELECTABLE => Self::Multiselectable,
1908            ffi::ATK_STATE_OPAQUE => Self::Opaque,
1909            ffi::ATK_STATE_PRESSED => Self::Pressed,
1910            ffi::ATK_STATE_RESIZABLE => Self::Resizable,
1911            ffi::ATK_STATE_SELECTABLE => Self::Selectable,
1912            ffi::ATK_STATE_SELECTED => Self::Selected,
1913            ffi::ATK_STATE_SENSITIVE => Self::Sensitive,
1914            ffi::ATK_STATE_SHOWING => Self::Showing,
1915            ffi::ATK_STATE_SINGLE_LINE => Self::SingleLine,
1916            ffi::ATK_STATE_STALE => Self::Stale,
1917            ffi::ATK_STATE_TRANSIENT => Self::Transient,
1918            ffi::ATK_STATE_VERTICAL => Self::Vertical,
1919            ffi::ATK_STATE_VISIBLE => Self::Visible,
1920            ffi::ATK_STATE_MANAGES_DESCENDANTS => Self::ManagesDescendants,
1921            ffi::ATK_STATE_INDETERMINATE => Self::Indeterminate,
1922            ffi::ATK_STATE_TRUNCATED => Self::Truncated,
1923            ffi::ATK_STATE_REQUIRED => Self::Required,
1924            ffi::ATK_STATE_INVALID_ENTRY => Self::InvalidEntry,
1925            ffi::ATK_STATE_SUPPORTS_AUTOCOMPLETION => Self::SupportsAutocompletion,
1926            ffi::ATK_STATE_SELECTABLE_TEXT => Self::SelectableText,
1927            ffi::ATK_STATE_DEFAULT => Self::Default,
1928            ffi::ATK_STATE_ANIMATED => Self::Animated,
1929            ffi::ATK_STATE_VISITED => Self::Visited,
1930            ffi::ATK_STATE_CHECKABLE => Self::Checkable,
1931            ffi::ATK_STATE_HAS_POPUP => Self::HasPopup,
1932            ffi::ATK_STATE_HAS_TOOLTIP => Self::HasTooltip,
1933            ffi::ATK_STATE_READ_ONLY => Self::ReadOnly,
1934            #[cfg(feature = "v2_38")]
1935            ffi::ATK_STATE_COLLAPSED => Self::Collapsed,
1936            ffi::ATK_STATE_LAST_DEFINED => Self::LastDefined,
1937            value => Self::__Unknown(value),
1938        }
1939    }
1940}
1941
1942impl StaticType for StateType {
1943    #[inline]
1944    #[doc(alias = "atk_state_type_get_type")]
1945    fn static_type() -> glib::Type {
1946        unsafe { from_glib(ffi::atk_state_type_get_type()) }
1947    }
1948}
1949
1950impl glib::HasParamSpec for StateType {
1951    type ParamSpec = glib::ParamSpecEnum;
1952    type SetValue = Self;
1953    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1954
1955    fn param_spec_builder() -> Self::BuilderFn {
1956        Self::ParamSpec::builder_with_default
1957    }
1958}
1959
1960impl glib::value::ValueType for StateType {
1961    type Type = Self;
1962}
1963
1964unsafe impl<'a> glib::value::FromValue<'a> for StateType {
1965    type Checker = glib::value::GenericValueTypeChecker<Self>;
1966
1967    #[inline]
1968    unsafe fn from_value(value: &'a glib::Value) -> Self {
1969        skip_assert_initialized!();
1970        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
1971    }
1972}
1973
1974impl ToValue for StateType {
1975    #[inline]
1976    fn to_value(&self) -> glib::Value {
1977        let mut value = glib::Value::for_value_type::<Self>();
1978        unsafe {
1979            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1980        }
1981        value
1982    }
1983
1984    #[inline]
1985    fn value_type(&self) -> glib::Type {
1986        Self::static_type()
1987    }
1988}
1989
1990impl From<StateType> for glib::Value {
1991    #[inline]
1992    fn from(v: StateType) -> Self {
1993        skip_assert_initialized!();
1994        ToValue::to_value(&v)
1995    }
1996}
1997
1998/// Describes the text attributes supported
1999#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2000#[non_exhaustive]
2001#[doc(alias = "AtkTextAttribute")]
2002pub enum TextAttribute {
2003    /// Invalid attribute, like bad spelling or grammar.
2004    #[doc(alias = "ATK_TEXT_ATTR_INVALID")]
2005    Invalid,
2006    /// The pixel width of the left margin
2007    #[doc(alias = "ATK_TEXT_ATTR_LEFT_MARGIN")]
2008    LeftMargin,
2009    /// The pixel width of the right margin
2010    #[doc(alias = "ATK_TEXT_ATTR_RIGHT_MARGIN")]
2011    RightMargin,
2012    /// The number of pixels that the text is indented
2013    #[doc(alias = "ATK_TEXT_ATTR_INDENT")]
2014    Indent,
2015    /// Either "true" or "false" indicating whether text is visible or not
2016    #[doc(alias = "ATK_TEXT_ATTR_INVISIBLE")]
2017    Invisible,
2018    /// Either "true" or "false" indicating whether text is editable or not
2019    #[doc(alias = "ATK_TEXT_ATTR_EDITABLE")]
2020    Editable,
2021    /// Pixels of blank space to leave above each newline-terminated line.
2022    #[doc(alias = "ATK_TEXT_ATTR_PIXELS_ABOVE_LINES")]
2023    PixelsAboveLines,
2024    /// Pixels of blank space to leave below each newline-terminated line.
2025    #[doc(alias = "ATK_TEXT_ATTR_PIXELS_BELOW_LINES")]
2026    PixelsBelowLines,
2027    /// Pixels of blank space to leave between wrapped lines inside the same newline-terminated line (paragraph).
2028    #[doc(alias = "ATK_TEXT_ATTR_PIXELS_INSIDE_WRAP")]
2029    PixelsInsideWrap,
2030    /// "true" or "false" whether to make the background color for each character the height of the highest font used on the current line, or the height of the font used for the current character.
2031    #[doc(alias = "ATK_TEXT_ATTR_BG_FULL_HEIGHT")]
2032    BgFullHeight,
2033    /// Number of pixels that the characters are risen above the baseline. See also ATK_TEXT_ATTR_TEXT_POSITION.
2034    #[doc(alias = "ATK_TEXT_ATTR_RISE")]
2035    Rise,
2036    /// "none", "single", "double", "low", or "error"
2037    #[doc(alias = "ATK_TEXT_ATTR_UNDERLINE")]
2038    Underline,
2039    /// "true" or "false" whether the text is strikethrough
2040    #[doc(alias = "ATK_TEXT_ATTR_STRIKETHROUGH")]
2041    Strikethrough,
2042    /// The size of the characters in points. eg: 10
2043    #[doc(alias = "ATK_TEXT_ATTR_SIZE")]
2044    Size,
2045    /// The scale of the characters. The value is a string representation of a double
2046    #[doc(alias = "ATK_TEXT_ATTR_SCALE")]
2047    Scale,
2048    /// The weight of the characters.
2049    #[doc(alias = "ATK_TEXT_ATTR_WEIGHT")]
2050    Weight,
2051    /// The language used
2052    #[doc(alias = "ATK_TEXT_ATTR_LANGUAGE")]
2053    Language,
2054    /// The font family name
2055    #[doc(alias = "ATK_TEXT_ATTR_FAMILY_NAME")]
2056    FamilyName,
2057    /// The background color. The value is an RGB value of the format "`u`,`u`,`u`"
2058    #[doc(alias = "ATK_TEXT_ATTR_BG_COLOR")]
2059    BgColor,
2060    /// The foreground color. The value is an RGB value of the format "`u`,`u`,`u`"
2061    #[doc(alias = "ATK_TEXT_ATTR_FG_COLOR")]
2062    FgColor,
2063    /// "true" if a `GdkBitmap` is set for stippling the background color.
2064    #[doc(alias = "ATK_TEXT_ATTR_BG_STIPPLE")]
2065    BgStipple,
2066    /// "true" if a `GdkBitmap` is set for stippling the foreground color.
2067    #[doc(alias = "ATK_TEXT_ATTR_FG_STIPPLE")]
2068    FgStipple,
2069    /// The wrap mode of the text, if any. Values are "none", "char", "word", or "word_char".
2070    #[doc(alias = "ATK_TEXT_ATTR_WRAP_MODE")]
2071    WrapMode,
2072    /// The direction of the text, if set. Values are "none", "ltr" or "rtl"
2073    #[doc(alias = "ATK_TEXT_ATTR_DIRECTION")]
2074    Direction,
2075    /// The justification of the text, if set. Values are "left", "right", "center" or "fill"
2076    #[doc(alias = "ATK_TEXT_ATTR_JUSTIFICATION")]
2077    Justification,
2078    /// The stretch of the text, if set. Values are "ultra_condensed", "extra_condensed", "condensed", "semi_condensed", "normal", "semi_expanded", "expanded", "extra_expanded" or "ultra_expanded"
2079    #[doc(alias = "ATK_TEXT_ATTR_STRETCH")]
2080    Stretch,
2081    /// The capitalization variant of the text, if set. Values are "normal" or "small_caps"
2082    #[doc(alias = "ATK_TEXT_ATTR_VARIANT")]
2083    Variant,
2084    /// The slant style of the text, if set. Values are "normal", "oblique" or "italic"
2085    #[doc(alias = "ATK_TEXT_ATTR_STYLE")]
2086    Style,
2087    /// The vertical position with respect to the baseline. Values are "baseline", "super", or "sub". Note that a super or sub text attribute refers to position with respect to the baseline of the prior character.
2088    #[doc(alias = "ATK_TEXT_ATTR_TEXT_POSITION")]
2089    TextPosition,
2090    /// not a valid text attribute, used for finding end of enumeration
2091    #[doc(alias = "ATK_TEXT_ATTR_LAST_DEFINED")]
2092    LastDefined,
2093    #[doc(hidden)]
2094    __Unknown(i32),
2095}
2096
2097impl TextAttribute {
2098    #[doc(alias = "atk_text_attribute_for_name")]
2099    pub fn for_name(name: &str) -> TextAttribute {
2100        assert_initialized_main_thread!();
2101        unsafe { from_glib(ffi::atk_text_attribute_for_name(name.to_glib_none().0)) }
2102    }
2103
2104    #[doc(alias = "atk_text_attribute_get_name")]
2105    #[doc(alias = "get_name")]
2106    pub fn name(self) -> Option<glib::GString> {
2107        assert_initialized_main_thread!();
2108        unsafe { from_glib_none(ffi::atk_text_attribute_get_name(self.into_glib())) }
2109    }
2110
2111    #[doc(alias = "atk_text_attribute_get_value")]
2112    #[doc(alias = "get_value")]
2113    pub fn value(self, index_: i32) -> Option<glib::GString> {
2114        assert_initialized_main_thread!();
2115        unsafe { from_glib_none(ffi::atk_text_attribute_get_value(self.into_glib(), index_)) }
2116    }
2117}
2118
2119#[doc(hidden)]
2120impl IntoGlib for TextAttribute {
2121    type GlibType = ffi::AtkTextAttribute;
2122
2123    fn into_glib(self) -> ffi::AtkTextAttribute {
2124        match self {
2125            Self::Invalid => ffi::ATK_TEXT_ATTR_INVALID,
2126            Self::LeftMargin => ffi::ATK_TEXT_ATTR_LEFT_MARGIN,
2127            Self::RightMargin => ffi::ATK_TEXT_ATTR_RIGHT_MARGIN,
2128            Self::Indent => ffi::ATK_TEXT_ATTR_INDENT,
2129            Self::Invisible => ffi::ATK_TEXT_ATTR_INVISIBLE,
2130            Self::Editable => ffi::ATK_TEXT_ATTR_EDITABLE,
2131            Self::PixelsAboveLines => ffi::ATK_TEXT_ATTR_PIXELS_ABOVE_LINES,
2132            Self::PixelsBelowLines => ffi::ATK_TEXT_ATTR_PIXELS_BELOW_LINES,
2133            Self::PixelsInsideWrap => ffi::ATK_TEXT_ATTR_PIXELS_INSIDE_WRAP,
2134            Self::BgFullHeight => ffi::ATK_TEXT_ATTR_BG_FULL_HEIGHT,
2135            Self::Rise => ffi::ATK_TEXT_ATTR_RISE,
2136            Self::Underline => ffi::ATK_TEXT_ATTR_UNDERLINE,
2137            Self::Strikethrough => ffi::ATK_TEXT_ATTR_STRIKETHROUGH,
2138            Self::Size => ffi::ATK_TEXT_ATTR_SIZE,
2139            Self::Scale => ffi::ATK_TEXT_ATTR_SCALE,
2140            Self::Weight => ffi::ATK_TEXT_ATTR_WEIGHT,
2141            Self::Language => ffi::ATK_TEXT_ATTR_LANGUAGE,
2142            Self::FamilyName => ffi::ATK_TEXT_ATTR_FAMILY_NAME,
2143            Self::BgColor => ffi::ATK_TEXT_ATTR_BG_COLOR,
2144            Self::FgColor => ffi::ATK_TEXT_ATTR_FG_COLOR,
2145            Self::BgStipple => ffi::ATK_TEXT_ATTR_BG_STIPPLE,
2146            Self::FgStipple => ffi::ATK_TEXT_ATTR_FG_STIPPLE,
2147            Self::WrapMode => ffi::ATK_TEXT_ATTR_WRAP_MODE,
2148            Self::Direction => ffi::ATK_TEXT_ATTR_DIRECTION,
2149            Self::Justification => ffi::ATK_TEXT_ATTR_JUSTIFICATION,
2150            Self::Stretch => ffi::ATK_TEXT_ATTR_STRETCH,
2151            Self::Variant => ffi::ATK_TEXT_ATTR_VARIANT,
2152            Self::Style => ffi::ATK_TEXT_ATTR_STYLE,
2153            Self::TextPosition => ffi::ATK_TEXT_ATTR_TEXT_POSITION,
2154            Self::LastDefined => ffi::ATK_TEXT_ATTR_LAST_DEFINED,
2155            Self::__Unknown(value) => value,
2156        }
2157    }
2158}
2159
2160#[doc(hidden)]
2161impl FromGlib<ffi::AtkTextAttribute> for TextAttribute {
2162    unsafe fn from_glib(value: ffi::AtkTextAttribute) -> Self {
2163        skip_assert_initialized!();
2164
2165        match value {
2166            ffi::ATK_TEXT_ATTR_INVALID => Self::Invalid,
2167            ffi::ATK_TEXT_ATTR_LEFT_MARGIN => Self::LeftMargin,
2168            ffi::ATK_TEXT_ATTR_RIGHT_MARGIN => Self::RightMargin,
2169            ffi::ATK_TEXT_ATTR_INDENT => Self::Indent,
2170            ffi::ATK_TEXT_ATTR_INVISIBLE => Self::Invisible,
2171            ffi::ATK_TEXT_ATTR_EDITABLE => Self::Editable,
2172            ffi::ATK_TEXT_ATTR_PIXELS_ABOVE_LINES => Self::PixelsAboveLines,
2173            ffi::ATK_TEXT_ATTR_PIXELS_BELOW_LINES => Self::PixelsBelowLines,
2174            ffi::ATK_TEXT_ATTR_PIXELS_INSIDE_WRAP => Self::PixelsInsideWrap,
2175            ffi::ATK_TEXT_ATTR_BG_FULL_HEIGHT => Self::BgFullHeight,
2176            ffi::ATK_TEXT_ATTR_RISE => Self::Rise,
2177            ffi::ATK_TEXT_ATTR_UNDERLINE => Self::Underline,
2178            ffi::ATK_TEXT_ATTR_STRIKETHROUGH => Self::Strikethrough,
2179            ffi::ATK_TEXT_ATTR_SIZE => Self::Size,
2180            ffi::ATK_TEXT_ATTR_SCALE => Self::Scale,
2181            ffi::ATK_TEXT_ATTR_WEIGHT => Self::Weight,
2182            ffi::ATK_TEXT_ATTR_LANGUAGE => Self::Language,
2183            ffi::ATK_TEXT_ATTR_FAMILY_NAME => Self::FamilyName,
2184            ffi::ATK_TEXT_ATTR_BG_COLOR => Self::BgColor,
2185            ffi::ATK_TEXT_ATTR_FG_COLOR => Self::FgColor,
2186            ffi::ATK_TEXT_ATTR_BG_STIPPLE => Self::BgStipple,
2187            ffi::ATK_TEXT_ATTR_FG_STIPPLE => Self::FgStipple,
2188            ffi::ATK_TEXT_ATTR_WRAP_MODE => Self::WrapMode,
2189            ffi::ATK_TEXT_ATTR_DIRECTION => Self::Direction,
2190            ffi::ATK_TEXT_ATTR_JUSTIFICATION => Self::Justification,
2191            ffi::ATK_TEXT_ATTR_STRETCH => Self::Stretch,
2192            ffi::ATK_TEXT_ATTR_VARIANT => Self::Variant,
2193            ffi::ATK_TEXT_ATTR_STYLE => Self::Style,
2194            ffi::ATK_TEXT_ATTR_TEXT_POSITION => Self::TextPosition,
2195            ffi::ATK_TEXT_ATTR_LAST_DEFINED => Self::LastDefined,
2196            value => Self::__Unknown(value),
2197        }
2198    }
2199}
2200
2201impl StaticType for TextAttribute {
2202    #[inline]
2203    #[doc(alias = "atk_text_attribute_get_type")]
2204    fn static_type() -> glib::Type {
2205        unsafe { from_glib(ffi::atk_text_attribute_get_type()) }
2206    }
2207}
2208
2209impl glib::HasParamSpec for TextAttribute {
2210    type ParamSpec = glib::ParamSpecEnum;
2211    type SetValue = Self;
2212    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
2213
2214    fn param_spec_builder() -> Self::BuilderFn {
2215        Self::ParamSpec::builder_with_default
2216    }
2217}
2218
2219impl glib::value::ValueType for TextAttribute {
2220    type Type = Self;
2221}
2222
2223unsafe impl<'a> glib::value::FromValue<'a> for TextAttribute {
2224    type Checker = glib::value::GenericValueTypeChecker<Self>;
2225
2226    #[inline]
2227    unsafe fn from_value(value: &'a glib::Value) -> Self {
2228        skip_assert_initialized!();
2229        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
2230    }
2231}
2232
2233impl ToValue for TextAttribute {
2234    #[inline]
2235    fn to_value(&self) -> glib::Value {
2236        let mut value = glib::Value::for_value_type::<Self>();
2237        unsafe {
2238            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
2239        }
2240        value
2241    }
2242
2243    #[inline]
2244    fn value_type(&self) -> glib::Type {
2245        Self::static_type()
2246    }
2247}
2248
2249impl From<TextAttribute> for glib::Value {
2250    #[inline]
2251    fn from(v: TextAttribute) -> Self {
2252        skip_assert_initialized!();
2253        ToValue::to_value(&v)
2254    }
2255}
2256
2257/// Text boundary types used for specifying boundaries for regions of text.
2258/// This enumeration is deprecated since 2.9.4 and should not be used. Use
2259/// AtkTextGranularity with `atk_text_get_string_at_offset` instead.
2260#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2261#[non_exhaustive]
2262#[doc(alias = "AtkTextBoundary")]
2263pub enum TextBoundary {
2264    /// Boundary is the boundary between characters
2265    /// (including non-printing characters)
2266    #[doc(alias = "ATK_TEXT_BOUNDARY_CHAR")]
2267    Char,
2268    /// Boundary is the start (i.e. first character) of a word.
2269    #[doc(alias = "ATK_TEXT_BOUNDARY_WORD_START")]
2270    WordStart,
2271    /// Boundary is the end (i.e. last
2272    /// character) of a word.
2273    #[doc(alias = "ATK_TEXT_BOUNDARY_WORD_END")]
2274    WordEnd,
2275    /// Boundary is the first character in a sentence.
2276    #[doc(alias = "ATK_TEXT_BOUNDARY_SENTENCE_START")]
2277    SentenceStart,
2278    /// Boundary is the last (terminal)
2279    /// character in a sentence; in languages which use "sentence stop"
2280    /// punctuation such as English, the boundary is thus the '.', '?', or
2281    /// similar terminal punctuation character.
2282    #[doc(alias = "ATK_TEXT_BOUNDARY_SENTENCE_END")]
2283    SentenceEnd,
2284    /// Boundary is the initial character of the content or a
2285    /// character immediately following a newline, linefeed, or return character.
2286    #[doc(alias = "ATK_TEXT_BOUNDARY_LINE_START")]
2287    LineStart,
2288    /// Boundary is the linefeed, or return
2289    /// character.
2290    #[doc(alias = "ATK_TEXT_BOUNDARY_LINE_END")]
2291    LineEnd,
2292    #[doc(hidden)]
2293    __Unknown(i32),
2294}
2295
2296#[doc(hidden)]
2297impl IntoGlib for TextBoundary {
2298    type GlibType = ffi::AtkTextBoundary;
2299
2300    #[inline]
2301    fn into_glib(self) -> ffi::AtkTextBoundary {
2302        match self {
2303            Self::Char => ffi::ATK_TEXT_BOUNDARY_CHAR,
2304            Self::WordStart => ffi::ATK_TEXT_BOUNDARY_WORD_START,
2305            Self::WordEnd => ffi::ATK_TEXT_BOUNDARY_WORD_END,
2306            Self::SentenceStart => ffi::ATK_TEXT_BOUNDARY_SENTENCE_START,
2307            Self::SentenceEnd => ffi::ATK_TEXT_BOUNDARY_SENTENCE_END,
2308            Self::LineStart => ffi::ATK_TEXT_BOUNDARY_LINE_START,
2309            Self::LineEnd => ffi::ATK_TEXT_BOUNDARY_LINE_END,
2310            Self::__Unknown(value) => value,
2311        }
2312    }
2313}
2314
2315#[doc(hidden)]
2316impl FromGlib<ffi::AtkTextBoundary> for TextBoundary {
2317    #[inline]
2318    unsafe fn from_glib(value: ffi::AtkTextBoundary) -> Self {
2319        skip_assert_initialized!();
2320
2321        match value {
2322            ffi::ATK_TEXT_BOUNDARY_CHAR => Self::Char,
2323            ffi::ATK_TEXT_BOUNDARY_WORD_START => Self::WordStart,
2324            ffi::ATK_TEXT_BOUNDARY_WORD_END => Self::WordEnd,
2325            ffi::ATK_TEXT_BOUNDARY_SENTENCE_START => Self::SentenceStart,
2326            ffi::ATK_TEXT_BOUNDARY_SENTENCE_END => Self::SentenceEnd,
2327            ffi::ATK_TEXT_BOUNDARY_LINE_START => Self::LineStart,
2328            ffi::ATK_TEXT_BOUNDARY_LINE_END => Self::LineEnd,
2329            value => Self::__Unknown(value),
2330        }
2331    }
2332}
2333
2334impl StaticType for TextBoundary {
2335    #[inline]
2336    #[doc(alias = "atk_text_boundary_get_type")]
2337    fn static_type() -> glib::Type {
2338        unsafe { from_glib(ffi::atk_text_boundary_get_type()) }
2339    }
2340}
2341
2342impl glib::HasParamSpec for TextBoundary {
2343    type ParamSpec = glib::ParamSpecEnum;
2344    type SetValue = Self;
2345    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
2346
2347    fn param_spec_builder() -> Self::BuilderFn {
2348        Self::ParamSpec::builder_with_default
2349    }
2350}
2351
2352impl glib::value::ValueType for TextBoundary {
2353    type Type = Self;
2354}
2355
2356unsafe impl<'a> glib::value::FromValue<'a> for TextBoundary {
2357    type Checker = glib::value::GenericValueTypeChecker<Self>;
2358
2359    #[inline]
2360    unsafe fn from_value(value: &'a glib::Value) -> Self {
2361        skip_assert_initialized!();
2362        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
2363    }
2364}
2365
2366impl ToValue for TextBoundary {
2367    #[inline]
2368    fn to_value(&self) -> glib::Value {
2369        let mut value = glib::Value::for_value_type::<Self>();
2370        unsafe {
2371            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
2372        }
2373        value
2374    }
2375
2376    #[inline]
2377    fn value_type(&self) -> glib::Type {
2378        Self::static_type()
2379    }
2380}
2381
2382impl From<TextBoundary> for glib::Value {
2383    #[inline]
2384    fn from(v: TextBoundary) -> Self {
2385        skip_assert_initialized!();
2386        ToValue::to_value(&v)
2387    }
2388}
2389
2390/// Describes the type of clipping required.
2391#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2392#[non_exhaustive]
2393#[doc(alias = "AtkTextClipType")]
2394pub enum TextClipType {
2395    /// No clipping to be done
2396    #[doc(alias = "ATK_TEXT_CLIP_NONE")]
2397    None,
2398    /// Text clipped by min coordinate is omitted
2399    #[doc(alias = "ATK_TEXT_CLIP_MIN")]
2400    Min,
2401    /// Text clipped by max coordinate is omitted
2402    #[doc(alias = "ATK_TEXT_CLIP_MAX")]
2403    Max,
2404    /// Only text fully within mix/max bound is retained
2405    #[doc(alias = "ATK_TEXT_CLIP_BOTH")]
2406    Both,
2407    #[doc(hidden)]
2408    __Unknown(i32),
2409}
2410
2411#[doc(hidden)]
2412impl IntoGlib for TextClipType {
2413    type GlibType = ffi::AtkTextClipType;
2414
2415    #[inline]
2416    fn into_glib(self) -> ffi::AtkTextClipType {
2417        match self {
2418            Self::None => ffi::ATK_TEXT_CLIP_NONE,
2419            Self::Min => ffi::ATK_TEXT_CLIP_MIN,
2420            Self::Max => ffi::ATK_TEXT_CLIP_MAX,
2421            Self::Both => ffi::ATK_TEXT_CLIP_BOTH,
2422            Self::__Unknown(value) => value,
2423        }
2424    }
2425}
2426
2427#[doc(hidden)]
2428impl FromGlib<ffi::AtkTextClipType> for TextClipType {
2429    #[inline]
2430    unsafe fn from_glib(value: ffi::AtkTextClipType) -> Self {
2431        skip_assert_initialized!();
2432
2433        match value {
2434            ffi::ATK_TEXT_CLIP_NONE => Self::None,
2435            ffi::ATK_TEXT_CLIP_MIN => Self::Min,
2436            ffi::ATK_TEXT_CLIP_MAX => Self::Max,
2437            ffi::ATK_TEXT_CLIP_BOTH => Self::Both,
2438            value => Self::__Unknown(value),
2439        }
2440    }
2441}
2442
2443impl StaticType for TextClipType {
2444    #[inline]
2445    #[doc(alias = "atk_text_clip_type_get_type")]
2446    fn static_type() -> glib::Type {
2447        unsafe { from_glib(ffi::atk_text_clip_type_get_type()) }
2448    }
2449}
2450
2451impl glib::HasParamSpec for TextClipType {
2452    type ParamSpec = glib::ParamSpecEnum;
2453    type SetValue = Self;
2454    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
2455
2456    fn param_spec_builder() -> Self::BuilderFn {
2457        Self::ParamSpec::builder_with_default
2458    }
2459}
2460
2461impl glib::value::ValueType for TextClipType {
2462    type Type = Self;
2463}
2464
2465unsafe impl<'a> glib::value::FromValue<'a> for TextClipType {
2466    type Checker = glib::value::GenericValueTypeChecker<Self>;
2467
2468    #[inline]
2469    unsafe fn from_value(value: &'a glib::Value) -> Self {
2470        skip_assert_initialized!();
2471        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
2472    }
2473}
2474
2475impl ToValue for TextClipType {
2476    #[inline]
2477    fn to_value(&self) -> glib::Value {
2478        let mut value = glib::Value::for_value_type::<Self>();
2479        unsafe {
2480            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
2481        }
2482        value
2483    }
2484
2485    #[inline]
2486    fn value_type(&self) -> glib::Type {
2487        Self::static_type()
2488    }
2489}
2490
2491impl From<TextClipType> for glib::Value {
2492    #[inline]
2493    fn from(v: TextClipType) -> Self {
2494        skip_assert_initialized!();
2495        ToValue::to_value(&v)
2496    }
2497}
2498
2499/// Text granularity types used for specifying the granularity of the region of
2500/// text we are interested in.
2501#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2502#[non_exhaustive]
2503#[doc(alias = "AtkTextGranularity")]
2504pub enum TextGranularity {
2505    /// Granularity is defined by the boundaries between characters
2506    /// (including non-printing characters)
2507    #[doc(alias = "ATK_TEXT_GRANULARITY_CHAR")]
2508    Char,
2509    /// Granularity is defined by the boundaries of a word,
2510    /// starting at the beginning of the current word and finishing at the beginning of
2511    /// the following one, if present.
2512    #[doc(alias = "ATK_TEXT_GRANULARITY_WORD")]
2513    Word,
2514    /// Granularity is defined by the boundaries of a sentence,
2515    /// starting at the beginning of the current sentence and finishing at the beginning of
2516    /// the following one, if present.
2517    #[doc(alias = "ATK_TEXT_GRANULARITY_SENTENCE")]
2518    Sentence,
2519    /// Granularity is defined by the boundaries of a line,
2520    /// starting at the beginning of the current line and finishing at the beginning of
2521    /// the following one, if present.
2522    #[doc(alias = "ATK_TEXT_GRANULARITY_LINE")]
2523    Line,
2524    /// Granularity is defined by the boundaries of a paragraph,
2525    /// starting at the beginning of the current paragraph and finishing at the beginning of
2526    /// the following one, if present.
2527    #[doc(alias = "ATK_TEXT_GRANULARITY_PARAGRAPH")]
2528    Paragraph,
2529    #[doc(hidden)]
2530    __Unknown(i32),
2531}
2532
2533#[doc(hidden)]
2534impl IntoGlib for TextGranularity {
2535    type GlibType = ffi::AtkTextGranularity;
2536
2537    #[inline]
2538    fn into_glib(self) -> ffi::AtkTextGranularity {
2539        match self {
2540            Self::Char => ffi::ATK_TEXT_GRANULARITY_CHAR,
2541            Self::Word => ffi::ATK_TEXT_GRANULARITY_WORD,
2542            Self::Sentence => ffi::ATK_TEXT_GRANULARITY_SENTENCE,
2543            Self::Line => ffi::ATK_TEXT_GRANULARITY_LINE,
2544            Self::Paragraph => ffi::ATK_TEXT_GRANULARITY_PARAGRAPH,
2545            Self::__Unknown(value) => value,
2546        }
2547    }
2548}
2549
2550#[doc(hidden)]
2551impl FromGlib<ffi::AtkTextGranularity> for TextGranularity {
2552    #[inline]
2553    unsafe fn from_glib(value: ffi::AtkTextGranularity) -> Self {
2554        skip_assert_initialized!();
2555
2556        match value {
2557            ffi::ATK_TEXT_GRANULARITY_CHAR => Self::Char,
2558            ffi::ATK_TEXT_GRANULARITY_WORD => Self::Word,
2559            ffi::ATK_TEXT_GRANULARITY_SENTENCE => Self::Sentence,
2560            ffi::ATK_TEXT_GRANULARITY_LINE => Self::Line,
2561            ffi::ATK_TEXT_GRANULARITY_PARAGRAPH => Self::Paragraph,
2562            value => Self::__Unknown(value),
2563        }
2564    }
2565}
2566
2567impl StaticType for TextGranularity {
2568    #[inline]
2569    #[doc(alias = "atk_text_granularity_get_type")]
2570    fn static_type() -> glib::Type {
2571        unsafe { from_glib(ffi::atk_text_granularity_get_type()) }
2572    }
2573}
2574
2575impl glib::HasParamSpec for TextGranularity {
2576    type ParamSpec = glib::ParamSpecEnum;
2577    type SetValue = Self;
2578    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
2579
2580    fn param_spec_builder() -> Self::BuilderFn {
2581        Self::ParamSpec::builder_with_default
2582    }
2583}
2584
2585impl glib::value::ValueType for TextGranularity {
2586    type Type = Self;
2587}
2588
2589unsafe impl<'a> glib::value::FromValue<'a> for TextGranularity {
2590    type Checker = glib::value::GenericValueTypeChecker<Self>;
2591
2592    #[inline]
2593    unsafe fn from_value(value: &'a glib::Value) -> Self {
2594        skip_assert_initialized!();
2595        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
2596    }
2597}
2598
2599impl ToValue for TextGranularity {
2600    #[inline]
2601    fn to_value(&self) -> glib::Value {
2602        let mut value = glib::Value::for_value_type::<Self>();
2603        unsafe {
2604            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
2605        }
2606        value
2607    }
2608
2609    #[inline]
2610    fn value_type(&self) -> glib::Type {
2611        Self::static_type()
2612    }
2613}
2614
2615impl From<TextGranularity> for glib::Value {
2616    #[inline]
2617    fn from(v: TextGranularity) -> Self {
2618        skip_assert_initialized!();
2619        ToValue::to_value(&v)
2620    }
2621}
2622
2623/// Default types for a given value. Those are defined in order to
2624/// easily get localized strings to describe a given value or a given
2625/// subrange, using [`localized_name()`][Self::localized_name()].
2626#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2627#[non_exhaustive]
2628#[doc(alias = "AtkValueType")]
2629pub enum ValueType {
2630    #[doc(alias = "ATK_VALUE_VERY_WEAK")]
2631    VeryWeak,
2632    #[doc(alias = "ATK_VALUE_WEAK")]
2633    Weak,
2634    #[doc(alias = "ATK_VALUE_ACCEPTABLE")]
2635    Acceptable,
2636    #[doc(alias = "ATK_VALUE_STRONG")]
2637    Strong,
2638    #[doc(alias = "ATK_VALUE_VERY_STRONG")]
2639    VeryStrong,
2640    #[doc(alias = "ATK_VALUE_VERY_LOW")]
2641    VeryLow,
2642    #[doc(alias = "ATK_VALUE_LOW")]
2643    Low,
2644    #[doc(alias = "ATK_VALUE_MEDIUM")]
2645    Medium,
2646    #[doc(alias = "ATK_VALUE_HIGH")]
2647    High,
2648    #[doc(alias = "ATK_VALUE_VERY_HIGH")]
2649    VeryHigh,
2650    #[doc(alias = "ATK_VALUE_VERY_BAD")]
2651    VeryBad,
2652    #[doc(alias = "ATK_VALUE_BAD")]
2653    Bad,
2654    #[doc(alias = "ATK_VALUE_GOOD")]
2655    Good,
2656    #[doc(alias = "ATK_VALUE_VERY_GOOD")]
2657    VeryGood,
2658    #[doc(alias = "ATK_VALUE_BEST")]
2659    Best,
2660    #[doc(alias = "ATK_VALUE_LAST_DEFINED")]
2661    LastDefined,
2662    #[doc(hidden)]
2663    __Unknown(i32),
2664}
2665
2666impl ValueType {
2667    #[doc(alias = "atk_value_type_get_localized_name")]
2668    #[doc(alias = "get_localized_name")]
2669    pub fn localized_name(self) -> Option<glib::GString> {
2670        assert_initialized_main_thread!();
2671        unsafe { from_glib_none(ffi::atk_value_type_get_localized_name(self.into_glib())) }
2672    }
2673
2674    #[doc(alias = "atk_value_type_get_name")]
2675    #[doc(alias = "get_name")]
2676    pub fn name(self) -> Option<glib::GString> {
2677        assert_initialized_main_thread!();
2678        unsafe { from_glib_none(ffi::atk_value_type_get_name(self.into_glib())) }
2679    }
2680}
2681
2682#[doc(hidden)]
2683impl IntoGlib for ValueType {
2684    type GlibType = ffi::AtkValueType;
2685
2686    fn into_glib(self) -> ffi::AtkValueType {
2687        match self {
2688            Self::VeryWeak => ffi::ATK_VALUE_VERY_WEAK,
2689            Self::Weak => ffi::ATK_VALUE_WEAK,
2690            Self::Acceptable => ffi::ATK_VALUE_ACCEPTABLE,
2691            Self::Strong => ffi::ATK_VALUE_STRONG,
2692            Self::VeryStrong => ffi::ATK_VALUE_VERY_STRONG,
2693            Self::VeryLow => ffi::ATK_VALUE_VERY_LOW,
2694            Self::Low => ffi::ATK_VALUE_LOW,
2695            Self::Medium => ffi::ATK_VALUE_MEDIUM,
2696            Self::High => ffi::ATK_VALUE_HIGH,
2697            Self::VeryHigh => ffi::ATK_VALUE_VERY_HIGH,
2698            Self::VeryBad => ffi::ATK_VALUE_VERY_BAD,
2699            Self::Bad => ffi::ATK_VALUE_BAD,
2700            Self::Good => ffi::ATK_VALUE_GOOD,
2701            Self::VeryGood => ffi::ATK_VALUE_VERY_GOOD,
2702            Self::Best => ffi::ATK_VALUE_BEST,
2703            Self::LastDefined => ffi::ATK_VALUE_LAST_DEFINED,
2704            Self::__Unknown(value) => value,
2705        }
2706    }
2707}
2708
2709#[doc(hidden)]
2710impl FromGlib<ffi::AtkValueType> for ValueType {
2711    unsafe fn from_glib(value: ffi::AtkValueType) -> Self {
2712        skip_assert_initialized!();
2713
2714        match value {
2715            ffi::ATK_VALUE_VERY_WEAK => Self::VeryWeak,
2716            ffi::ATK_VALUE_WEAK => Self::Weak,
2717            ffi::ATK_VALUE_ACCEPTABLE => Self::Acceptable,
2718            ffi::ATK_VALUE_STRONG => Self::Strong,
2719            ffi::ATK_VALUE_VERY_STRONG => Self::VeryStrong,
2720            ffi::ATK_VALUE_VERY_LOW => Self::VeryLow,
2721            ffi::ATK_VALUE_LOW => Self::Low,
2722            ffi::ATK_VALUE_MEDIUM => Self::Medium,
2723            ffi::ATK_VALUE_HIGH => Self::High,
2724            ffi::ATK_VALUE_VERY_HIGH => Self::VeryHigh,
2725            ffi::ATK_VALUE_VERY_BAD => Self::VeryBad,
2726            ffi::ATK_VALUE_BAD => Self::Bad,
2727            ffi::ATK_VALUE_GOOD => Self::Good,
2728            ffi::ATK_VALUE_VERY_GOOD => Self::VeryGood,
2729            ffi::ATK_VALUE_BEST => Self::Best,
2730            ffi::ATK_VALUE_LAST_DEFINED => Self::LastDefined,
2731            value => Self::__Unknown(value),
2732        }
2733    }
2734}
2735
2736impl StaticType for ValueType {
2737    #[inline]
2738    #[doc(alias = "atk_value_type_get_type")]
2739    fn static_type() -> glib::Type {
2740        unsafe { from_glib(ffi::atk_value_type_get_type()) }
2741    }
2742}
2743
2744impl glib::HasParamSpec for ValueType {
2745    type ParamSpec = glib::ParamSpecEnum;
2746    type SetValue = Self;
2747    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
2748
2749    fn param_spec_builder() -> Self::BuilderFn {
2750        Self::ParamSpec::builder_with_default
2751    }
2752}
2753
2754impl glib::value::ValueType for ValueType {
2755    type Type = Self;
2756}
2757
2758unsafe impl<'a> glib::value::FromValue<'a> for ValueType {
2759    type Checker = glib::value::GenericValueTypeChecker<Self>;
2760
2761    #[inline]
2762    unsafe fn from_value(value: &'a glib::Value) -> Self {
2763        skip_assert_initialized!();
2764        unsafe { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) }
2765    }
2766}
2767
2768impl ToValue for ValueType {
2769    #[inline]
2770    fn to_value(&self) -> glib::Value {
2771        let mut value = glib::Value::for_value_type::<Self>();
2772        unsafe {
2773            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
2774        }
2775        value
2776    }
2777
2778    #[inline]
2779    fn value_type(&self) -> glib::Type {
2780        Self::static_type()
2781    }
2782}
2783
2784impl From<ValueType> for glib::Value {
2785    #[inline]
2786    fn from(v: ValueType) -> Self {
2787        skip_assert_initialized!();
2788        ToValue::to_value(&v)
2789    }
2790}