gtk4/auto/
info_bar.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, Buildable, Button, ConstraintTarget, LayoutManager,
8    MessageType, Overflow, ResponseType, Widget,
9};
10use glib::{
11    object::ObjectType as _,
12    prelude::*,
13    signal::{connect_raw, SignalHandlerId},
14    translate::*,
15};
16use std::boxed::Box as Box_;
17
18glib::wrapper! {
19    /// There is no replacement in GTK for an "info bar" widget;
20    ///   you can use [`Revealer`][crate::Revealer] with a [`Box`][crate::Box] containing a
21    ///   [`Label`][crate::Label] and an optional [`Button`][crate::Button], according to
22    ///   your application's design.
23    /// [`InfoBar`][crate::InfoBar] can be used to show messages to the user without a dialog.
24    ///
25    /// ![An example GtkInfoBar](info-bar.png)
26    ///
27    /// It is often temporarily shown at the top or bottom of a document.
28    /// In contrast to [`Dialog`][crate::Dialog], which has an action area at the
29    /// bottom, [`InfoBar`][crate::InfoBar] has an action area at the side.
30    ///
31    /// The API of [`InfoBar`][crate::InfoBar] is very similar to [`Dialog`][crate::Dialog], allowing you
32    /// to add buttons to the action area with [`add_button()`][Self::add_button()]
33    /// or [`with_buttons()`][Self::with_buttons()]. The sensitivity of action widgets
34    /// can be controlled with [`set_response_sensitive()`][Self::set_response_sensitive()].
35    ///
36    /// To add widgets to the main content area of a [`InfoBar`][crate::InfoBar], use
37    /// [`add_child()`][Self::add_child()].
38    ///
39    /// Similar to [`MessageDialog`][crate::MessageDialog], the contents of a [`InfoBar`][crate::InfoBar]
40    /// can by classified as error message, warning, informational message, etc,
41    /// by using [`set_message_type()`][Self::set_message_type()]. GTK may use the message
42    /// type to determine how the message is displayed.
43    ///
44    /// A simple example for using a [`InfoBar`][crate::InfoBar]:
45    /// **⚠️ The following code is in c ⚠️**
46    ///
47    /// ```c
48    /// GtkWidget *message_label;
49    /// GtkWidget *widget;
50    /// GtkWidget *grid;
51    /// GtkInfoBar *bar;
52    ///
53    /// // set up info bar
54    /// widget = gtk_info_bar_new ();
55    /// bar = GTK_INFO_BAR (widget);
56    /// grid = gtk_grid_new ();
57    ///
58    /// message_label = gtk_label_new ("");
59    /// gtk_info_bar_add_child (bar, message_label);
60    /// gtk_info_bar_add_button (bar,
61    ///                          _("_OK"),
62    ///                          GTK_RESPONSE_OK);
63    /// g_signal_connect (bar,
64    ///                   "response",
65    ///                   G_CALLBACK (gtk_widget_hide),
66    ///                   NULL);
67    /// gtk_grid_attach (GTK_GRID (grid),
68    ///                  widget,
69    ///                  0, 2, 1, 1);
70    ///
71    /// // ...
72    ///
73    /// // show an error message
74    /// gtk_label_set_text (GTK_LABEL (message_label), "An error occurred!");
75    /// gtk_info_bar_set_message_type (bar, GTK_MESSAGE_ERROR);
76    /// gtk_widget_show (bar);
77    /// ```
78    ///
79    /// # GtkInfoBar as GtkBuildable
80    ///
81    /// [`InfoBar`][crate::InfoBar] supports a custom `<action-widgets>` element, which can contain
82    /// multiple `<action-widget>` elements. The “response” attribute specifies a
83    /// numeric response, and the content of the element is the id of widget
84    /// (which should be a child of the dialogs @action_area).
85    ///
86    /// [`InfoBar`][crate::InfoBar] supports adding action widgets by specifying “action” as
87    /// the “type” attribute of a `<child>` element. The widget will be added
88    /// either to the action area. The response id has to be associated
89    /// with the action widget using the `<action-widgets>` element.
90    ///
91    /// # CSS nodes
92    ///
93    /// [`InfoBar`][crate::InfoBar] has a single CSS node with name infobar. The node may get
94    /// one of the style classes .info, .warning, .error or .question, depending
95    /// on the message type.
96    /// If the info bar shows a close button, that button will have the .close
97    /// style class applied.
98    ///
99    /// ## Properties
100    ///
101    ///
102    /// #### `message-type`
103    ///  The type of the message.
104    ///
105    /// The type may be used to determine the appearance of the info bar.
106    ///
107    /// Readable | Writeable | Construct
108    ///
109    ///
110    /// #### `revealed`
111    ///  Whether the info bar shows its contents.
112    ///
113    /// Readable | Writeable
114    ///
115    ///
116    /// #### `show-close-button`
117    ///  Whether to include a standard close button.
118    ///
119    /// Readable | Writeable | Construct
120    /// <details><summary><h4>Widget</h4></summary>
121    ///
122    ///
123    /// #### `can-focus`
124    ///  Whether the widget or any of its descendents can accept
125    /// the input focus.
126    ///
127    /// This property is meant to be set by widget implementations,
128    /// typically in their instance init function.
129    ///
130    /// Readable | Writeable
131    ///
132    ///
133    /// #### `can-target`
134    ///  Whether the widget can receive pointer events.
135    ///
136    /// Readable | Writeable
137    ///
138    ///
139    /// #### `css-classes`
140    ///  A list of css classes applied to this widget.
141    ///
142    /// Readable | Writeable
143    ///
144    ///
145    /// #### `css-name`
146    ///  The name of this widget in the CSS tree.
147    ///
148    /// This property is meant to be set by widget implementations,
149    /// typically in their instance init function.
150    ///
151    /// Readable | Writeable | Construct Only
152    ///
153    ///
154    /// #### `cursor`
155    ///  The cursor used by @widget.
156    ///
157    /// Readable | Writeable
158    ///
159    ///
160    /// #### `focus-on-click`
161    ///  Whether the widget should grab focus when it is clicked with the mouse.
162    ///
163    /// This property is only relevant for widgets that can take focus.
164    ///
165    /// Readable | Writeable
166    ///
167    ///
168    /// #### `focusable`
169    ///  Whether this widget itself will accept the input focus.
170    ///
171    /// Readable | Writeable
172    ///
173    ///
174    /// #### `halign`
175    ///  How to distribute horizontal space if widget gets extra space.
176    ///
177    /// Readable | Writeable
178    ///
179    ///
180    /// #### `has-default`
181    ///  Whether the widget is the default widget.
182    ///
183    /// Readable
184    ///
185    ///
186    /// #### `has-focus`
187    ///  Whether the widget has the input focus.
188    ///
189    /// Readable
190    ///
191    ///
192    /// #### `has-tooltip`
193    ///  Enables or disables the emission of the [`query-tooltip`][struct@crate::Widget#query-tooltip]
194    /// signal on @widget.
195    ///
196    /// A true value indicates that @widget can have a tooltip, in this case
197    /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to
198    /// determine whether it will provide a tooltip or not.
199    ///
200    /// Readable | Writeable
201    ///
202    ///
203    /// #### `height-request`
204    ///  Overrides for height request of the widget.
205    ///
206    /// If this is -1, the natural request will be used.
207    ///
208    /// Readable | Writeable
209    ///
210    ///
211    /// #### `hexpand`
212    ///  Whether to expand horizontally.
213    ///
214    /// Readable | Writeable
215    ///
216    ///
217    /// #### `hexpand-set`
218    ///  Whether to use the `hexpand` property.
219    ///
220    /// Readable | Writeable
221    ///
222    ///
223    /// #### `layout-manager`
224    ///  The [`LayoutManager`][crate::LayoutManager] instance to use to compute
225    /// the preferred size of the widget, and allocate its children.
226    ///
227    /// This property is meant to be set by widget implementations,
228    /// typically in their instance init function.
229    ///
230    /// Readable | Writeable
231    ///
232    ///
233    /// #### `limit-events`
234    ///  Makes this widget act like a modal dialog, with respect to
235    /// event delivery.
236    ///
237    /// Global event controllers will not handle events with targets
238    /// inside the widget, unless they are set up to ignore propagation
239    /// limits. See [`EventControllerExt::set_propagation_limit()`][crate::prelude::EventControllerExt::set_propagation_limit()].
240    ///
241    /// Readable | Writeable
242    ///
243    ///
244    /// #### `margin-bottom`
245    ///  Margin on bottom side of widget.
246    ///
247    /// This property adds margin outside of the widget's normal size
248    /// request, the margin will be added in addition to the size from
249    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
250    ///
251    /// Readable | Writeable
252    ///
253    ///
254    /// #### `margin-end`
255    ///  Margin on end of widget, horizontally.
256    ///
257    /// This property supports left-to-right and right-to-left text
258    /// directions.
259    ///
260    /// This property adds margin outside of the widget's normal size
261    /// request, the margin will be added in addition to the size from
262    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
263    ///
264    /// Readable | Writeable
265    ///
266    ///
267    /// #### `margin-start`
268    ///  Margin on start of widget, horizontally.
269    ///
270    /// This property supports left-to-right and right-to-left text
271    /// directions.
272    ///
273    /// This property adds margin outside of the widget's normal size
274    /// request, the margin will be added in addition to the size from
275    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
276    ///
277    /// Readable | Writeable
278    ///
279    ///
280    /// #### `margin-top`
281    ///  Margin on top side of widget.
282    ///
283    /// This property adds margin outside of the widget's normal size
284    /// request, the margin will be added in addition to the size from
285    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
286    ///
287    /// Readable | Writeable
288    ///
289    ///
290    /// #### `name`
291    ///  The name of the widget.
292    ///
293    /// Readable | Writeable
294    ///
295    ///
296    /// #### `opacity`
297    ///  The requested opacity of the widget.
298    ///
299    /// Readable | Writeable
300    ///
301    ///
302    /// #### `overflow`
303    ///  How content outside the widget's content area is treated.
304    ///
305    /// This property is meant to be set by widget implementations,
306    /// typically in their instance init function.
307    ///
308    /// Readable | Writeable
309    ///
310    ///
311    /// #### `parent`
312    ///  The parent widget of this widget.
313    ///
314    /// Readable
315    ///
316    ///
317    /// #### `receives-default`
318    ///  Whether the widget will receive the default action when it is focused.
319    ///
320    /// Readable | Writeable
321    ///
322    ///
323    /// #### `root`
324    ///  The [`Root`][crate::Root] widget of the widget tree containing this widget.
325    ///
326    /// This will be `NULL` if the widget is not contained in a root widget.
327    ///
328    /// Readable
329    ///
330    ///
331    /// #### `scale-factor`
332    ///  The scale factor of the widget.
333    ///
334    /// Readable
335    ///
336    ///
337    /// #### `sensitive`
338    ///  Whether the widget responds to input.
339    ///
340    /// Readable | Writeable
341    ///
342    ///
343    /// #### `tooltip-markup`
344    ///  Sets the text of tooltip to be the given string, which is marked up
345    /// with Pango markup.
346    ///
347    /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
348    ///
349    /// This is a convenience property which will take care of getting the
350    /// tooltip shown if the given string is not `NULL`:
351    /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
352    /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
353    /// the default signal handler.
354    ///
355    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
356    /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
357    ///
358    /// Readable | Writeable
359    ///
360    ///
361    /// #### `tooltip-text`
362    ///  Sets the text of tooltip to be the given string.
363    ///
364    /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
365    ///
366    /// This is a convenience property which will take care of getting the
367    /// tooltip shown if the given string is not `NULL`:
368    /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
369    /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
370    /// the default signal handler.
371    ///
372    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
373    /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
374    ///
375    /// Readable | Writeable
376    ///
377    ///
378    /// #### `valign`
379    ///  How to distribute vertical space if widget gets extra space.
380    ///
381    /// Readable | Writeable
382    ///
383    ///
384    /// #### `vexpand`
385    ///  Whether to expand vertically.
386    ///
387    /// Readable | Writeable
388    ///
389    ///
390    /// #### `vexpand-set`
391    ///  Whether to use the `vexpand` property.
392    ///
393    /// Readable | Writeable
394    ///
395    ///
396    /// #### `visible`
397    ///  Whether the widget is visible.
398    ///
399    /// Readable | Writeable
400    ///
401    ///
402    /// #### `width-request`
403    ///  Overrides for width request of the widget.
404    ///
405    /// If this is -1, the natural request will be used.
406    ///
407    /// Readable | Writeable
408    /// </details>
409    /// <details><summary><h4>Accessible</h4></summary>
410    ///
411    ///
412    /// #### `accessible-role`
413    ///  The accessible role of the given [`Accessible`][crate::Accessible] implementation.
414    ///
415    /// The accessible role cannot be changed once set.
416    ///
417    /// Readable | Writeable
418    /// </details>
419    ///
420    /// ## Signals
421    ///
422    ///
423    /// #### `close`
424    ///  Gets emitted when the user uses a keybinding to dismiss the info bar.
425    ///
426    /// The ::close signal is a [keybinding signal](class.SignalAction.html).
427    ///
428    /// The default binding for this signal is the Escape key.
429    ///
430    /// Action
431    ///
432    ///
433    /// #### `response`
434    ///  Emitted when an action widget is clicked.
435    ///
436    /// The signal is also emitted when the application programmer
437    /// calls [`InfoBar::response()`][crate::InfoBar::response()]. The @response_id depends
438    /// on which action widget was clicked.
439    ///
440    ///
441    /// <details><summary><h4>Widget</h4></summary>
442    ///
443    ///
444    /// #### `destroy`
445    ///  Signals that all holders of a reference to the widget should release
446    /// the reference that they hold.
447    ///
448    /// May result in finalization of the widget if all references are released.
449    ///
450    /// This signal is not suitable for saving widget state.
451    ///
452    ///
453    ///
454    ///
455    /// #### `direction-changed`
456    ///  Emitted when the text direction of a widget changes.
457    ///
458    ///
459    ///
460    ///
461    /// #### `hide`
462    ///  Emitted when @widget is hidden.
463    ///
464    ///
465    ///
466    ///
467    /// #### `keynav-failed`
468    ///  Emitted if keyboard navigation fails.
469    ///
470    /// See [`WidgetExt::keynav_failed()`][crate::prelude::WidgetExt::keynav_failed()] for details.
471    ///
472    ///
473    ///
474    ///
475    /// #### `map`
476    ///  Emitted when @widget is going to be mapped.
477    ///
478    /// A widget is mapped when the widget is visible (which is controlled with
479    /// [`visible`][struct@crate::Widget#visible]) and all its parents up to the toplevel widget
480    /// are also visible.
481    ///
482    /// The `::map` signal can be used to determine whether a widget will be drawn,
483    /// for instance it can resume an animation that was stopped during the
484    /// emission of [`unmap`][struct@crate::Widget#unmap].
485    ///
486    ///
487    ///
488    ///
489    /// #### `mnemonic-activate`
490    ///  Emitted when a widget is activated via a mnemonic.
491    ///
492    /// The default handler for this signal activates @widget if @group_cycling
493    /// is false, or just makes @widget grab focus if @group_cycling is true.
494    ///
495    ///
496    ///
497    ///
498    /// #### `move-focus`
499    ///  Emitted when the focus is moved.
500    ///
501    /// The `::move-focus` signal is a [keybinding signal](class.SignalAction.html).
502    ///
503    /// The default bindings for this signal are <kbd>Tab</kbd> to move forward,
504    /// and <kbd>Shift</kbd>+<kbd>Tab</kbd> to move backward.
505    ///
506    /// Action
507    ///
508    ///
509    /// #### `query-tooltip`
510    ///  Emitted when the widget’s tooltip is about to be shown.
511    ///
512    /// This happens when the [`has-tooltip`][struct@crate::Widget#has-tooltip] property
513    /// is true and the hover timeout has expired with the cursor hovering
514    /// above @widget; or emitted when @widget got focus in keyboard mode.
515    ///
516    /// Using the given coordinates, the signal handler should determine
517    /// whether a tooltip should be shown for @widget. If this is the case
518    /// true should be returned, false otherwise. Note that if @keyboard_mode
519    /// is true, the values of @x and @y are undefined and should not be used.
520    ///
521    /// The signal handler is free to manipulate @tooltip with the therefore
522    /// destined function calls.
523    ///
524    ///
525    ///
526    ///
527    /// #### `realize`
528    ///  Emitted when @widget is associated with a [`gdk::Surface`][crate::gdk::Surface].
529    ///
530    /// This means that [`WidgetExt::realize()`][crate::prelude::WidgetExt::realize()] has been called
531    /// or the widget has been mapped (that is, it is going to be drawn).
532    ///
533    ///
534    ///
535    ///
536    /// #### `show`
537    ///  Emitted when @widget is shown.
538    ///
539    ///
540    ///
541    ///
542    /// #### `state-flags-changed`
543    ///  Emitted when the widget state changes.
544    ///
545    /// See [`WidgetExt::state_flags()`][crate::prelude::WidgetExt::state_flags()].
546    ///
547    ///
548    ///
549    ///
550    /// #### `unmap`
551    ///  Emitted when @widget is going to be unmapped.
552    ///
553    /// A widget is unmapped when either it or any of its parents up to the
554    /// toplevel widget have been set as hidden.
555    ///
556    /// As `::unmap` indicates that a widget will not be shown any longer,
557    /// it can be used to, for example, stop an animation on the widget.
558    ///
559    ///
560    ///
561    ///
562    /// #### `unrealize`
563    ///  Emitted when the [`gdk::Surface`][crate::gdk::Surface] associated with @widget is destroyed.
564    ///
565    /// This means that [`WidgetExt::unrealize()`][crate::prelude::WidgetExt::unrealize()] has been called
566    /// or the widget has been unmapped (that is, it is going to be hidden).
567    ///
568    ///
569    /// </details>
570    ///
571    /// # Implements
572    ///
573    /// [`WidgetExt`][trait@crate::prelude::WidgetExt], [`trait@glib::ObjectExt`], [`AccessibleExt`][trait@crate::prelude::AccessibleExt], [`BuildableExt`][trait@crate::prelude::BuildableExt], [`ConstraintTargetExt`][trait@crate::prelude::ConstraintTargetExt], [`WidgetExtManual`][trait@crate::prelude::WidgetExtManual], [`AccessibleExtManual`][trait@crate::prelude::AccessibleExtManual]
574    #[doc(alias = "GtkInfoBar")]
575    pub struct InfoBar(Object<ffi::GtkInfoBar>) @extends Widget, @implements Accessible, Buildable, ConstraintTarget;
576
577    match fn {
578        type_ => || ffi::gtk_info_bar_get_type(),
579    }
580}
581
582impl InfoBar {
583    /// Creates a new [`InfoBar`][crate::InfoBar] object.
584    ///
585    /// # Deprecated since 4.10
586    ///
587    ///
588    /// # Returns
589    ///
590    /// a new [`InfoBar`][crate::InfoBar] object
591    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
592    #[allow(deprecated)]
593    #[doc(alias = "gtk_info_bar_new")]
594    pub fn new() -> InfoBar {
595        assert_initialized_main_thread!();
596        unsafe { Widget::from_glib_none(ffi::gtk_info_bar_new()).unsafe_cast() }
597    }
598
599    // rustdoc-stripper-ignore-next
600    /// Creates a new builder-pattern struct instance to construct [`InfoBar`] objects.
601    ///
602    /// This method returns an instance of [`InfoBarBuilder`](crate::builders::InfoBarBuilder) which can be used to create [`InfoBar`] objects.
603    pub fn builder() -> InfoBarBuilder {
604        InfoBarBuilder::new()
605    }
606
607    /// Add an activatable widget to the action area of a [`InfoBar`][crate::InfoBar].
608    ///
609    /// This also connects a signal handler that will emit the
610    /// [`response`][struct@crate::InfoBar#response] signal on the message area
611    /// when the widget is activated. The widget is appended to the
612    /// end of the message areas action area.
613    ///
614    /// # Deprecated since 4.10
615    ///
616    /// ## `child`
617    /// an activatable widget
618    /// ## `response_id`
619    /// response ID for @child
620    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
621    #[allow(deprecated)]
622    #[doc(alias = "gtk_info_bar_add_action_widget")]
623    pub fn add_action_widget(&self, child: &impl IsA<Widget>, response_id: ResponseType) {
624        unsafe {
625            ffi::gtk_info_bar_add_action_widget(
626                self.to_glib_none().0,
627                child.as_ref().to_glib_none().0,
628                response_id.into_glib(),
629            );
630        }
631    }
632
633    /// Adds a button with the given text.
634    ///
635    /// Clicking the button will emit the [`response`][struct@crate::InfoBar#response]
636    /// signal with the given response_id. The button is appended to the
637    /// end of the info bar's action area. The button widget is returned,
638    /// but usually you don't need it.
639    ///
640    /// # Deprecated since 4.10
641    ///
642    /// ## `button_text`
643    /// text of button
644    /// ## `response_id`
645    /// response ID for the button
646    ///
647    /// # Returns
648    ///
649    /// the [`Button`][crate::Button] widget
650    /// that was added
651    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
652    #[allow(deprecated)]
653    #[doc(alias = "gtk_info_bar_add_button")]
654    pub fn add_button(&self, button_text: &str, response_id: ResponseType) -> Button {
655        unsafe {
656            from_glib_none(ffi::gtk_info_bar_add_button(
657                self.to_glib_none().0,
658                button_text.to_glib_none().0,
659                response_id.into_glib(),
660            ))
661        }
662    }
663
664    /// Adds a widget to the content area of the info bar.
665    ///
666    /// # Deprecated since 4.10
667    ///
668    /// ## `widget`
669    /// the child to be added
670    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
671    #[allow(deprecated)]
672    #[doc(alias = "gtk_info_bar_add_child")]
673    pub fn add_child(&self, widget: &impl IsA<Widget>) {
674        unsafe {
675            ffi::gtk_info_bar_add_child(self.to_glib_none().0, widget.as_ref().to_glib_none().0);
676        }
677    }
678
679    /// Returns the message type of the message area.
680    ///
681    /// # Deprecated since 4.10
682    ///
683    ///
684    /// # Returns
685    ///
686    /// the message type of the message area.
687    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
688    #[allow(deprecated)]
689    #[doc(alias = "gtk_info_bar_get_message_type")]
690    #[doc(alias = "get_message_type")]
691    #[doc(alias = "message-type")]
692    pub fn message_type(&self) -> MessageType {
693        unsafe { from_glib(ffi::gtk_info_bar_get_message_type(self.to_glib_none().0)) }
694    }
695
696    /// Returns whether the info bar is currently revealed.
697    ///
698    /// # Deprecated since 4.10
699    ///
700    ///
701    /// # Returns
702    ///
703    /// the current value of the [`revealed`][struct@crate::InfoBar#revealed] property
704    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
705    #[allow(deprecated)]
706    #[doc(alias = "gtk_info_bar_get_revealed")]
707    #[doc(alias = "get_revealed")]
708    #[doc(alias = "revealed")]
709    pub fn is_revealed(&self) -> bool {
710        unsafe { from_glib(ffi::gtk_info_bar_get_revealed(self.to_glib_none().0)) }
711    }
712
713    /// Returns whether the widget will display a standard close button.
714    ///
715    /// # Deprecated since 4.10
716    ///
717    ///
718    /// # Returns
719    ///
720    /// [`true`] if the widget displays standard close button
721    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
722    #[allow(deprecated)]
723    #[doc(alias = "gtk_info_bar_get_show_close_button")]
724    #[doc(alias = "get_show_close_button")]
725    #[doc(alias = "show-close-button")]
726    pub fn shows_close_button(&self) -> bool {
727        unsafe {
728            from_glib(ffi::gtk_info_bar_get_show_close_button(
729                self.to_glib_none().0,
730            ))
731        }
732    }
733
734    /// Removes a widget from the action area of @self.
735    ///
736    /// The widget must have been put there by a call to
737    /// [`add_action_widget()`][Self::add_action_widget()] or [`add_button()`][Self::add_button()].
738    ///
739    /// # Deprecated since 4.10
740    ///
741    /// ## `widget`
742    /// an action widget to remove
743    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
744    #[allow(deprecated)]
745    #[doc(alias = "gtk_info_bar_remove_action_widget")]
746    pub fn remove_action_widget(&self, widget: &impl IsA<Widget>) {
747        unsafe {
748            ffi::gtk_info_bar_remove_action_widget(
749                self.to_glib_none().0,
750                widget.as_ref().to_glib_none().0,
751            );
752        }
753    }
754
755    /// Removes a widget from the content area of the info bar.
756    ///
757    /// # Deprecated since 4.10
758    ///
759    /// ## `widget`
760    /// a child that has been added to the content area
761    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
762    #[allow(deprecated)]
763    #[doc(alias = "gtk_info_bar_remove_child")]
764    pub fn remove_child(&self, widget: &impl IsA<Widget>) {
765        unsafe {
766            ffi::gtk_info_bar_remove_child(self.to_glib_none().0, widget.as_ref().to_glib_none().0);
767        }
768    }
769
770    /// Emits the “response” signal with the given @response_id.
771    ///
772    /// # Deprecated since 4.10
773    ///
774    /// ## `response_id`
775    /// a response ID
776    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
777    #[allow(deprecated)]
778    #[doc(alias = "gtk_info_bar_response")]
779    pub fn response(&self, response_id: ResponseType) {
780        unsafe {
781            ffi::gtk_info_bar_response(self.to_glib_none().0, response_id.into_glib());
782        }
783    }
784
785    /// Sets the last widget in the info bar’s action area with
786    /// the given response_id as the default widget for the dialog.
787    ///
788    /// Pressing “Enter” normally activates the default widget.
789    ///
790    /// Note that this function currently requires @self to
791    /// be added to a widget hierarchy.
792    ///
793    /// # Deprecated since 4.10
794    ///
795    /// ## `response_id`
796    /// a response ID
797    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
798    #[allow(deprecated)]
799    #[doc(alias = "gtk_info_bar_set_default_response")]
800    pub fn set_default_response(&self, response_id: ResponseType) {
801        unsafe {
802            ffi::gtk_info_bar_set_default_response(self.to_glib_none().0, response_id.into_glib());
803        }
804    }
805
806    /// Sets the message type of the message area.
807    ///
808    /// GTK uses this type to determine how the message is displayed.
809    ///
810    /// # Deprecated since 4.10
811    ///
812    /// ## `message_type`
813    /// a [`MessageType`][crate::MessageType]
814    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
815    #[allow(deprecated)]
816    #[doc(alias = "gtk_info_bar_set_message_type")]
817    #[doc(alias = "message-type")]
818    pub fn set_message_type(&self, message_type: MessageType) {
819        unsafe {
820            ffi::gtk_info_bar_set_message_type(self.to_glib_none().0, message_type.into_glib());
821        }
822    }
823
824    /// Sets the sensitivity of action widgets for @response_id.
825    ///
826    /// Calls `gtk_widget_set_sensitive (widget, setting)` for each
827    /// widget in the info bars’s action area with the given @response_id.
828    /// A convenient way to sensitize/desensitize buttons.
829    ///
830    /// # Deprecated since 4.10
831    ///
832    /// ## `response_id`
833    /// a response ID
834    /// ## `setting`
835    /// TRUE for sensitive
836    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
837    #[allow(deprecated)]
838    #[doc(alias = "gtk_info_bar_set_response_sensitive")]
839    pub fn set_response_sensitive(&self, response_id: ResponseType, setting: bool) {
840        unsafe {
841            ffi::gtk_info_bar_set_response_sensitive(
842                self.to_glib_none().0,
843                response_id.into_glib(),
844                setting.into_glib(),
845            );
846        }
847    }
848
849    /// Sets whether the [`InfoBar`][crate::InfoBar] is revealed.
850    ///
851    /// Changing this will make @self reveal or conceal
852    /// itself via a sliding transition.
853    ///
854    /// Note: this does not show or hide @self in the
855    /// [`visible`][struct@crate::Widget#visible] sense, so revealing has no effect
856    /// if [`visible`][struct@crate::Widget#visible] is [`false`].
857    ///
858    /// # Deprecated since 4.10
859    ///
860    /// ## `revealed`
861    /// The new value of the property
862    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
863    #[allow(deprecated)]
864    #[doc(alias = "gtk_info_bar_set_revealed")]
865    #[doc(alias = "revealed")]
866    pub fn set_revealed(&self, revealed: bool) {
867        unsafe {
868            ffi::gtk_info_bar_set_revealed(self.to_glib_none().0, revealed.into_glib());
869        }
870    }
871
872    /// If true, a standard close button is shown.
873    ///
874    /// When clicked it emits the response [`ResponseType::Close`][crate::ResponseType::Close].
875    ///
876    /// # Deprecated since 4.10
877    ///
878    /// ## `setting`
879    /// [`true`] to include a close button
880    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
881    #[allow(deprecated)]
882    #[doc(alias = "gtk_info_bar_set_show_close_button")]
883    #[doc(alias = "show-close-button")]
884    pub fn set_show_close_button(&self, setting: bool) {
885        unsafe {
886            ffi::gtk_info_bar_set_show_close_button(self.to_glib_none().0, setting.into_glib());
887        }
888    }
889
890    /// Gets emitted when the user uses a keybinding to dismiss the info bar.
891    ///
892    /// The ::close signal is a [keybinding signal](class.SignalAction.html).
893    ///
894    /// The default binding for this signal is the Escape key.
895    #[doc(alias = "close")]
896    pub fn connect_close<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
897        unsafe extern "C" fn close_trampoline<F: Fn(&InfoBar) + 'static>(
898            this: *mut ffi::GtkInfoBar,
899            f: glib::ffi::gpointer,
900        ) {
901            let f: &F = &*(f as *const F);
902            f(&from_glib_borrow(this))
903        }
904        unsafe {
905            let f: Box_<F> = Box_::new(f);
906            connect_raw(
907                self.as_ptr() as *mut _,
908                b"close\0".as_ptr() as *const _,
909                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
910                    close_trampoline::<F> as *const (),
911                )),
912                Box_::into_raw(f),
913            )
914        }
915    }
916
917    pub fn emit_close(&self) {
918        self.emit_by_name::<()>("close", &[]);
919    }
920
921    /// Emitted when an action widget is clicked.
922    ///
923    /// The signal is also emitted when the application programmer
924    /// calls [`response()`][Self::response()]. The @response_id depends
925    /// on which action widget was clicked.
926    /// ## `response_id`
927    /// the response ID
928    #[doc(alias = "response")]
929    pub fn connect_response<F: Fn(&Self, ResponseType) + 'static>(&self, f: F) -> SignalHandlerId {
930        unsafe extern "C" fn response_trampoline<F: Fn(&InfoBar, ResponseType) + 'static>(
931            this: *mut ffi::GtkInfoBar,
932            response_id: ffi::GtkResponseType,
933            f: glib::ffi::gpointer,
934        ) {
935            let f: &F = &*(f as *const F);
936            f(&from_glib_borrow(this), from_glib(response_id))
937        }
938        unsafe {
939            let f: Box_<F> = Box_::new(f);
940            connect_raw(
941                self.as_ptr() as *mut _,
942                b"response\0".as_ptr() as *const _,
943                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
944                    response_trampoline::<F> as *const (),
945                )),
946                Box_::into_raw(f),
947            )
948        }
949    }
950
951    #[doc(alias = "message-type")]
952    pub fn connect_message_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
953        unsafe extern "C" fn notify_message_type_trampoline<F: Fn(&InfoBar) + 'static>(
954            this: *mut ffi::GtkInfoBar,
955            _param_spec: glib::ffi::gpointer,
956            f: glib::ffi::gpointer,
957        ) {
958            let f: &F = &*(f as *const F);
959            f(&from_glib_borrow(this))
960        }
961        unsafe {
962            let f: Box_<F> = Box_::new(f);
963            connect_raw(
964                self.as_ptr() as *mut _,
965                b"notify::message-type\0".as_ptr() as *const _,
966                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
967                    notify_message_type_trampoline::<F> as *const (),
968                )),
969                Box_::into_raw(f),
970            )
971        }
972    }
973
974    #[doc(alias = "revealed")]
975    pub fn connect_revealed_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
976        unsafe extern "C" fn notify_revealed_trampoline<F: Fn(&InfoBar) + 'static>(
977            this: *mut ffi::GtkInfoBar,
978            _param_spec: glib::ffi::gpointer,
979            f: glib::ffi::gpointer,
980        ) {
981            let f: &F = &*(f as *const F);
982            f(&from_glib_borrow(this))
983        }
984        unsafe {
985            let f: Box_<F> = Box_::new(f);
986            connect_raw(
987                self.as_ptr() as *mut _,
988                b"notify::revealed\0".as_ptr() as *const _,
989                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
990                    notify_revealed_trampoline::<F> as *const (),
991                )),
992                Box_::into_raw(f),
993            )
994        }
995    }
996
997    #[doc(alias = "show-close-button")]
998    pub fn connect_show_close_button_notify<F: Fn(&Self) + 'static>(
999        &self,
1000        f: F,
1001    ) -> SignalHandlerId {
1002        unsafe extern "C" fn notify_show_close_button_trampoline<F: Fn(&InfoBar) + 'static>(
1003            this: *mut ffi::GtkInfoBar,
1004            _param_spec: glib::ffi::gpointer,
1005            f: glib::ffi::gpointer,
1006        ) {
1007            let f: &F = &*(f as *const F);
1008            f(&from_glib_borrow(this))
1009        }
1010        unsafe {
1011            let f: Box_<F> = Box_::new(f);
1012            connect_raw(
1013                self.as_ptr() as *mut _,
1014                b"notify::show-close-button\0".as_ptr() as *const _,
1015                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1016                    notify_show_close_button_trampoline::<F> as *const (),
1017                )),
1018                Box_::into_raw(f),
1019            )
1020        }
1021    }
1022}
1023
1024impl Default for InfoBar {
1025    fn default() -> Self {
1026        Self::new()
1027    }
1028}
1029
1030// rustdoc-stripper-ignore-next
1031/// A [builder-pattern] type to construct [`InfoBar`] objects.
1032///
1033/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
1034#[must_use = "The builder must be built to be used"]
1035pub struct InfoBarBuilder {
1036    builder: glib::object::ObjectBuilder<'static, InfoBar>,
1037}
1038
1039impl InfoBarBuilder {
1040    fn new() -> Self {
1041        Self {
1042            builder: glib::object::Object::builder(),
1043        }
1044    }
1045
1046    /// The type of the message.
1047    ///
1048    /// The type may be used to determine the appearance of the info bar.
1049    pub fn message_type(self, message_type: MessageType) -> Self {
1050        Self {
1051            builder: self.builder.property("message-type", message_type),
1052        }
1053    }
1054
1055    /// Whether the info bar shows its contents.
1056    pub fn revealed(self, revealed: bool) -> Self {
1057        Self {
1058            builder: self.builder.property("revealed", revealed),
1059        }
1060    }
1061
1062    /// Whether to include a standard close button.
1063    pub fn show_close_button(self, show_close_button: bool) -> Self {
1064        Self {
1065            builder: self
1066                .builder
1067                .property("show-close-button", show_close_button),
1068        }
1069    }
1070
1071    /// Whether the widget or any of its descendents can accept
1072    /// the input focus.
1073    ///
1074    /// This property is meant to be set by widget implementations,
1075    /// typically in their instance init function.
1076    pub fn can_focus(self, can_focus: bool) -> Self {
1077        Self {
1078            builder: self.builder.property("can-focus", can_focus),
1079        }
1080    }
1081
1082    /// Whether the widget can receive pointer events.
1083    pub fn can_target(self, can_target: bool) -> Self {
1084        Self {
1085            builder: self.builder.property("can-target", can_target),
1086        }
1087    }
1088
1089    /// A list of css classes applied to this widget.
1090    pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
1091        Self {
1092            builder: self.builder.property("css-classes", css_classes.into()),
1093        }
1094    }
1095
1096    /// The name of this widget in the CSS tree.
1097    ///
1098    /// This property is meant to be set by widget implementations,
1099    /// typically in their instance init function.
1100    pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
1101        Self {
1102            builder: self.builder.property("css-name", css_name.into()),
1103        }
1104    }
1105
1106    /// The cursor used by @widget.
1107    pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
1108        Self {
1109            builder: self.builder.property("cursor", cursor.clone()),
1110        }
1111    }
1112
1113    /// Whether the widget should grab focus when it is clicked with the mouse.
1114    ///
1115    /// This property is only relevant for widgets that can take focus.
1116    pub fn focus_on_click(self, focus_on_click: bool) -> Self {
1117        Self {
1118            builder: self.builder.property("focus-on-click", focus_on_click),
1119        }
1120    }
1121
1122    /// Whether this widget itself will accept the input focus.
1123    pub fn focusable(self, focusable: bool) -> Self {
1124        Self {
1125            builder: self.builder.property("focusable", focusable),
1126        }
1127    }
1128
1129    /// How to distribute horizontal space if widget gets extra space.
1130    pub fn halign(self, halign: Align) -> Self {
1131        Self {
1132            builder: self.builder.property("halign", halign),
1133        }
1134    }
1135
1136    /// Enables or disables the emission of the [`query-tooltip`][struct@crate::Widget#query-tooltip]
1137    /// signal on @widget.
1138    ///
1139    /// A true value indicates that @widget can have a tooltip, in this case
1140    /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to
1141    /// determine whether it will provide a tooltip or not.
1142    pub fn has_tooltip(self, has_tooltip: bool) -> Self {
1143        Self {
1144            builder: self.builder.property("has-tooltip", has_tooltip),
1145        }
1146    }
1147
1148    /// Overrides for height request of the widget.
1149    ///
1150    /// If this is -1, the natural request will be used.
1151    pub fn height_request(self, height_request: i32) -> Self {
1152        Self {
1153            builder: self.builder.property("height-request", height_request),
1154        }
1155    }
1156
1157    /// Whether to expand horizontally.
1158    pub fn hexpand(self, hexpand: bool) -> Self {
1159        Self {
1160            builder: self.builder.property("hexpand", hexpand),
1161        }
1162    }
1163
1164    /// Whether to use the `hexpand` property.
1165    pub fn hexpand_set(self, hexpand_set: bool) -> Self {
1166        Self {
1167            builder: self.builder.property("hexpand-set", hexpand_set),
1168        }
1169    }
1170
1171    /// The [`LayoutManager`][crate::LayoutManager] instance to use to compute
1172    /// the preferred size of the widget, and allocate its children.
1173    ///
1174    /// This property is meant to be set by widget implementations,
1175    /// typically in their instance init function.
1176    pub fn layout_manager(self, layout_manager: &impl IsA<LayoutManager>) -> Self {
1177        Self {
1178            builder: self
1179                .builder
1180                .property("layout-manager", layout_manager.clone().upcast()),
1181        }
1182    }
1183
1184    /// Makes this widget act like a modal dialog, with respect to
1185    /// event delivery.
1186    ///
1187    /// Global event controllers will not handle events with targets
1188    /// inside the widget, unless they are set up to ignore propagation
1189    /// limits. See [`EventControllerExt::set_propagation_limit()`][crate::prelude::EventControllerExt::set_propagation_limit()].
1190    #[cfg(feature = "v4_18")]
1191    #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
1192    pub fn limit_events(self, limit_events: bool) -> Self {
1193        Self {
1194            builder: self.builder.property("limit-events", limit_events),
1195        }
1196    }
1197
1198    /// Margin on bottom side of widget.
1199    ///
1200    /// This property adds margin outside of the widget's normal size
1201    /// request, the margin will be added in addition to the size from
1202    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1203    pub fn margin_bottom(self, margin_bottom: i32) -> Self {
1204        Self {
1205            builder: self.builder.property("margin-bottom", margin_bottom),
1206        }
1207    }
1208
1209    /// Margin on end of widget, horizontally.
1210    ///
1211    /// This property supports left-to-right and right-to-left text
1212    /// directions.
1213    ///
1214    /// This property adds margin outside of the widget's normal size
1215    /// request, the margin will be added in addition to the size from
1216    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1217    pub fn margin_end(self, margin_end: i32) -> Self {
1218        Self {
1219            builder: self.builder.property("margin-end", margin_end),
1220        }
1221    }
1222
1223    /// Margin on start of widget, horizontally.
1224    ///
1225    /// This property supports left-to-right and right-to-left text
1226    /// directions.
1227    ///
1228    /// This property adds margin outside of the widget's normal size
1229    /// request, the margin will be added in addition to the size from
1230    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1231    pub fn margin_start(self, margin_start: i32) -> Self {
1232        Self {
1233            builder: self.builder.property("margin-start", margin_start),
1234        }
1235    }
1236
1237    /// Margin on top side of widget.
1238    ///
1239    /// This property adds margin outside of the widget's normal size
1240    /// request, the margin will be added in addition to the size from
1241    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1242    pub fn margin_top(self, margin_top: i32) -> Self {
1243        Self {
1244            builder: self.builder.property("margin-top", margin_top),
1245        }
1246    }
1247
1248    /// The name of the widget.
1249    pub fn name(self, name: impl Into<glib::GString>) -> Self {
1250        Self {
1251            builder: self.builder.property("name", name.into()),
1252        }
1253    }
1254
1255    /// The requested opacity of the widget.
1256    pub fn opacity(self, opacity: f64) -> Self {
1257        Self {
1258            builder: self.builder.property("opacity", opacity),
1259        }
1260    }
1261
1262    /// How content outside the widget's content area is treated.
1263    ///
1264    /// This property is meant to be set by widget implementations,
1265    /// typically in their instance init function.
1266    pub fn overflow(self, overflow: Overflow) -> Self {
1267        Self {
1268            builder: self.builder.property("overflow", overflow),
1269        }
1270    }
1271
1272    /// Whether the widget will receive the default action when it is focused.
1273    pub fn receives_default(self, receives_default: bool) -> Self {
1274        Self {
1275            builder: self.builder.property("receives-default", receives_default),
1276        }
1277    }
1278
1279    /// Whether the widget responds to input.
1280    pub fn sensitive(self, sensitive: bool) -> Self {
1281        Self {
1282            builder: self.builder.property("sensitive", sensitive),
1283        }
1284    }
1285
1286    /// Sets the text of tooltip to be the given string, which is marked up
1287    /// with Pango markup.
1288    ///
1289    /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
1290    ///
1291    /// This is a convenience property which will take care of getting the
1292    /// tooltip shown if the given string is not `NULL`:
1293    /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
1294    /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
1295    /// the default signal handler.
1296    ///
1297    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
1298    /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
1299    pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
1300        Self {
1301            builder: self
1302                .builder
1303                .property("tooltip-markup", tooltip_markup.into()),
1304        }
1305    }
1306
1307    /// Sets the text of tooltip to be the given string.
1308    ///
1309    /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
1310    ///
1311    /// This is a convenience property which will take care of getting the
1312    /// tooltip shown if the given string is not `NULL`:
1313    /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
1314    /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
1315    /// the default signal handler.
1316    ///
1317    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
1318    /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
1319    pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
1320        Self {
1321            builder: self.builder.property("tooltip-text", tooltip_text.into()),
1322        }
1323    }
1324
1325    /// How to distribute vertical space if widget gets extra space.
1326    pub fn valign(self, valign: Align) -> Self {
1327        Self {
1328            builder: self.builder.property("valign", valign),
1329        }
1330    }
1331
1332    /// Whether to expand vertically.
1333    pub fn vexpand(self, vexpand: bool) -> Self {
1334        Self {
1335            builder: self.builder.property("vexpand", vexpand),
1336        }
1337    }
1338
1339    /// Whether to use the `vexpand` property.
1340    pub fn vexpand_set(self, vexpand_set: bool) -> Self {
1341        Self {
1342            builder: self.builder.property("vexpand-set", vexpand_set),
1343        }
1344    }
1345
1346    /// Whether the widget is visible.
1347    pub fn visible(self, visible: bool) -> Self {
1348        Self {
1349            builder: self.builder.property("visible", visible),
1350        }
1351    }
1352
1353    /// Overrides for width request of the widget.
1354    ///
1355    /// If this is -1, the natural request will be used.
1356    pub fn width_request(self, width_request: i32) -> Self {
1357        Self {
1358            builder: self.builder.property("width-request", width_request),
1359        }
1360    }
1361
1362    /// The accessible role of the given [`Accessible`][crate::Accessible] implementation.
1363    ///
1364    /// The accessible role cannot be changed once set.
1365    pub fn accessible_role(self, accessible_role: AccessibleRole) -> Self {
1366        Self {
1367            builder: self.builder.property("accessible-role", accessible_role),
1368        }
1369    }
1370
1371    // rustdoc-stripper-ignore-next
1372    /// Build the [`InfoBar`].
1373    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
1374    pub fn build(self) -> InfoBar {
1375        assert_initialized_main_thread!();
1376        self.builder.build()
1377    }
1378}