gtk4/auto/
app_chooser_dialog.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#![allow(deprecated)]
5
6use crate::{
7    ffi, Accessible, AppChooser, Buildable, ConstraintTarget, Dialog, DialogFlags, Native, Root,
8    ShortcutManager, Widget, Window,
9};
10use glib::{
11    prelude::*,
12    signal::{connect_raw, SignalHandlerId},
13    translate::*,
14};
15use std::boxed::Box as Box_;
16
17glib::wrapper! {
18    /// The application selection widgets should be
19    ///   implemented according to the design of each platform and/or
20    ///   application requiring them.
21    /// [`AppChooserDialog`][crate::AppChooserDialog] shows a [`AppChooserWidget`][crate::AppChooserWidget] inside a [`Dialog`][crate::Dialog].
22    ///
23    /// <picture>
24    ///   <source srcset="appchooserdialog-dark.png" media="(prefers-color-scheme: dark)">
25    ///   <img alt="An example GtkAppChooserDialog" src="appchooserdialog.png">
26    /// </picture>
27    ///
28    /// Note that [`AppChooserDialog`][crate::AppChooserDialog] does not have any interesting methods
29    /// of its own. Instead, you should get the embedded [`AppChooserWidget`][crate::AppChooserWidget]
30    /// using [`widget()`][Self::widget()] and call its methods if
31    /// the generic [`AppChooser`][crate::AppChooser] interface is not sufficient for
32    /// your needs.
33    ///
34    /// To set the heading that is shown above the [`AppChooserWidget`][crate::AppChooserWidget],
35    /// use [`set_heading()`][Self::set_heading()].
36    ///
37    /// ## CSS nodes
38    ///
39    /// [`AppChooserDialog`][crate::AppChooserDialog] has a single CSS node with the name `window` and style
40    /// class `.appchooser`.
41    ///
42    /// ## Properties
43    ///
44    ///
45    /// #### `gfile`
46    ///  The GFile used by the [`AppChooserDialog`][crate::AppChooserDialog].
47    ///
48    /// The dialog's [`AppChooserWidget`][crate::AppChooserWidget] content type will
49    /// be guessed from the file, if present.
50    ///
51    /// Readable | Writeable | Construct Only
52    ///
53    ///
54    /// #### `heading`
55    ///  The text to show at the top of the dialog.
56    ///
57    /// The string may contain Pango markup.
58    ///
59    /// Readable | Writeable
60    /// <details><summary><h4>Dialog</h4></summary>
61    ///
62    ///
63    /// #### `use-header-bar`
64    ///  [`true`] if the dialog uses a headerbar for action buttons
65    /// instead of the action-area.
66    ///
67    /// For technical reasons, this property is declared as an integer
68    /// property, but you should only set it to [`true`] or [`false`].
69    ///
70    /// ## Creating a dialog with headerbar
71    ///
72    /// Builtin [`Dialog`][crate::Dialog] subclasses such as [`ColorChooserDialog`][crate::ColorChooserDialog]
73    /// set this property according to platform conventions (using the
74    /// [`gtk-dialogs-use-header`][struct@crate::Settings#gtk-dialogs-use-header] setting).
75    ///
76    /// Here is how you can achieve the same:
77    ///
78    /// **⚠️ The following code is in c ⚠️**
79    ///
80    /// ```c
81    /// g_object_get (settings, "gtk-dialogs-use-header", &header, NULL);
82    /// dialog = g_object_new (GTK_TYPE_DIALOG, header, TRUE, NULL);
83    /// ```
84    ///
85    /// Readable | Writeable | Construct Only
86    /// </details>
87    /// <details><summary><h4>Window</h4></summary>
88    ///
89    ///
90    /// #### `application`
91    ///  The [`Application`][crate::Application] associated with the window.
92    ///
93    /// The application will be kept alive for at least as long as it
94    /// has any windows associated with it (see g_application_hold()
95    /// for a way to keep it alive without windows).
96    ///
97    /// Normally, the connection between the application and the window
98    /// will remain until the window is destroyed, but you can explicitly
99    /// remove it by setting the this property to `NULL`.
100    ///
101    /// Readable | Writeable
102    ///
103    ///
104    /// #### `child`
105    ///  The child widget.
106    ///
107    /// Readable | Writeable
108    ///
109    ///
110    /// #### `decorated`
111    ///  Whether the window should have a frame (also known as *decorations*).
112    ///
113    /// Readable | Writeable
114    ///
115    ///
116    /// #### `default-height`
117    ///  The default height of the window.
118    ///
119    /// Readable | Writeable
120    ///
121    ///
122    /// #### `default-widget`
123    ///  The default widget.
124    ///
125    /// Readable | Writeable
126    ///
127    ///
128    /// #### `default-width`
129    ///  The default width of the window.
130    ///
131    /// Readable | Writeable
132    ///
133    ///
134    /// #### `deletable`
135    ///  Whether the window frame should have a close button.
136    ///
137    /// Readable | Writeable
138    ///
139    ///
140    /// #### `destroy-with-parent`
141    ///  If this window should be destroyed when the parent is destroyed.
142    ///
143    /// Readable | Writeable
144    ///
145    ///
146    /// #### `display`
147    ///  The display that will display this window.
148    ///
149    /// Readable | Writeable
150    ///
151    ///
152    /// #### `focus-visible`
153    ///  Whether 'focus rectangles' are currently visible in this window.
154    ///
155    /// This property is maintained by GTK based on user input
156    /// and should not be set by applications.
157    ///
158    /// Readable | Writeable
159    ///
160    ///
161    /// #### `focus-widget`
162    ///  The focus widget.
163    ///
164    /// Readable | Writeable
165    ///
166    ///
167    /// #### `fullscreened`
168    ///  Whether the window is fullscreen.
169    ///
170    /// Setting this property is the equivalent of calling
171    /// [`GtkWindowExt::fullscreen()`][crate::prelude::GtkWindowExt::fullscreen()] or [`GtkWindowExt::unfullscreen()`][crate::prelude::GtkWindowExt::unfullscreen()];
172    /// either operation is asynchronous, which means you will need to
173    /// connect to the ::notify signal in order to know whether the
174    /// operation was successful.
175    ///
176    /// Readable | Writeable | Construct
177    ///
178    ///
179    /// #### `handle-menubar-accel`
180    ///  Whether the window frame should handle <kbd>F10</kbd> for activating
181    /// menubars.
182    ///
183    /// Readable | Writeable
184    ///
185    ///
186    /// #### `hide-on-close`
187    ///  If this window should be hidden instead of destroyed when the user clicks
188    /// the close button.
189    ///
190    /// Readable | Writeable
191    ///
192    ///
193    /// #### `icon-name`
194    ///  Specifies the name of the themed icon to use as the window icon.
195    ///
196    /// See [`IconTheme`][crate::IconTheme] for more details.
197    ///
198    /// Readable | Writeable
199    ///
200    ///
201    /// #### `is-active`
202    ///  Whether the toplevel is the currently active window.
203    ///
204    /// Readable
205    ///
206    ///
207    /// #### `maximized`
208    ///  Whether the window is maximized.
209    ///
210    /// Setting this property is the equivalent of calling
211    /// [`GtkWindowExt::maximize()`][crate::prelude::GtkWindowExt::maximize()] or [`GtkWindowExt::unmaximize()`][crate::prelude::GtkWindowExt::unmaximize()];
212    /// either operation is asynchronous, which means you will need to
213    /// connect to the ::notify signal in order to know whether the
214    /// operation was successful.
215    ///
216    /// Readable | Writeable | Construct
217    ///
218    ///
219    /// #### `mnemonics-visible`
220    ///  Whether mnemonics are currently visible in this window.
221    ///
222    /// This property is maintained by GTK based on user input,
223    /// and should not be set by applications.
224    ///
225    /// Readable | Writeable
226    ///
227    ///
228    /// #### `modal`
229    ///  If true, the window is modal.
230    ///
231    /// Readable | Writeable
232    ///
233    ///
234    /// #### `resizable`
235    ///  If true, users can resize the window.
236    ///
237    /// Readable | Writeable
238    ///
239    ///
240    /// #### `startup-id`
241    ///  A write-only property for setting window's startup notification identifier.
242    ///
243    /// Writeable
244    ///
245    ///
246    /// #### `suspended`
247    ///  Whether the window is suspended.
248    ///
249    /// See [`GtkWindowExt::is_suspended()`][crate::prelude::GtkWindowExt::is_suspended()] for details about what suspended means.
250    ///
251    /// Readable
252    ///
253    ///
254    /// #### `title`
255    ///  The title of the window.
256    ///
257    /// Readable | Writeable
258    ///
259    ///
260    /// #### `titlebar`
261    ///  The titlebar widget.
262    ///
263    /// Readable | Writeable
264    ///
265    ///
266    /// #### `transient-for`
267    ///  The transient parent of the window.
268    ///
269    /// Readable | Writeable | Construct
270    /// </details>
271    /// <details><summary><h4>Widget</h4></summary>
272    ///
273    ///
274    /// #### `can-focus`
275    ///  Whether the widget or any of its descendents can accept
276    /// the input focus.
277    ///
278    /// This property is meant to be set by widget implementations,
279    /// typically in their instance init function.
280    ///
281    /// Readable | Writeable
282    ///
283    ///
284    /// #### `can-target`
285    ///  Whether the widget can receive pointer events.
286    ///
287    /// Readable | Writeable
288    ///
289    ///
290    /// #### `css-classes`
291    ///  A list of css classes applied to this widget.
292    ///
293    /// Readable | Writeable
294    ///
295    ///
296    /// #### `css-name`
297    ///  The name of this widget in the CSS tree.
298    ///
299    /// This property is meant to be set by widget implementations,
300    /// typically in their instance init function.
301    ///
302    /// Readable | Writeable | Construct Only
303    ///
304    ///
305    /// #### `cursor`
306    ///  The cursor used by @widget.
307    ///
308    /// Readable | Writeable
309    ///
310    ///
311    /// #### `focus-on-click`
312    ///  Whether the widget should grab focus when it is clicked with the mouse.
313    ///
314    /// This property is only relevant for widgets that can take focus.
315    ///
316    /// Readable | Writeable
317    ///
318    ///
319    /// #### `focusable`
320    ///  Whether this widget itself will accept the input focus.
321    ///
322    /// Readable | Writeable
323    ///
324    ///
325    /// #### `halign`
326    ///  How to distribute horizontal space if widget gets extra space.
327    ///
328    /// Readable | Writeable
329    ///
330    ///
331    /// #### `has-default`
332    ///  Whether the widget is the default widget.
333    ///
334    /// Readable
335    ///
336    ///
337    /// #### `has-focus`
338    ///  Whether the widget has the input focus.
339    ///
340    /// Readable
341    ///
342    ///
343    /// #### `has-tooltip`
344    ///  Enables or disables the emission of the [`query-tooltip`][struct@crate::Widget#query-tooltip]
345    /// signal on @widget.
346    ///
347    /// A true value indicates that @widget can have a tooltip, in this case
348    /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to
349    /// determine whether it will provide a tooltip or not.
350    ///
351    /// Readable | Writeable
352    ///
353    ///
354    /// #### `height-request`
355    ///  Overrides for height request of the widget.
356    ///
357    /// If this is -1, the natural request will be used.
358    ///
359    /// Readable | Writeable
360    ///
361    ///
362    /// #### `hexpand`
363    ///  Whether to expand horizontally.
364    ///
365    /// Readable | Writeable
366    ///
367    ///
368    /// #### `hexpand-set`
369    ///  Whether to use the `hexpand` property.
370    ///
371    /// Readable | Writeable
372    ///
373    ///
374    /// #### `layout-manager`
375    ///  The [`LayoutManager`][crate::LayoutManager] instance to use to compute
376    /// the preferred size of the widget, and allocate its children.
377    ///
378    /// This property is meant to be set by widget implementations,
379    /// typically in their instance init function.
380    ///
381    /// Readable | Writeable
382    ///
383    ///
384    /// #### `limit-events`
385    ///  Makes this widget act like a modal dialog, with respect to
386    /// event delivery.
387    ///
388    /// Global event controllers will not handle events with targets
389    /// inside the widget, unless they are set up to ignore propagation
390    /// limits. See [`EventControllerExt::set_propagation_limit()`][crate::prelude::EventControllerExt::set_propagation_limit()].
391    ///
392    /// Readable | Writeable
393    ///
394    ///
395    /// #### `margin-bottom`
396    ///  Margin on bottom side of widget.
397    ///
398    /// This property adds margin outside of the widget's normal size
399    /// request, the margin will be added in addition to the size from
400    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
401    ///
402    /// Readable | Writeable
403    ///
404    ///
405    /// #### `margin-end`
406    ///  Margin on end of widget, horizontally.
407    ///
408    /// This property supports left-to-right and right-to-left text
409    /// directions.
410    ///
411    /// This property adds margin outside of the widget's normal size
412    /// request, the margin will be added in addition to the size from
413    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
414    ///
415    /// Readable | Writeable
416    ///
417    ///
418    /// #### `margin-start`
419    ///  Margin on start of widget, horizontally.
420    ///
421    /// This property supports left-to-right and right-to-left text
422    /// directions.
423    ///
424    /// This property adds margin outside of the widget's normal size
425    /// request, the margin will be added in addition to the size from
426    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
427    ///
428    /// Readable | Writeable
429    ///
430    ///
431    /// #### `margin-top`
432    ///  Margin on top side of widget.
433    ///
434    /// This property adds margin outside of the widget's normal size
435    /// request, the margin will be added in addition to the size from
436    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
437    ///
438    /// Readable | Writeable
439    ///
440    ///
441    /// #### `name`
442    ///  The name of the widget.
443    ///
444    /// Readable | Writeable
445    ///
446    ///
447    /// #### `opacity`
448    ///  The requested opacity of the widget.
449    ///
450    /// Readable | Writeable
451    ///
452    ///
453    /// #### `overflow`
454    ///  How content outside the widget's content area is treated.
455    ///
456    /// This property is meant to be set by widget implementations,
457    /// typically in their instance init function.
458    ///
459    /// Readable | Writeable
460    ///
461    ///
462    /// #### `parent`
463    ///  The parent widget of this widget.
464    ///
465    /// Readable
466    ///
467    ///
468    /// #### `receives-default`
469    ///  Whether the widget will receive the default action when it is focused.
470    ///
471    /// Readable | Writeable
472    ///
473    ///
474    /// #### `root`
475    ///  The [`Root`][crate::Root] widget of the widget tree containing this widget.
476    ///
477    /// This will be `NULL` if the widget is not contained in a root widget.
478    ///
479    /// Readable
480    ///
481    ///
482    /// #### `scale-factor`
483    ///  The scale factor of the widget.
484    ///
485    /// Readable
486    ///
487    ///
488    /// #### `sensitive`
489    ///  Whether the widget responds to input.
490    ///
491    /// Readable | Writeable
492    ///
493    ///
494    /// #### `tooltip-markup`
495    ///  Sets the text of tooltip to be the given string, which is marked up
496    /// with Pango markup.
497    ///
498    /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
499    ///
500    /// This is a convenience property which will take care of getting the
501    /// tooltip shown if the given string is not `NULL`:
502    /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
503    /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
504    /// the default signal handler.
505    ///
506    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
507    /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
508    ///
509    /// Readable | Writeable
510    ///
511    ///
512    /// #### `tooltip-text`
513    ///  Sets the text of tooltip to be the given string.
514    ///
515    /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
516    ///
517    /// This is a convenience property which will take care of getting the
518    /// tooltip shown if the given string is not `NULL`:
519    /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
520    /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
521    /// the default signal handler.
522    ///
523    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
524    /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
525    ///
526    /// Readable | Writeable
527    ///
528    ///
529    /// #### `valign`
530    ///  How to distribute vertical space if widget gets extra space.
531    ///
532    /// Readable | Writeable
533    ///
534    ///
535    /// #### `vexpand`
536    ///  Whether to expand vertically.
537    ///
538    /// Readable | Writeable
539    ///
540    ///
541    /// #### `vexpand-set`
542    ///  Whether to use the `vexpand` property.
543    ///
544    /// Readable | Writeable
545    ///
546    ///
547    /// #### `visible`
548    ///  Whether the widget is visible.
549    ///
550    /// Readable | Writeable
551    ///
552    ///
553    /// #### `width-request`
554    ///  Overrides for width request of the widget.
555    ///
556    /// If this is -1, the natural request will be used.
557    ///
558    /// Readable | Writeable
559    /// </details>
560    /// <details><summary><h4>Accessible</h4></summary>
561    ///
562    ///
563    /// #### `accessible-role`
564    ///  The accessible role of the given [`Accessible`][crate::Accessible] implementation.
565    ///
566    /// The accessible role cannot be changed once set.
567    ///
568    /// Readable | Writeable
569    /// </details>
570    /// <details><summary><h4>AppChooser</h4></summary>
571    ///
572    ///
573    /// #### `content-type`
574    ///  The content type of the [`AppChooser`][crate::AppChooser] object.
575    ///
576    /// See `GContentType` for more information about content types.
577    ///
578    /// Readable | Writeable | Construct Only
579    /// </details>
580    ///
581    /// # Implements
582    ///
583    /// [`DialogExt`][trait@crate::prelude::DialogExt], [`GtkWindowExt`][trait@crate::prelude::GtkWindowExt], [`WidgetExt`][trait@crate::prelude::WidgetExt], [`trait@glib::ObjectExt`], [`AccessibleExt`][trait@crate::prelude::AccessibleExt], [`BuildableExt`][trait@crate::prelude::BuildableExt], [`ConstraintTargetExt`][trait@crate::prelude::ConstraintTargetExt], [`NativeExt`][trait@crate::prelude::NativeExt], [`RootExt`][trait@crate::prelude::RootExt], [`ShortcutManagerExt`][trait@crate::prelude::ShortcutManagerExt], [`AppChooserExt`][trait@crate::prelude::AppChooserExt], [`DialogExtManual`][trait@crate::prelude::DialogExtManual], [`WidgetExtManual`][trait@crate::prelude::WidgetExtManual], [`AccessibleExtManual`][trait@crate::prelude::AccessibleExtManual]
584    #[doc(alias = "GtkAppChooserDialog")]
585    pub struct AppChooserDialog(Object<ffi::GtkAppChooserDialog>) @extends Dialog, Window, Widget, @implements Accessible, Buildable, ConstraintTarget, Native, Root, ShortcutManager, AppChooser;
586
587    match fn {
588        type_ => || ffi::gtk_app_chooser_dialog_get_type(),
589    }
590}
591
592impl AppChooserDialog {
593    /// Creates a new [`AppChooserDialog`][crate::AppChooserDialog] for the provided `GFile`.
594    ///
595    /// The dialog will show applications that can open the file.
596    ///
597    /// # Deprecated since 4.10
598    ///
599    /// This widget will be removed in GTK 5
600    /// ## `parent`
601    /// a [`Window`][crate::Window]
602    /// ## `flags`
603    /// flags for this dialog
604    /// ## `file`
605    /// a `GFile`
606    ///
607    /// # Returns
608    ///
609    /// a newly created [`AppChooserDialog`][crate::AppChooserDialog]
610    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
611    #[allow(deprecated)]
612    #[doc(alias = "gtk_app_chooser_dialog_new")]
613    pub fn new(
614        parent: Option<&impl IsA<Window>>,
615        flags: DialogFlags,
616        file: &impl IsA<gio::File>,
617    ) -> AppChooserDialog {
618        assert_initialized_main_thread!();
619        unsafe {
620            Widget::from_glib_none(ffi::gtk_app_chooser_dialog_new(
621                parent.map(|p| p.as_ref()).to_glib_none().0,
622                flags.into_glib(),
623                file.as_ref().to_glib_none().0,
624            ))
625            .unsafe_cast()
626        }
627    }
628
629    /// Creates a new [`AppChooserDialog`][crate::AppChooserDialog] for the provided content type.
630    ///
631    /// The dialog will show applications that can open the content type.
632    ///
633    /// # Deprecated since 4.10
634    ///
635    /// This widget will be removed in GTK 5
636    /// ## `parent`
637    /// a [`Window`][crate::Window]
638    /// ## `flags`
639    /// flags for this dialog
640    /// ## `content_type`
641    /// a content type string
642    ///
643    /// # Returns
644    ///
645    /// a newly created [`AppChooserDialog`][crate::AppChooserDialog]
646    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
647    #[allow(deprecated)]
648    #[doc(alias = "gtk_app_chooser_dialog_new_for_content_type")]
649    #[doc(alias = "new_for_content_type")]
650    pub fn for_content_type(
651        parent: Option<&impl IsA<Window>>,
652        flags: DialogFlags,
653        content_type: &str,
654    ) -> AppChooserDialog {
655        assert_initialized_main_thread!();
656        unsafe {
657            Widget::from_glib_none(ffi::gtk_app_chooser_dialog_new_for_content_type(
658                parent.map(|p| p.as_ref()).to_glib_none().0,
659                flags.into_glib(),
660                content_type.to_glib_none().0,
661            ))
662            .unsafe_cast()
663        }
664    }
665
666    /// Returns the text to display at the top of the dialog.
667    ///
668    /// # Deprecated since 4.10
669    ///
670    /// This widget will be removed in GTK 5
671    ///
672    /// # Returns
673    ///
674    /// the text to display at the top of the dialog,
675    ///   or [`None`], in which case a default text is displayed
676    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
677    #[allow(deprecated)]
678    #[doc(alias = "gtk_app_chooser_dialog_get_heading")]
679    #[doc(alias = "get_heading")]
680    pub fn heading(&self) -> Option<glib::GString> {
681        unsafe {
682            from_glib_none(ffi::gtk_app_chooser_dialog_get_heading(
683                self.to_glib_none().0,
684            ))
685        }
686    }
687
688    /// Returns the [`AppChooserWidget`][crate::AppChooserWidget] of this dialog.
689    ///
690    /// # Deprecated since 4.10
691    ///
692    /// This widget will be removed in GTK 5
693    ///
694    /// # Returns
695    ///
696    /// the [`AppChooserWidget`][crate::AppChooserWidget] of @self
697    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
698    #[allow(deprecated)]
699    #[doc(alias = "gtk_app_chooser_dialog_get_widget")]
700    #[doc(alias = "get_widget")]
701    pub fn widget(&self) -> Widget {
702        unsafe {
703            from_glib_none(ffi::gtk_app_chooser_dialog_get_widget(
704                self.to_glib_none().0,
705            ))
706        }
707    }
708
709    /// Sets the text to display at the top of the dialog.
710    ///
711    /// If the heading is not set, the dialog displays a default text.
712    ///
713    /// # Deprecated since 4.10
714    ///
715    /// This widget will be removed in GTK 5
716    /// ## `heading`
717    /// a string containing Pango markup
718    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
719    #[allow(deprecated)]
720    #[doc(alias = "gtk_app_chooser_dialog_set_heading")]
721    #[doc(alias = "heading")]
722    pub fn set_heading(&self, heading: &str) {
723        unsafe {
724            ffi::gtk_app_chooser_dialog_set_heading(
725                self.to_glib_none().0,
726                heading.to_glib_none().0,
727            );
728        }
729    }
730
731    /// The GFile used by the [`AppChooserDialog`][crate::AppChooserDialog].
732    ///
733    /// The dialog's [`AppChooserWidget`][crate::AppChooserWidget] content type will
734    /// be guessed from the file, if present.
735    pub fn gfile(&self) -> Option<gio::File> {
736        ObjectExt::property(self, "gfile")
737    }
738
739    #[doc(alias = "heading")]
740    pub fn connect_heading_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
741        unsafe extern "C" fn notify_heading_trampoline<F: Fn(&AppChooserDialog) + 'static>(
742            this: *mut ffi::GtkAppChooserDialog,
743            _param_spec: glib::ffi::gpointer,
744            f: glib::ffi::gpointer,
745        ) {
746            let f: &F = &*(f as *const F);
747            f(&from_glib_borrow(this))
748        }
749        unsafe {
750            let f: Box_<F> = Box_::new(f);
751            connect_raw(
752                self.as_ptr() as *mut _,
753                c"notify::heading".as_ptr() as *const _,
754                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
755                    notify_heading_trampoline::<F> as *const (),
756                )),
757                Box_::into_raw(f),
758            )
759        }
760    }
761}