1#![allow(deprecated)]
5
6use crate::{ffi, Accessible, Buildable, ConstraintTarget, Widget};
7use glib::{prelude::*, translate::*};
8
9glib::wrapper! {
10 #[doc(alias = "GtkAppChooser")]
11 pub struct AppChooser(Interface<ffi::GtkAppChooser>) @requires Widget, Accessible, Buildable, ConstraintTarget;
12
13 match fn {
14 type_ => || ffi::gtk_app_chooser_get_type(),
15 }
16}
17
18impl AppChooser {
19 pub const NONE: Option<&'static AppChooser> = None;
20}
21
22pub trait AppChooserExt: IsA<AppChooser> + 'static {
23 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
24 #[allow(deprecated)]
25 #[doc(alias = "gtk_app_chooser_get_app_info")]
26 #[doc(alias = "get_app_info")]
27 fn app_info(&self) -> Option<gio::AppInfo> {
28 unsafe {
29 from_glib_full(ffi::gtk_app_chooser_get_app_info(
30 self.as_ref().to_glib_none().0,
31 ))
32 }
33 }
34
35 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
36 #[allow(deprecated)]
37 #[doc(alias = "gtk_app_chooser_get_content_type")]
38 #[doc(alias = "get_content_type")]
39 #[doc(alias = "content-type")]
40 fn content_type(&self) -> glib::GString {
41 unsafe {
42 from_glib_full(ffi::gtk_app_chooser_get_content_type(
43 self.as_ref().to_glib_none().0,
44 ))
45 }
46 }
47
48 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
49 #[allow(deprecated)]
50 #[doc(alias = "gtk_app_chooser_refresh")]
51 fn refresh(&self) {
52 unsafe {
53 ffi::gtk_app_chooser_refresh(self.as_ref().to_glib_none().0);
54 }
55 }
56}
57
58impl<O: IsA<AppChooser>> AppChooserExt for O {}