Skip to main content

libadwaita/auto/
flap.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from
3// from gir-files (https://github.com/gtk-rs/gir-files.git)
4// DO NOT EDIT
5#![allow(deprecated)]
6
7use crate::{
8    FlapFoldPolicy, FlapTransitionType, FoldThresholdPolicy, SpringParams, Swipeable, ffi,
9};
10use glib::{
11    prelude::*,
12    signal::{SignalHandlerId, connect_raw},
13    translate::*,
14};
15use std::boxed::Box as Box_;
16
17#[cfg(feature = "gtk_v4_10")]
18#[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_10")))]
19glib::wrapper! {
20    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
21    /// ` element, and separator by specifying “separator”. Specifying
22    /// “content” child type or omitting it results in setting the content child.
23    ///
24    /// ## CSS nodes
25    ///
26    /// [`Flap`][crate::Flap] has a single CSS node with name `flap`. The node will get the style
27    /// classes `.folded` when it is folded, and `.unfolded` when it's not.
28    ///
29    /// ## Properties
30    ///
31    ///
32    /// #### `content`
33    ///  The content widget.
34    ///
35    /// It's always displayed when unfolded, and partially visible when folded.
36    ///
37    /// Readable | Writable
38    ///
39    ///
40    /// #### `flap`
41    ///  The flap widget.
42    ///
43    /// It's only visible when [`reveal-progress`][struct@crate::Flap#reveal-progress] is greater than 0.
44    ///
45    /// Readable | Writable
46    ///
47    ///
48    /// #### `flap-position`
49    ///  The flap position.
50    ///
51    /// If it's set to [enum@Gtk.PackType.start], the flap is displayed before the
52    /// content, if [enum@Gtk.PackType.end], it's displayed after the content.
53    ///
54    /// Readable | Writable
55    ///
56    ///
57    /// #### `fold-duration`
58    ///  The fold transition animation duration, in milliseconds.
59    ///
60    /// Readable | Writable
61    ///
62    ///
63    /// #### `fold-policy`
64    ///  The fold policy for the flap.
65    ///
66    /// Readable | Writable
67    ///
68    ///
69    /// #### `fold-threshold-policy`
70    ///  Determines when the flap will fold.
71    ///
72    /// If set to [enum@Adw.FoldThresholdPolicy.minimum], flap will only fold when
73    /// the children cannot fit anymore. With [enum@Adw.FoldThresholdPolicy.natural],
74    /// it will fold as soon as children don't get their natural size.
75    ///
76    /// This can be useful if you have a long ellipsizing label and want to let it
77    /// ellipsize instead of immediately folding.
78    ///
79    /// Readable | Writable
80    ///
81    ///
82    /// #### `folded`
83    ///  Whether the flap is currently folded.
84    ///
85    /// See [`fold-policy`][struct@crate::Flap#fold-policy].
86    ///
87    /// Readable
88    ///
89    ///
90    /// #### `locked`
91    ///  Whether the flap is locked.
92    ///
93    /// If `FALSE`, folding when the flap is revealed automatically closes it, and
94    /// unfolding it when the flap is not revealed opens it. If `TRUE`,
95    /// [`reveal-flap`][struct@crate::Flap#reveal-flap] value never changes on its own.
96    ///
97    /// Readable | Writable
98    ///
99    ///
100    /// #### `modal`
101    ///   key, will close the flap. If `FALSE`, clicks
102    /// are passed through to the content widget.
103    ///
104    /// Readable | Writable
105    ///
106    ///
107    /// #### `reveal-flap`
108    ///  Whether the flap widget is revealed.
109    ///
110    /// Readable | Writable
111    ///
112    ///
113    /// #### `reveal-params`
114    ///  The reveal animation spring parameters.
115    ///
116    /// The default value is equivalent to:
117    ///
118    /// **⚠️ The following code is in c ⚠️**
119    ///
120    /// ```c
121    /// adw_spring_params_new (1, 0.5, 500)
122    /// ```
123    ///
124    /// Readable | Writable
125    ///
126    ///
127    /// #### `reveal-progress`
128    ///  The current reveal transition progress.
129    ///
130    /// 0 means fully hidden, 1 means fully revealed.
131    ///
132    /// See [`reveal-flap`][struct@crate::Flap#reveal-flap].
133    ///
134    /// Readable
135    ///
136    ///
137    /// #### `separator`
138    ///  The separator widget.
139    ///
140    /// It's displayed between content and flap when there's no shadow to display.
141    /// When exactly it's visible depends on the [`transition-type`][struct@crate::Flap#transition-type]
142    /// value.
143    ///
144    /// Readable | Writable
145    ///
146    ///
147    /// #### `swipe-to-close`
148    ///  Whether the flap can be closed with a swipe gesture.
149    ///
150    /// The area that can be swiped depends on the [`transition-type`][struct@crate::Flap#transition-type]
151    /// value.
152    ///
153    /// Readable | Writable
154    ///
155    ///
156    /// #### `swipe-to-open`
157    ///  Whether the flap can be opened with a swipe gesture.
158    ///
159    /// The area that can be swiped depends on the [`transition-type`][struct@crate::Flap#transition-type]
160    /// value.
161    ///
162    /// Readable | Writable
163    ///
164    ///
165    /// #### `transition-type`
166    ///  the type of animation used for reveal and fold transitions.
167    ///
168    /// [`flap`][struct@crate::Flap#flap] is transparent by default, which means the content
169    /// will be seen through it with [enum@Adw.FlapTransitionType.over] transitions;
170    /// add the [`.background`](style-classes.html#background) style class to it if
171    /// this is unwanted.
172    ///
173    /// Readable | Writable
174    /// <details><summary><h4>Widget</h4></summary>
175    ///
176    ///
177    /// #### `can-focus`
178    ///  Whether the widget or any of its descendents can accept
179    /// the input focus.
180    ///
181    /// This property is meant to be set by widget implementations,
182    /// typically in their instance init function.
183    ///
184    /// Readable | Writable
185    ///
186    ///
187    /// #### `can-target`
188    ///  Whether the widget can receive pointer events.
189    ///
190    /// Readable | Writable
191    ///
192    ///
193    /// #### `css-classes`
194    ///  A list of css classes applied to this widget.
195    ///
196    /// Readable | Writable
197    ///
198    ///
199    /// #### `css-name`
200    ///  The name of this widget in the CSS tree.
201    ///
202    /// This property is meant to be set by widget implementations,
203    /// typically in their instance init function.
204    ///
205    /// Readable | Writable | Construct Only
206    ///
207    ///
208    /// #### `cursor`
209    ///  The cursor used by @widget.
210    ///
211    /// Readable | Writable
212    ///
213    ///
214    /// #### `focus-on-click`
215    ///  Whether the widget should grab focus when it is clicked with the mouse.
216    ///
217    /// This property is only relevant for widgets that can take focus.
218    ///
219    /// Readable | Writable
220    ///
221    ///
222    /// #### `focusable`
223    ///  Whether this widget itself will accept the input focus.
224    ///
225    /// Readable | Writable
226    ///
227    ///
228    /// #### `halign`
229    ///  How to distribute horizontal space if widget gets extra space.
230    ///
231    /// Readable | Writable
232    ///
233    ///
234    /// #### `has-default`
235    ///  Whether the widget is the default widget.
236    ///
237    /// Readable
238    ///
239    ///
240    /// #### `has-focus`
241    ///  Whether the widget has the input focus.
242    ///
243    /// Readable
244    ///
245    ///
246    /// #### `has-tooltip`
247    ///  Enables or disables the emission of the [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip]
248    /// signal on @widget.
249    ///
250    /// A true value indicates that @widget can have a tooltip, in this case
251    /// the widget will be queried using [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] to
252    /// determine whether it will provide a tooltip or not.
253    ///
254    /// Readable | Writable
255    ///
256    ///
257    /// #### `height-request`
258    ///  Overrides for height request of the widget.
259    ///
260    /// If this is -1, the natural request will be used.
261    ///
262    /// Readable | Writable
263    ///
264    ///
265    /// #### `hexpand`
266    ///  Whether to expand horizontally.
267    ///
268    /// Readable | Writable
269    ///
270    ///
271    /// #### `hexpand-set`
272    ///  Whether to use the `hexpand` property.
273    ///
274    /// Readable | Writable
275    ///
276    ///
277    /// #### `layout-manager`
278    ///  The [`gtk::LayoutManager`][crate::gtk::LayoutManager] instance to use to compute
279    /// the preferred size of the widget, and allocate its children.
280    ///
281    /// This property is meant to be set by widget implementations,
282    /// typically in their instance init function.
283    ///
284    /// Readable | Writable
285    ///
286    ///
287    /// #### `limit-events`
288    ///  Makes this widget act like a modal dialog, with respect to
289    /// event delivery.
290    ///
291    /// Global event controllers will not handle events with targets
292    /// inside the widget, unless they are set up to ignore propagation
293    /// limits. See `Gtk::EventController::set_propagation_limit()`.
294    ///
295    /// Readable | Writable
296    ///
297    ///
298    /// #### `margin-bottom`
299    ///  Margin on bottom side of widget.
300    ///
301    /// This property adds margin outside of the widget's normal size
302    /// request, the margin will be added in addition to the size from
303    /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
304    ///
305    /// Readable | Writable
306    ///
307    ///
308    /// #### `margin-end`
309    ///  Margin on end of widget, horizontally.
310    ///
311    /// This property supports left-to-right and right-to-left text
312    /// directions.
313    ///
314    /// This property adds margin outside of the widget's normal size
315    /// request, the margin will be added in addition to the size from
316    /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
317    ///
318    /// Readable | Writable
319    ///
320    ///
321    /// #### `margin-start`
322    ///  Margin on start of widget, horizontally.
323    ///
324    /// This property supports left-to-right and right-to-left text
325    /// directions.
326    ///
327    /// This property adds margin outside of the widget's normal size
328    /// request, the margin will be added in addition to the size from
329    /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
330    ///
331    /// Readable | Writable
332    ///
333    ///
334    /// #### `margin-top`
335    ///  Margin on top side of widget.
336    ///
337    /// This property adds margin outside of the widget's normal size
338    /// request, the margin will be added in addition to the size from
339    /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
340    ///
341    /// Readable | Writable
342    ///
343    ///
344    /// #### `name`
345    ///  The name of the widget.
346    ///
347    /// Readable | Writable
348    ///
349    ///
350    /// #### `opacity`
351    ///  The requested opacity of the widget.
352    ///
353    /// Readable | Writable
354    ///
355    ///
356    /// #### `overflow`
357    ///  How content outside the widget's content area is treated.
358    ///
359    /// This property is meant to be set by widget implementations,
360    /// typically in their instance init function.
361    ///
362    /// Readable | Writable
363    ///
364    ///
365    /// #### `parent`
366    ///  The parent widget of this widget.
367    ///
368    /// Readable
369    ///
370    ///
371    /// #### `receives-default`
372    ///  Whether the widget will receive the default action when it is focused.
373    ///
374    /// Readable | Writable
375    ///
376    ///
377    /// #### `root`
378    ///  The [`gtk::Root`][crate::gtk::Root] widget of the widget tree containing this widget.
379    ///
380    /// This will be `NULL` if the widget is not contained in a root widget.
381    ///
382    /// Readable
383    ///
384    ///
385    /// #### `scale-factor`
386    ///  The scale factor of the widget.
387    ///
388    /// Readable
389    ///
390    ///
391    /// #### `sensitive`
392    ///  Whether the widget responds to input.
393    ///
394    /// Readable | Writable
395    ///
396    ///
397    /// #### `tooltip-markup`
398    ///  Sets the text of tooltip to be the given string, which is marked up
399    /// with Pango markup.
400    ///
401    /// Also see `Gtk::Tooltip::set_markup()`.
402    ///
403    /// This is a convenience property which will take care of getting the
404    /// tooltip shown if the given string is not `NULL`:
405    /// [`has-tooltip`][struct@crate::gtk::Widget#has-tooltip] will automatically be set to true
406    /// and there will be taken care of [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] in
407    /// the default signal handler.
408    ///
409    /// Note that if both [`tooltip-text`][struct@crate::gtk::Widget#tooltip-text] and
410    /// [`tooltip-markup`][struct@crate::gtk::Widget#tooltip-markup] are set, the last one wins.
411    ///
412    /// Readable | Writable
413    ///
414    ///
415    /// #### `tooltip-text`
416    ///  Sets the text of tooltip to be the given string.
417    ///
418    /// Also see `Gtk::Tooltip::set_text()`.
419    ///
420    /// This is a convenience property which will take care of getting the
421    /// tooltip shown if the given string is not `NULL`:
422    /// [`has-tooltip`][struct@crate::gtk::Widget#has-tooltip] will automatically be set to true
423    /// and there will be taken care of [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] in
424    /// the default signal handler.
425    ///
426    /// Note that if both [`tooltip-text`][struct@crate::gtk::Widget#tooltip-text] and
427    /// [`tooltip-markup`][struct@crate::gtk::Widget#tooltip-markup] are set, the last one wins.
428    ///
429    /// Readable | Writable
430    ///
431    ///
432    /// #### `valign`
433    ///  How to distribute vertical space if widget gets extra space.
434    ///
435    /// Readable | Writable
436    ///
437    ///
438    /// #### `vexpand`
439    ///  Whether to expand vertically.
440    ///
441    /// Readable | Writable
442    ///
443    ///
444    /// #### `vexpand-set`
445    ///  Whether to use the `vexpand` property.
446    ///
447    /// Readable | Writable
448    ///
449    ///
450    /// #### `visible`
451    ///  Whether the widget is visible.
452    ///
453    /// Readable | Writable
454    ///
455    ///
456    /// #### `width-request`
457    ///  Overrides for width request of the widget.
458    ///
459    /// If this is -1, the natural request will be used.
460    ///
461    /// Readable | Writable
462    /// </details>
463    /// <details><summary><h4>Accessible</h4></summary>
464    ///
465    ///
466    /// #### `accessible-role`
467    ///  The accessible role of the given [`gtk::Accessible`][crate::gtk::Accessible] implementation.
468    ///
469    /// The accessible role cannot be changed once set.
470    ///
471    /// Readable | Writable
472    /// </details>
473    /// <details><summary><h4>Orientable</h4></summary>
474    ///
475    ///
476    /// #### `orientation`
477    ///  The orientation of the orientable.
478    ///
479    /// Readable | Writable
480    /// </details>
481    ///
482    /// # Implements
483    ///
484    /// [`trait@gtk::prelude::WidgetExt`], [`trait@glib::ObjectExt`], [`trait@gtk::prelude::AccessibleExt`], [`trait@gtk::prelude::BuildableExt`], [`trait@gtk::prelude::ConstraintTargetExt`], [`SwipeableExt`][trait@crate::prelude::SwipeableExt], [`trait@gtk::prelude::OrientableExt`]
485    #[doc(alias = "AdwFlap")]
486    pub struct Flap(Object<ffi::AdwFlap, ffi::AdwFlapClass>) @extends gtk::Widget, @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, Swipeable, gtk::Orientable;
487
488    match fn {
489        type_ => || ffi::adw_flap_get_type(),
490    }
491}
492
493#[cfg(not(feature = "gtk_v4_10"))]
494glib::wrapper! {
495    #[doc(alias = "AdwFlap")]
496    pub struct Flap(Object<ffi::AdwFlap, ffi::AdwFlapClass>) @extends gtk::Widget, @implements gtk::Buildable, gtk::ConstraintTarget, Swipeable, gtk::Orientable;
497
498    match fn {
499        type_ => || ffi::adw_flap_get_type(),
500    }
501}
502
503impl Flap {
504    /// Creates a new [`Flap`][crate::Flap].
505    ///
506    /// # Deprecated since 1.4
507    ///
508    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
509    ///
510    /// # Returns
511    ///
512    /// the newly created [`Flap`][crate::Flap]
513    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
514    #[allow(deprecated)]
515    #[doc(alias = "adw_flap_new")]
516    pub fn new() -> Flap {
517        assert_initialized_main_thread!();
518        unsafe { gtk::Widget::from_glib_none(ffi::adw_flap_new()).unsafe_cast() }
519    }
520
521    // rustdoc-stripper-ignore-next
522    /// Creates a new builder-pattern struct instance to construct [`Flap`] objects.
523    ///
524    /// This method returns an instance of [`FlapBuilder`](crate::builders::FlapBuilder) which can be used to create [`Flap`] objects.
525    pub fn builder() -> FlapBuilder {
526        FlapBuilder::new()
527    }
528
529    /// Gets the content widget for @self.
530    ///
531    /// # Deprecated since 1.4
532    ///
533    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
534    ///
535    /// # Returns
536    ///
537    /// the content widget for @self
538    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
539    #[allow(deprecated)]
540    #[doc(alias = "adw_flap_get_content")]
541    #[doc(alias = "get_content")]
542    pub fn content(&self) -> Option<gtk::Widget> {
543        unsafe { from_glib_none(ffi::adw_flap_get_content(self.to_glib_none().0)) }
544    }
545
546    /// Gets the flap widget for @self.
547    ///
548    /// # Deprecated since 1.4
549    ///
550    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
551    ///
552    /// # Returns
553    ///
554    /// the flap widget for @self
555    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
556    #[allow(deprecated)]
557    #[doc(alias = "adw_flap_get_flap")]
558    #[doc(alias = "get_flap")]
559    pub fn flap(&self) -> Option<gtk::Widget> {
560        unsafe { from_glib_none(ffi::adw_flap_get_flap(self.to_glib_none().0)) }
561    }
562
563    /// Gets the flap position for @self.
564    ///
565    /// # Deprecated since 1.4
566    ///
567    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
568    ///
569    /// # Returns
570    ///
571    /// the flap position for @self
572    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
573    #[allow(deprecated)]
574    #[doc(alias = "adw_flap_get_flap_position")]
575    #[doc(alias = "get_flap_position")]
576    #[doc(alias = "flap-position")]
577    pub fn flap_position(&self) -> gtk::PackType {
578        unsafe { from_glib(ffi::adw_flap_get_flap_position(self.to_glib_none().0)) }
579    }
580
581    /// Gets the fold transition animation duration for @self, in milliseconds.
582    ///
583    /// # Deprecated since 1.4
584    ///
585    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
586    ///
587    /// # Returns
588    ///
589    /// the fold transition duration
590    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
591    #[allow(deprecated)]
592    #[doc(alias = "adw_flap_get_fold_duration")]
593    #[doc(alias = "get_fold_duration")]
594    #[doc(alias = "fold-duration")]
595    pub fn fold_duration(&self) -> u32 {
596        unsafe { ffi::adw_flap_get_fold_duration(self.to_glib_none().0) }
597    }
598
599    /// Gets the fold policy for @self.
600    ///
601    /// # Deprecated since 1.4
602    ///
603    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
604    ///
605    /// # Returns
606    ///
607    /// the fold policy for @self
608    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
609    #[allow(deprecated)]
610    #[doc(alias = "adw_flap_get_fold_policy")]
611    #[doc(alias = "get_fold_policy")]
612    #[doc(alias = "fold-policy")]
613    pub fn fold_policy(&self) -> FlapFoldPolicy {
614        unsafe { from_glib(ffi::adw_flap_get_fold_policy(self.to_glib_none().0)) }
615    }
616
617    /// Gets the fold threshold policy for @self.
618    ///
619    /// # Deprecated since 1.4
620    ///
621    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
622    ///
623    /// # Returns
624    ///
625    /// the fold threshold policy
626    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
627    #[allow(deprecated)]
628    #[doc(alias = "adw_flap_get_fold_threshold_policy")]
629    #[doc(alias = "get_fold_threshold_policy")]
630    #[doc(alias = "fold-threshold-policy")]
631    pub fn fold_threshold_policy(&self) -> FoldThresholdPolicy {
632        unsafe {
633            from_glib(ffi::adw_flap_get_fold_threshold_policy(
634                self.to_glib_none().0,
635            ))
636        }
637    }
638
639    /// Gets whether @self is currently folded.
640    ///
641    /// See [`fold-policy`][struct@crate::Flap#fold-policy].
642    ///
643    /// # Deprecated since 1.4
644    ///
645    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
646    ///
647    /// # Returns
648    ///
649    /// `TRUE` if @self is currently folded
650    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
651    #[allow(deprecated)]
652    #[doc(alias = "adw_flap_get_folded")]
653    #[doc(alias = "get_folded")]
654    #[doc(alias = "folded")]
655    pub fn is_folded(&self) -> bool {
656        unsafe { from_glib(ffi::adw_flap_get_folded(self.to_glib_none().0)) }
657    }
658
659    /// Gets whether @self is locked.
660    ///
661    /// # Deprecated since 1.4
662    ///
663    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
664    ///
665    /// # Returns
666    ///
667    /// `TRUE` if @self is locked
668    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
669    #[allow(deprecated)]
670    #[doc(alias = "adw_flap_get_locked")]
671    #[doc(alias = "get_locked")]
672    #[doc(alias = "locked")]
673    pub fn is_locked(&self) -> bool {
674        unsafe { from_glib(ffi::adw_flap_get_locked(self.to_glib_none().0)) }
675    }
676
677    /// Gets whether @self is modal.
678    ///
679    /// # Deprecated since 1.4
680    ///
681    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
682    ///
683    /// # Returns
684    ///
685    /// `TRUE` if @self is modal
686    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
687    #[allow(deprecated)]
688    #[doc(alias = "adw_flap_get_modal")]
689    #[doc(alias = "get_modal")]
690    #[doc(alias = "modal")]
691    pub fn is_modal(&self) -> bool {
692        unsafe { from_glib(ffi::adw_flap_get_modal(self.to_glib_none().0)) }
693    }
694
695    /// Gets whether the flap widget is revealed for @self.
696    ///
697    /// # Deprecated since 1.4
698    ///
699    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
700    ///
701    /// # Returns
702    ///
703    /// `TRUE` if the flap widget is revealed
704    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
705    #[allow(deprecated)]
706    #[doc(alias = "adw_flap_get_reveal_flap")]
707    #[doc(alias = "get_reveal_flap")]
708    #[doc(alias = "reveal-flap")]
709    pub fn reveals_flap(&self) -> bool {
710        unsafe { from_glib(ffi::adw_flap_get_reveal_flap(self.to_glib_none().0)) }
711    }
712
713    /// Gets the reveal animation spring parameters for @self.
714    ///
715    /// # Deprecated since 1.4
716    ///
717    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
718    ///
719    /// # Returns
720    ///
721    /// the reveal animation parameters
722    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
723    #[allow(deprecated)]
724    #[doc(alias = "adw_flap_get_reveal_params")]
725    #[doc(alias = "get_reveal_params")]
726    #[doc(alias = "reveal-params")]
727    pub fn reveal_params(&self) -> SpringParams {
728        unsafe { from_glib_full(ffi::adw_flap_get_reveal_params(self.to_glib_none().0)) }
729    }
730
731    /// Gets the current reveal progress for @self.
732    ///
733    /// 0 means fully hidden, 1 means fully revealed.
734    ///
735    /// See [`reveal-flap`][struct@crate::Flap#reveal-flap].
736    ///
737    /// # Deprecated since 1.4
738    ///
739    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
740    ///
741    /// # Returns
742    ///
743    /// the current reveal progress for @self
744    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
745    #[allow(deprecated)]
746    #[doc(alias = "adw_flap_get_reveal_progress")]
747    #[doc(alias = "get_reveal_progress")]
748    #[doc(alias = "reveal-progress")]
749    pub fn reveal_progress(&self) -> f64 {
750        unsafe { ffi::adw_flap_get_reveal_progress(self.to_glib_none().0) }
751    }
752
753    /// Gets the separator widget for @self.
754    ///
755    /// # Deprecated since 1.4
756    ///
757    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
758    ///
759    /// # Returns
760    ///
761    /// the separator widget for @self
762    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
763    #[allow(deprecated)]
764    #[doc(alias = "adw_flap_get_separator")]
765    #[doc(alias = "get_separator")]
766    pub fn separator(&self) -> Option<gtk::Widget> {
767        unsafe { from_glib_none(ffi::adw_flap_get_separator(self.to_glib_none().0)) }
768    }
769
770    /// Gets whether @self can be closed with a swipe gesture.
771    ///
772    /// # Deprecated since 1.4
773    ///
774    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
775    ///
776    /// # Returns
777    ///
778    /// `TRUE` if @self can be closed with a swipe gesture
779    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
780    #[allow(deprecated)]
781    #[doc(alias = "adw_flap_get_swipe_to_close")]
782    #[doc(alias = "get_swipe_to_close")]
783    #[doc(alias = "swipe-to-close")]
784    pub fn is_swipe_to_close(&self) -> bool {
785        unsafe { from_glib(ffi::adw_flap_get_swipe_to_close(self.to_glib_none().0)) }
786    }
787
788    /// Gets whether @self can be opened with a swipe gesture.
789    ///
790    /// # Deprecated since 1.4
791    ///
792    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
793    ///
794    /// # Returns
795    ///
796    /// `TRUE` if @self can be opened with a swipe gesture
797    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
798    #[allow(deprecated)]
799    #[doc(alias = "adw_flap_get_swipe_to_open")]
800    #[doc(alias = "get_swipe_to_open")]
801    #[doc(alias = "swipe-to-open")]
802    pub fn is_swipe_to_open(&self) -> bool {
803        unsafe { from_glib(ffi::adw_flap_get_swipe_to_open(self.to_glib_none().0)) }
804    }
805
806    /// Gets the type of animation used for reveal and fold transitions in @self.
807    ///
808    /// # Deprecated since 1.4
809    ///
810    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
811    ///
812    /// # Returns
813    ///
814    /// the current transition type of @self
815    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
816    #[allow(deprecated)]
817    #[doc(alias = "adw_flap_get_transition_type")]
818    #[doc(alias = "get_transition_type")]
819    #[doc(alias = "transition-type")]
820    pub fn transition_type(&self) -> FlapTransitionType {
821        unsafe { from_glib(ffi::adw_flap_get_transition_type(self.to_glib_none().0)) }
822    }
823
824    /// Sets the content widget for @self.
825    ///
826    /// It's always displayed when unfolded, and partially visible when folded.
827    ///
828    /// # Deprecated since 1.4
829    ///
830    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
831    /// ## `content`
832    /// the content widget
833    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
834    #[allow(deprecated)]
835    #[doc(alias = "adw_flap_set_content")]
836    #[doc(alias = "content")]
837    pub fn set_content(&self, content: Option<&impl IsA<gtk::Widget>>) {
838        unsafe {
839            ffi::adw_flap_set_content(
840                self.to_glib_none().0,
841                content.map(|p| p.as_ref()).to_glib_none().0,
842            );
843        }
844    }
845
846    /// Sets the flap widget for @self.
847    ///
848    /// It's only visible when [`reveal-progress`][struct@crate::Flap#reveal-progress] is greater than 0.
849    ///
850    /// # Deprecated since 1.4
851    ///
852    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
853    /// ## `flap`
854    /// the flap widget
855    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
856    #[allow(deprecated)]
857    #[doc(alias = "adw_flap_set_flap")]
858    #[doc(alias = "flap")]
859    pub fn set_flap(&self, flap: Option<&impl IsA<gtk::Widget>>) {
860        unsafe {
861            ffi::adw_flap_set_flap(
862                self.to_glib_none().0,
863                flap.map(|p| p.as_ref()).to_glib_none().0,
864            );
865        }
866    }
867
868    /// Sets the flap position for @self.
869    ///
870    /// If it's set to [enum@Gtk.PackType.start], the flap is displayed before the
871    /// content, if [enum@Gtk.PackType.end], it's displayed after the content.
872    ///
873    /// # Deprecated since 1.4
874    ///
875    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
876    /// ## `position`
877    /// the new value
878    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
879    #[allow(deprecated)]
880    #[doc(alias = "adw_flap_set_flap_position")]
881    #[doc(alias = "flap-position")]
882    pub fn set_flap_position(&self, position: gtk::PackType) {
883        unsafe {
884            ffi::adw_flap_set_flap_position(self.to_glib_none().0, position.into_glib());
885        }
886    }
887
888    /// Sets the fold transition animation duration for @self, in milliseconds.
889    ///
890    /// # Deprecated since 1.4
891    ///
892    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
893    /// ## `duration`
894    /// the new duration, in milliseconds
895    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
896    #[allow(deprecated)]
897    #[doc(alias = "adw_flap_set_fold_duration")]
898    #[doc(alias = "fold-duration")]
899    pub fn set_fold_duration(&self, duration: u32) {
900        unsafe {
901            ffi::adw_flap_set_fold_duration(self.to_glib_none().0, duration);
902        }
903    }
904
905    /// Sets the fold policy for @self.
906    ///
907    /// # Deprecated since 1.4
908    ///
909    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
910    /// ## `policy`
911    /// the fold policy
912    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
913    #[allow(deprecated)]
914    #[doc(alias = "adw_flap_set_fold_policy")]
915    #[doc(alias = "fold-policy")]
916    pub fn set_fold_policy(&self, policy: FlapFoldPolicy) {
917        unsafe {
918            ffi::adw_flap_set_fold_policy(self.to_glib_none().0, policy.into_glib());
919        }
920    }
921
922    /// Sets the fold threshold policy for @self.
923    ///
924    /// If set to [enum@Adw.FoldThresholdPolicy.minimum], flap will only fold when
925    /// the children cannot fit anymore. With [enum@Adw.FoldThresholdPolicy.natural],
926    /// it will fold as soon as children don't get their natural size.
927    ///
928    /// This can be useful if you have a long ellipsizing label and want to let it
929    /// ellipsize instead of immediately folding.
930    ///
931    /// # Deprecated since 1.4
932    ///
933    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
934    /// ## `policy`
935    /// the policy to use
936    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
937    #[allow(deprecated)]
938    #[doc(alias = "adw_flap_set_fold_threshold_policy")]
939    #[doc(alias = "fold-threshold-policy")]
940    pub fn set_fold_threshold_policy(&self, policy: FoldThresholdPolicy) {
941        unsafe {
942            ffi::adw_flap_set_fold_threshold_policy(self.to_glib_none().0, policy.into_glib());
943        }
944    }
945
946    /// Sets whether @self is locked.
947    ///
948    /// If `FALSE`, folding when the flap is revealed automatically closes it, and
949    /// unfolding it when the flap is not revealed opens it. If `TRUE`,
950    /// [`reveal-flap`][struct@crate::Flap#reveal-flap] value never changes on its own.
951    ///
952    /// # Deprecated since 1.4
953    ///
954    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
955    /// ## `locked`
956    /// the new value
957    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
958    #[allow(deprecated)]
959    #[doc(alias = "adw_flap_set_locked")]
960    #[doc(alias = "locked")]
961    pub fn set_locked(&self, locked: bool) {
962        unsafe {
963            ffi::adw_flap_set_locked(self.to_glib_none().0, locked.into_glib());
964        }
965    }
966
967    ///  key, will close the flap. If `FALSE`, clicks are
968    /// passed through to the content widget.
969    ///
970    /// # Deprecated since 1.4
971    ///
972    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
973    /// ## `modal`
974    /// whether @self is modal
975    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
976    #[allow(deprecated)]
977    #[doc(alias = "adw_flap_set_modal")]
978    #[doc(alias = "modal")]
979    pub fn set_modal(&self, modal: bool) {
980        unsafe {
981            ffi::adw_flap_set_modal(self.to_glib_none().0, modal.into_glib());
982        }
983    }
984
985    /// Sets whether the flap widget is revealed for @self.
986    ///
987    /// # Deprecated since 1.4
988    ///
989    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
990    /// ## `reveal_flap`
991    /// whether to reveal the flap widget
992    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
993    #[allow(deprecated)]
994    #[doc(alias = "adw_flap_set_reveal_flap")]
995    #[doc(alias = "reveal-flap")]
996    pub fn set_reveal_flap(&self, reveal_flap: bool) {
997        unsafe {
998            ffi::adw_flap_set_reveal_flap(self.to_glib_none().0, reveal_flap.into_glib());
999        }
1000    }
1001
1002    /// Sets the reveal animation spring parameters for @self.
1003    ///
1004    /// The default value is equivalent to:
1005    ///
1006    /// **⚠️ The following code is in c ⚠️**
1007    ///
1008    /// ```c
1009    /// adw_spring_params_new (1, 0.5, 500)
1010    /// ```
1011    ///
1012    /// # Deprecated since 1.4
1013    ///
1014    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
1015    /// ## `params`
1016    /// the new parameters
1017    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1018    #[allow(deprecated)]
1019    #[doc(alias = "adw_flap_set_reveal_params")]
1020    #[doc(alias = "reveal-params")]
1021    pub fn set_reveal_params(&self, params: &SpringParams) {
1022        unsafe {
1023            ffi::adw_flap_set_reveal_params(self.to_glib_none().0, params.to_glib_none().0);
1024        }
1025    }
1026
1027    /// Sets the separator widget for @self.
1028    ///
1029    /// It's displayed between content and flap when there's no shadow to display.
1030    /// When exactly it's visible depends on the [`transition-type`][struct@crate::Flap#transition-type]
1031    /// value.
1032    ///
1033    /// # Deprecated since 1.4
1034    ///
1035    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
1036    /// ## `separator`
1037    /// the separator widget
1038    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1039    #[allow(deprecated)]
1040    #[doc(alias = "adw_flap_set_separator")]
1041    #[doc(alias = "separator")]
1042    pub fn set_separator(&self, separator: Option<&impl IsA<gtk::Widget>>) {
1043        unsafe {
1044            ffi::adw_flap_set_separator(
1045                self.to_glib_none().0,
1046                separator.map(|p| p.as_ref()).to_glib_none().0,
1047            );
1048        }
1049    }
1050
1051    /// Sets whether @self can be closed with a swipe gesture.
1052    ///
1053    /// The area that can be swiped depends on the [`transition-type`][struct@crate::Flap#transition-type]
1054    /// value.
1055    ///
1056    /// # Deprecated since 1.4
1057    ///
1058    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
1059    /// ## `swipe_to_close`
1060    /// whether @self can be closed with a swipe gesture
1061    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1062    #[allow(deprecated)]
1063    #[doc(alias = "adw_flap_set_swipe_to_close")]
1064    #[doc(alias = "swipe-to-close")]
1065    pub fn set_swipe_to_close(&self, swipe_to_close: bool) {
1066        unsafe {
1067            ffi::adw_flap_set_swipe_to_close(self.to_glib_none().0, swipe_to_close.into_glib());
1068        }
1069    }
1070
1071    /// Sets whether @self can be opened with a swipe gesture.
1072    ///
1073    /// The area that can be swiped depends on the [`transition-type`][struct@crate::Flap#transition-type]
1074    /// value.
1075    ///
1076    /// # Deprecated since 1.4
1077    ///
1078    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
1079    /// ## `swipe_to_open`
1080    /// whether @self can be opened with a swipe gesture
1081    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1082    #[allow(deprecated)]
1083    #[doc(alias = "adw_flap_set_swipe_to_open")]
1084    #[doc(alias = "swipe-to-open")]
1085    pub fn set_swipe_to_open(&self, swipe_to_open: bool) {
1086        unsafe {
1087            ffi::adw_flap_set_swipe_to_open(self.to_glib_none().0, swipe_to_open.into_glib());
1088        }
1089    }
1090
1091    /// Sets the type of animation used for reveal and fold transitions in @self.
1092    ///
1093    /// [`flap`][struct@crate::Flap#flap] is transparent by default, which means the content will
1094    /// be seen through it with [enum@Adw.FlapTransitionType.over] transitions; add
1095    /// the [`.background`](style-classes.html#background) style class to it if this
1096    /// is unwanted.
1097    ///
1098    /// # Deprecated since 1.4
1099    ///
1100    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
1101    /// ## `transition_type`
1102    /// the new transition type
1103    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1104    #[allow(deprecated)]
1105    #[doc(alias = "adw_flap_set_transition_type")]
1106    #[doc(alias = "transition-type")]
1107    pub fn set_transition_type(&self, transition_type: FlapTransitionType) {
1108        unsafe {
1109            ffi::adw_flap_set_transition_type(self.to_glib_none().0, transition_type.into_glib());
1110        }
1111    }
1112
1113    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1114    #[doc(alias = "content")]
1115    pub fn connect_content_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1116        unsafe extern "C" fn notify_content_trampoline<F: Fn(&Flap) + 'static>(
1117            this: *mut ffi::AdwFlap,
1118            _param_spec: glib::ffi::gpointer,
1119            f: glib::ffi::gpointer,
1120        ) {
1121            unsafe {
1122                let f: &F = &*(f as *const F);
1123                f(&from_glib_borrow(this))
1124            }
1125        }
1126        unsafe {
1127            let f: Box_<F> = Box_::new(f);
1128            connect_raw(
1129                self.as_ptr() as *mut _,
1130                c"notify::content".as_ptr(),
1131                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1132                    notify_content_trampoline::<F> as *const (),
1133                )),
1134                Box_::into_raw(f),
1135            )
1136        }
1137    }
1138
1139    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1140    #[doc(alias = "flap")]
1141    pub fn connect_flap_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1142        unsafe extern "C" fn notify_flap_trampoline<F: Fn(&Flap) + 'static>(
1143            this: *mut ffi::AdwFlap,
1144            _param_spec: glib::ffi::gpointer,
1145            f: glib::ffi::gpointer,
1146        ) {
1147            unsafe {
1148                let f: &F = &*(f as *const F);
1149                f(&from_glib_borrow(this))
1150            }
1151        }
1152        unsafe {
1153            let f: Box_<F> = Box_::new(f);
1154            connect_raw(
1155                self.as_ptr() as *mut _,
1156                c"notify::flap".as_ptr(),
1157                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1158                    notify_flap_trampoline::<F> as *const (),
1159                )),
1160                Box_::into_raw(f),
1161            )
1162        }
1163    }
1164
1165    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1166    #[doc(alias = "flap-position")]
1167    pub fn connect_flap_position_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1168        unsafe extern "C" fn notify_flap_position_trampoline<F: Fn(&Flap) + 'static>(
1169            this: *mut ffi::AdwFlap,
1170            _param_spec: glib::ffi::gpointer,
1171            f: glib::ffi::gpointer,
1172        ) {
1173            unsafe {
1174                let f: &F = &*(f as *const F);
1175                f(&from_glib_borrow(this))
1176            }
1177        }
1178        unsafe {
1179            let f: Box_<F> = Box_::new(f);
1180            connect_raw(
1181                self.as_ptr() as *mut _,
1182                c"notify::flap-position".as_ptr(),
1183                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1184                    notify_flap_position_trampoline::<F> as *const (),
1185                )),
1186                Box_::into_raw(f),
1187            )
1188        }
1189    }
1190
1191    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1192    #[doc(alias = "fold-duration")]
1193    pub fn connect_fold_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1194        unsafe extern "C" fn notify_fold_duration_trampoline<F: Fn(&Flap) + 'static>(
1195            this: *mut ffi::AdwFlap,
1196            _param_spec: glib::ffi::gpointer,
1197            f: glib::ffi::gpointer,
1198        ) {
1199            unsafe {
1200                let f: &F = &*(f as *const F);
1201                f(&from_glib_borrow(this))
1202            }
1203        }
1204        unsafe {
1205            let f: Box_<F> = Box_::new(f);
1206            connect_raw(
1207                self.as_ptr() as *mut _,
1208                c"notify::fold-duration".as_ptr(),
1209                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1210                    notify_fold_duration_trampoline::<F> as *const (),
1211                )),
1212                Box_::into_raw(f),
1213            )
1214        }
1215    }
1216
1217    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1218    #[doc(alias = "fold-policy")]
1219    pub fn connect_fold_policy_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1220        unsafe extern "C" fn notify_fold_policy_trampoline<F: Fn(&Flap) + 'static>(
1221            this: *mut ffi::AdwFlap,
1222            _param_spec: glib::ffi::gpointer,
1223            f: glib::ffi::gpointer,
1224        ) {
1225            unsafe {
1226                let f: &F = &*(f as *const F);
1227                f(&from_glib_borrow(this))
1228            }
1229        }
1230        unsafe {
1231            let f: Box_<F> = Box_::new(f);
1232            connect_raw(
1233                self.as_ptr() as *mut _,
1234                c"notify::fold-policy".as_ptr(),
1235                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1236                    notify_fold_policy_trampoline::<F> as *const (),
1237                )),
1238                Box_::into_raw(f),
1239            )
1240        }
1241    }
1242
1243    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1244    #[doc(alias = "fold-threshold-policy")]
1245    pub fn connect_fold_threshold_policy_notify<F: Fn(&Self) + 'static>(
1246        &self,
1247        f: F,
1248    ) -> SignalHandlerId {
1249        unsafe extern "C" fn notify_fold_threshold_policy_trampoline<F: Fn(&Flap) + 'static>(
1250            this: *mut ffi::AdwFlap,
1251            _param_spec: glib::ffi::gpointer,
1252            f: glib::ffi::gpointer,
1253        ) {
1254            unsafe {
1255                let f: &F = &*(f as *const F);
1256                f(&from_glib_borrow(this))
1257            }
1258        }
1259        unsafe {
1260            let f: Box_<F> = Box_::new(f);
1261            connect_raw(
1262                self.as_ptr() as *mut _,
1263                c"notify::fold-threshold-policy".as_ptr(),
1264                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1265                    notify_fold_threshold_policy_trampoline::<F> as *const (),
1266                )),
1267                Box_::into_raw(f),
1268            )
1269        }
1270    }
1271
1272    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1273    #[doc(alias = "folded")]
1274    pub fn connect_folded_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1275        unsafe extern "C" fn notify_folded_trampoline<F: Fn(&Flap) + 'static>(
1276            this: *mut ffi::AdwFlap,
1277            _param_spec: glib::ffi::gpointer,
1278            f: glib::ffi::gpointer,
1279        ) {
1280            unsafe {
1281                let f: &F = &*(f as *const F);
1282                f(&from_glib_borrow(this))
1283            }
1284        }
1285        unsafe {
1286            let f: Box_<F> = Box_::new(f);
1287            connect_raw(
1288                self.as_ptr() as *mut _,
1289                c"notify::folded".as_ptr(),
1290                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1291                    notify_folded_trampoline::<F> as *const (),
1292                )),
1293                Box_::into_raw(f),
1294            )
1295        }
1296    }
1297
1298    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1299    #[doc(alias = "locked")]
1300    pub fn connect_locked_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1301        unsafe extern "C" fn notify_locked_trampoline<F: Fn(&Flap) + 'static>(
1302            this: *mut ffi::AdwFlap,
1303            _param_spec: glib::ffi::gpointer,
1304            f: glib::ffi::gpointer,
1305        ) {
1306            unsafe {
1307                let f: &F = &*(f as *const F);
1308                f(&from_glib_borrow(this))
1309            }
1310        }
1311        unsafe {
1312            let f: Box_<F> = Box_::new(f);
1313            connect_raw(
1314                self.as_ptr() as *mut _,
1315                c"notify::locked".as_ptr(),
1316                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1317                    notify_locked_trampoline::<F> as *const (),
1318                )),
1319                Box_::into_raw(f),
1320            )
1321        }
1322    }
1323
1324    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1325    #[doc(alias = "modal")]
1326    pub fn connect_modal_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1327        unsafe extern "C" fn notify_modal_trampoline<F: Fn(&Flap) + 'static>(
1328            this: *mut ffi::AdwFlap,
1329            _param_spec: glib::ffi::gpointer,
1330            f: glib::ffi::gpointer,
1331        ) {
1332            unsafe {
1333                let f: &F = &*(f as *const F);
1334                f(&from_glib_borrow(this))
1335            }
1336        }
1337        unsafe {
1338            let f: Box_<F> = Box_::new(f);
1339            connect_raw(
1340                self.as_ptr() as *mut _,
1341                c"notify::modal".as_ptr(),
1342                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1343                    notify_modal_trampoline::<F> as *const (),
1344                )),
1345                Box_::into_raw(f),
1346            )
1347        }
1348    }
1349
1350    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1351    #[doc(alias = "reveal-flap")]
1352    pub fn connect_reveal_flap_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1353        unsafe extern "C" fn notify_reveal_flap_trampoline<F: Fn(&Flap) + 'static>(
1354            this: *mut ffi::AdwFlap,
1355            _param_spec: glib::ffi::gpointer,
1356            f: glib::ffi::gpointer,
1357        ) {
1358            unsafe {
1359                let f: &F = &*(f as *const F);
1360                f(&from_glib_borrow(this))
1361            }
1362        }
1363        unsafe {
1364            let f: Box_<F> = Box_::new(f);
1365            connect_raw(
1366                self.as_ptr() as *mut _,
1367                c"notify::reveal-flap".as_ptr(),
1368                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1369                    notify_reveal_flap_trampoline::<F> as *const (),
1370                )),
1371                Box_::into_raw(f),
1372            )
1373        }
1374    }
1375
1376    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1377    #[doc(alias = "reveal-params")]
1378    pub fn connect_reveal_params_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1379        unsafe extern "C" fn notify_reveal_params_trampoline<F: Fn(&Flap) + 'static>(
1380            this: *mut ffi::AdwFlap,
1381            _param_spec: glib::ffi::gpointer,
1382            f: glib::ffi::gpointer,
1383        ) {
1384            unsafe {
1385                let f: &F = &*(f as *const F);
1386                f(&from_glib_borrow(this))
1387            }
1388        }
1389        unsafe {
1390            let f: Box_<F> = Box_::new(f);
1391            connect_raw(
1392                self.as_ptr() as *mut _,
1393                c"notify::reveal-params".as_ptr(),
1394                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1395                    notify_reveal_params_trampoline::<F> as *const (),
1396                )),
1397                Box_::into_raw(f),
1398            )
1399        }
1400    }
1401
1402    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1403    #[doc(alias = "reveal-progress")]
1404    pub fn connect_reveal_progress_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1405        unsafe extern "C" fn notify_reveal_progress_trampoline<F: Fn(&Flap) + 'static>(
1406            this: *mut ffi::AdwFlap,
1407            _param_spec: glib::ffi::gpointer,
1408            f: glib::ffi::gpointer,
1409        ) {
1410            unsafe {
1411                let f: &F = &*(f as *const F);
1412                f(&from_glib_borrow(this))
1413            }
1414        }
1415        unsafe {
1416            let f: Box_<F> = Box_::new(f);
1417            connect_raw(
1418                self.as_ptr() as *mut _,
1419                c"notify::reveal-progress".as_ptr(),
1420                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1421                    notify_reveal_progress_trampoline::<F> as *const (),
1422                )),
1423                Box_::into_raw(f),
1424            )
1425        }
1426    }
1427
1428    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1429    #[doc(alias = "separator")]
1430    pub fn connect_separator_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1431        unsafe extern "C" fn notify_separator_trampoline<F: Fn(&Flap) + 'static>(
1432            this: *mut ffi::AdwFlap,
1433            _param_spec: glib::ffi::gpointer,
1434            f: glib::ffi::gpointer,
1435        ) {
1436            unsafe {
1437                let f: &F = &*(f as *const F);
1438                f(&from_glib_borrow(this))
1439            }
1440        }
1441        unsafe {
1442            let f: Box_<F> = Box_::new(f);
1443            connect_raw(
1444                self.as_ptr() as *mut _,
1445                c"notify::separator".as_ptr(),
1446                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1447                    notify_separator_trampoline::<F> as *const (),
1448                )),
1449                Box_::into_raw(f),
1450            )
1451        }
1452    }
1453
1454    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1455    #[doc(alias = "swipe-to-close")]
1456    pub fn connect_swipe_to_close_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1457        unsafe extern "C" fn notify_swipe_to_close_trampoline<F: Fn(&Flap) + 'static>(
1458            this: *mut ffi::AdwFlap,
1459            _param_spec: glib::ffi::gpointer,
1460            f: glib::ffi::gpointer,
1461        ) {
1462            unsafe {
1463                let f: &F = &*(f as *const F);
1464                f(&from_glib_borrow(this))
1465            }
1466        }
1467        unsafe {
1468            let f: Box_<F> = Box_::new(f);
1469            connect_raw(
1470                self.as_ptr() as *mut _,
1471                c"notify::swipe-to-close".as_ptr(),
1472                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1473                    notify_swipe_to_close_trampoline::<F> as *const (),
1474                )),
1475                Box_::into_raw(f),
1476            )
1477        }
1478    }
1479
1480    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1481    #[doc(alias = "swipe-to-open")]
1482    pub fn connect_swipe_to_open_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1483        unsafe extern "C" fn notify_swipe_to_open_trampoline<F: Fn(&Flap) + 'static>(
1484            this: *mut ffi::AdwFlap,
1485            _param_spec: glib::ffi::gpointer,
1486            f: glib::ffi::gpointer,
1487        ) {
1488            unsafe {
1489                let f: &F = &*(f as *const F);
1490                f(&from_glib_borrow(this))
1491            }
1492        }
1493        unsafe {
1494            let f: Box_<F> = Box_::new(f);
1495            connect_raw(
1496                self.as_ptr() as *mut _,
1497                c"notify::swipe-to-open".as_ptr(),
1498                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1499                    notify_swipe_to_open_trampoline::<F> as *const (),
1500                )),
1501                Box_::into_raw(f),
1502            )
1503        }
1504    }
1505
1506    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1507    #[doc(alias = "transition-type")]
1508    pub fn connect_transition_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1509        unsafe extern "C" fn notify_transition_type_trampoline<F: Fn(&Flap) + 'static>(
1510            this: *mut ffi::AdwFlap,
1511            _param_spec: glib::ffi::gpointer,
1512            f: glib::ffi::gpointer,
1513        ) {
1514            unsafe {
1515                let f: &F = &*(f as *const F);
1516                f(&from_glib_borrow(this))
1517            }
1518        }
1519        unsafe {
1520            let f: Box_<F> = Box_::new(f);
1521            connect_raw(
1522                self.as_ptr() as *mut _,
1523                c"notify::transition-type".as_ptr(),
1524                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1525                    notify_transition_type_trampoline::<F> as *const (),
1526                )),
1527                Box_::into_raw(f),
1528            )
1529        }
1530    }
1531}
1532
1533impl Default for Flap {
1534    fn default() -> Self {
1535        Self::new()
1536    }
1537}
1538
1539// rustdoc-stripper-ignore-next
1540/// A [builder-pattern] type to construct [`Flap`] objects.
1541///
1542/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
1543#[must_use = "The builder must be built to be used"]
1544pub struct FlapBuilder {
1545    builder: glib::object::ObjectBuilder<'static, Flap>,
1546}
1547
1548impl FlapBuilder {
1549    fn new() -> Self {
1550        Self {
1551            builder: glib::object::Object::builder(),
1552        }
1553    }
1554
1555    /// The content widget.
1556    ///
1557    /// It's always displayed when unfolded, and partially visible when folded.
1558    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
1559    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1560    pub fn content(self, content: &impl IsA<gtk::Widget>) -> Self {
1561        Self {
1562            builder: self.builder.property("content", content.clone().upcast()),
1563        }
1564    }
1565
1566    /// The flap widget.
1567    ///
1568    /// It's only visible when [`reveal-progress`][struct@crate::Flap#reveal-progress] is greater than 0.
1569    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
1570    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1571    pub fn flap(self, flap: &impl IsA<gtk::Widget>) -> Self {
1572        Self {
1573            builder: self.builder.property("flap", flap.clone().upcast()),
1574        }
1575    }
1576
1577    /// The flap position.
1578    ///
1579    /// If it's set to [enum@Gtk.PackType.start], the flap is displayed before the
1580    /// content, if [enum@Gtk.PackType.end], it's displayed after the content.
1581    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
1582    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1583    pub fn flap_position(self, flap_position: gtk::PackType) -> Self {
1584        Self {
1585            builder: self.builder.property("flap-position", flap_position),
1586        }
1587    }
1588
1589    /// The fold transition animation duration, in milliseconds.
1590    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
1591    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1592    pub fn fold_duration(self, fold_duration: u32) -> Self {
1593        Self {
1594            builder: self.builder.property("fold-duration", fold_duration),
1595        }
1596    }
1597
1598    /// The fold policy for the flap.
1599    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
1600    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1601    pub fn fold_policy(self, fold_policy: FlapFoldPolicy) -> Self {
1602        Self {
1603            builder: self.builder.property("fold-policy", fold_policy),
1604        }
1605    }
1606
1607    /// Determines when the flap will fold.
1608    ///
1609    /// If set to [enum@Adw.FoldThresholdPolicy.minimum], flap will only fold when
1610    /// the children cannot fit anymore. With [enum@Adw.FoldThresholdPolicy.natural],
1611    /// it will fold as soon as children don't get their natural size.
1612    ///
1613    /// This can be useful if you have a long ellipsizing label and want to let it
1614    /// ellipsize instead of immediately folding.
1615    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
1616    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1617    pub fn fold_threshold_policy(self, fold_threshold_policy: FoldThresholdPolicy) -> Self {
1618        Self {
1619            builder: self
1620                .builder
1621                .property("fold-threshold-policy", fold_threshold_policy),
1622        }
1623    }
1624
1625    /// Whether the flap is locked.
1626    ///
1627    /// If `FALSE`, folding when the flap is revealed automatically closes it, and
1628    /// unfolding it when the flap is not revealed opens it. If `TRUE`,
1629    /// [`reveal-flap`][struct@crate::Flap#reveal-flap] value never changes on its own.
1630    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
1631    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1632    pub fn locked(self, locked: bool) -> Self {
1633        Self {
1634            builder: self.builder.property("locked", locked),
1635        }
1636    }
1637
1638    ///  key, will close the flap. If `FALSE`, clicks
1639    /// are passed through to the content widget.
1640    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
1641    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1642    pub fn modal(self, modal: bool) -> Self {
1643        Self {
1644            builder: self.builder.property("modal", modal),
1645        }
1646    }
1647
1648    /// Whether the flap widget is revealed.
1649    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
1650    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1651    pub fn reveal_flap(self, reveal_flap: bool) -> Self {
1652        Self {
1653            builder: self.builder.property("reveal-flap", reveal_flap),
1654        }
1655    }
1656
1657    /// The reveal animation spring parameters.
1658    ///
1659    /// The default value is equivalent to:
1660    ///
1661    /// **⚠️ The following code is in c ⚠️**
1662    ///
1663    /// ```c
1664    /// adw_spring_params_new (1, 0.5, 500)
1665    /// ```
1666    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
1667    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1668    pub fn reveal_params(self, reveal_params: &SpringParams) -> Self {
1669        Self {
1670            builder: self
1671                .builder
1672                .property("reveal-params", reveal_params.clone()),
1673        }
1674    }
1675
1676    /// The separator widget.
1677    ///
1678    /// It's displayed between content and flap when there's no shadow to display.
1679    /// When exactly it's visible depends on the [`transition-type`][struct@crate::Flap#transition-type]
1680    /// value.
1681    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
1682    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1683    pub fn separator(self, separator: &impl IsA<gtk::Widget>) -> Self {
1684        Self {
1685            builder: self
1686                .builder
1687                .property("separator", separator.clone().upcast()),
1688        }
1689    }
1690
1691    /// Whether the flap can be closed with a swipe gesture.
1692    ///
1693    /// The area that can be swiped depends on the [`transition-type`][struct@crate::Flap#transition-type]
1694    /// value.
1695    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
1696    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1697    pub fn swipe_to_close(self, swipe_to_close: bool) -> Self {
1698        Self {
1699            builder: self.builder.property("swipe-to-close", swipe_to_close),
1700        }
1701    }
1702
1703    /// Whether the flap can be opened with a swipe gesture.
1704    ///
1705    /// The area that can be swiped depends on the [`transition-type`][struct@crate::Flap#transition-type]
1706    /// value.
1707    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
1708    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1709    pub fn swipe_to_open(self, swipe_to_open: bool) -> Self {
1710        Self {
1711            builder: self.builder.property("swipe-to-open", swipe_to_open),
1712        }
1713    }
1714
1715    /// the type of animation used for reveal and fold transitions.
1716    ///
1717    /// [`flap`][struct@crate::Flap#flap] is transparent by default, which means the content
1718    /// will be seen through it with [enum@Adw.FlapTransitionType.over] transitions;
1719    /// add the [`.background`](style-classes.html#background) style class to it if
1720    /// this is unwanted.
1721    /// See [the migration guide](migrating-to-breakpoints.html#replace-adwflap)
1722    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
1723    pub fn transition_type(self, transition_type: FlapTransitionType) -> Self {
1724        Self {
1725            builder: self.builder.property("transition-type", transition_type),
1726        }
1727    }
1728
1729    /// Whether the widget or any of its descendents can accept
1730    /// the input focus.
1731    ///
1732    /// This property is meant to be set by widget implementations,
1733    /// typically in their instance init function.
1734    pub fn can_focus(self, can_focus: bool) -> Self {
1735        Self {
1736            builder: self.builder.property("can-focus", can_focus),
1737        }
1738    }
1739
1740    /// Whether the widget can receive pointer events.
1741    pub fn can_target(self, can_target: bool) -> Self {
1742        Self {
1743            builder: self.builder.property("can-target", can_target),
1744        }
1745    }
1746
1747    /// A list of css classes applied to this widget.
1748    pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
1749        Self {
1750            builder: self.builder.property("css-classes", css_classes.into()),
1751        }
1752    }
1753
1754    /// The name of this widget in the CSS tree.
1755    ///
1756    /// This property is meant to be set by widget implementations,
1757    /// typically in their instance init function.
1758    pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
1759        Self {
1760            builder: self.builder.property("css-name", css_name.into()),
1761        }
1762    }
1763
1764    /// The cursor used by @widget.
1765    pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
1766        Self {
1767            builder: self.builder.property("cursor", cursor.clone()),
1768        }
1769    }
1770
1771    /// Whether the widget should grab focus when it is clicked with the mouse.
1772    ///
1773    /// This property is only relevant for widgets that can take focus.
1774    pub fn focus_on_click(self, focus_on_click: bool) -> Self {
1775        Self {
1776            builder: self.builder.property("focus-on-click", focus_on_click),
1777        }
1778    }
1779
1780    /// Whether this widget itself will accept the input focus.
1781    pub fn focusable(self, focusable: bool) -> Self {
1782        Self {
1783            builder: self.builder.property("focusable", focusable),
1784        }
1785    }
1786
1787    /// How to distribute horizontal space if widget gets extra space.
1788    pub fn halign(self, halign: gtk::Align) -> Self {
1789        Self {
1790            builder: self.builder.property("halign", halign),
1791        }
1792    }
1793
1794    /// Enables or disables the emission of the [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip]
1795    /// signal on @widget.
1796    ///
1797    /// A true value indicates that @widget can have a tooltip, in this case
1798    /// the widget will be queried using [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] to
1799    /// determine whether it will provide a tooltip or not.
1800    pub fn has_tooltip(self, has_tooltip: bool) -> Self {
1801        Self {
1802            builder: self.builder.property("has-tooltip", has_tooltip),
1803        }
1804    }
1805
1806    /// Overrides for height request of the widget.
1807    ///
1808    /// If this is -1, the natural request will be used.
1809    pub fn height_request(self, height_request: i32) -> Self {
1810        Self {
1811            builder: self.builder.property("height-request", height_request),
1812        }
1813    }
1814
1815    /// Whether to expand horizontally.
1816    pub fn hexpand(self, hexpand: bool) -> Self {
1817        Self {
1818            builder: self.builder.property("hexpand", hexpand),
1819        }
1820    }
1821
1822    /// Whether to use the `hexpand` property.
1823    pub fn hexpand_set(self, hexpand_set: bool) -> Self {
1824        Self {
1825            builder: self.builder.property("hexpand-set", hexpand_set),
1826        }
1827    }
1828
1829    /// The [`gtk::LayoutManager`][crate::gtk::LayoutManager] instance to use to compute
1830    /// the preferred size of the widget, and allocate its children.
1831    ///
1832    /// This property is meant to be set by widget implementations,
1833    /// typically in their instance init function.
1834    pub fn layout_manager(self, layout_manager: &impl IsA<gtk::LayoutManager>) -> Self {
1835        Self {
1836            builder: self
1837                .builder
1838                .property("layout-manager", layout_manager.clone().upcast()),
1839        }
1840    }
1841
1842    /// Makes this widget act like a modal dialog, with respect to
1843    /// event delivery.
1844    ///
1845    /// Global event controllers will not handle events with targets
1846    /// inside the widget, unless they are set up to ignore propagation
1847    /// limits. See `Gtk::EventController::set_propagation_limit()`.
1848    #[cfg(feature = "gtk_v4_18")]
1849    #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_18")))]
1850    pub fn limit_events(self, limit_events: bool) -> Self {
1851        Self {
1852            builder: self.builder.property("limit-events", limit_events),
1853        }
1854    }
1855
1856    /// Margin on bottom side of widget.
1857    ///
1858    /// This property adds margin outside of the widget's normal size
1859    /// request, the margin will be added in addition to the size from
1860    /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
1861    pub fn margin_bottom(self, margin_bottom: i32) -> Self {
1862        Self {
1863            builder: self.builder.property("margin-bottom", margin_bottom),
1864        }
1865    }
1866
1867    /// Margin on end of widget, horizontally.
1868    ///
1869    /// This property supports left-to-right and right-to-left text
1870    /// directions.
1871    ///
1872    /// This property adds margin outside of the widget's normal size
1873    /// request, the margin will be added in addition to the size from
1874    /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
1875    pub fn margin_end(self, margin_end: i32) -> Self {
1876        Self {
1877            builder: self.builder.property("margin-end", margin_end),
1878        }
1879    }
1880
1881    /// Margin on start of widget, horizontally.
1882    ///
1883    /// This property supports left-to-right and right-to-left text
1884    /// directions.
1885    ///
1886    /// This property adds margin outside of the widget's normal size
1887    /// request, the margin will be added in addition to the size from
1888    /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
1889    pub fn margin_start(self, margin_start: i32) -> Self {
1890        Self {
1891            builder: self.builder.property("margin-start", margin_start),
1892        }
1893    }
1894
1895    /// Margin on top side of widget.
1896    ///
1897    /// This property adds margin outside of the widget's normal size
1898    /// request, the margin will be added in addition to the size from
1899    /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
1900    pub fn margin_top(self, margin_top: i32) -> Self {
1901        Self {
1902            builder: self.builder.property("margin-top", margin_top),
1903        }
1904    }
1905
1906    /// The name of the widget.
1907    pub fn name(self, name: impl Into<glib::GString>) -> Self {
1908        Self {
1909            builder: self.builder.property("name", name.into()),
1910        }
1911    }
1912
1913    /// The requested opacity of the widget.
1914    pub fn opacity(self, opacity: f64) -> Self {
1915        Self {
1916            builder: self.builder.property("opacity", opacity),
1917        }
1918    }
1919
1920    /// How content outside the widget's content area is treated.
1921    ///
1922    /// This property is meant to be set by widget implementations,
1923    /// typically in their instance init function.
1924    pub fn overflow(self, overflow: gtk::Overflow) -> Self {
1925        Self {
1926            builder: self.builder.property("overflow", overflow),
1927        }
1928    }
1929
1930    /// Whether the widget will receive the default action when it is focused.
1931    pub fn receives_default(self, receives_default: bool) -> Self {
1932        Self {
1933            builder: self.builder.property("receives-default", receives_default),
1934        }
1935    }
1936
1937    /// Whether the widget responds to input.
1938    pub fn sensitive(self, sensitive: bool) -> Self {
1939        Self {
1940            builder: self.builder.property("sensitive", sensitive),
1941        }
1942    }
1943
1944    /// Sets the text of tooltip to be the given string, which is marked up
1945    /// with Pango markup.
1946    ///
1947    /// Also see `Gtk::Tooltip::set_markup()`.
1948    ///
1949    /// This is a convenience property which will take care of getting the
1950    /// tooltip shown if the given string is not `NULL`:
1951    /// [`has-tooltip`][struct@crate::gtk::Widget#has-tooltip] will automatically be set to true
1952    /// and there will be taken care of [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] in
1953    /// the default signal handler.
1954    ///
1955    /// Note that if both [`tooltip-text`][struct@crate::gtk::Widget#tooltip-text] and
1956    /// [`tooltip-markup`][struct@crate::gtk::Widget#tooltip-markup] are set, the last one wins.
1957    pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
1958        Self {
1959            builder: self
1960                .builder
1961                .property("tooltip-markup", tooltip_markup.into()),
1962        }
1963    }
1964
1965    /// Sets the text of tooltip to be the given string.
1966    ///
1967    /// Also see `Gtk::Tooltip::set_text()`.
1968    ///
1969    /// This is a convenience property which will take care of getting the
1970    /// tooltip shown if the given string is not `NULL`:
1971    /// [`has-tooltip`][struct@crate::gtk::Widget#has-tooltip] will automatically be set to true
1972    /// and there will be taken care of [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] in
1973    /// the default signal handler.
1974    ///
1975    /// Note that if both [`tooltip-text`][struct@crate::gtk::Widget#tooltip-text] and
1976    /// [`tooltip-markup`][struct@crate::gtk::Widget#tooltip-markup] are set, the last one wins.
1977    pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
1978        Self {
1979            builder: self.builder.property("tooltip-text", tooltip_text.into()),
1980        }
1981    }
1982
1983    /// How to distribute vertical space if widget gets extra space.
1984    pub fn valign(self, valign: gtk::Align) -> Self {
1985        Self {
1986            builder: self.builder.property("valign", valign),
1987        }
1988    }
1989
1990    /// Whether to expand vertically.
1991    pub fn vexpand(self, vexpand: bool) -> Self {
1992        Self {
1993            builder: self.builder.property("vexpand", vexpand),
1994        }
1995    }
1996
1997    /// Whether to use the `vexpand` property.
1998    pub fn vexpand_set(self, vexpand_set: bool) -> Self {
1999        Self {
2000            builder: self.builder.property("vexpand-set", vexpand_set),
2001        }
2002    }
2003
2004    /// Whether the widget is visible.
2005    pub fn visible(self, visible: bool) -> Self {
2006        Self {
2007            builder: self.builder.property("visible", visible),
2008        }
2009    }
2010
2011    /// Overrides for width request of the widget.
2012    ///
2013    /// If this is -1, the natural request will be used.
2014    pub fn width_request(self, width_request: i32) -> Self {
2015        Self {
2016            builder: self.builder.property("width-request", width_request),
2017        }
2018    }
2019
2020    /// The accessible role of the given [`gtk::Accessible`][crate::gtk::Accessible] implementation.
2021    ///
2022    /// The accessible role cannot be changed once set.
2023    pub fn accessible_role(self, accessible_role: gtk::AccessibleRole) -> Self {
2024        Self {
2025            builder: self.builder.property("accessible-role", accessible_role),
2026        }
2027    }
2028
2029    /// The orientation of the orientable.
2030    pub fn orientation(self, orientation: gtk::Orientation) -> Self {
2031        Self {
2032            builder: self.builder.property("orientation", orientation),
2033        }
2034    }
2035
2036    // rustdoc-stripper-ignore-next
2037    /// Build the [`Flap`].
2038    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
2039    pub fn build(self) -> Flap {
2040        assert_initialized_main_thread!();
2041        self.builder.build()
2042    }
2043}