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
177    ///
178    ///
179    /// #### `gravity`
180    ///  The gravity to use when resizing the window programmatically.
181    ///
182    /// Gravity describes which point of the window we want to keep
183    /// fixed (meaning that the window will grow in the opposite direction).
184    /// For example, a gravity of `GTK_WINDOW_GRAVITY_TOP_RIGHT` means that we
185    /// want the to fix top right corner of the window.
186    ///
187    /// Readable | Writeable
188    ///
189    ///
190    /// #### `handle-menubar-accel`
191    ///  Whether the window frame should handle <kbd>F10</kbd> for activating
192    /// menubars.
193    ///
194    /// Readable | Writeable
195    ///
196    ///
197    /// #### `hide-on-close`
198    ///  If this window should be hidden instead of destroyed when the user clicks
199    /// the close button.
200    ///
201    /// Readable | Writeable
202    ///
203    ///
204    /// #### `icon-name`
205    ///  Specifies the name of the themed icon to use as the window icon.
206    ///
207    /// See [`IconTheme`][crate::IconTheme] for more details.
208    ///
209    /// Readable | Writeable
210    ///
211    ///
212    /// #### `is-active`
213    ///  Whether the toplevel is the currently active window.
214    ///
215    /// Readable
216    ///
217    ///
218    /// #### `maximized`
219    ///  Whether the window is maximized.
220    ///
221    /// Setting this property is the equivalent of calling
222    /// [`GtkWindowExt::maximize()`][crate::prelude::GtkWindowExt::maximize()] or [`GtkWindowExt::unmaximize()`][crate::prelude::GtkWindowExt::unmaximize()];
223    /// either operation is asynchronous, which means you will need to
224    /// connect to the ::notify signal in order to know whether the
225    /// operation was successful.
226    ///
227    /// Readable | Writeable
228    ///
229    ///
230    /// #### `mnemonics-visible`
231    ///  Whether mnemonics are currently visible in this window.
232    ///
233    /// This property is maintained by GTK based on user input,
234    /// and should not be set by applications.
235    ///
236    /// Readable | Writeable
237    ///
238    ///
239    /// #### `modal`
240    ///  If true, the window is modal.
241    ///
242    /// Readable | Writeable
243    ///
244    ///
245    /// #### `resizable`
246    ///  If true, users can resize the window.
247    ///
248    /// Readable | Writeable
249    ///
250    ///
251    /// #### `startup-id`
252    ///  A write-only property for setting window's startup notification identifier.
253    ///
254    /// Writeable
255    ///
256    ///
257    /// #### `suspended`
258    ///  Whether the window is suspended.
259    ///
260    /// See [`GtkWindowExt::is_suspended()`][crate::prelude::GtkWindowExt::is_suspended()] for details about what suspended means.
261    ///
262    /// Readable
263    ///
264    ///
265    /// #### `title`
266    ///  The title of the window.
267    ///
268    /// Readable | Writeable
269    ///
270    ///
271    /// #### `titlebar`
272    ///  The titlebar widget.
273    ///
274    /// Readable | Writeable
275    ///
276    ///
277    /// #### `transient-for`
278    ///  The transient parent of the window.
279    ///
280    /// Readable | Writeable | Construct
281    /// </details>
282    /// <details><summary><h4>Widget</h4></summary>
283    ///
284    ///
285    /// #### `can-focus`
286    ///  Whether the widget or any of its descendents can accept
287    /// the input focus.
288    ///
289    /// This property is meant to be set by widget implementations,
290    /// typically in their instance init function.
291    ///
292    /// Readable | Writeable
293    ///
294    ///
295    /// #### `can-target`
296    ///  Whether the widget can receive pointer events.
297    ///
298    /// Readable | Writeable
299    ///
300    ///
301    /// #### `css-classes`
302    ///  A list of css classes applied to this widget.
303    ///
304    /// Readable | Writeable
305    ///
306    ///
307    /// #### `css-name`
308    ///  The name of this widget in the CSS tree.
309    ///
310    /// This property is meant to be set by widget implementations,
311    /// typically in their instance init function.
312    ///
313    /// Readable | Writeable | Construct Only
314    ///
315    ///
316    /// #### `cursor`
317    ///  The cursor used by @widget.
318    ///
319    /// Readable | Writeable
320    ///
321    ///
322    /// #### `focus-on-click`
323    ///  Whether the widget should grab focus when it is clicked with the mouse.
324    ///
325    /// This property is only relevant for widgets that can take focus.
326    ///
327    /// Readable | Writeable
328    ///
329    ///
330    /// #### `focusable`
331    ///  Whether this widget itself will accept the input focus.
332    ///
333    /// Readable | Writeable
334    ///
335    ///
336    /// #### `halign`
337    ///  How to distribute horizontal space if widget gets extra space.
338    ///
339    /// Readable | Writeable
340    ///
341    ///
342    /// #### `has-default`
343    ///  Whether the widget is the default widget.
344    ///
345    /// Readable
346    ///
347    ///
348    /// #### `has-focus`
349    ///  Whether the widget has the input focus.
350    ///
351    /// Readable
352    ///
353    ///
354    /// #### `has-tooltip`
355    ///  Enables or disables the emission of the [`query-tooltip`][struct@crate::Widget#query-tooltip]
356    /// signal on @widget.
357    ///
358    /// A true value indicates that @widget can have a tooltip, in this case
359    /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to
360    /// determine whether it will provide a tooltip or not.
361    ///
362    /// Readable | Writeable
363    ///
364    ///
365    /// #### `height-request`
366    ///  Overrides for height request of the widget.
367    ///
368    /// If this is -1, the natural request will be used.
369    ///
370    /// Readable | Writeable
371    ///
372    ///
373    /// #### `hexpand`
374    ///  Whether to expand horizontally.
375    ///
376    /// Readable | Writeable
377    ///
378    ///
379    /// #### `hexpand-set`
380    ///  Whether to use the `hexpand` property.
381    ///
382    /// Readable | Writeable
383    ///
384    ///
385    /// #### `layout-manager`
386    ///  The [`LayoutManager`][crate::LayoutManager] instance to use to compute
387    /// the preferred size of the widget, and allocate its children.
388    ///
389    /// This property is meant to be set by widget implementations,
390    /// typically in their instance init function.
391    ///
392    /// Readable | Writeable
393    ///
394    ///
395    /// #### `limit-events`
396    ///  Makes this widget act like a modal dialog, with respect to
397    /// event delivery.
398    ///
399    /// Global event controllers will not handle events with targets
400    /// inside the widget, unless they are set up to ignore propagation
401    /// limits. See [`EventControllerExt::set_propagation_limit()`][crate::prelude::EventControllerExt::set_propagation_limit()].
402    ///
403    /// Readable | Writeable
404    ///
405    ///
406    /// #### `margin-bottom`
407    ///  Margin on bottom side of widget.
408    ///
409    /// This property adds margin outside of the widget's normal size
410    /// request, the margin will be added in addition to the size from
411    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
412    ///
413    /// Readable | Writeable
414    ///
415    ///
416    /// #### `margin-end`
417    ///  Margin on end of widget, horizontally.
418    ///
419    /// This property supports left-to-right and right-to-left text
420    /// directions.
421    ///
422    /// This property adds margin outside of the widget's normal size
423    /// request, the margin will be added in addition to the size from
424    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
425    ///
426    /// Readable | Writeable
427    ///
428    ///
429    /// #### `margin-start`
430    ///  Margin on start of widget, horizontally.
431    ///
432    /// This property supports left-to-right and right-to-left text
433    /// directions.
434    ///
435    /// This property adds margin outside of the widget's normal size
436    /// request, the margin will be added in addition to the size from
437    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
438    ///
439    /// Readable | Writeable
440    ///
441    ///
442    /// #### `margin-top`
443    ///  Margin on top side of widget.
444    ///
445    /// This property adds margin outside of the widget's normal size
446    /// request, the margin will be added in addition to the size from
447    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
448    ///
449    /// Readable | Writeable
450    ///
451    ///
452    /// #### `name`
453    ///  The name of the widget.
454    ///
455    /// Readable | Writeable
456    ///
457    ///
458    /// #### `opacity`
459    ///  The requested opacity of the widget.
460    ///
461    /// Readable | Writeable
462    ///
463    ///
464    /// #### `overflow`
465    ///  How content outside the widget's content area is treated.
466    ///
467    /// This property is meant to be set by widget implementations,
468    /// typically in their instance init function.
469    ///
470    /// Readable | Writeable
471    ///
472    ///
473    /// #### `parent`
474    ///  The parent widget of this widget.
475    ///
476    /// Readable
477    ///
478    ///
479    /// #### `receives-default`
480    ///  Whether the widget will receive the default action when it is focused.
481    ///
482    /// Readable | Writeable
483    ///
484    ///
485    /// #### `root`
486    ///  The [`Root`][crate::Root] widget of the widget tree containing this widget.
487    ///
488    /// This will be `NULL` if the widget is not contained in a root widget.
489    ///
490    /// Readable
491    ///
492    ///
493    /// #### `scale-factor`
494    ///  The scale factor of the widget.
495    ///
496    /// Readable
497    ///
498    ///
499    /// #### `sensitive`
500    ///  Whether the widget responds to input.
501    ///
502    /// Readable | Writeable
503    ///
504    ///
505    /// #### `tooltip-markup`
506    ///  Sets the text of tooltip to be the given string, which is marked up
507    /// with Pango markup.
508    ///
509    /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
510    ///
511    /// This is a convenience property which will take care of getting the
512    /// tooltip shown if the given string is not `NULL`:
513    /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
514    /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
515    /// the default signal handler.
516    ///
517    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
518    /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
519    ///
520    /// Readable | Writeable
521    ///
522    ///
523    /// #### `tooltip-text`
524    ///  Sets the text of tooltip to be the given string.
525    ///
526    /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
527    ///
528    /// This is a convenience property which will take care of getting the
529    /// tooltip shown if the given string is not `NULL`:
530    /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
531    /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
532    /// the default signal handler.
533    ///
534    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
535    /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
536    ///
537    /// Readable | Writeable
538    ///
539    ///
540    /// #### `valign`
541    ///  How to distribute vertical space if widget gets extra space.
542    ///
543    /// Readable | Writeable
544    ///
545    ///
546    /// #### `vexpand`
547    ///  Whether to expand vertically.
548    ///
549    /// Readable | Writeable
550    ///
551    ///
552    /// #### `vexpand-set`
553    ///  Whether to use the `vexpand` property.
554    ///
555    /// Readable | Writeable
556    ///
557    ///
558    /// #### `visible`
559    ///  Whether the widget is visible.
560    ///
561    /// Readable | Writeable
562    ///
563    ///
564    /// #### `width-request`
565    ///  Overrides for width request of the widget.
566    ///
567    /// If this is -1, the natural request will be used.
568    ///
569    /// Readable | Writeable
570    /// </details>
571    /// <details><summary><h4>Accessible</h4></summary>
572    ///
573    ///
574    /// #### `accessible-role`
575    ///  The accessible role of the given [`Accessible`][crate::Accessible] implementation.
576    ///
577    /// The accessible role cannot be changed once set.
578    ///
579    /// Readable | Writeable
580    /// </details>
581    /// <details><summary><h4>AppChooser</h4></summary>
582    ///
583    ///
584    /// #### `content-type`
585    ///  The content type of the [`AppChooser`][crate::AppChooser] object.
586    ///
587    /// See `GContentType` for more information about content types.
588    ///
589    /// Readable | Writeable | Construct Only
590    /// </details>
591    ///
592    /// # Implements
593    ///
594    /// [`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]
595    #[doc(alias = "GtkAppChooserDialog")]
596    pub struct AppChooserDialog(Object<ffi::GtkAppChooserDialog>) @extends Dialog, Window, Widget, @implements Accessible, Buildable, ConstraintTarget, Native, Root, ShortcutManager, AppChooser;
597
598    match fn {
599        type_ => || ffi::gtk_app_chooser_dialog_get_type(),
600    }
601}
602
603impl AppChooserDialog {
604    /// Creates a new [`AppChooserDialog`][crate::AppChooserDialog] for the provided `GFile`.
605    ///
606    /// The dialog will show applications that can open the file.
607    ///
608    /// # Deprecated since 4.10
609    ///
610    /// This widget will be removed in GTK 5
611    /// ## `parent`
612    /// a [`Window`][crate::Window]
613    /// ## `flags`
614    /// flags for this dialog
615    /// ## `file`
616    /// a `GFile`
617    ///
618    /// # Returns
619    ///
620    /// a newly created [`AppChooserDialog`][crate::AppChooserDialog]
621    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
622    #[allow(deprecated)]
623    #[doc(alias = "gtk_app_chooser_dialog_new")]
624    pub fn new(
625        parent: Option<&impl IsA<Window>>,
626        flags: DialogFlags,
627        file: &impl IsA<gio::File>,
628    ) -> AppChooserDialog {
629        assert_initialized_main_thread!();
630        unsafe {
631            Widget::from_glib_none(ffi::gtk_app_chooser_dialog_new(
632                parent.map(|p| p.as_ref()).to_glib_none().0,
633                flags.into_glib(),
634                file.as_ref().to_glib_none().0,
635            ))
636            .unsafe_cast()
637        }
638    }
639
640    /// Creates a new [`AppChooserDialog`][crate::AppChooserDialog] for the provided content type.
641    ///
642    /// The dialog will show applications that can open the content type.
643    ///
644    /// # Deprecated since 4.10
645    ///
646    /// This widget will be removed in GTK 5
647    /// ## `parent`
648    /// a [`Window`][crate::Window]
649    /// ## `flags`
650    /// flags for this dialog
651    /// ## `content_type`
652    /// a content type string
653    ///
654    /// # Returns
655    ///
656    /// a newly created [`AppChooserDialog`][crate::AppChooserDialog]
657    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
658    #[allow(deprecated)]
659    #[doc(alias = "gtk_app_chooser_dialog_new_for_content_type")]
660    #[doc(alias = "new_for_content_type")]
661    pub fn for_content_type(
662        parent: Option<&impl IsA<Window>>,
663        flags: DialogFlags,
664        content_type: &str,
665    ) -> AppChooserDialog {
666        assert_initialized_main_thread!();
667        unsafe {
668            Widget::from_glib_none(ffi::gtk_app_chooser_dialog_new_for_content_type(
669                parent.map(|p| p.as_ref()).to_glib_none().0,
670                flags.into_glib(),
671                content_type.to_glib_none().0,
672            ))
673            .unsafe_cast()
674        }
675    }
676
677    /// Returns the text to display at the top of the dialog.
678    ///
679    /// # Deprecated since 4.10
680    ///
681    /// This widget will be removed in GTK 5
682    ///
683    /// # Returns
684    ///
685    /// the text to display at the top of the dialog,
686    ///   or [`None`], in which case a default text is displayed
687    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
688    #[allow(deprecated)]
689    #[doc(alias = "gtk_app_chooser_dialog_get_heading")]
690    #[doc(alias = "get_heading")]
691    pub fn heading(&self) -> Option<glib::GString> {
692        unsafe {
693            from_glib_none(ffi::gtk_app_chooser_dialog_get_heading(
694                self.to_glib_none().0,
695            ))
696        }
697    }
698
699    /// Returns the [`AppChooserWidget`][crate::AppChooserWidget] of this dialog.
700    ///
701    /// # Deprecated since 4.10
702    ///
703    /// This widget will be removed in GTK 5
704    ///
705    /// # Returns
706    ///
707    /// the [`AppChooserWidget`][crate::AppChooserWidget] of @self
708    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
709    #[allow(deprecated)]
710    #[doc(alias = "gtk_app_chooser_dialog_get_widget")]
711    #[doc(alias = "get_widget")]
712    pub fn widget(&self) -> Widget {
713        unsafe {
714            from_glib_none(ffi::gtk_app_chooser_dialog_get_widget(
715                self.to_glib_none().0,
716            ))
717        }
718    }
719
720    /// Sets the text to display at the top of the dialog.
721    ///
722    /// If the heading is not set, the dialog displays a default text.
723    ///
724    /// # Deprecated since 4.10
725    ///
726    /// This widget will be removed in GTK 5
727    /// ## `heading`
728    /// a string containing Pango markup
729    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
730    #[allow(deprecated)]
731    #[doc(alias = "gtk_app_chooser_dialog_set_heading")]
732    #[doc(alias = "heading")]
733    pub fn set_heading(&self, heading: &str) {
734        unsafe {
735            ffi::gtk_app_chooser_dialog_set_heading(
736                self.to_glib_none().0,
737                heading.to_glib_none().0,
738            );
739        }
740    }
741
742    /// The GFile used by the [`AppChooserDialog`][crate::AppChooserDialog].
743    ///
744    /// The dialog's [`AppChooserWidget`][crate::AppChooserWidget] content type will
745    /// be guessed from the file, if present.
746    pub fn gfile(&self) -> Option<gio::File> {
747        ObjectExt::property(self, "gfile")
748    }
749
750    #[doc(alias = "heading")]
751    pub fn connect_heading_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
752        unsafe extern "C" fn notify_heading_trampoline<F: Fn(&AppChooserDialog) + 'static>(
753            this: *mut ffi::GtkAppChooserDialog,
754            _param_spec: glib::ffi::gpointer,
755            f: glib::ffi::gpointer,
756        ) {
757            let f: &F = &*(f as *const F);
758            f(&from_glib_borrow(this))
759        }
760        unsafe {
761            let f: Box_<F> = Box_::new(f);
762            connect_raw(
763                self.as_ptr() as *mut _,
764                c"notify::heading".as_ptr() as *const _,
765                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
766                    notify_heading_trampoline::<F> as *const (),
767                )),
768                Box_::into_raw(f),
769            )
770        }
771    }
772}