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