libadwaita/auto/expander_row.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::{PreferencesRow, ffi};
8use glib::{
9 prelude::*,
10 signal::{SignalHandlerId, connect_raw},
11 translate::*,
12};
13use std::boxed::Box as Box_;
14
15glib::wrapper! {
16 /// A [`gtk::ListBoxRow`][crate::gtk::ListBoxRow] used to reveal widgets.
17 ///
18 /// <picture>
19 /// <source srcset="expander-row-dark.png" media="(prefers-color-scheme: dark)">
20 /// <img src="expander-row.png" alt="expander-row">
21 /// </picture>
22 ///
23 /// The [`ExpanderRow`][crate::ExpanderRow] widget allows the user to reveal or hide widgets below
24 /// it. It also allows the user to enable the expansion of the row, allowing to
25 /// disable all that the row contains.
26 ///
27 /// ## AdwExpanderRow as GtkBuildable
28 ///
29 /// The [`ExpanderRow`][crate::ExpanderRow] implementation of the [`gtk::Buildable`][crate::gtk::Buildable] interface
30 /// supports adding a child as an suffix widget by specifying “suffix” as the
31 /// “type” attribute of a <child> element.
32 ///
33 /// It also supports adding it as a prefix widget by specifying “prefix” as the
34 /// “type” attribute of a <child> element.
35 ///
36 /// ## CSS nodes
37 ///
38 /// [`ExpanderRow`][crate::ExpanderRow] has a main CSS node with name `row` and the `.expander`
39 /// style class. It has the `.empty` style class when it contains no children.
40 ///
41 /// It contains the subnodes `row.header` for its main embedded row,
42 /// `list.nested` for the list it can expand, and `image.expander-row-arrow` for
43 /// its arrow.
44 ///
45 /// ## Style classes
46 ///
47 /// [`ExpanderRow`][crate::ExpanderRow] can use the [`.`](style-classes.html#property-rows)
48 /// style class to emphasize the row subtitle instead of the row title, which is
49 /// useful for displaying read-only properties.
50 ///
51 /// When used together with the `.monospace` style class, only the subtitle
52 /// becomes monospace, not the title or any extra widgets.
53 ///
54 /// ## Properties
55 ///
56 ///
57 /// #### `enable-expansion`
58 /// Whether expansion is enabled.
59 ///
60 /// Readable | Writeable
61 ///
62 ///
63 /// #### `expanded`
64 /// Whether the row is expanded.
65 ///
66 /// Readable | Writeable
67 ///
68 ///
69 /// #### `icon-name`
70 /// The icon name for this row.
71 ///
72 /// Readable | Writeable
73 ///
74 ///
75 /// #### `show-enable-switch`
76 /// Whether the switch enabling the expansion is visible.
77 ///
78 /// Readable | Writeable
79 ///
80 ///
81 /// #### `subtitle`
82 /// The subtitle for this row.
83 ///
84 /// The subtitle is interpreted as Pango markup unless
85 /// [`use-markup`][struct@crate::PreferencesRow#use-markup] is set to `FALSE`.
86 ///
87 /// Readable | Writeable
88 ///
89 ///
90 /// #### `subtitle-lines`
91 /// The number of lines at the end of which the subtitle label will be
92 /// ellipsized.
93 ///
94 /// If the value is 0, the number of lines won't be limited.
95 ///
96 /// Readable | Writeable
97 ///
98 ///
99 /// #### `title-lines`
100 /// The number of lines at the end of which the title label will be ellipsized.
101 ///
102 /// If the value is 0, the number of lines won't be limited.
103 ///
104 /// Readable | Writeable
105 /// <details><summary><h4>PreferencesRow</h4></summary>
106 ///
107 ///
108 /// #### `title`
109 /// The title of the preference represented by this row.
110 ///
111 /// The title is interpreted as Pango markup unless
112 /// [`use-markup`][struct@crate::PreferencesRow#use-markup] is set to `FALSE`.
113 ///
114 /// Readable | Writeable
115 ///
116 ///
117 /// #### `title-selectable`
118 /// Whether the user can copy the title from the label.
119 ///
120 /// See also [`selectable`][struct@crate::Gtk::Label#selectable].
121 ///
122 /// Readable | Writeable
123 ///
124 ///
125 /// #### `use-markup`
126 /// Whether to use Pango markup for the title label.
127 ///
128 /// Subclasses may also use it for other labels, such as subtitle.
129 ///
130 /// See also `parse_markup()`.
131 ///
132 /// Readable | Writeable
133 ///
134 ///
135 /// #### `use-underline`
136 /// Whether an embedded underline in the title indicates a mnemonic.
137 ///
138 /// Readable | Writeable
139 /// </details>
140 /// <details><summary><h4>ListBoxRow</h4></summary>
141 ///
142 ///
143 /// #### `activatable`
144 /// Determines whether the ::row-activated
145 /// signal will be emitted for this row.
146 ///
147 /// Readable | Writeable
148 ///
149 ///
150 /// #### `child`
151 /// The child widget.
152 ///
153 /// Readable | Writeable
154 ///
155 ///
156 /// #### `selectable`
157 /// Determines whether this row can be selected.
158 ///
159 /// Readable | Writeable
160 /// </details>
161 /// <details><summary><h4>Widget</h4></summary>
162 ///
163 ///
164 /// #### `can-focus`
165 /// Whether the widget or any of its descendents can accept
166 /// the input focus.
167 ///
168 /// This property is meant to be set by widget implementations,
169 /// typically in their instance init function.
170 ///
171 /// Readable | Writeable
172 ///
173 ///
174 /// #### `can-target`
175 /// Whether the widget can receive pointer events.
176 ///
177 /// Readable | Writeable
178 ///
179 ///
180 /// #### `css-classes`
181 /// A list of css classes applied to this widget.
182 ///
183 /// Readable | Writeable
184 ///
185 ///
186 /// #### `css-name`
187 /// The name of this widget in the CSS tree.
188 ///
189 /// This property is meant to be set by widget implementations,
190 /// typically in their instance init function.
191 ///
192 /// Readable | Writeable | Construct Only
193 ///
194 ///
195 /// #### `cursor`
196 /// The cursor used by @widget.
197 ///
198 /// Readable | Writeable
199 ///
200 ///
201 /// #### `focus-on-click`
202 /// Whether the widget should grab focus when it is clicked with the mouse.
203 ///
204 /// This property is only relevant for widgets that can take focus.
205 ///
206 /// Readable | Writeable
207 ///
208 ///
209 /// #### `focusable`
210 /// Whether this widget itself will accept the input focus.
211 ///
212 /// Readable | Writeable
213 ///
214 ///
215 /// #### `halign`
216 /// How to distribute horizontal space if widget gets extra space.
217 ///
218 /// Readable | Writeable
219 ///
220 ///
221 /// #### `has-default`
222 /// Whether the widget is the default widget.
223 ///
224 /// Readable
225 ///
226 ///
227 /// #### `has-focus`
228 /// Whether the widget has the input focus.
229 ///
230 /// Readable
231 ///
232 ///
233 /// #### `has-tooltip`
234 /// Enables or disables the emission of the [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip]
235 /// signal on @widget.
236 ///
237 /// A true value indicates that @widget can have a tooltip, in this case
238 /// the widget will be queried using [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] to
239 /// determine whether it will provide a tooltip or not.
240 ///
241 /// Readable | Writeable
242 ///
243 ///
244 /// #### `height-request`
245 /// Overrides for height request of the widget.
246 ///
247 /// If this is -1, the natural request will be used.
248 ///
249 /// Readable | Writeable
250 ///
251 ///
252 /// #### `hexpand`
253 /// Whether to expand horizontally.
254 ///
255 /// Readable | Writeable
256 ///
257 ///
258 /// #### `hexpand-set`
259 /// Whether to use the `hexpand` property.
260 ///
261 /// Readable | Writeable
262 ///
263 ///
264 /// #### `layout-manager`
265 /// The [`gtk::LayoutManager`][crate::gtk::LayoutManager] instance to use to compute
266 /// the preferred size of the widget, and allocate its children.
267 ///
268 /// This property is meant to be set by widget implementations,
269 /// typically in their instance init function.
270 ///
271 /// Readable | Writeable
272 ///
273 ///
274 /// #### `limit-events`
275 /// Makes this widget act like a modal dialog, with respect to
276 /// event delivery.
277 ///
278 /// Global event controllers will not handle events with targets
279 /// inside the widget, unless they are set up to ignore propagation
280 /// limits. See `Gtk::EventController::set_propagation_limit()`.
281 ///
282 /// Readable | Writeable
283 ///
284 ///
285 /// #### `margin-bottom`
286 /// Margin on bottom side of widget.
287 ///
288 /// This property adds margin outside of the widget's normal size
289 /// request, the margin will be added in addition to the size from
290 /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
291 ///
292 /// Readable | Writeable
293 ///
294 ///
295 /// #### `margin-end`
296 /// Margin on end of widget, horizontally.
297 ///
298 /// This property supports left-to-right and right-to-left text
299 /// directions.
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 | Writeable
306 ///
307 ///
308 /// #### `margin-start`
309 /// Margin on start 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 | Writeable
319 ///
320 ///
321 /// #### `margin-top`
322 /// Margin on top side of widget.
323 ///
324 /// This property adds margin outside of the widget's normal size
325 /// request, the margin will be added in addition to the size from
326 /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
327 ///
328 /// Readable | Writeable
329 ///
330 ///
331 /// #### `name`
332 /// The name of the widget.
333 ///
334 /// Readable | Writeable
335 ///
336 ///
337 /// #### `opacity`
338 /// The requested opacity of the widget.
339 ///
340 /// Readable | Writeable
341 ///
342 ///
343 /// #### `overflow`
344 /// How content outside the widget's content area is treated.
345 ///
346 /// This property is meant to be set by widget implementations,
347 /// typically in their instance init function.
348 ///
349 /// Readable | Writeable
350 ///
351 ///
352 /// #### `parent`
353 /// The parent widget of this widget.
354 ///
355 /// Readable
356 ///
357 ///
358 /// #### `receives-default`
359 /// Whether the widget will receive the default action when it is focused.
360 ///
361 /// Readable | Writeable
362 ///
363 ///
364 /// #### `root`
365 /// The [`gtk::Root`][crate::gtk::Root] widget of the widget tree containing this widget.
366 ///
367 /// This will be `NULL` if the widget is not contained in a root widget.
368 ///
369 /// Readable
370 ///
371 ///
372 /// #### `scale-factor`
373 /// The scale factor of the widget.
374 ///
375 /// Readable
376 ///
377 ///
378 /// #### `sensitive`
379 /// Whether the widget responds to input.
380 ///
381 /// Readable | Writeable
382 ///
383 ///
384 /// #### `tooltip-markup`
385 /// Sets the text of tooltip to be the given string, which is marked up
386 /// with Pango markup.
387 ///
388 /// Also see `Gtk::Tooltip::set_markup()`.
389 ///
390 /// This is a convenience property which will take care of getting the
391 /// tooltip shown if the given string is not `NULL`:
392 /// [`has-tooltip`][struct@crate::gtk::Widget#has-tooltip] will automatically be set to true
393 /// and there will be taken care of [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] in
394 /// the default signal handler.
395 ///
396 /// Note that if both [`tooltip-text`][struct@crate::gtk::Widget#tooltip-text] and
397 /// [`tooltip-markup`][struct@crate::gtk::Widget#tooltip-markup] are set, the last one wins.
398 ///
399 /// Readable | Writeable
400 ///
401 ///
402 /// #### `tooltip-text`
403 /// Sets the text of tooltip to be the given string.
404 ///
405 /// Also see `Gtk::Tooltip::set_text()`.
406 ///
407 /// This is a convenience property which will take care of getting the
408 /// tooltip shown if the given string is not `NULL`:
409 /// [`has-tooltip`][struct@crate::gtk::Widget#has-tooltip] will automatically be set to true
410 /// and there will be taken care of [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] in
411 /// the default signal handler.
412 ///
413 /// Note that if both [`tooltip-text`][struct@crate::gtk::Widget#tooltip-text] and
414 /// [`tooltip-markup`][struct@crate::gtk::Widget#tooltip-markup] are set, the last one wins.
415 ///
416 /// Readable | Writeable
417 ///
418 ///
419 /// #### `valign`
420 /// How to distribute vertical space if widget gets extra space.
421 ///
422 /// Readable | Writeable
423 ///
424 ///
425 /// #### `vexpand`
426 /// Whether to expand vertically.
427 ///
428 /// Readable | Writeable
429 ///
430 ///
431 /// #### `vexpand-set`
432 /// Whether to use the `vexpand` property.
433 ///
434 /// Readable | Writeable
435 ///
436 ///
437 /// #### `visible`
438 /// Whether the widget is visible.
439 ///
440 /// Readable | Writeable
441 ///
442 ///
443 /// #### `width-request`
444 /// Overrides for width request of the widget.
445 ///
446 /// If this is -1, the natural request will be used.
447 ///
448 /// Readable | Writeable
449 /// </details>
450 /// <details><summary><h4>Accessible</h4></summary>
451 ///
452 ///
453 /// #### `accessible-role`
454 /// The accessible role of the given [`gtk::Accessible`][crate::gtk::Accessible] implementation.
455 ///
456 /// The accessible role cannot be changed once set.
457 ///
458 /// Readable | Writeable
459 /// </details>
460 /// <details><summary><h4>Actionable</h4></summary>
461 ///
462 ///
463 /// #### `action-name`
464 /// The name of the action with which this widget should be associated.
465 ///
466 /// Readable | Writeable
467 ///
468 ///
469 /// #### `action-target`
470 /// The target value of the actionable widget's action.
471 ///
472 /// Readable | Writeable
473 /// </details>
474 ///
475 /// # Implements
476 ///
477 /// [`ExpanderRowExt`][trait@crate::prelude::ExpanderRowExt], [`PreferencesRowExt`][trait@crate::prelude::PreferencesRowExt], [`trait@gtk::prelude::ListBoxRowExt`], [`trait@gtk::prelude::WidgetExt`], [`trait@glib::ObjectExt`], [`trait@gtk::prelude::AccessibleExt`], [`trait@gtk::prelude::BuildableExt`], [`trait@gtk::prelude::ConstraintTargetExt`], [`trait@gtk::prelude::ActionableExt`]
478 #[doc(alias = "AdwExpanderRow")]
479 pub struct ExpanderRow(Object<ffi::AdwExpanderRow, ffi::AdwExpanderRowClass>) @extends PreferencesRow, gtk::ListBoxRow, gtk::Widget, @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Actionable;
480
481 match fn {
482 type_ => || ffi::adw_expander_row_get_type(),
483 }
484}
485
486impl ExpanderRow {
487 pub const NONE: Option<&'static ExpanderRow> = None;
488
489 /// Creates a new [`ExpanderRow`][crate::ExpanderRow].
490 ///
491 /// # Returns
492 ///
493 /// the newly created [`ExpanderRow`][crate::ExpanderRow]
494 #[doc(alias = "adw_expander_row_new")]
495 pub fn new() -> ExpanderRow {
496 assert_initialized_main_thread!();
497 unsafe { gtk::Widget::from_glib_none(ffi::adw_expander_row_new()).unsafe_cast() }
498 }
499
500 // rustdoc-stripper-ignore-next
501 /// Creates a new builder-pattern struct instance to construct [`ExpanderRow`] objects.
502 ///
503 /// This method returns an instance of [`ExpanderRowBuilder`](crate::builders::ExpanderRowBuilder) which can be used to create [`ExpanderRow`] objects.
504 pub fn builder() -> ExpanderRowBuilder {
505 ExpanderRowBuilder::new()
506 }
507}
508
509impl Default for ExpanderRow {
510 fn default() -> Self {
511 Self::new()
512 }
513}
514
515// rustdoc-stripper-ignore-next
516/// A [builder-pattern] type to construct [`ExpanderRow`] objects.
517///
518/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
519#[must_use = "The builder must be built to be used"]
520pub struct ExpanderRowBuilder {
521 builder: glib::object::ObjectBuilder<'static, ExpanderRow>,
522}
523
524impl ExpanderRowBuilder {
525 fn new() -> Self {
526 Self {
527 builder: glib::object::Object::builder(),
528 }
529 }
530
531 /// Whether expansion is enabled.
532 pub fn enable_expansion(self, enable_expansion: bool) -> Self {
533 Self {
534 builder: self.builder.property("enable-expansion", enable_expansion),
535 }
536 }
537
538 /// Whether the row is expanded.
539 pub fn expanded(self, expanded: bool) -> Self {
540 Self {
541 builder: self.builder.property("expanded", expanded),
542 }
543 }
544
545 /// The icon name for this row.
546 /// Use [`ExpanderRowExt::add_prefix()`][crate::prelude::ExpanderRowExt::add_prefix()] to add an icon.
547 #[cfg_attr(feature = "v1_3", deprecated = "Since 1.3")]
548 pub fn icon_name(self, icon_name: impl Into<glib::GString>) -> Self {
549 Self {
550 builder: self.builder.property("icon-name", icon_name.into()),
551 }
552 }
553
554 /// Whether the switch enabling the expansion is visible.
555 pub fn show_enable_switch(self, show_enable_switch: bool) -> Self {
556 Self {
557 builder: self
558 .builder
559 .property("show-enable-switch", show_enable_switch),
560 }
561 }
562
563 /// The subtitle for this row.
564 ///
565 /// The subtitle is interpreted as Pango markup unless
566 /// [`use-markup`][struct@crate::PreferencesRow#use-markup] is set to `FALSE`.
567 pub fn subtitle(self, subtitle: impl Into<glib::GString>) -> Self {
568 Self {
569 builder: self.builder.property("subtitle", subtitle.into()),
570 }
571 }
572
573 /// The number of lines at the end of which the subtitle label will be
574 /// ellipsized.
575 ///
576 /// If the value is 0, the number of lines won't be limited.
577 #[cfg(feature = "v1_3")]
578 #[cfg_attr(docsrs, doc(cfg(feature = "v1_3")))]
579 pub fn subtitle_lines(self, subtitle_lines: i32) -> Self {
580 Self {
581 builder: self.builder.property("subtitle-lines", subtitle_lines),
582 }
583 }
584
585 /// The number of lines at the end of which the title label will be ellipsized.
586 ///
587 /// If the value is 0, the number of lines won't be limited.
588 #[cfg(feature = "v1_3")]
589 #[cfg_attr(docsrs, doc(cfg(feature = "v1_3")))]
590 pub fn title_lines(self, title_lines: i32) -> Self {
591 Self {
592 builder: self.builder.property("title-lines", title_lines),
593 }
594 }
595
596 /// The title of the preference represented by this row.
597 ///
598 /// The title is interpreted as Pango markup unless
599 /// [`use-markup`][struct@crate::PreferencesRow#use-markup] is set to `FALSE`.
600 pub fn title(self, title: impl Into<glib::GString>) -> Self {
601 Self {
602 builder: self.builder.property("title", title.into()),
603 }
604 }
605
606 /// Whether the user can copy the title from the label.
607 ///
608 /// See also [`selectable`][struct@crate::Gtk::Label#selectable].
609 #[cfg(feature = "v1_1")]
610 #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))]
611 pub fn title_selectable(self, title_selectable: bool) -> Self {
612 Self {
613 builder: self.builder.property("title-selectable", title_selectable),
614 }
615 }
616
617 /// Whether to use Pango markup for the title label.
618 ///
619 /// Subclasses may also use it for other labels, such as subtitle.
620 ///
621 /// See also `parse_markup()`.
622 #[cfg(feature = "v1_2")]
623 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
624 pub fn use_markup(self, use_markup: bool) -> Self {
625 Self {
626 builder: self.builder.property("use-markup", use_markup),
627 }
628 }
629
630 /// Whether an embedded underline in the title indicates a mnemonic.
631 pub fn use_underline(self, use_underline: bool) -> Self {
632 Self {
633 builder: self.builder.property("use-underline", use_underline),
634 }
635 }
636
637 /// Determines whether the ::row-activated
638 /// signal will be emitted for this row.
639 pub fn activatable(self, activatable: bool) -> Self {
640 Self {
641 builder: self.builder.property("activatable", activatable),
642 }
643 }
644
645 /// The child widget.
646 pub fn child(self, child: &impl IsA<gtk::Widget>) -> Self {
647 Self {
648 builder: self.builder.property("child", child.clone().upcast()),
649 }
650 }
651
652 /// Determines whether this row can be selected.
653 pub fn selectable(self, selectable: bool) -> Self {
654 Self {
655 builder: self.builder.property("selectable", selectable),
656 }
657 }
658
659 /// Whether the widget or any of its descendents can accept
660 /// the input focus.
661 ///
662 /// This property is meant to be set by widget implementations,
663 /// typically in their instance init function.
664 pub fn can_focus(self, can_focus: bool) -> Self {
665 Self {
666 builder: self.builder.property("can-focus", can_focus),
667 }
668 }
669
670 /// Whether the widget can receive pointer events.
671 pub fn can_target(self, can_target: bool) -> Self {
672 Self {
673 builder: self.builder.property("can-target", can_target),
674 }
675 }
676
677 /// A list of css classes applied to this widget.
678 pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
679 Self {
680 builder: self.builder.property("css-classes", css_classes.into()),
681 }
682 }
683
684 /// The name of this widget in the CSS tree.
685 ///
686 /// This property is meant to be set by widget implementations,
687 /// typically in their instance init function.
688 pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
689 Self {
690 builder: self.builder.property("css-name", css_name.into()),
691 }
692 }
693
694 /// The cursor used by @widget.
695 pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
696 Self {
697 builder: self.builder.property("cursor", cursor.clone()),
698 }
699 }
700
701 /// Whether the widget should grab focus when it is clicked with the mouse.
702 ///
703 /// This property is only relevant for widgets that can take focus.
704 pub fn focus_on_click(self, focus_on_click: bool) -> Self {
705 Self {
706 builder: self.builder.property("focus-on-click", focus_on_click),
707 }
708 }
709
710 /// Whether this widget itself will accept the input focus.
711 pub fn focusable(self, focusable: bool) -> Self {
712 Self {
713 builder: self.builder.property("focusable", focusable),
714 }
715 }
716
717 /// How to distribute horizontal space if widget gets extra space.
718 pub fn halign(self, halign: gtk::Align) -> Self {
719 Self {
720 builder: self.builder.property("halign", halign),
721 }
722 }
723
724 /// Enables or disables the emission of the [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip]
725 /// signal on @widget.
726 ///
727 /// A true value indicates that @widget can have a tooltip, in this case
728 /// the widget will be queried using [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] to
729 /// determine whether it will provide a tooltip or not.
730 pub fn has_tooltip(self, has_tooltip: bool) -> Self {
731 Self {
732 builder: self.builder.property("has-tooltip", has_tooltip),
733 }
734 }
735
736 /// Overrides for height request of the widget.
737 ///
738 /// If this is -1, the natural request will be used.
739 pub fn height_request(self, height_request: i32) -> Self {
740 Self {
741 builder: self.builder.property("height-request", height_request),
742 }
743 }
744
745 /// Whether to expand horizontally.
746 pub fn hexpand(self, hexpand: bool) -> Self {
747 Self {
748 builder: self.builder.property("hexpand", hexpand),
749 }
750 }
751
752 /// Whether to use the `hexpand` property.
753 pub fn hexpand_set(self, hexpand_set: bool) -> Self {
754 Self {
755 builder: self.builder.property("hexpand-set", hexpand_set),
756 }
757 }
758
759 /// The [`gtk::LayoutManager`][crate::gtk::LayoutManager] instance to use to compute
760 /// the preferred size of the widget, and allocate its children.
761 ///
762 /// This property is meant to be set by widget implementations,
763 /// typically in their instance init function.
764 pub fn layout_manager(self, layout_manager: &impl IsA<gtk::LayoutManager>) -> Self {
765 Self {
766 builder: self
767 .builder
768 .property("layout-manager", layout_manager.clone().upcast()),
769 }
770 }
771
772 /// Makes this widget act like a modal dialog, with respect to
773 /// event delivery.
774 ///
775 /// Global event controllers will not handle events with targets
776 /// inside the widget, unless they are set up to ignore propagation
777 /// limits. See `Gtk::EventController::set_propagation_limit()`.
778 #[cfg(feature = "gtk_v4_18")]
779 #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_18")))]
780 pub fn limit_events(self, limit_events: bool) -> Self {
781 Self {
782 builder: self.builder.property("limit-events", limit_events),
783 }
784 }
785
786 /// Margin on bottom side of widget.
787 ///
788 /// This property adds margin outside of the widget's normal size
789 /// request, the margin will be added in addition to the size from
790 /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
791 pub fn margin_bottom(self, margin_bottom: i32) -> Self {
792 Self {
793 builder: self.builder.property("margin-bottom", margin_bottom),
794 }
795 }
796
797 /// Margin on end of widget, horizontally.
798 ///
799 /// This property supports left-to-right and right-to-left text
800 /// directions.
801 ///
802 /// This property adds margin outside of the widget's normal size
803 /// request, the margin will be added in addition to the size from
804 /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
805 pub fn margin_end(self, margin_end: i32) -> Self {
806 Self {
807 builder: self.builder.property("margin-end", margin_end),
808 }
809 }
810
811 /// Margin on start of widget, horizontally.
812 ///
813 /// This property supports left-to-right and right-to-left text
814 /// directions.
815 ///
816 /// This property adds margin outside of the widget's normal size
817 /// request, the margin will be added in addition to the size from
818 /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
819 pub fn margin_start(self, margin_start: i32) -> Self {
820 Self {
821 builder: self.builder.property("margin-start", margin_start),
822 }
823 }
824
825 /// Margin on top side of widget.
826 ///
827 /// This property adds margin outside of the widget's normal size
828 /// request, the margin will be added in addition to the size from
829 /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
830 pub fn margin_top(self, margin_top: i32) -> Self {
831 Self {
832 builder: self.builder.property("margin-top", margin_top),
833 }
834 }
835
836 /// The name of the widget.
837 pub fn name(self, name: impl Into<glib::GString>) -> Self {
838 Self {
839 builder: self.builder.property("name", name.into()),
840 }
841 }
842
843 /// The requested opacity of the widget.
844 pub fn opacity(self, opacity: f64) -> Self {
845 Self {
846 builder: self.builder.property("opacity", opacity),
847 }
848 }
849
850 /// How content outside the widget's content area is treated.
851 ///
852 /// This property is meant to be set by widget implementations,
853 /// typically in their instance init function.
854 pub fn overflow(self, overflow: gtk::Overflow) -> Self {
855 Self {
856 builder: self.builder.property("overflow", overflow),
857 }
858 }
859
860 /// Whether the widget will receive the default action when it is focused.
861 pub fn receives_default(self, receives_default: bool) -> Self {
862 Self {
863 builder: self.builder.property("receives-default", receives_default),
864 }
865 }
866
867 /// Whether the widget responds to input.
868 pub fn sensitive(self, sensitive: bool) -> Self {
869 Self {
870 builder: self.builder.property("sensitive", sensitive),
871 }
872 }
873
874 /// Sets the text of tooltip to be the given string, which is marked up
875 /// with Pango markup.
876 ///
877 /// Also see `Gtk::Tooltip::set_markup()`.
878 ///
879 /// This is a convenience property which will take care of getting the
880 /// tooltip shown if the given string is not `NULL`:
881 /// [`has-tooltip`][struct@crate::gtk::Widget#has-tooltip] will automatically be set to true
882 /// and there will be taken care of [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] in
883 /// the default signal handler.
884 ///
885 /// Note that if both [`tooltip-text`][struct@crate::gtk::Widget#tooltip-text] and
886 /// [`tooltip-markup`][struct@crate::gtk::Widget#tooltip-markup] are set, the last one wins.
887 pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
888 Self {
889 builder: self
890 .builder
891 .property("tooltip-markup", tooltip_markup.into()),
892 }
893 }
894
895 /// Sets the text of tooltip to be the given string.
896 ///
897 /// Also see `Gtk::Tooltip::set_text()`.
898 ///
899 /// This is a convenience property which will take care of getting the
900 /// tooltip shown if the given string is not `NULL`:
901 /// [`has-tooltip`][struct@crate::gtk::Widget#has-tooltip] will automatically be set to true
902 /// and there will be taken care of [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] in
903 /// the default signal handler.
904 ///
905 /// Note that if both [`tooltip-text`][struct@crate::gtk::Widget#tooltip-text] and
906 /// [`tooltip-markup`][struct@crate::gtk::Widget#tooltip-markup] are set, the last one wins.
907 pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
908 Self {
909 builder: self.builder.property("tooltip-text", tooltip_text.into()),
910 }
911 }
912
913 /// How to distribute vertical space if widget gets extra space.
914 pub fn valign(self, valign: gtk::Align) -> Self {
915 Self {
916 builder: self.builder.property("valign", valign),
917 }
918 }
919
920 /// Whether to expand vertically.
921 pub fn vexpand(self, vexpand: bool) -> Self {
922 Self {
923 builder: self.builder.property("vexpand", vexpand),
924 }
925 }
926
927 /// Whether to use the `vexpand` property.
928 pub fn vexpand_set(self, vexpand_set: bool) -> Self {
929 Self {
930 builder: self.builder.property("vexpand-set", vexpand_set),
931 }
932 }
933
934 /// Whether the widget is visible.
935 pub fn visible(self, visible: bool) -> Self {
936 Self {
937 builder: self.builder.property("visible", visible),
938 }
939 }
940
941 /// Overrides for width request of the widget.
942 ///
943 /// If this is -1, the natural request will be used.
944 pub fn width_request(self, width_request: i32) -> Self {
945 Self {
946 builder: self.builder.property("width-request", width_request),
947 }
948 }
949
950 /// The accessible role of the given [`gtk::Accessible`][crate::gtk::Accessible] implementation.
951 ///
952 /// The accessible role cannot be changed once set.
953 pub fn accessible_role(self, accessible_role: gtk::AccessibleRole) -> Self {
954 Self {
955 builder: self.builder.property("accessible-role", accessible_role),
956 }
957 }
958
959 /// The name of the action with which this widget should be associated.
960 pub fn action_name(self, action_name: impl Into<glib::GString>) -> Self {
961 Self {
962 builder: self.builder.property("action-name", action_name.into()),
963 }
964 }
965
966 /// The target value of the actionable widget's action.
967 pub fn action_target(self, action_target: &glib::Variant) -> Self {
968 Self {
969 builder: self
970 .builder
971 .property("action-target", action_target.clone()),
972 }
973 }
974
975 // rustdoc-stripper-ignore-next
976 /// Build the [`ExpanderRow`].
977 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
978 pub fn build(self) -> ExpanderRow {
979 assert_initialized_main_thread!();
980 self.builder.build()
981 }
982}
983
984/// Trait containing all [`struct@ExpanderRow`] methods.
985///
986/// # Implementors
987///
988/// [`ExpanderRow`][struct@crate::ExpanderRow]
989pub trait ExpanderRowExt: IsA<ExpanderRow> + 'static {
990 /// Adds an action widget to @self.
991 ///
992 /// # Deprecated since 1.4
993 ///
994 /// Use [`add_suffix()`][Self::add_suffix()] to add a suffix.
995 /// ## `widget`
996 /// a widget
997 #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
998 #[allow(deprecated)]
999 #[doc(alias = "adw_expander_row_add_action")]
1000 fn add_action(&self, widget: &impl IsA<gtk::Widget>) {
1001 unsafe {
1002 ffi::adw_expander_row_add_action(
1003 self.as_ref().to_glib_none().0,
1004 widget.as_ref().to_glib_none().0,
1005 );
1006 }
1007 }
1008
1009 /// Adds a prefix widget to @self.
1010 /// ## `widget`
1011 /// a widget
1012 #[doc(alias = "adw_expander_row_add_prefix")]
1013 fn add_prefix(&self, widget: &impl IsA<gtk::Widget>) {
1014 unsafe {
1015 ffi::adw_expander_row_add_prefix(
1016 self.as_ref().to_glib_none().0,
1017 widget.as_ref().to_glib_none().0,
1018 );
1019 }
1020 }
1021
1022 /// Adds a widget to @self.
1023 ///
1024 /// The widget will appear in the expanding list below @self.
1025 /// ## `child`
1026 /// a widget
1027 #[doc(alias = "adw_expander_row_add_row")]
1028 fn add_row(&self, child: &impl IsA<gtk::Widget>) {
1029 unsafe {
1030 ffi::adw_expander_row_add_row(
1031 self.as_ref().to_glib_none().0,
1032 child.as_ref().to_glib_none().0,
1033 );
1034 }
1035 }
1036
1037 /// Adds an suffix widget to @self.
1038 /// ## `widget`
1039 /// a widget
1040 #[cfg(feature = "v1_4")]
1041 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
1042 #[doc(alias = "adw_expander_row_add_suffix")]
1043 fn add_suffix(&self, widget: &impl IsA<gtk::Widget>) {
1044 unsafe {
1045 ffi::adw_expander_row_add_suffix(
1046 self.as_ref().to_glib_none().0,
1047 widget.as_ref().to_glib_none().0,
1048 );
1049 }
1050 }
1051
1052 /// Gets whether the expansion of @self is enabled.
1053 ///
1054 /// # Returns
1055 ///
1056 /// whether the expansion of @self is enabled.
1057 #[doc(alias = "adw_expander_row_get_enable_expansion")]
1058 #[doc(alias = "get_enable_expansion")]
1059 #[doc(alias = "enable-expansion")]
1060 fn enables_expansion(&self) -> bool {
1061 unsafe {
1062 from_glib(ffi::adw_expander_row_get_enable_expansion(
1063 self.as_ref().to_glib_none().0,
1064 ))
1065 }
1066 }
1067
1068 /// Gets whether @self is expanded.
1069 ///
1070 /// # Returns
1071 ///
1072 /// whether @self is expanded
1073 #[doc(alias = "adw_expander_row_get_expanded")]
1074 #[doc(alias = "get_expanded")]
1075 #[doc(alias = "expanded")]
1076 fn is_expanded(&self) -> bool {
1077 unsafe {
1078 from_glib(ffi::adw_expander_row_get_expanded(
1079 self.as_ref().to_glib_none().0,
1080 ))
1081 }
1082 }
1083
1084 /// Gets the icon name for @self.
1085 ///
1086 /// # Deprecated since 1.3
1087 ///
1088 /// Use [`add_prefix()`][Self::add_prefix()] to add an icon.
1089 ///
1090 /// # Returns
1091 ///
1092 /// the icon name for @self
1093 #[cfg_attr(feature = "v1_3", deprecated = "Since 1.3")]
1094 #[allow(deprecated)]
1095 #[doc(alias = "adw_expander_row_get_icon_name")]
1096 #[doc(alias = "get_icon_name")]
1097 #[doc(alias = "icon-name")]
1098 fn icon_name(&self) -> Option<glib::GString> {
1099 unsafe {
1100 from_glib_none(ffi::adw_expander_row_get_icon_name(
1101 self.as_ref().to_glib_none().0,
1102 ))
1103 }
1104 }
1105
1106 /// Gets whether the switch enabling the expansion of @self is visible.
1107 ///
1108 /// # Returns
1109 ///
1110 /// whether the switch enabling the expansion is visible
1111 #[doc(alias = "adw_expander_row_get_show_enable_switch")]
1112 #[doc(alias = "get_show_enable_switch")]
1113 #[doc(alias = "show-enable-switch")]
1114 fn shows_enable_switch(&self) -> bool {
1115 unsafe {
1116 from_glib(ffi::adw_expander_row_get_show_enable_switch(
1117 self.as_ref().to_glib_none().0,
1118 ))
1119 }
1120 }
1121
1122 /// Gets the subtitle for @self.
1123 ///
1124 /// # Returns
1125 ///
1126 /// the subtitle for @self
1127 #[doc(alias = "adw_expander_row_get_subtitle")]
1128 #[doc(alias = "get_subtitle")]
1129 fn subtitle(&self) -> glib::GString {
1130 unsafe {
1131 from_glib_none(ffi::adw_expander_row_get_subtitle(
1132 self.as_ref().to_glib_none().0,
1133 ))
1134 }
1135 }
1136
1137 /// Gets the number of lines at the end of which the subtitle label will be
1138 /// ellipsized.
1139 ///
1140 /// # Returns
1141 ///
1142 /// the number of lines at the end of which the subtitle label will be
1143 /// ellipsized
1144 #[cfg(feature = "v1_3")]
1145 #[cfg_attr(docsrs, doc(cfg(feature = "v1_3")))]
1146 #[doc(alias = "adw_expander_row_get_subtitle_lines")]
1147 #[doc(alias = "get_subtitle_lines")]
1148 #[doc(alias = "subtitle-lines")]
1149 fn subtitle_lines(&self) -> i32 {
1150 unsafe { ffi::adw_expander_row_get_subtitle_lines(self.as_ref().to_glib_none().0) }
1151 }
1152
1153 /// Gets the number of lines at the end of which the title label will be
1154 /// ellipsized.
1155 ///
1156 /// # Returns
1157 ///
1158 /// the number of lines at the end of which the title label will be
1159 /// ellipsized
1160 #[cfg(feature = "v1_3")]
1161 #[cfg_attr(docsrs, doc(cfg(feature = "v1_3")))]
1162 #[doc(alias = "adw_expander_row_get_title_lines")]
1163 #[doc(alias = "get_title_lines")]
1164 #[doc(alias = "title-lines")]
1165 fn title_lines(&self) -> i32 {
1166 unsafe { ffi::adw_expander_row_get_title_lines(self.as_ref().to_glib_none().0) }
1167 }
1168
1169 /// Removes a child from @self.
1170 /// ## `child`
1171 /// the child to be removed
1172 #[doc(alias = "adw_expander_row_remove")]
1173 fn remove(&self, child: &impl IsA<gtk::Widget>) {
1174 unsafe {
1175 ffi::adw_expander_row_remove(
1176 self.as_ref().to_glib_none().0,
1177 child.as_ref().to_glib_none().0,
1178 );
1179 }
1180 }
1181
1182 /// Sets whether the expansion of @self is enabled.
1183 /// ## `enable_expansion`
1184 /// whether to enable the expansion
1185 #[doc(alias = "adw_expander_row_set_enable_expansion")]
1186 #[doc(alias = "enable-expansion")]
1187 fn set_enable_expansion(&self, enable_expansion: bool) {
1188 unsafe {
1189 ffi::adw_expander_row_set_enable_expansion(
1190 self.as_ref().to_glib_none().0,
1191 enable_expansion.into_glib(),
1192 );
1193 }
1194 }
1195
1196 /// Sets whether @self is expanded.
1197 /// ## `expanded`
1198 /// whether to expand the row
1199 #[doc(alias = "adw_expander_row_set_expanded")]
1200 #[doc(alias = "expanded")]
1201 fn set_expanded(&self, expanded: bool) {
1202 unsafe {
1203 ffi::adw_expander_row_set_expanded(
1204 self.as_ref().to_glib_none().0,
1205 expanded.into_glib(),
1206 );
1207 }
1208 }
1209
1210 /// Sets the icon name for @self.
1211 ///
1212 /// # Deprecated since 1.3
1213 ///
1214 /// Use [`add_prefix()`][Self::add_prefix()] to add an icon.
1215 /// ## `icon_name`
1216 /// the icon name
1217 #[cfg_attr(feature = "v1_3", deprecated = "Since 1.3")]
1218 #[allow(deprecated)]
1219 #[doc(alias = "adw_expander_row_set_icon_name")]
1220 #[doc(alias = "icon-name")]
1221 fn set_icon_name(&self, icon_name: Option<&str>) {
1222 unsafe {
1223 ffi::adw_expander_row_set_icon_name(
1224 self.as_ref().to_glib_none().0,
1225 icon_name.to_glib_none().0,
1226 );
1227 }
1228 }
1229
1230 /// Sets whether the switch enabling the expansion of @self is visible.
1231 /// ## `show_enable_switch`
1232 /// whether to show the switch enabling the expansion
1233 #[doc(alias = "adw_expander_row_set_show_enable_switch")]
1234 #[doc(alias = "show-enable-switch")]
1235 fn set_show_enable_switch(&self, show_enable_switch: bool) {
1236 unsafe {
1237 ffi::adw_expander_row_set_show_enable_switch(
1238 self.as_ref().to_glib_none().0,
1239 show_enable_switch.into_glib(),
1240 );
1241 }
1242 }
1243
1244 /// Sets the subtitle for @self.
1245 ///
1246 /// The subtitle is interpreted as Pango markup unless
1247 /// [`use-markup`][struct@crate::PreferencesRow#use-markup] is set to `FALSE`.
1248 /// ## `subtitle`
1249 /// the subtitle
1250 #[doc(alias = "adw_expander_row_set_subtitle")]
1251 #[doc(alias = "subtitle")]
1252 fn set_subtitle(&self, subtitle: &str) {
1253 unsafe {
1254 ffi::adw_expander_row_set_subtitle(
1255 self.as_ref().to_glib_none().0,
1256 subtitle.to_glib_none().0,
1257 );
1258 }
1259 }
1260
1261 /// Sets the number of lines at the end of which the subtitle label will be
1262 /// ellipsized.
1263 ///
1264 /// If the value is 0, the number of lines won't be limited.
1265 /// ## `subtitle_lines`
1266 /// the number of lines at the end of which the subtitle label will be ellipsized
1267 #[cfg(feature = "v1_3")]
1268 #[cfg_attr(docsrs, doc(cfg(feature = "v1_3")))]
1269 #[doc(alias = "adw_expander_row_set_subtitle_lines")]
1270 #[doc(alias = "subtitle-lines")]
1271 fn set_subtitle_lines(&self, subtitle_lines: i32) {
1272 unsafe {
1273 ffi::adw_expander_row_set_subtitle_lines(
1274 self.as_ref().to_glib_none().0,
1275 subtitle_lines,
1276 );
1277 }
1278 }
1279
1280 /// Sets the number of lines at the end of which the title label will be
1281 /// ellipsized.
1282 ///
1283 /// If the value is 0, the number of lines won't be limited.
1284 /// ## `title_lines`
1285 /// the number of lines at the end of which the title label will be ellipsized
1286 #[cfg(feature = "v1_3")]
1287 #[cfg_attr(docsrs, doc(cfg(feature = "v1_3")))]
1288 #[doc(alias = "adw_expander_row_set_title_lines")]
1289 #[doc(alias = "title-lines")]
1290 fn set_title_lines(&self, title_lines: i32) {
1291 unsafe {
1292 ffi::adw_expander_row_set_title_lines(self.as_ref().to_glib_none().0, title_lines);
1293 }
1294 }
1295
1296 #[doc(alias = "enable-expansion")]
1297 fn connect_enable_expansion_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1298 unsafe extern "C" fn notify_enable_expansion_trampoline<
1299 P: IsA<ExpanderRow>,
1300 F: Fn(&P) + 'static,
1301 >(
1302 this: *mut ffi::AdwExpanderRow,
1303 _param_spec: glib::ffi::gpointer,
1304 f: glib::ffi::gpointer,
1305 ) {
1306 unsafe {
1307 let f: &F = &*(f as *const F);
1308 f(ExpanderRow::from_glib_borrow(this).unsafe_cast_ref())
1309 }
1310 }
1311 unsafe {
1312 let f: Box_<F> = Box_::new(f);
1313 connect_raw(
1314 self.as_ptr() as *mut _,
1315 c"notify::enable-expansion".as_ptr() as *const _,
1316 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1317 notify_enable_expansion_trampoline::<Self, F> as *const (),
1318 )),
1319 Box_::into_raw(f),
1320 )
1321 }
1322 }
1323
1324 #[doc(alias = "expanded")]
1325 fn connect_expanded_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1326 unsafe extern "C" fn notify_expanded_trampoline<
1327 P: IsA<ExpanderRow>,
1328 F: Fn(&P) + 'static,
1329 >(
1330 this: *mut ffi::AdwExpanderRow,
1331 _param_spec: glib::ffi::gpointer,
1332 f: glib::ffi::gpointer,
1333 ) {
1334 unsafe {
1335 let f: &F = &*(f as *const F);
1336 f(ExpanderRow::from_glib_borrow(this).unsafe_cast_ref())
1337 }
1338 }
1339 unsafe {
1340 let f: Box_<F> = Box_::new(f);
1341 connect_raw(
1342 self.as_ptr() as *mut _,
1343 c"notify::expanded".as_ptr() as *const _,
1344 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1345 notify_expanded_trampoline::<Self, F> as *const (),
1346 )),
1347 Box_::into_raw(f),
1348 )
1349 }
1350 }
1351
1352 #[cfg_attr(feature = "v1_3", deprecated = "Since 1.3")]
1353 #[doc(alias = "icon-name")]
1354 fn connect_icon_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1355 unsafe extern "C" fn notify_icon_name_trampoline<
1356 P: IsA<ExpanderRow>,
1357 F: Fn(&P) + 'static,
1358 >(
1359 this: *mut ffi::AdwExpanderRow,
1360 _param_spec: glib::ffi::gpointer,
1361 f: glib::ffi::gpointer,
1362 ) {
1363 unsafe {
1364 let f: &F = &*(f as *const F);
1365 f(ExpanderRow::from_glib_borrow(this).unsafe_cast_ref())
1366 }
1367 }
1368 unsafe {
1369 let f: Box_<F> = Box_::new(f);
1370 connect_raw(
1371 self.as_ptr() as *mut _,
1372 c"notify::icon-name".as_ptr() as *const _,
1373 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1374 notify_icon_name_trampoline::<Self, F> as *const (),
1375 )),
1376 Box_::into_raw(f),
1377 )
1378 }
1379 }
1380
1381 #[doc(alias = "show-enable-switch")]
1382 fn connect_show_enable_switch_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1383 unsafe extern "C" fn notify_show_enable_switch_trampoline<
1384 P: IsA<ExpanderRow>,
1385 F: Fn(&P) + 'static,
1386 >(
1387 this: *mut ffi::AdwExpanderRow,
1388 _param_spec: glib::ffi::gpointer,
1389 f: glib::ffi::gpointer,
1390 ) {
1391 unsafe {
1392 let f: &F = &*(f as *const F);
1393 f(ExpanderRow::from_glib_borrow(this).unsafe_cast_ref())
1394 }
1395 }
1396 unsafe {
1397 let f: Box_<F> = Box_::new(f);
1398 connect_raw(
1399 self.as_ptr() as *mut _,
1400 c"notify::show-enable-switch".as_ptr() as *const _,
1401 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1402 notify_show_enable_switch_trampoline::<Self, F> as *const (),
1403 )),
1404 Box_::into_raw(f),
1405 )
1406 }
1407 }
1408
1409 #[doc(alias = "subtitle")]
1410 fn connect_subtitle_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1411 unsafe extern "C" fn notify_subtitle_trampoline<
1412 P: IsA<ExpanderRow>,
1413 F: Fn(&P) + 'static,
1414 >(
1415 this: *mut ffi::AdwExpanderRow,
1416 _param_spec: glib::ffi::gpointer,
1417 f: glib::ffi::gpointer,
1418 ) {
1419 unsafe {
1420 let f: &F = &*(f as *const F);
1421 f(ExpanderRow::from_glib_borrow(this).unsafe_cast_ref())
1422 }
1423 }
1424 unsafe {
1425 let f: Box_<F> = Box_::new(f);
1426 connect_raw(
1427 self.as_ptr() as *mut _,
1428 c"notify::subtitle".as_ptr() as *const _,
1429 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1430 notify_subtitle_trampoline::<Self, F> as *const (),
1431 )),
1432 Box_::into_raw(f),
1433 )
1434 }
1435 }
1436
1437 #[cfg(feature = "v1_3")]
1438 #[cfg_attr(docsrs, doc(cfg(feature = "v1_3")))]
1439 #[doc(alias = "subtitle-lines")]
1440 fn connect_subtitle_lines_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1441 unsafe extern "C" fn notify_subtitle_lines_trampoline<
1442 P: IsA<ExpanderRow>,
1443 F: Fn(&P) + 'static,
1444 >(
1445 this: *mut ffi::AdwExpanderRow,
1446 _param_spec: glib::ffi::gpointer,
1447 f: glib::ffi::gpointer,
1448 ) {
1449 unsafe {
1450 let f: &F = &*(f as *const F);
1451 f(ExpanderRow::from_glib_borrow(this).unsafe_cast_ref())
1452 }
1453 }
1454 unsafe {
1455 let f: Box_<F> = Box_::new(f);
1456 connect_raw(
1457 self.as_ptr() as *mut _,
1458 c"notify::subtitle-lines".as_ptr() as *const _,
1459 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1460 notify_subtitle_lines_trampoline::<Self, F> as *const (),
1461 )),
1462 Box_::into_raw(f),
1463 )
1464 }
1465 }
1466
1467 #[cfg(feature = "v1_3")]
1468 #[cfg_attr(docsrs, doc(cfg(feature = "v1_3")))]
1469 #[doc(alias = "title-lines")]
1470 fn connect_title_lines_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1471 unsafe extern "C" fn notify_title_lines_trampoline<
1472 P: IsA<ExpanderRow>,
1473 F: Fn(&P) + 'static,
1474 >(
1475 this: *mut ffi::AdwExpanderRow,
1476 _param_spec: glib::ffi::gpointer,
1477 f: glib::ffi::gpointer,
1478 ) {
1479 unsafe {
1480 let f: &F = &*(f as *const F);
1481 f(ExpanderRow::from_glib_borrow(this).unsafe_cast_ref())
1482 }
1483 }
1484 unsafe {
1485 let f: Box_<F> = Box_::new(f);
1486 connect_raw(
1487 self.as_ptr() as *mut _,
1488 c"notify::title-lines".as_ptr() as *const _,
1489 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1490 notify_title_lines_trampoline::<Self, F> as *const (),
1491 )),
1492 Box_::into_raw(f),
1493 )
1494 }
1495 }
1496}
1497
1498impl<O: IsA<ExpanderRow>> ExpanderRowExt for O {}