Skip to main content

gtk4/auto/
assistant.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
6#[cfg(feature = "v4_10")]
7#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
8use crate::Accessible;
9#[cfg(feature = "v4_20")]
10#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
11use crate::WindowGravity;
12use crate::{
13    AccessibleRole, Align, Application, AssistantPage, AssistantPageType, Buildable,
14    ConstraintTarget, LayoutManager, Native, Overflow, Root, ShortcutManager, Widget, Window, ffi,
15};
16use glib::{
17    object::ObjectType as _,
18    prelude::*,
19    signal::{SignalHandlerId, connect_raw},
20    translate::*,
21};
22use std::boxed::Box as Box_;
23
24#[cfg(feature = "v4_10")]
25#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
26glib::wrapper! {
27    /// This widget will be removed in GTK 5
28    /// .
29    ///
30    /// To add pages to an assistant in [`Builder`][crate::Builder], simply add it as a
31    /// child to the [`Assistant`][crate::Assistant] object. If you need to set per-object
32    /// properties, create a [`AssistantPage`][crate::AssistantPage] object explicitly, and
33    /// set the child widget as a property on it.
34    ///
35    /// # CSS nodes
36    ///
37    /// [`Assistant`][crate::Assistant] has a single CSS node with the name window and style
38    /// class .assistant.
39    ///
40    /// ## Properties
41    ///
42    ///
43    /// #### `pages`
44    ///  `GListModel` containing the pages.
45    ///
46    /// Readable
47    ///
48    ///
49    /// #### `use-header-bar`
50    ///  [`true`] if the assistant uses a [`HeaderBar`][crate::HeaderBar] for action buttons
51    /// instead of the action-area.
52    ///
53    /// For technical reasons, this property is declared as an integer
54    /// property, but you should only set it to [`true`] or [`false`].
55    ///
56    /// Readable | Writable | Construct Only
57    /// <details><summary><h4>Window</h4></summary>
58    ///
59    ///
60    /// #### `application`
61    ///  The [`Application`][crate::Application] associated with the window.
62    ///
63    /// The application will be kept alive for at least as long as it
64    /// has any windows associated with it (see g_application_hold()
65    /// for a way to keep it alive without windows).
66    ///
67    /// Normally, the connection between the application and the window
68    /// will remain until the window is destroyed, but you can explicitly
69    /// remove it by setting the this property to `NULL`.
70    ///
71    /// Readable | Writable
72    ///
73    ///
74    /// #### `child`
75    ///  The child widget.
76    ///
77    /// Readable | Writable
78    ///
79    ///
80    /// #### `decorated`
81    ///  Whether the window should have a frame (also known as *decorations*).
82    ///
83    /// Readable | Writable
84    ///
85    ///
86    /// #### `default-height`
87    ///  The default height of the window.
88    ///
89    /// Readable | Writable
90    ///
91    ///
92    /// #### `default-widget`
93    ///  The default widget.
94    ///
95    /// Readable | Writable
96    ///
97    ///
98    /// #### `default-width`
99    ///  The default width of the window.
100    ///
101    /// Readable | Writable
102    ///
103    ///
104    /// #### `deletable`
105    ///  Whether the window frame should have a close button.
106    ///
107    /// Readable | Writable
108    ///
109    ///
110    /// #### `destroy-with-parent`
111    ///  If this window should be destroyed when the parent is destroyed.
112    ///
113    /// Readable | Writable
114    ///
115    ///
116    /// #### `display`
117    ///  The display that will display this window.
118    ///
119    /// Readable | Writable
120    ///
121    ///
122    /// #### `focus-visible`
123    ///  Whether 'focus rectangles' are currently visible in this window.
124    ///
125    /// This property is maintained by GTK based on user input
126    /// and should not be set by applications.
127    ///
128    /// Readable | Writable
129    ///
130    ///
131    /// #### `focus-widget`
132    ///  The focus widget.
133    ///
134    /// Readable | Writable
135    ///
136    ///
137    /// #### `fullscreened`
138    ///  Whether the window is fullscreen.
139    ///
140    /// Setting this property is the equivalent of calling
141    /// [`GtkWindowExt::fullscreen()`][crate::prelude::GtkWindowExt::fullscreen()] or [`GtkWindowExt::unfullscreen()`][crate::prelude::GtkWindowExt::unfullscreen()];
142    /// either operation is asynchronous, which means you will need to
143    /// connect to the ::notify signal in order to know whether the
144    /// operation was successful.
145    ///
146    /// Readable | Writable
147    ///
148    ///
149    /// #### `gravity`
150    ///  The gravity to use when resizing the window programmatically.
151    ///
152    /// Gravity describes which point of the window we want to keep
153    /// fixed (meaning that the window will grow in the opposite direction).
154    /// For example, a gravity of `GTK_WINDOW_GRAVITY_TOP_RIGHT` means that we
155    /// want the to fix top right corner of the window.
156    ///
157    /// Readable | Writable
158    ///
159    ///
160    /// #### `handle-menubar-accel`
161    ///   for activating
162    /// menubars.
163    ///
164    /// Readable | Writable
165    ///
166    ///
167    /// #### `hide-on-close`
168    ///  If this window should be hidden instead of destroyed when the user clicks
169    /// the close button.
170    ///
171    /// Readable | Writable
172    ///
173    ///
174    /// #### `icon-name`
175    ///  Specifies the name of the themed icon to use as the window icon.
176    ///
177    /// See [`IconTheme`][crate::IconTheme] for more details.
178    ///
179    /// Readable | Writable
180    ///
181    ///
182    /// #### `is-active`
183    ///  Whether the toplevel is the currently active window.
184    ///
185    /// Readable
186    ///
187    ///
188    /// #### `maximized`
189    ///  Whether the window is maximized.
190    ///
191    /// Setting this property is the equivalent of calling
192    /// [`GtkWindowExt::maximize()`][crate::prelude::GtkWindowExt::maximize()] or [`GtkWindowExt::unmaximize()`][crate::prelude::GtkWindowExt::unmaximize()];
193    /// either operation is asynchronous, which means you will need to
194    /// connect to the ::notify signal in order to know whether the
195    /// operation was successful.
196    ///
197    /// Readable | Writable
198    ///
199    ///
200    /// #### `mnemonics-visible`
201    ///  Whether mnemonics are currently visible in this window.
202    ///
203    /// This property is maintained by GTK based on user input,
204    /// and should not be set by applications.
205    ///
206    /// Readable | Writable
207    ///
208    ///
209    /// #### `modal`
210    ///  If true, the window is modal.
211    ///
212    /// Readable | Writable
213    ///
214    ///
215    /// #### `resizable`
216    ///  If true, users can resize the window.
217    ///
218    /// Readable | Writable
219    ///
220    ///
221    /// #### `startup-id`
222    ///  A write-only property for setting window's startup notification identifier.
223    ///
224    /// Writable
225    ///
226    ///
227    /// #### `suspended`
228    ///  Whether the window is suspended.
229    ///
230    /// See [`GtkWindowExt::is_suspended()`][crate::prelude::GtkWindowExt::is_suspended()] for details about what suspended means.
231    ///
232    /// Readable
233    ///
234    ///
235    /// #### `title`
236    ///  The title of the window.
237    ///
238    /// Readable | Writable
239    ///
240    ///
241    /// #### `titlebar`
242    ///  The titlebar widget.
243    ///
244    /// Readable | Writable
245    ///
246    ///
247    /// #### `transient-for`
248    ///  The transient parent of the window.
249    ///
250    /// Readable | Writable | Construct
251    /// </details>
252    /// <details><summary><h4>Widget</h4></summary>
253    ///
254    ///
255    /// #### `can-focus`
256    ///  Whether the widget or any of its descendents can accept
257    /// the input focus.
258    ///
259    /// This property is meant to be set by widget implementations,
260    /// typically in their instance init function.
261    ///
262    /// Readable | Writable
263    ///
264    ///
265    /// #### `can-target`
266    ///  Whether the widget can receive pointer events.
267    ///
268    /// Readable | Writable
269    ///
270    ///
271    /// #### `css-classes`
272    ///  A list of css classes applied to this widget.
273    ///
274    /// Readable | Writable
275    ///
276    ///
277    /// #### `css-name`
278    ///  The name of this widget in the CSS tree.
279    ///
280    /// This property is meant to be set by widget implementations,
281    /// typically in their instance init function.
282    ///
283    /// Readable | Writable | Construct Only
284    ///
285    ///
286    /// #### `cursor`
287    ///  The cursor used by @widget.
288    ///
289    /// Readable | Writable
290    ///
291    ///
292    /// #### `focus-on-click`
293    ///  Whether the widget should grab focus when it is clicked with the mouse.
294    ///
295    /// This property is only relevant for widgets that can take focus.
296    ///
297    /// Readable | Writable
298    ///
299    ///
300    /// #### `focusable`
301    ///  Whether this widget itself will accept the input focus.
302    ///
303    /// Readable | Writable
304    ///
305    ///
306    /// #### `halign`
307    ///  How to distribute horizontal space if widget gets extra space.
308    ///
309    /// Readable | Writable
310    ///
311    ///
312    /// #### `has-default`
313    ///  Whether the widget is the default widget.
314    ///
315    /// Readable
316    ///
317    ///
318    /// #### `has-focus`
319    ///  Whether the widget has the input focus.
320    ///
321    /// Readable
322    ///
323    ///
324    /// #### `has-tooltip`
325    ///  Enables or disables the emission of the [`query-tooltip`][struct@crate::Widget#query-tooltip]
326    /// signal on @widget.
327    ///
328    /// A true value indicates that @widget can have a tooltip, in this case
329    /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to
330    /// determine whether it will provide a tooltip or not.
331    ///
332    /// Readable | Writable
333    ///
334    ///
335    /// #### `height-request`
336    ///  Overrides for height request of the widget.
337    ///
338    /// If this is -1, the natural request will be used.
339    ///
340    /// Readable | Writable
341    ///
342    ///
343    /// #### `hexpand`
344    ///  Whether to expand horizontally.
345    ///
346    /// Readable | Writable
347    ///
348    ///
349    /// #### `hexpand-set`
350    ///  Whether to use the `hexpand` property.
351    ///
352    /// Readable | Writable
353    ///
354    ///
355    /// #### `layout-manager`
356    ///  The [`LayoutManager`][crate::LayoutManager] instance to use to compute
357    /// the preferred size of the widget, and allocate its children.
358    ///
359    /// This property is meant to be set by widget implementations,
360    /// typically in their instance init function.
361    ///
362    /// Readable | Writable
363    ///
364    ///
365    /// #### `limit-events`
366    ///  Makes this widget act like a modal dialog, with respect to
367    /// event delivery.
368    ///
369    /// Global event controllers will not handle events with targets
370    /// inside the widget, unless they are set up to ignore propagation
371    /// limits. See [`EventControllerExt::set_propagation_limit()`][crate::prelude::EventControllerExt::set_propagation_limit()].
372    ///
373    /// Readable | Writable
374    ///
375    ///
376    /// #### `margin-bottom`
377    ///  Margin on bottom side of widget.
378    ///
379    /// This property adds margin outside of the widget's normal size
380    /// request, the margin will be added in addition to the size from
381    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
382    ///
383    /// Readable | Writable
384    ///
385    ///
386    /// #### `margin-end`
387    ///  Margin on end of widget, horizontally.
388    ///
389    /// This property supports left-to-right and right-to-left text
390    /// directions.
391    ///
392    /// This property adds margin outside of the widget's normal size
393    /// request, the margin will be added in addition to the size from
394    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
395    ///
396    /// Readable | Writable
397    ///
398    ///
399    /// #### `margin-start`
400    ///  Margin on start of widget, horizontally.
401    ///
402    /// This property supports left-to-right and right-to-left text
403    /// directions.
404    ///
405    /// This property adds margin outside of the widget's normal size
406    /// request, the margin will be added in addition to the size from
407    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
408    ///
409    /// Readable | Writable
410    ///
411    ///
412    /// #### `margin-top`
413    ///  Margin on top side of widget.
414    ///
415    /// This property adds margin outside of the widget's normal size
416    /// request, the margin will be added in addition to the size from
417    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
418    ///
419    /// Readable | Writable
420    ///
421    ///
422    /// #### `name`
423    ///  The name of the widget.
424    ///
425    /// Readable | Writable
426    ///
427    ///
428    /// #### `opacity`
429    ///  The requested opacity of the widget.
430    ///
431    /// Readable | Writable
432    ///
433    ///
434    /// #### `overflow`
435    ///  How content outside the widget's content area is treated.
436    ///
437    /// This property is meant to be set by widget implementations,
438    /// typically in their instance init function.
439    ///
440    /// Readable | Writable
441    ///
442    ///
443    /// #### `parent`
444    ///  The parent widget of this widget.
445    ///
446    /// Readable
447    ///
448    ///
449    /// #### `receives-default`
450    ///  Whether the widget will receive the default action when it is focused.
451    ///
452    /// Readable | Writable
453    ///
454    ///
455    /// #### `root`
456    ///  The [`Root`][crate::Root] widget of the widget tree containing this widget.
457    ///
458    /// This will be `NULL` if the widget is not contained in a root widget.
459    ///
460    /// Readable
461    ///
462    ///
463    /// #### `scale-factor`
464    ///  The scale factor of the widget.
465    ///
466    /// Readable
467    ///
468    ///
469    /// #### `sensitive`
470    ///  Whether the widget responds to input.
471    ///
472    /// Readable | Writable
473    ///
474    ///
475    /// #### `tooltip-markup`
476    ///  Sets the text of tooltip to be the given string, which is marked up
477    /// with Pango markup.
478    ///
479    /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
480    ///
481    /// This is a convenience property which will take care of getting the
482    /// tooltip shown if the given string is not `NULL`:
483    /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
484    /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
485    /// the default signal handler.
486    ///
487    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
488    /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
489    ///
490    /// Readable | Writable
491    ///
492    ///
493    /// #### `tooltip-text`
494    ///  Sets the text of tooltip to be the given string.
495    ///
496    /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
497    ///
498    /// This is a convenience property which will take care of getting the
499    /// tooltip shown if the given string is not `NULL`:
500    /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
501    /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
502    /// the default signal handler.
503    ///
504    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
505    /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
506    ///
507    /// Readable | Writable
508    ///
509    ///
510    /// #### `valign`
511    ///  How to distribute vertical space if widget gets extra space.
512    ///
513    /// Readable | Writable
514    ///
515    ///
516    /// #### `vexpand`
517    ///  Whether to expand vertically.
518    ///
519    /// Readable | Writable
520    ///
521    ///
522    /// #### `vexpand-set`
523    ///  Whether to use the `vexpand` property.
524    ///
525    /// Readable | Writable
526    ///
527    ///
528    /// #### `visible`
529    ///  Whether the widget is visible.
530    ///
531    /// Readable | Writable
532    ///
533    ///
534    /// #### `width-request`
535    ///  Overrides for width request of the widget.
536    ///
537    /// If this is -1, the natural request will be used.
538    ///
539    /// Readable | Writable
540    /// </details>
541    /// <details><summary><h4>Accessible</h4></summary>
542    ///
543    ///
544    /// #### `accessible-role`
545    ///  The accessible role of the given [`Accessible`][crate::Accessible] implementation.
546    ///
547    /// The accessible role cannot be changed once set.
548    ///
549    /// Readable | Writable
550    /// </details>
551    ///
552    /// ## Signals
553    ///
554    ///
555    /// #### `apply`
556    ///  Emitted when the apply button is clicked.
557    ///
558    /// The default behavior of the [`Assistant`][crate::Assistant] is to switch to the page
559    /// after the current page, unless the current page is the last one.
560    ///
561    /// A handler for the ::apply signal should carry out the actions for
562    /// which the wizard has collected data. If the action takes a long time
563    /// to complete, you might consider putting a page of type
564    /// [`AssistantPageType::Progress`][crate::AssistantPageType::Progress] after the confirmation page and handle
565    /// this operation within the [`prepare`][struct@crate::Assistant#prepare] signal of
566    /// the progress page.
567    ///
568    ///
569    ///
570    ///
571    /// #### `cancel`
572    ///  Emitted when then the cancel button is clicked.
573    ///
574    ///
575    ///
576    ///
577    /// #### `close`
578    ///  Emitted either when the close button of a summary page is clicked,
579    /// or when the apply button in the last page in the flow (of type
580    /// [`AssistantPageType::Confirm`][crate::AssistantPageType::Confirm]) is clicked.
581    ///
582    ///
583    ///
584    ///
585    /// #### `escape`
586    ///  The action signal for the Escape binding.
587    ///
588    /// Action
589    ///
590    ///
591    /// #### `prepare`
592    ///  Emitted when a new page is set as the assistant's current page,
593    /// before making the new page visible.
594    ///
595    /// A handler for this signal can do any preparations which are
596    /// necessary before showing @page.
597    ///
598    ///
599    /// <details><summary><h4>Window</h4></summary>
600    ///
601    ///
602    /// #### `activate-default`
603    ///   key.
604    ///
605    /// Action
606    ///
607    ///
608    /// #### `activate-focus`
609    ///  .
610    ///
611    /// Action
612    ///
613    ///
614    /// #### `close-request`
615    ///  Emitted when the user clicks on the close button of the window.
616    ///
617    ///
618    ///
619    ///
620    /// #### `enable-debugging`
621    ///  .
622    ///
623    /// Action
624    ///
625    ///
626    /// #### `force-close`
627    ///  Emitted when the compositor has decided to eliminate a window.
628    ///
629    /// @window *has* to be in a hidden state after this signal was handled.
630    ///
631    ///
632    ///
633    ///
634    /// #### `keys-changed`
635    ///  Emitted when the set of accelerators or mnemonics that
636    /// are associated with the window changes.
637    ///
638    ///
639    /// </details>
640    /// <details><summary><h4>Widget</h4></summary>
641    ///
642    ///
643    /// #### `destroy`
644    ///  Signals that all holders of a reference to the widget should release
645    /// the reference that they hold.
646    ///
647    /// May result in finalization of the widget if all references are released.
648    ///
649    /// This signal is not suitable for saving widget state.
650    ///
651    ///
652    ///
653    ///
654    /// #### `direction-changed`
655    ///  Emitted when the text direction of a widget changes.
656    ///
657    ///
658    ///
659    ///
660    /// #### `hide`
661    ///  Emitted when @widget is hidden.
662    ///
663    ///
664    ///
665    ///
666    /// #### `keynav-failed`
667    ///  Emitted if keyboard navigation fails.
668    ///
669    /// See [`WidgetExt::keynav_failed()`][crate::prelude::WidgetExt::keynav_failed()] for details.
670    ///
671    ///
672    ///
673    ///
674    /// #### `map`
675    ///  Emitted when @widget is going to be mapped.
676    ///
677    /// A widget is mapped when the widget is visible (which is controlled with
678    /// [`visible`][struct@crate::Widget#visible]) and all its parents up to the toplevel widget
679    /// are also visible.
680    ///
681    /// The `::map` signal can be used to determine whether a widget will be drawn,
682    /// for instance it can resume an animation that was stopped during the
683    /// emission of [`unmap`][struct@crate::Widget#unmap].
684    ///
685    ///
686    ///
687    ///
688    /// #### `mnemonic-activate`
689    ///  Emitted when a widget is activated via a mnemonic.
690    ///
691    /// The default handler for this signal activates @widget if @group_cycling
692    /// is false, or just makes @widget grab focus if @group_cycling is true.
693    ///
694    ///
695    ///
696    ///
697    /// #### `move-focus`
698    ///   to move backward.
699    ///
700    /// Action
701    ///
702    ///
703    /// #### `query-tooltip`
704    ///  s tooltip is about to be shown.
705    ///
706    /// This happens when the [`has-tooltip`][struct@crate::Widget#has-tooltip] property
707    /// is true and the hover timeout has expired with the cursor hovering
708    /// above @widget; or emitted when @widget got focus in keyboard mode.
709    ///
710    /// Using the given coordinates, the signal handler should determine
711    /// whether a tooltip should be shown for @widget. If this is the case
712    /// true should be returned, false otherwise. Note that if @keyboard_mode
713    /// is true, the values of @x and @y are undefined and should not be used.
714    ///
715    /// The signal handler is free to manipulate @tooltip with the therefore
716    /// destined function calls.
717    ///
718    ///
719    ///
720    ///
721    /// #### `realize`
722    ///  Emitted when @widget is associated with a [`gdk::Surface`][crate::gdk::Surface].
723    ///
724    /// This means that [`WidgetExt::realize()`][crate::prelude::WidgetExt::realize()] has been called
725    /// or the widget has been mapped (that is, it is going to be drawn).
726    ///
727    ///
728    ///
729    ///
730    /// #### `show`
731    ///  Emitted when @widget is shown.
732    ///
733    ///
734    ///
735    ///
736    /// #### `state-flags-changed`
737    ///  Emitted when the widget state changes.
738    ///
739    /// See [`WidgetExt::state_flags()`][crate::prelude::WidgetExt::state_flags()].
740    ///
741    ///
742    ///
743    ///
744    /// #### `unmap`
745    ///  Emitted when @widget is going to be unmapped.
746    ///
747    /// A widget is unmapped when either it or any of its parents up to the
748    /// toplevel widget have been set as hidden.
749    ///
750    /// As `::unmap` indicates that a widget will not be shown any longer,
751    /// it can be used to, for example, stop an animation on the widget.
752    ///
753    ///
754    ///
755    ///
756    /// #### `unrealize`
757    ///  Emitted when the [`gdk::Surface`][crate::gdk::Surface] associated with @widget is destroyed.
758    ///
759    /// This means that [`WidgetExt::unrealize()`][crate::prelude::WidgetExt::unrealize()] has been called
760    /// or the widget has been unmapped (that is, it is going to be hidden).
761    ///
762    ///
763    /// </details>
764    ///
765    /// # Implements
766    ///
767    /// [`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], [`WidgetExtManual`][trait@crate::prelude::WidgetExtManual], [`AccessibleExtManual`][trait@crate::prelude::AccessibleExtManual]
768    #[doc(alias = "GtkAssistant")]
769    pub struct Assistant(Object<ffi::GtkAssistant>) @extends Window, Widget, @implements Accessible, Buildable, ConstraintTarget, Native, Root, ShortcutManager;
770
771    match fn {
772        type_ => || ffi::gtk_assistant_get_type(),
773    }
774}
775
776#[cfg(not(feature = "v4_10"))]
777glib::wrapper! {
778    #[doc(alias = "GtkAssistant")]
779    pub struct Assistant(Object<ffi::GtkAssistant>) @extends Window, Widget, @implements Buildable, ConstraintTarget, Native, Root, ShortcutManager;
780
781    match fn {
782        type_ => || ffi::gtk_assistant_get_type(),
783    }
784}
785
786impl Assistant {
787    /// Creates a new [`Assistant`][crate::Assistant].
788    ///
789    /// # Deprecated since 4.10
790    ///
791    /// This widget will be removed in GTK 5
792    ///
793    /// # Returns
794    ///
795    /// a newly created [`Assistant`][crate::Assistant]
796    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
797    #[allow(deprecated)]
798    #[doc(alias = "gtk_assistant_new")]
799    pub fn new() -> Assistant {
800        assert_initialized_main_thread!();
801        unsafe { Widget::from_glib_none(ffi::gtk_assistant_new()).unsafe_cast() }
802    }
803
804    // rustdoc-stripper-ignore-next
805    /// Creates a new builder-pattern struct instance to construct [`Assistant`] objects.
806    ///
807    /// This method returns an instance of [`AssistantBuilder`](crate::builders::AssistantBuilder) which can be used to create [`Assistant`] objects.
808    pub fn builder() -> AssistantBuilder {
809        AssistantBuilder::new()
810    }
811
812    /// Adds a widget to the action area of a [`Assistant`][crate::Assistant].
813    ///
814    /// # Deprecated since 4.10
815    ///
816    /// This widget will be removed in GTK 5
817    /// ## `child`
818    /// a [`Widget`][crate::Widget]
819    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
820    #[allow(deprecated)]
821    #[doc(alias = "gtk_assistant_add_action_widget")]
822    pub fn add_action_widget(&self, child: &impl IsA<Widget>) {
823        unsafe {
824            ffi::gtk_assistant_add_action_widget(
825                self.to_glib_none().0,
826                child.as_ref().to_glib_none().0,
827            );
828        }
829    }
830
831    /// Appends a page to the @self.
832    ///
833    /// # Deprecated since 4.10
834    ///
835    /// This widget will be removed in GTK 5
836    /// ## `page`
837    /// a [`Widget`][crate::Widget]
838    ///
839    /// # Returns
840    ///
841    /// the index (starting at 0) of the inserted page
842    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
843    #[allow(deprecated)]
844    #[doc(alias = "gtk_assistant_append_page")]
845    pub fn append_page(&self, page: &impl IsA<Widget>) -> i32 {
846        unsafe {
847            ffi::gtk_assistant_append_page(self.to_glib_none().0, page.as_ref().to_glib_none().0)
848        }
849    }
850
851    /// Erases the visited page history.
852    ///
853    /// GTK will then hide the back button on the current page,
854    /// and removes the cancel button from subsequent pages.
855    ///
856    /// Use this when the information provided up to the current
857    /// page is hereafter deemed permanent and cannot be modified
858    /// or undone. For example, showing a progress page to track
859    /// a long-running, unreversible operation after the user has
860    /// clicked apply on a confirmation page.
861    ///
862    /// # Deprecated since 4.10
863    ///
864    /// This widget will be removed in GTK 5
865    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
866    #[allow(deprecated)]
867    #[doc(alias = "gtk_assistant_commit")]
868    pub fn commit(&self) {
869        unsafe {
870            ffi::gtk_assistant_commit(self.to_glib_none().0);
871        }
872    }
873
874    /// Returns the page number of the current page.
875    ///
876    /// # Deprecated since 4.10
877    ///
878    /// This widget will be removed in GTK 5
879    ///
880    /// # Returns
881    ///
882    /// The index (starting from 0) of the current
883    ///   page in the @self, or -1 if the @self has no pages,
884    ///   or no current page
885    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
886    #[allow(deprecated)]
887    #[doc(alias = "gtk_assistant_get_current_page")]
888    #[doc(alias = "get_current_page")]
889    pub fn current_page(&self) -> i32 {
890        unsafe { ffi::gtk_assistant_get_current_page(self.to_glib_none().0) }
891    }
892
893    /// Returns the number of pages in the @self
894    ///
895    /// # Deprecated since 4.10
896    ///
897    /// This widget will be removed in GTK 5
898    ///
899    /// # Returns
900    ///
901    /// the number of pages in the @self
902    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
903    #[allow(deprecated)]
904    #[doc(alias = "gtk_assistant_get_n_pages")]
905    #[doc(alias = "get_n_pages")]
906    pub fn n_pages(&self) -> i32 {
907        unsafe { ffi::gtk_assistant_get_n_pages(self.to_glib_none().0) }
908    }
909
910    /// Returns the child widget contained in page number @page_num.
911    ///
912    /// # Deprecated since 4.10
913    ///
914    /// This widget will be removed in GTK 5
915    /// ## `page_num`
916    /// the index of a page in the @self,
917    ///   or -1 to get the last page
918    ///
919    /// # Returns
920    ///
921    /// the child widget, or [`None`]
922    ///   if @page_num is out of bounds
923    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
924    #[allow(deprecated)]
925    #[doc(alias = "gtk_assistant_get_nth_page")]
926    #[doc(alias = "get_nth_page")]
927    pub fn nth_page(&self, page_num: i32) -> Option<Widget> {
928        unsafe {
929            from_glib_none(ffi::gtk_assistant_get_nth_page(
930                self.to_glib_none().0,
931                page_num,
932            ))
933        }
934    }
935
936    /// Returns the [`AssistantPage`][crate::AssistantPage] object for @child.
937    ///
938    /// # Deprecated since 4.10
939    ///
940    /// This widget will be removed in GTK 5
941    /// ## `child`
942    /// a child of @self
943    ///
944    /// # Returns
945    ///
946    /// the [`AssistantPage`][crate::AssistantPage] for @child
947    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
948    #[allow(deprecated)]
949    #[doc(alias = "gtk_assistant_get_page")]
950    #[doc(alias = "get_page")]
951    pub fn page(&self, child: &impl IsA<Widget>) -> AssistantPage {
952        unsafe {
953            from_glib_none(ffi::gtk_assistant_get_page(
954                self.to_glib_none().0,
955                child.as_ref().to_glib_none().0,
956            ))
957        }
958    }
959
960    /// Gets whether @page is complete.
961    ///
962    /// # Deprecated since 4.10
963    ///
964    /// This widget will be removed in GTK 5
965    /// ## `page`
966    /// a page of @self
967    ///
968    /// # Returns
969    ///
970    /// [`true`] if @page is complete.
971    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
972    #[allow(deprecated)]
973    #[doc(alias = "gtk_assistant_get_page_complete")]
974    #[doc(alias = "get_page_complete")]
975    pub fn page_is_complete(&self, page: &impl IsA<Widget>) -> bool {
976        unsafe {
977            from_glib(ffi::gtk_assistant_get_page_complete(
978                self.to_glib_none().0,
979                page.as_ref().to_glib_none().0,
980            ))
981        }
982    }
983
984    /// Gets the title for @page.
985    ///
986    /// # Deprecated since 4.10
987    ///
988    /// This widget will be removed in GTK 5
989    /// ## `page`
990    /// a page of @self
991    ///
992    /// # Returns
993    ///
994    /// the title for @page
995    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
996    #[allow(deprecated)]
997    #[doc(alias = "gtk_assistant_get_page_title")]
998    #[doc(alias = "get_page_title")]
999    pub fn page_title(&self, page: &impl IsA<Widget>) -> glib::GString {
1000        unsafe {
1001            from_glib_none(ffi::gtk_assistant_get_page_title(
1002                self.to_glib_none().0,
1003                page.as_ref().to_glib_none().0,
1004            ))
1005        }
1006    }
1007
1008    /// Gets the page type of @page.
1009    ///
1010    /// # Deprecated since 4.10
1011    ///
1012    /// This widget will be removed in GTK 5
1013    /// ## `page`
1014    /// a page of @self
1015    ///
1016    /// # Returns
1017    ///
1018    /// the page type of @page
1019    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1020    #[allow(deprecated)]
1021    #[doc(alias = "gtk_assistant_get_page_type")]
1022    #[doc(alias = "get_page_type")]
1023    pub fn page_type(&self, page: &impl IsA<Widget>) -> AssistantPageType {
1024        unsafe {
1025            from_glib(ffi::gtk_assistant_get_page_type(
1026                self.to_glib_none().0,
1027                page.as_ref().to_glib_none().0,
1028            ))
1029        }
1030    }
1031
1032    /// Gets a list model of the assistant pages.
1033    ///
1034    /// # Deprecated since 4.10
1035    ///
1036    /// This widget will be removed in GTK 5
1037    ///
1038    /// # Returns
1039    ///
1040    /// A list model of the pages.
1041    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1042    #[allow(deprecated)]
1043    #[doc(alias = "gtk_assistant_get_pages")]
1044    #[doc(alias = "get_pages")]
1045    pub fn pages(&self) -> gio::ListModel {
1046        unsafe { from_glib_full(ffi::gtk_assistant_get_pages(self.to_glib_none().0)) }
1047    }
1048
1049    /// Inserts a page in the @self at a given position.
1050    ///
1051    /// # Deprecated since 4.10
1052    ///
1053    /// This widget will be removed in GTK 5
1054    /// ## `page`
1055    /// a [`Widget`][crate::Widget]
1056    /// ## `position`
1057    /// the index (starting at 0) at which to insert the page,
1058    ///   or -1 to append the page to the @self
1059    ///
1060    /// # Returns
1061    ///
1062    /// the index (starting from 0) of the inserted page
1063    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1064    #[allow(deprecated)]
1065    #[doc(alias = "gtk_assistant_insert_page")]
1066    pub fn insert_page(&self, page: &impl IsA<Widget>, position: i32) -> i32 {
1067        unsafe {
1068            ffi::gtk_assistant_insert_page(
1069                self.to_glib_none().0,
1070                page.as_ref().to_glib_none().0,
1071                position,
1072            )
1073        }
1074    }
1075
1076    /// Navigate to the next page.
1077    ///
1078    /// It is a programming error to call this function when
1079    /// there is no next page.
1080    ///
1081    /// This function is for use when creating pages of the
1082    /// [`AssistantPageType::Custom`][crate::AssistantPageType::Custom] type.
1083    ///
1084    /// # Deprecated since 4.10
1085    ///
1086    /// This widget will be removed in GTK 5
1087    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1088    #[allow(deprecated)]
1089    #[doc(alias = "gtk_assistant_next_page")]
1090    pub fn next_page(&self) {
1091        unsafe {
1092            ffi::gtk_assistant_next_page(self.to_glib_none().0);
1093        }
1094    }
1095
1096    /// Prepends a page to the @self.
1097    ///
1098    /// # Deprecated since 4.10
1099    ///
1100    /// This widget will be removed in GTK 5
1101    /// ## `page`
1102    /// a [`Widget`][crate::Widget]
1103    ///
1104    /// # Returns
1105    ///
1106    /// the index (starting at 0) of the inserted page
1107    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1108    #[allow(deprecated)]
1109    #[doc(alias = "gtk_assistant_prepend_page")]
1110    pub fn prepend_page(&self, page: &impl IsA<Widget>) -> i32 {
1111        unsafe {
1112            ffi::gtk_assistant_prepend_page(self.to_glib_none().0, page.as_ref().to_glib_none().0)
1113        }
1114    }
1115
1116    /// Navigate to the previous visited page.
1117    ///
1118    /// It is a programming error to call this function when
1119    /// no previous page is available.
1120    ///
1121    /// This function is for use when creating pages of the
1122    /// [`AssistantPageType::Custom`][crate::AssistantPageType::Custom] type.
1123    ///
1124    /// # Deprecated since 4.10
1125    ///
1126    /// This widget will be removed in GTK 5
1127    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1128    #[allow(deprecated)]
1129    #[doc(alias = "gtk_assistant_previous_page")]
1130    pub fn previous_page(&self) {
1131        unsafe {
1132            ffi::gtk_assistant_previous_page(self.to_glib_none().0);
1133        }
1134    }
1135
1136    /// Removes a widget from the action area of a [`Assistant`][crate::Assistant].
1137    ///
1138    /// # Deprecated since 4.10
1139    ///
1140    /// This widget will be removed in GTK 5
1141    /// ## `child`
1142    /// a [`Widget`][crate::Widget]
1143    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1144    #[allow(deprecated)]
1145    #[doc(alias = "gtk_assistant_remove_action_widget")]
1146    pub fn remove_action_widget(&self, child: &impl IsA<Widget>) {
1147        unsafe {
1148            ffi::gtk_assistant_remove_action_widget(
1149                self.to_glib_none().0,
1150                child.as_ref().to_glib_none().0,
1151            );
1152        }
1153    }
1154
1155    /// s page from @self.
1156    ///
1157    /// # Deprecated since 4.10
1158    ///
1159    /// This widget will be removed in GTK 5
1160    /// ## `page_num`
1161    /// the index of a page in the @self,
1162    ///   or -1 to remove the last page
1163    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1164    #[allow(deprecated)]
1165    #[doc(alias = "gtk_assistant_remove_page")]
1166    pub fn remove_page(&self, page_num: i32) {
1167        unsafe {
1168            ffi::gtk_assistant_remove_page(self.to_glib_none().0, page_num);
1169        }
1170    }
1171
1172    /// Switches the page to @page_num.
1173    ///
1174    /// Note that this will only be necessary in custom buttons,
1175    /// as the @self flow can be set with
1176    /// gtk_assistant_set_forward_page_func().
1177    ///
1178    /// # Deprecated since 4.10
1179    ///
1180    /// This widget will be removed in GTK 5
1181    /// ## `page_num`
1182    /// index of the page to switch to, starting from 0.
1183    ///   If negative, the last page will be used. If greater
1184    ///   than the number of pages in the @self, nothing
1185    ///   will be done.
1186    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1187    #[allow(deprecated)]
1188    #[doc(alias = "gtk_assistant_set_current_page")]
1189    pub fn set_current_page(&self, page_num: i32) {
1190        unsafe {
1191            ffi::gtk_assistant_set_current_page(self.to_glib_none().0, page_num);
1192        }
1193    }
1194
1195    /// Sets the page forwarding function to be @page_func.
1196    ///
1197    /// This function will be used to determine what will be
1198    /// the next page when the user presses the forward button.
1199    /// Setting @page_func to [`None`] will make the assistant to
1200    /// use the default forward function, which just goes to the
1201    /// next visible page.
1202    ///
1203    /// # Deprecated since 4.10
1204    ///
1205    /// This widget will be removed in GTK 5
1206    /// ## `page_func`
1207    /// the `GtkAssistantPageFunc`, or [`None`]
1208    ///   to use the default one
1209    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1210    #[allow(deprecated)]
1211    #[doc(alias = "gtk_assistant_set_forward_page_func")]
1212    pub fn set_forward_page_func<P: Fn(i32) -> i32 + 'static>(&self, page_func: P) {
1213        let page_func_data: Box_<P> = Box_::new(page_func);
1214        unsafe extern "C" fn page_func_func<P: Fn(i32) -> i32 + 'static>(
1215            current_page: std::ffi::c_int,
1216            data: glib::ffi::gpointer,
1217        ) -> std::ffi::c_int {
1218            unsafe {
1219                let callback = &*(data as *mut P);
1220                (*callback)(current_page)
1221            }
1222        }
1223        let page_func = Some(page_func_func::<P> as _);
1224        unsafe extern "C" fn destroy_func<P: Fn(i32) -> i32 + 'static>(data: glib::ffi::gpointer) {
1225            unsafe {
1226                let _callback = Box_::from_raw(data as *mut P);
1227            }
1228        }
1229        let destroy_call3 = Some(destroy_func::<P> as _);
1230        let super_callback0: Box_<P> = page_func_data;
1231        unsafe {
1232            ffi::gtk_assistant_set_forward_page_func(
1233                self.to_glib_none().0,
1234                page_func,
1235                Box_::into_raw(super_callback0) as *mut _,
1236                destroy_call3,
1237            );
1238        }
1239    }
1240
1241    /// Sets whether @page contents are complete.
1242    ///
1243    /// This will make @self update the buttons state
1244    /// to be able to continue the task.
1245    ///
1246    /// # Deprecated since 4.10
1247    ///
1248    /// This widget will be removed in GTK 5
1249    /// ## `page`
1250    /// a page of @self
1251    /// ## `complete`
1252    /// the completeness status of the page
1253    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1254    #[allow(deprecated)]
1255    #[doc(alias = "gtk_assistant_set_page_complete")]
1256    pub fn set_page_complete(&self, page: &impl IsA<Widget>, complete: bool) {
1257        unsafe {
1258            ffi::gtk_assistant_set_page_complete(
1259                self.to_glib_none().0,
1260                page.as_ref().to_glib_none().0,
1261                complete.into_glib(),
1262            );
1263        }
1264    }
1265
1266    /// Sets a title for @page.
1267    ///
1268    /// The title is displayed in the header area of the assistant
1269    /// when @page is the current page.
1270    ///
1271    /// # Deprecated since 4.10
1272    ///
1273    /// This widget will be removed in GTK 5
1274    /// ## `page`
1275    /// a page of @self
1276    /// ## `title`
1277    /// the new title for @page
1278    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1279    #[allow(deprecated)]
1280    #[doc(alias = "gtk_assistant_set_page_title")]
1281    pub fn set_page_title(&self, page: &impl IsA<Widget>, title: &str) {
1282        unsafe {
1283            ffi::gtk_assistant_set_page_title(
1284                self.to_glib_none().0,
1285                page.as_ref().to_glib_none().0,
1286                title.to_glib_none().0,
1287            );
1288        }
1289    }
1290
1291    /// Sets the page type for @page.
1292    ///
1293    /// The page type determines the page behavior in the @self.
1294    ///
1295    /// # Deprecated since 4.10
1296    ///
1297    /// This widget will be removed in GTK 5
1298    /// ## `page`
1299    /// a page of @self
1300    /// ## `type_`
1301    /// the new type for @page
1302    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1303    #[allow(deprecated)]
1304    #[doc(alias = "gtk_assistant_set_page_type")]
1305    pub fn set_page_type(&self, page: &impl IsA<Widget>, type_: AssistantPageType) {
1306        unsafe {
1307            ffi::gtk_assistant_set_page_type(
1308                self.to_glib_none().0,
1309                page.as_ref().to_glib_none().0,
1310                type_.into_glib(),
1311            );
1312        }
1313    }
1314
1315    /// Forces @self to recompute the buttons state.
1316    ///
1317    /// GTK automatically takes care of this in most situations,
1318    /// e.g. when the user goes to a different page, or when the
1319    /// visibility or completeness of a page changes.
1320    ///
1321    /// One situation where it can be necessary to call this
1322    /// function is when changing a value on the current page
1323    /// affects the future page flow of the assistant.
1324    ///
1325    /// # Deprecated since 4.10
1326    ///
1327    /// This widget will be removed in GTK 5
1328    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1329    #[allow(deprecated)]
1330    #[doc(alias = "gtk_assistant_update_buttons_state")]
1331    pub fn update_buttons_state(&self) {
1332        unsafe {
1333            ffi::gtk_assistant_update_buttons_state(self.to_glib_none().0);
1334        }
1335    }
1336
1337    /// [`true`] if the assistant uses a [`HeaderBar`][crate::HeaderBar] for action buttons
1338    /// instead of the action-area.
1339    ///
1340    /// For technical reasons, this property is declared as an integer
1341    /// property, but you should only set it to [`true`] or [`false`].
1342    ///
1343    /// # Deprecated since 4.10
1344    ///
1345    /// This widget will be removed in GTK 5
1346    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1347    #[doc(alias = "use-header-bar")]
1348    pub fn use_header_bar(&self) -> i32 {
1349        ObjectExt::property(self, "use-header-bar")
1350    }
1351
1352    /// Emitted when the apply button is clicked.
1353    ///
1354    /// The default behavior of the [`Assistant`][crate::Assistant] is to switch to the page
1355    /// after the current page, unless the current page is the last one.
1356    ///
1357    /// A handler for the ::apply signal should carry out the actions for
1358    /// which the wizard has collected data. If the action takes a long time
1359    /// to complete, you might consider putting a page of type
1360    /// [`AssistantPageType::Progress`][crate::AssistantPageType::Progress] after the confirmation page and handle
1361    /// this operation within the [`prepare`][struct@crate::Assistant#prepare] signal of
1362    /// the progress page.
1363    ///
1364    /// # Deprecated since 4.10
1365    ///
1366    /// This widget will be removed in GTK 5
1367    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1368    #[doc(alias = "apply")]
1369    pub fn connect_apply<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1370        unsafe extern "C" fn apply_trampoline<F: Fn(&Assistant) + 'static>(
1371            this: *mut ffi::GtkAssistant,
1372            f: glib::ffi::gpointer,
1373        ) {
1374            unsafe {
1375                let f: &F = &*(f as *const F);
1376                f(&from_glib_borrow(this))
1377            }
1378        }
1379        unsafe {
1380            let f: Box_<F> = Box_::new(f);
1381            connect_raw(
1382                self.as_ptr() as *mut _,
1383                c"apply".as_ptr(),
1384                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1385                    apply_trampoline::<F> as *const (),
1386                )),
1387                Box_::into_raw(f),
1388            )
1389        }
1390    }
1391
1392    /// Emitted when then the cancel button is clicked.
1393    ///
1394    /// # Deprecated since 4.10
1395    ///
1396    /// This widget will be removed in GTK 5
1397    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1398    #[doc(alias = "cancel")]
1399    pub fn connect_cancel<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1400        unsafe extern "C" fn cancel_trampoline<F: Fn(&Assistant) + 'static>(
1401            this: *mut ffi::GtkAssistant,
1402            f: glib::ffi::gpointer,
1403        ) {
1404            unsafe {
1405                let f: &F = &*(f as *const F);
1406                f(&from_glib_borrow(this))
1407            }
1408        }
1409        unsafe {
1410            let f: Box_<F> = Box_::new(f);
1411            connect_raw(
1412                self.as_ptr() as *mut _,
1413                c"cancel".as_ptr(),
1414                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1415                    cancel_trampoline::<F> as *const (),
1416                )),
1417                Box_::into_raw(f),
1418            )
1419        }
1420    }
1421
1422    /// Emitted either when the close button of a summary page is clicked,
1423    /// or when the apply button in the last page in the flow (of type
1424    /// [`AssistantPageType::Confirm`][crate::AssistantPageType::Confirm]) is clicked.
1425    ///
1426    /// # Deprecated since 4.10
1427    ///
1428    /// This widget will be removed in GTK 5
1429    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1430    #[doc(alias = "close")]
1431    pub fn connect_close<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1432        unsafe extern "C" fn close_trampoline<F: Fn(&Assistant) + 'static>(
1433            this: *mut ffi::GtkAssistant,
1434            f: glib::ffi::gpointer,
1435        ) {
1436            unsafe {
1437                let f: &F = &*(f as *const F);
1438                f(&from_glib_borrow(this))
1439            }
1440        }
1441        unsafe {
1442            let f: Box_<F> = Box_::new(f);
1443            connect_raw(
1444                self.as_ptr() as *mut _,
1445                c"close".as_ptr(),
1446                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1447                    close_trampoline::<F> as *const (),
1448                )),
1449                Box_::into_raw(f),
1450            )
1451        }
1452    }
1453
1454    /// The action signal for the Escape binding.
1455    ///
1456    /// # Deprecated since 4.10
1457    ///
1458    /// This widget will be removed in GTK 5
1459    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1460    #[doc(alias = "escape")]
1461    pub fn connect_escape<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1462        unsafe extern "C" fn escape_trampoline<F: Fn(&Assistant) + 'static>(
1463            this: *mut ffi::GtkAssistant,
1464            f: glib::ffi::gpointer,
1465        ) {
1466            unsafe {
1467                let f: &F = &*(f as *const F);
1468                f(&from_glib_borrow(this))
1469            }
1470        }
1471        unsafe {
1472            let f: Box_<F> = Box_::new(f);
1473            connect_raw(
1474                self.as_ptr() as *mut _,
1475                c"escape".as_ptr(),
1476                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1477                    escape_trampoline::<F> as *const (),
1478                )),
1479                Box_::into_raw(f),
1480            )
1481        }
1482    }
1483
1484    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1485    pub fn emit_escape(&self) {
1486        self.emit_by_name::<()>("escape", &[]);
1487    }
1488
1489    /// Emitted when a new page is set as the assistant's current page,
1490    /// before making the new page visible.
1491    ///
1492    /// A handler for this signal can do any preparations which are
1493    /// necessary before showing @page.
1494    ///
1495    /// # Deprecated since 4.10
1496    ///
1497    /// This widget will be removed in GTK 5
1498    /// ## `page`
1499    /// the current page
1500    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1501    #[doc(alias = "prepare")]
1502    pub fn connect_prepare<F: Fn(&Self, &Widget) + 'static>(&self, f: F) -> SignalHandlerId {
1503        unsafe extern "C" fn prepare_trampoline<F: Fn(&Assistant, &Widget) + 'static>(
1504            this: *mut ffi::GtkAssistant,
1505            page: *mut ffi::GtkWidget,
1506            f: glib::ffi::gpointer,
1507        ) {
1508            unsafe {
1509                let f: &F = &*(f as *const F);
1510                f(&from_glib_borrow(this), &from_glib_borrow(page))
1511            }
1512        }
1513        unsafe {
1514            let f: Box_<F> = Box_::new(f);
1515            connect_raw(
1516                self.as_ptr() as *mut _,
1517                c"prepare".as_ptr(),
1518                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1519                    prepare_trampoline::<F> as *const (),
1520                )),
1521                Box_::into_raw(f),
1522            )
1523        }
1524    }
1525
1526    #[doc(alias = "pages")]
1527    pub fn connect_pages_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1528        unsafe extern "C" fn notify_pages_trampoline<F: Fn(&Assistant) + 'static>(
1529            this: *mut ffi::GtkAssistant,
1530            _param_spec: glib::ffi::gpointer,
1531            f: glib::ffi::gpointer,
1532        ) {
1533            unsafe {
1534                let f: &F = &*(f as *const F);
1535                f(&from_glib_borrow(this))
1536            }
1537        }
1538        unsafe {
1539            let f: Box_<F> = Box_::new(f);
1540            connect_raw(
1541                self.as_ptr() as *mut _,
1542                c"notify::pages".as_ptr(),
1543                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1544                    notify_pages_trampoline::<F> as *const (),
1545                )),
1546                Box_::into_raw(f),
1547            )
1548        }
1549    }
1550}
1551
1552impl Default for Assistant {
1553    fn default() -> Self {
1554        Self::new()
1555    }
1556}
1557
1558// rustdoc-stripper-ignore-next
1559/// A [builder-pattern] type to construct [`Assistant`] objects.
1560///
1561/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
1562#[must_use = "The builder must be built to be used"]
1563pub struct AssistantBuilder {
1564    builder: glib::object::ObjectBuilder<'static, Assistant>,
1565}
1566
1567impl AssistantBuilder {
1568    fn new() -> Self {
1569        Self {
1570            builder: glib::object::Object::builder(),
1571        }
1572    }
1573
1574    /// [`true`] if the assistant uses a [`HeaderBar`][crate::HeaderBar] for action buttons
1575    /// instead of the action-area.
1576    ///
1577    /// For technical reasons, this property is declared as an integer
1578    /// property, but you should only set it to [`true`] or [`false`].
1579    /// This widget will be removed in GTK 5
1580    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1581    pub fn use_header_bar(self, use_header_bar: i32) -> Self {
1582        Self {
1583            builder: self.builder.property("use-header-bar", use_header_bar),
1584        }
1585    }
1586
1587    /// The [`Application`][crate::Application] associated with the window.
1588    ///
1589    /// The application will be kept alive for at least as long as it
1590    /// has any windows associated with it (see g_application_hold()
1591    /// for a way to keep it alive without windows).
1592    ///
1593    /// Normally, the connection between the application and the window
1594    /// will remain until the window is destroyed, but you can explicitly
1595    /// remove it by setting the this property to `NULL`.
1596    pub fn application(self, application: &impl IsA<Application>) -> Self {
1597        Self {
1598            builder: self
1599                .builder
1600                .property("application", application.clone().upcast()),
1601        }
1602    }
1603
1604    /// The child widget.
1605    pub fn child(self, child: &impl IsA<Widget>) -> Self {
1606        Self {
1607            builder: self.builder.property("child", child.clone().upcast()),
1608        }
1609    }
1610
1611    /// Whether the window should have a frame (also known as *decorations*).
1612    pub fn decorated(self, decorated: bool) -> Self {
1613        Self {
1614            builder: self.builder.property("decorated", decorated),
1615        }
1616    }
1617
1618    /// The default height of the window.
1619    pub fn default_height(self, default_height: i32) -> Self {
1620        Self {
1621            builder: self.builder.property("default-height", default_height),
1622        }
1623    }
1624
1625    /// The default widget.
1626    pub fn default_widget(self, default_widget: &impl IsA<Widget>) -> Self {
1627        Self {
1628            builder: self
1629                .builder
1630                .property("default-widget", default_widget.clone().upcast()),
1631        }
1632    }
1633
1634    /// The default width of the window.
1635    pub fn default_width(self, default_width: i32) -> Self {
1636        Self {
1637            builder: self.builder.property("default-width", default_width),
1638        }
1639    }
1640
1641    /// Whether the window frame should have a close button.
1642    pub fn deletable(self, deletable: bool) -> Self {
1643        Self {
1644            builder: self.builder.property("deletable", deletable),
1645        }
1646    }
1647
1648    /// If this window should be destroyed when the parent is destroyed.
1649    pub fn destroy_with_parent(self, destroy_with_parent: bool) -> Self {
1650        Self {
1651            builder: self
1652                .builder
1653                .property("destroy-with-parent", destroy_with_parent),
1654        }
1655    }
1656
1657    /// The display that will display this window.
1658    pub fn display(self, display: &impl IsA<gdk::Display>) -> Self {
1659        Self {
1660            builder: self.builder.property("display", display.clone().upcast()),
1661        }
1662    }
1663
1664    /// Whether 'focus rectangles' are currently visible in this window.
1665    ///
1666    /// This property is maintained by GTK based on user input
1667    /// and should not be set by applications.
1668    pub fn focus_visible(self, focus_visible: bool) -> Self {
1669        Self {
1670            builder: self.builder.property("focus-visible", focus_visible),
1671        }
1672    }
1673
1674    /// The focus widget.
1675    pub fn focus_widget(self, focus_widget: &impl IsA<Widget>) -> Self {
1676        Self {
1677            builder: self
1678                .builder
1679                .property("focus-widget", focus_widget.clone().upcast()),
1680        }
1681    }
1682
1683    /// Whether the window is fullscreen.
1684    ///
1685    /// Setting this property is the equivalent of calling
1686    /// [`GtkWindowExt::fullscreen()`][crate::prelude::GtkWindowExt::fullscreen()] or [`GtkWindowExt::unfullscreen()`][crate::prelude::GtkWindowExt::unfullscreen()];
1687    /// either operation is asynchronous, which means you will need to
1688    /// connect to the ::notify signal in order to know whether the
1689    /// operation was successful.
1690    pub fn fullscreened(self, fullscreened: bool) -> Self {
1691        Self {
1692            builder: self.builder.property("fullscreened", fullscreened),
1693        }
1694    }
1695
1696    /// The gravity to use when resizing the window programmatically.
1697    ///
1698    /// Gravity describes which point of the window we want to keep
1699    /// fixed (meaning that the window will grow in the opposite direction).
1700    /// For example, a gravity of `GTK_WINDOW_GRAVITY_TOP_RIGHT` means that we
1701    /// want the to fix top right corner of the window.
1702    #[cfg(feature = "v4_20")]
1703    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
1704    pub fn gravity(self, gravity: WindowGravity) -> Self {
1705        Self {
1706            builder: self.builder.property("gravity", gravity),
1707        }
1708    }
1709
1710    ///  for activating
1711    /// menubars.
1712    #[cfg(feature = "v4_2")]
1713    #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))]
1714    pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self {
1715        Self {
1716            builder: self
1717                .builder
1718                .property("handle-menubar-accel", handle_menubar_accel),
1719        }
1720    }
1721
1722    /// If this window should be hidden instead of destroyed when the user clicks
1723    /// the close button.
1724    pub fn hide_on_close(self, hide_on_close: bool) -> Self {
1725        Self {
1726            builder: self.builder.property("hide-on-close", hide_on_close),
1727        }
1728    }
1729
1730    /// Specifies the name of the themed icon to use as the window icon.
1731    ///
1732    /// See [`IconTheme`][crate::IconTheme] for more details.
1733    pub fn icon_name(self, icon_name: impl Into<glib::GString>) -> Self {
1734        Self {
1735            builder: self.builder.property("icon-name", icon_name.into()),
1736        }
1737    }
1738
1739    /// Whether the window is maximized.
1740    ///
1741    /// Setting this property is the equivalent of calling
1742    /// [`GtkWindowExt::maximize()`][crate::prelude::GtkWindowExt::maximize()] or [`GtkWindowExt::unmaximize()`][crate::prelude::GtkWindowExt::unmaximize()];
1743    /// either operation is asynchronous, which means you will need to
1744    /// connect to the ::notify signal in order to know whether the
1745    /// operation was successful.
1746    pub fn maximized(self, maximized: bool) -> Self {
1747        Self {
1748            builder: self.builder.property("maximized", maximized),
1749        }
1750    }
1751
1752    /// Whether mnemonics are currently visible in this window.
1753    ///
1754    /// This property is maintained by GTK based on user input,
1755    /// and should not be set by applications.
1756    pub fn mnemonics_visible(self, mnemonics_visible: bool) -> Self {
1757        Self {
1758            builder: self
1759                .builder
1760                .property("mnemonics-visible", mnemonics_visible),
1761        }
1762    }
1763
1764    /// If true, the window is modal.
1765    pub fn modal(self, modal: bool) -> Self {
1766        Self {
1767            builder: self.builder.property("modal", modal),
1768        }
1769    }
1770
1771    /// If true, users can resize the window.
1772    pub fn resizable(self, resizable: bool) -> Self {
1773        Self {
1774            builder: self.builder.property("resizable", resizable),
1775        }
1776    }
1777
1778    /// A write-only property for setting window's startup notification identifier.
1779    pub fn startup_id(self, startup_id: impl Into<glib::GString>) -> Self {
1780        Self {
1781            builder: self.builder.property("startup-id", startup_id.into()),
1782        }
1783    }
1784
1785    /// The title of the window.
1786    pub fn title(self, title: impl Into<glib::GString>) -> Self {
1787        Self {
1788            builder: self.builder.property("title", title.into()),
1789        }
1790    }
1791
1792    /// The titlebar widget.
1793    #[cfg(feature = "v4_6")]
1794    #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
1795    pub fn titlebar(self, titlebar: &impl IsA<Widget>) -> Self {
1796        Self {
1797            builder: self.builder.property("titlebar", titlebar.clone().upcast()),
1798        }
1799    }
1800
1801    /// The transient parent of the window.
1802    pub fn transient_for(self, transient_for: &impl IsA<Window>) -> Self {
1803        Self {
1804            builder: self
1805                .builder
1806                .property("transient-for", transient_for.clone().upcast()),
1807        }
1808    }
1809
1810    /// Whether the widget or any of its descendents can accept
1811    /// the input focus.
1812    ///
1813    /// This property is meant to be set by widget implementations,
1814    /// typically in their instance init function.
1815    pub fn can_focus(self, can_focus: bool) -> Self {
1816        Self {
1817            builder: self.builder.property("can-focus", can_focus),
1818        }
1819    }
1820
1821    /// Whether the widget can receive pointer events.
1822    pub fn can_target(self, can_target: bool) -> Self {
1823        Self {
1824            builder: self.builder.property("can-target", can_target),
1825        }
1826    }
1827
1828    /// A list of css classes applied to this widget.
1829    pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
1830        Self {
1831            builder: self.builder.property("css-classes", css_classes.into()),
1832        }
1833    }
1834
1835    /// The name of this widget in the CSS tree.
1836    ///
1837    /// This property is meant to be set by widget implementations,
1838    /// typically in their instance init function.
1839    pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
1840        Self {
1841            builder: self.builder.property("css-name", css_name.into()),
1842        }
1843    }
1844
1845    /// The cursor used by @widget.
1846    pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
1847        Self {
1848            builder: self.builder.property("cursor", cursor.clone()),
1849        }
1850    }
1851
1852    /// Whether the widget should grab focus when it is clicked with the mouse.
1853    ///
1854    /// This property is only relevant for widgets that can take focus.
1855    pub fn focus_on_click(self, focus_on_click: bool) -> Self {
1856        Self {
1857            builder: self.builder.property("focus-on-click", focus_on_click),
1858        }
1859    }
1860
1861    /// Whether this widget itself will accept the input focus.
1862    pub fn focusable(self, focusable: bool) -> Self {
1863        Self {
1864            builder: self.builder.property("focusable", focusable),
1865        }
1866    }
1867
1868    /// How to distribute horizontal space if widget gets extra space.
1869    pub fn halign(self, halign: Align) -> Self {
1870        Self {
1871            builder: self.builder.property("halign", halign),
1872        }
1873    }
1874
1875    /// Enables or disables the emission of the [`query-tooltip`][struct@crate::Widget#query-tooltip]
1876    /// signal on @widget.
1877    ///
1878    /// A true value indicates that @widget can have a tooltip, in this case
1879    /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to
1880    /// determine whether it will provide a tooltip or not.
1881    pub fn has_tooltip(self, has_tooltip: bool) -> Self {
1882        Self {
1883            builder: self.builder.property("has-tooltip", has_tooltip),
1884        }
1885    }
1886
1887    /// Overrides for height request of the widget.
1888    ///
1889    /// If this is -1, the natural request will be used.
1890    pub fn height_request(self, height_request: i32) -> Self {
1891        Self {
1892            builder: self.builder.property("height-request", height_request),
1893        }
1894    }
1895
1896    /// Whether to expand horizontally.
1897    pub fn hexpand(self, hexpand: bool) -> Self {
1898        Self {
1899            builder: self.builder.property("hexpand", hexpand),
1900        }
1901    }
1902
1903    /// Whether to use the `hexpand` property.
1904    pub fn hexpand_set(self, hexpand_set: bool) -> Self {
1905        Self {
1906            builder: self.builder.property("hexpand-set", hexpand_set),
1907        }
1908    }
1909
1910    /// The [`LayoutManager`][crate::LayoutManager] instance to use to compute
1911    /// the preferred size of the widget, and allocate its children.
1912    ///
1913    /// This property is meant to be set by widget implementations,
1914    /// typically in their instance init function.
1915    pub fn layout_manager(self, layout_manager: &impl IsA<LayoutManager>) -> Self {
1916        Self {
1917            builder: self
1918                .builder
1919                .property("layout-manager", layout_manager.clone().upcast()),
1920        }
1921    }
1922
1923    /// Makes this widget act like a modal dialog, with respect to
1924    /// event delivery.
1925    ///
1926    /// Global event controllers will not handle events with targets
1927    /// inside the widget, unless they are set up to ignore propagation
1928    /// limits. See [`EventControllerExt::set_propagation_limit()`][crate::prelude::EventControllerExt::set_propagation_limit()].
1929    #[cfg(feature = "v4_18")]
1930    #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
1931    pub fn limit_events(self, limit_events: bool) -> Self {
1932        Self {
1933            builder: self.builder.property("limit-events", limit_events),
1934        }
1935    }
1936
1937    /// Margin on bottom side of widget.
1938    ///
1939    /// This property adds margin outside of the widget's normal size
1940    /// request, the margin will be added in addition to the size from
1941    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1942    pub fn margin_bottom(self, margin_bottom: i32) -> Self {
1943        Self {
1944            builder: self.builder.property("margin-bottom", margin_bottom),
1945        }
1946    }
1947
1948    /// Margin on end of widget, horizontally.
1949    ///
1950    /// This property supports left-to-right and right-to-left text
1951    /// directions.
1952    ///
1953    /// This property adds margin outside of the widget's normal size
1954    /// request, the margin will be added in addition to the size from
1955    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1956    pub fn margin_end(self, margin_end: i32) -> Self {
1957        Self {
1958            builder: self.builder.property("margin-end", margin_end),
1959        }
1960    }
1961
1962    /// Margin on start of widget, horizontally.
1963    ///
1964    /// This property supports left-to-right and right-to-left text
1965    /// directions.
1966    ///
1967    /// This property adds margin outside of the widget's normal size
1968    /// request, the margin will be added in addition to the size from
1969    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1970    pub fn margin_start(self, margin_start: i32) -> Self {
1971        Self {
1972            builder: self.builder.property("margin-start", margin_start),
1973        }
1974    }
1975
1976    /// Margin on top side of widget.
1977    ///
1978    /// This property adds margin outside of the widget's normal size
1979    /// request, the margin will be added in addition to the size from
1980    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1981    pub fn margin_top(self, margin_top: i32) -> Self {
1982        Self {
1983            builder: self.builder.property("margin-top", margin_top),
1984        }
1985    }
1986
1987    /// The name of the widget.
1988    pub fn name(self, name: impl Into<glib::GString>) -> Self {
1989        Self {
1990            builder: self.builder.property("name", name.into()),
1991        }
1992    }
1993
1994    /// The requested opacity of the widget.
1995    pub fn opacity(self, opacity: f64) -> Self {
1996        Self {
1997            builder: self.builder.property("opacity", opacity),
1998        }
1999    }
2000
2001    /// How content outside the widget's content area is treated.
2002    ///
2003    /// This property is meant to be set by widget implementations,
2004    /// typically in their instance init function.
2005    pub fn overflow(self, overflow: Overflow) -> Self {
2006        Self {
2007            builder: self.builder.property("overflow", overflow),
2008        }
2009    }
2010
2011    /// Whether the widget will receive the default action when it is focused.
2012    pub fn receives_default(self, receives_default: bool) -> Self {
2013        Self {
2014            builder: self.builder.property("receives-default", receives_default),
2015        }
2016    }
2017
2018    /// Whether the widget responds to input.
2019    pub fn sensitive(self, sensitive: bool) -> Self {
2020        Self {
2021            builder: self.builder.property("sensitive", sensitive),
2022        }
2023    }
2024
2025    /// Sets the text of tooltip to be the given string, which is marked up
2026    /// with Pango markup.
2027    ///
2028    /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
2029    ///
2030    /// This is a convenience property which will take care of getting the
2031    /// tooltip shown if the given string is not `NULL`:
2032    /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
2033    /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
2034    /// the default signal handler.
2035    ///
2036    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
2037    /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
2038    pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
2039        Self {
2040            builder: self
2041                .builder
2042                .property("tooltip-markup", tooltip_markup.into()),
2043        }
2044    }
2045
2046    /// Sets the text of tooltip to be the given string.
2047    ///
2048    /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
2049    ///
2050    /// This is a convenience property which will take care of getting the
2051    /// tooltip shown if the given string is not `NULL`:
2052    /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
2053    /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
2054    /// the default signal handler.
2055    ///
2056    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
2057    /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
2058    pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
2059        Self {
2060            builder: self.builder.property("tooltip-text", tooltip_text.into()),
2061        }
2062    }
2063
2064    /// How to distribute vertical space if widget gets extra space.
2065    pub fn valign(self, valign: Align) -> Self {
2066        Self {
2067            builder: self.builder.property("valign", valign),
2068        }
2069    }
2070
2071    /// Whether to expand vertically.
2072    pub fn vexpand(self, vexpand: bool) -> Self {
2073        Self {
2074            builder: self.builder.property("vexpand", vexpand),
2075        }
2076    }
2077
2078    /// Whether to use the `vexpand` property.
2079    pub fn vexpand_set(self, vexpand_set: bool) -> Self {
2080        Self {
2081            builder: self.builder.property("vexpand-set", vexpand_set),
2082        }
2083    }
2084
2085    /// Whether the widget is visible.
2086    pub fn visible(self, visible: bool) -> Self {
2087        Self {
2088            builder: self.builder.property("visible", visible),
2089        }
2090    }
2091
2092    /// Overrides for width request of the widget.
2093    ///
2094    /// If this is -1, the natural request will be used.
2095    pub fn width_request(self, width_request: i32) -> Self {
2096        Self {
2097            builder: self.builder.property("width-request", width_request),
2098        }
2099    }
2100
2101    /// The accessible role of the given [`Accessible`][crate::Accessible] implementation.
2102    ///
2103    /// The accessible role cannot be changed once set.
2104    pub fn accessible_role(self, accessible_role: AccessibleRole) -> Self {
2105        Self {
2106            builder: self.builder.property("accessible-role", accessible_role),
2107        }
2108    }
2109
2110    // rustdoc-stripper-ignore-next
2111    /// Build the [`Assistant`].
2112    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
2113    pub fn build(self) -> Assistant {
2114        assert_initialized_main_thread!();
2115        self.builder.build()
2116    }
2117}