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