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 
6 use crate::PreferencesRow;
7 use glib::object::Cast;
8 use glib::object::IsA;
9 use glib::signal::connect_raw;
10 use glib::signal::SignalHandlerId;
11 use glib::translate::*;
12 use glib::StaticType;
13 use glib::ToValue;
14 use std::boxed::Box as Box_;
15 use std::fmt;
16 use std::mem::transmute;
17 
18 glib::wrapper! {
19     #[doc(alias = "HdyActionRow")]
20     pub struct ActionRow(Object<ffi::HdyActionRow, ffi::HdyActionRowClass>) @extends PreferencesRow, gtk::ListBoxRow, gtk::Bin, gtk::Container, gtk::Widget, @implements gtk::Buildable, gtk::Actionable;
21 
22     match fn {
23         type_ => || ffi::hdy_action_row_get_type(),
24     }
25 }
26 
27 impl ActionRow {
28     #[doc(alias = "hdy_action_row_new")]
new() -> ActionRow29     pub fn new() -> ActionRow {
30         assert_initialized_main_thread!();
31         unsafe { gtk::Widget::from_glib_none(ffi::hdy_action_row_new()).unsafe_cast() }
32     }
33 
34     // rustdoc-stripper-ignore-next
35     /// Creates a new builder-pattern struct instance to construct [`ActionRow`] objects.
36     ///
37     /// This method returns an instance of [`ActionRowBuilder`] which can be used to create [`ActionRow`] objects.
builder() -> ActionRowBuilder38     pub fn builder() -> ActionRowBuilder {
39         ActionRowBuilder::default()
40     }
41 }
42 
43 impl Default for ActionRow {
default() -> Self44     fn default() -> Self {
45         Self::new()
46     }
47 }
48 
49 #[derive(Clone, Default)]
50 // rustdoc-stripper-ignore-next
51 /// A [builder-pattern] type to construct [`ActionRow`] objects.
52 ///
53 /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
54 pub struct ActionRowBuilder {
55     activatable_widget: Option<gtk::Widget>,
56     icon_name: Option<String>,
57     subtitle: Option<String>,
58     #[cfg(any(feature = "v1_2", feature = "dox"))]
59     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
60     subtitle_lines: Option<i32>,
61     #[cfg(any(feature = "v1_2", feature = "dox"))]
62     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
63     title_lines: Option<i32>,
64     use_underline: Option<bool>,
65     title: Option<String>,
66     activatable: Option<bool>,
67     selectable: Option<bool>,
68     border_width: Option<u32>,
69     child: Option<gtk::Widget>,
70     resize_mode: Option<gtk::ResizeMode>,
71     app_paintable: Option<bool>,
72     can_default: Option<bool>,
73     can_focus: Option<bool>,
74     double_buffered: Option<bool>,
75     events: Option<gdk::EventMask>,
76     expand: Option<bool>,
77     focus_on_click: Option<bool>,
78     halign: Option<gtk::Align>,
79     has_default: Option<bool>,
80     has_focus: Option<bool>,
81     has_tooltip: Option<bool>,
82     height_request: Option<i32>,
83     hexpand: Option<bool>,
84     hexpand_set: Option<bool>,
85     is_focus: Option<bool>,
86     margin: Option<i32>,
87     margin_bottom: Option<i32>,
88     margin_end: Option<i32>,
89     margin_left: Option<i32>,
90     margin_right: Option<i32>,
91     margin_start: Option<i32>,
92     margin_top: Option<i32>,
93     name: Option<String>,
94     no_show_all: Option<bool>,
95     opacity: Option<f64>,
96     parent: Option<gtk::Container>,
97     receives_default: Option<bool>,
98     sensitive: Option<bool>,
99     //style: /*Unknown type*/,
100     tooltip_markup: Option<String>,
101     tooltip_text: Option<String>,
102     valign: Option<gtk::Align>,
103     vexpand: Option<bool>,
104     vexpand_set: Option<bool>,
105     visible: Option<bool>,
106     width_request: Option<i32>,
107     action_name: Option<String>,
108     action_target: Option<glib::Variant>,
109 }
110 
111 impl ActionRowBuilder {
112     // rustdoc-stripper-ignore-next
113     /// Create a new [`ActionRowBuilder`].
new() -> Self114     pub fn new() -> Self {
115         Self::default()
116     }
117 
118     // rustdoc-stripper-ignore-next
119     /// Build the [`ActionRow`].
build(self) -> ActionRow120     pub fn build(self) -> ActionRow {
121         let mut properties: Vec<(&str, &dyn ToValue)> = vec![];
122         if let Some(ref activatable_widget) = self.activatable_widget {
123             properties.push(("activatable-widget", activatable_widget));
124         }
125         if let Some(ref icon_name) = self.icon_name {
126             properties.push(("icon-name", icon_name));
127         }
128         if let Some(ref subtitle) = self.subtitle {
129             properties.push(("subtitle", subtitle));
130         }
131         #[cfg(any(feature = "v1_2", feature = "dox"))]
132         if let Some(ref subtitle_lines) = self.subtitle_lines {
133             properties.push(("subtitle-lines", subtitle_lines));
134         }
135         #[cfg(any(feature = "v1_2", feature = "dox"))]
136         if let Some(ref title_lines) = self.title_lines {
137             properties.push(("title-lines", title_lines));
138         }
139         if let Some(ref use_underline) = self.use_underline {
140             properties.push(("use-underline", use_underline));
141         }
142         if let Some(ref title) = self.title {
143             properties.push(("title", title));
144         }
145         if let Some(ref activatable) = self.activatable {
146             properties.push(("activatable", activatable));
147         }
148         if let Some(ref selectable) = self.selectable {
149             properties.push(("selectable", selectable));
150         }
151         if let Some(ref border_width) = self.border_width {
152             properties.push(("border-width", border_width));
153         }
154         if let Some(ref child) = self.child {
155             properties.push(("child", child));
156         }
157         if let Some(ref resize_mode) = self.resize_mode {
158             properties.push(("resize-mode", resize_mode));
159         }
160         if let Some(ref app_paintable) = self.app_paintable {
161             properties.push(("app-paintable", app_paintable));
162         }
163         if let Some(ref can_default) = self.can_default {
164             properties.push(("can-default", can_default));
165         }
166         if let Some(ref can_focus) = self.can_focus {
167             properties.push(("can-focus", can_focus));
168         }
169         if let Some(ref double_buffered) = self.double_buffered {
170             properties.push(("double-buffered", double_buffered));
171         }
172         if let Some(ref events) = self.events {
173             properties.push(("events", events));
174         }
175         if let Some(ref expand) = self.expand {
176             properties.push(("expand", expand));
177         }
178         if let Some(ref focus_on_click) = self.focus_on_click {
179             properties.push(("focus-on-click", focus_on_click));
180         }
181         if let Some(ref halign) = self.halign {
182             properties.push(("halign", halign));
183         }
184         if let Some(ref has_default) = self.has_default {
185             properties.push(("has-default", has_default));
186         }
187         if let Some(ref has_focus) = self.has_focus {
188             properties.push(("has-focus", has_focus));
189         }
190         if let Some(ref has_tooltip) = self.has_tooltip {
191             properties.push(("has-tooltip", has_tooltip));
192         }
193         if let Some(ref height_request) = self.height_request {
194             properties.push(("height-request", height_request));
195         }
196         if let Some(ref hexpand) = self.hexpand {
197             properties.push(("hexpand", hexpand));
198         }
199         if let Some(ref hexpand_set) = self.hexpand_set {
200             properties.push(("hexpand-set", hexpand_set));
201         }
202         if let Some(ref is_focus) = self.is_focus {
203             properties.push(("is-focus", is_focus));
204         }
205         if let Some(ref margin) = self.margin {
206             properties.push(("margin", margin));
207         }
208         if let Some(ref margin_bottom) = self.margin_bottom {
209             properties.push(("margin-bottom", margin_bottom));
210         }
211         if let Some(ref margin_end) = self.margin_end {
212             properties.push(("margin-end", margin_end));
213         }
214         if let Some(ref margin_left) = self.margin_left {
215             properties.push(("margin-left", margin_left));
216         }
217         if let Some(ref margin_right) = self.margin_right {
218             properties.push(("margin-right", margin_right));
219         }
220         if let Some(ref margin_start) = self.margin_start {
221             properties.push(("margin-start", margin_start));
222         }
223         if let Some(ref margin_top) = self.margin_top {
224             properties.push(("margin-top", margin_top));
225         }
226         if let Some(ref name) = self.name {
227             properties.push(("name", name));
228         }
229         if let Some(ref no_show_all) = self.no_show_all {
230             properties.push(("no-show-all", no_show_all));
231         }
232         if let Some(ref opacity) = self.opacity {
233             properties.push(("opacity", opacity));
234         }
235         if let Some(ref parent) = self.parent {
236             properties.push(("parent", parent));
237         }
238         if let Some(ref receives_default) = self.receives_default {
239             properties.push(("receives-default", receives_default));
240         }
241         if let Some(ref sensitive) = self.sensitive {
242             properties.push(("sensitive", sensitive));
243         }
244         if let Some(ref tooltip_markup) = self.tooltip_markup {
245             properties.push(("tooltip-markup", tooltip_markup));
246         }
247         if let Some(ref tooltip_text) = self.tooltip_text {
248             properties.push(("tooltip-text", tooltip_text));
249         }
250         if let Some(ref valign) = self.valign {
251             properties.push(("valign", valign));
252         }
253         if let Some(ref vexpand) = self.vexpand {
254             properties.push(("vexpand", vexpand));
255         }
256         if let Some(ref vexpand_set) = self.vexpand_set {
257             properties.push(("vexpand-set", vexpand_set));
258         }
259         if let Some(ref visible) = self.visible {
260             properties.push(("visible", visible));
261         }
262         if let Some(ref width_request) = self.width_request {
263             properties.push(("width-request", width_request));
264         }
265         if let Some(ref action_name) = self.action_name {
266             properties.push(("action-name", action_name));
267         }
268         if let Some(ref action_target) = self.action_target {
269             properties.push(("action-target", action_target));
270         }
271         glib::Object::new::<ActionRow>(&properties)
272             .expect("Failed to create an instance of ActionRow")
273     }
274 
activatable_widget<P: IsA<gtk::Widget>>(mut self, activatable_widget: &P) -> Self275     pub fn activatable_widget<P: IsA<gtk::Widget>>(mut self, activatable_widget: &P) -> Self {
276         self.activatable_widget = Some(activatable_widget.clone().upcast());
277         self
278     }
279 
icon_name(mut self, icon_name: &str) -> Self280     pub fn icon_name(mut self, icon_name: &str) -> Self {
281         self.icon_name = Some(icon_name.to_string());
282         self
283     }
284 
subtitle(mut self, subtitle: &str) -> Self285     pub fn subtitle(mut self, subtitle: &str) -> Self {
286         self.subtitle = Some(subtitle.to_string());
287         self
288     }
289 
290     #[cfg(any(feature = "v1_2", feature = "dox"))]
291     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
subtitle_lines(mut self, subtitle_lines: i32) -> Self292     pub fn subtitle_lines(mut self, subtitle_lines: i32) -> Self {
293         self.subtitle_lines = Some(subtitle_lines);
294         self
295     }
296 
297     #[cfg(any(feature = "v1_2", feature = "dox"))]
298     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
title_lines(mut self, title_lines: i32) -> Self299     pub fn title_lines(mut self, title_lines: i32) -> Self {
300         self.title_lines = Some(title_lines);
301         self
302     }
303 
use_underline(mut self, use_underline: bool) -> Self304     pub fn use_underline(mut self, use_underline: bool) -> Self {
305         self.use_underline = Some(use_underline);
306         self
307     }
308 
title(mut self, title: &str) -> Self309     pub fn title(mut self, title: &str) -> Self {
310         self.title = Some(title.to_string());
311         self
312     }
313 
activatable(mut self, activatable: bool) -> Self314     pub fn activatable(mut self, activatable: bool) -> Self {
315         self.activatable = Some(activatable);
316         self
317     }
318 
selectable(mut self, selectable: bool) -> Self319     pub fn selectable(mut self, selectable: bool) -> Self {
320         self.selectable = Some(selectable);
321         self
322     }
323 
border_width(mut self, border_width: u32) -> Self324     pub fn border_width(mut self, border_width: u32) -> Self {
325         self.border_width = Some(border_width);
326         self
327     }
328 
child<P: IsA<gtk::Widget>>(mut self, child: &P) -> Self329     pub fn child<P: IsA<gtk::Widget>>(mut self, child: &P) -> Self {
330         self.child = Some(child.clone().upcast());
331         self
332     }
333 
resize_mode(mut self, resize_mode: gtk::ResizeMode) -> Self334     pub fn resize_mode(mut self, resize_mode: gtk::ResizeMode) -> Self {
335         self.resize_mode = Some(resize_mode);
336         self
337     }
338 
app_paintable(mut self, app_paintable: bool) -> Self339     pub fn app_paintable(mut self, app_paintable: bool) -> Self {
340         self.app_paintable = Some(app_paintable);
341         self
342     }
343 
can_default(mut self, can_default: bool) -> Self344     pub fn can_default(mut self, can_default: bool) -> Self {
345         self.can_default = Some(can_default);
346         self
347     }
348 
can_focus(mut self, can_focus: bool) -> Self349     pub fn can_focus(mut self, can_focus: bool) -> Self {
350         self.can_focus = Some(can_focus);
351         self
352     }
353 
double_buffered(mut self, double_buffered: bool) -> Self354     pub fn double_buffered(mut self, double_buffered: bool) -> Self {
355         self.double_buffered = Some(double_buffered);
356         self
357     }
358 
events(mut self, events: gdk::EventMask) -> Self359     pub fn events(mut self, events: gdk::EventMask) -> Self {
360         self.events = Some(events);
361         self
362     }
363 
expand(mut self, expand: bool) -> Self364     pub fn expand(mut self, expand: bool) -> Self {
365         self.expand = Some(expand);
366         self
367     }
368 
focus_on_click(mut self, focus_on_click: bool) -> Self369     pub fn focus_on_click(mut self, focus_on_click: bool) -> Self {
370         self.focus_on_click = Some(focus_on_click);
371         self
372     }
373 
halign(mut self, halign: gtk::Align) -> Self374     pub fn halign(mut self, halign: gtk::Align) -> Self {
375         self.halign = Some(halign);
376         self
377     }
378 
has_default(mut self, has_default: bool) -> Self379     pub fn has_default(mut self, has_default: bool) -> Self {
380         self.has_default = Some(has_default);
381         self
382     }
383 
has_focus(mut self, has_focus: bool) -> Self384     pub fn has_focus(mut self, has_focus: bool) -> Self {
385         self.has_focus = Some(has_focus);
386         self
387     }
388 
has_tooltip(mut self, has_tooltip: bool) -> Self389     pub fn has_tooltip(mut self, has_tooltip: bool) -> Self {
390         self.has_tooltip = Some(has_tooltip);
391         self
392     }
393 
height_request(mut self, height_request: i32) -> Self394     pub fn height_request(mut self, height_request: i32) -> Self {
395         self.height_request = Some(height_request);
396         self
397     }
398 
hexpand(mut self, hexpand: bool) -> Self399     pub fn hexpand(mut self, hexpand: bool) -> Self {
400         self.hexpand = Some(hexpand);
401         self
402     }
403 
hexpand_set(mut self, hexpand_set: bool) -> Self404     pub fn hexpand_set(mut self, hexpand_set: bool) -> Self {
405         self.hexpand_set = Some(hexpand_set);
406         self
407     }
408 
is_focus(mut self, is_focus: bool) -> Self409     pub fn is_focus(mut self, is_focus: bool) -> Self {
410         self.is_focus = Some(is_focus);
411         self
412     }
413 
margin(mut self, margin: i32) -> Self414     pub fn margin(mut self, margin: i32) -> Self {
415         self.margin = Some(margin);
416         self
417     }
418 
margin_bottom(mut self, margin_bottom: i32) -> Self419     pub fn margin_bottom(mut self, margin_bottom: i32) -> Self {
420         self.margin_bottom = Some(margin_bottom);
421         self
422     }
423 
margin_end(mut self, margin_end: i32) -> Self424     pub fn margin_end(mut self, margin_end: i32) -> Self {
425         self.margin_end = Some(margin_end);
426         self
427     }
428 
margin_left(mut self, margin_left: i32) -> Self429     pub fn margin_left(mut self, margin_left: i32) -> Self {
430         self.margin_left = Some(margin_left);
431         self
432     }
433 
margin_right(mut self, margin_right: i32) -> Self434     pub fn margin_right(mut self, margin_right: i32) -> Self {
435         self.margin_right = Some(margin_right);
436         self
437     }
438 
margin_start(mut self, margin_start: i32) -> Self439     pub fn margin_start(mut self, margin_start: i32) -> Self {
440         self.margin_start = Some(margin_start);
441         self
442     }
443 
margin_top(mut self, margin_top: i32) -> Self444     pub fn margin_top(mut self, margin_top: i32) -> Self {
445         self.margin_top = Some(margin_top);
446         self
447     }
448 
name(mut self, name: &str) -> Self449     pub fn name(mut self, name: &str) -> Self {
450         self.name = Some(name.to_string());
451         self
452     }
453 
no_show_all(mut self, no_show_all: bool) -> Self454     pub fn no_show_all(mut self, no_show_all: bool) -> Self {
455         self.no_show_all = Some(no_show_all);
456         self
457     }
458 
opacity(mut self, opacity: f64) -> Self459     pub fn opacity(mut self, opacity: f64) -> Self {
460         self.opacity = Some(opacity);
461         self
462     }
463 
parent<P: IsA<gtk::Container>>(mut self, parent: &P) -> Self464     pub fn parent<P: IsA<gtk::Container>>(mut self, parent: &P) -> Self {
465         self.parent = Some(parent.clone().upcast());
466         self
467     }
468 
receives_default(mut self, receives_default: bool) -> Self469     pub fn receives_default(mut self, receives_default: bool) -> Self {
470         self.receives_default = Some(receives_default);
471         self
472     }
473 
sensitive(mut self, sensitive: bool) -> Self474     pub fn sensitive(mut self, sensitive: bool) -> Self {
475         self.sensitive = Some(sensitive);
476         self
477     }
478 
tooltip_markup(mut self, tooltip_markup: &str) -> Self479     pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self {
480         self.tooltip_markup = Some(tooltip_markup.to_string());
481         self
482     }
483 
tooltip_text(mut self, tooltip_text: &str) -> Self484     pub fn tooltip_text(mut self, tooltip_text: &str) -> Self {
485         self.tooltip_text = Some(tooltip_text.to_string());
486         self
487     }
488 
valign(mut self, valign: gtk::Align) -> Self489     pub fn valign(mut self, valign: gtk::Align) -> Self {
490         self.valign = Some(valign);
491         self
492     }
493 
vexpand(mut self, vexpand: bool) -> Self494     pub fn vexpand(mut self, vexpand: bool) -> Self {
495         self.vexpand = Some(vexpand);
496         self
497     }
498 
vexpand_set(mut self, vexpand_set: bool) -> Self499     pub fn vexpand_set(mut self, vexpand_set: bool) -> Self {
500         self.vexpand_set = Some(vexpand_set);
501         self
502     }
503 
visible(mut self, visible: bool) -> Self504     pub fn visible(mut self, visible: bool) -> Self {
505         self.visible = Some(visible);
506         self
507     }
508 
width_request(mut self, width_request: i32) -> Self509     pub fn width_request(mut self, width_request: i32) -> Self {
510         self.width_request = Some(width_request);
511         self
512     }
513 
action_name(mut self, action_name: &str) -> Self514     pub fn action_name(mut self, action_name: &str) -> Self {
515         self.action_name = Some(action_name.to_string());
516         self
517     }
518 
action_target(mut self, action_target: &glib::Variant) -> Self519     pub fn action_target(mut self, action_target: &glib::Variant) -> Self {
520         self.action_target = Some(action_target.clone());
521         self
522     }
523 }
524 
525 pub const NONE_ACTION_ROW: Option<&ActionRow> = None;
526 
527 pub trait ActionRowExt: 'static {
528     #[doc(alias = "hdy_action_row_activate")]
activate(&self)529     fn activate(&self);
530 
531     #[doc(alias = "hdy_action_row_add_prefix")]
add_prefix<P: IsA<gtk::Widget>>(&self, widget: &P)532     fn add_prefix<P: IsA<gtk::Widget>>(&self, widget: &P);
533 
534     #[doc(alias = "hdy_action_row_get_activatable_widget")]
535     #[doc(alias = "get_activatable_widget")]
activatable_widget(&self) -> Option<gtk::Widget>536     fn activatable_widget(&self) -> Option<gtk::Widget>;
537 
538     #[doc(alias = "hdy_action_row_get_icon_name")]
539     #[doc(alias = "get_icon_name")]
icon_name(&self) -> Option<glib::GString>540     fn icon_name(&self) -> Option<glib::GString>;
541 
542     #[doc(alias = "hdy_action_row_get_subtitle")]
543     #[doc(alias = "get_subtitle")]
subtitle(&self) -> Option<glib::GString>544     fn subtitle(&self) -> Option<glib::GString>;
545 
546     #[cfg(any(feature = "v1_2", feature = "dox"))]
547     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
548     #[doc(alias = "hdy_action_row_get_subtitle_lines")]
549     #[doc(alias = "get_subtitle_lines")]
subtitle_lines(&self) -> i32550     fn subtitle_lines(&self) -> i32;
551 
552     #[cfg(any(feature = "v1_2", feature = "dox"))]
553     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
554     #[doc(alias = "hdy_action_row_get_title_lines")]
555     #[doc(alias = "get_title_lines")]
title_lines(&self) -> i32556     fn title_lines(&self) -> i32;
557 
558     #[doc(alias = "hdy_action_row_set_activatable_widget")]
set_activatable_widget<P: IsA<gtk::Widget>>(&self, widget: Option<&P>)559     fn set_activatable_widget<P: IsA<gtk::Widget>>(&self, widget: Option<&P>);
560 
561     #[doc(alias = "hdy_action_row_set_icon_name")]
set_icon_name(&self, icon_name: &str)562     fn set_icon_name(&self, icon_name: &str);
563 
564     #[doc(alias = "hdy_action_row_set_subtitle")]
set_subtitle(&self, subtitle: Option<&str>)565     fn set_subtitle(&self, subtitle: Option<&str>);
566 
567     #[cfg(any(feature = "v1_2", feature = "dox"))]
568     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
569     #[doc(alias = "hdy_action_row_set_subtitle_lines")]
set_subtitle_lines(&self, subtitle_lines: i32)570     fn set_subtitle_lines(&self, subtitle_lines: i32);
571 
572     #[cfg(any(feature = "v1_2", feature = "dox"))]
573     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
574     #[doc(alias = "hdy_action_row_set_title_lines")]
set_title_lines(&self, title_lines: i32)575     fn set_title_lines(&self, title_lines: i32);
576 
577     #[doc(alias = "activated")]
connect_activated<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId578     fn connect_activated<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
579 
580     #[doc(alias = "activatable-widget")]
connect_activatable_widget_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId581     fn connect_activatable_widget_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
582 
583     #[doc(alias = "icon-name")]
connect_icon_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId584     fn connect_icon_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
585 
586     #[doc(alias = "subtitle")]
connect_subtitle_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId587     fn connect_subtitle_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
588 
589     #[cfg(any(feature = "v1_2", feature = "dox"))]
590     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
591     #[doc(alias = "subtitle-lines")]
connect_subtitle_lines_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId592     fn connect_subtitle_lines_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
593 
594     #[cfg(any(feature = "v1_2", feature = "dox"))]
595     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
596     #[doc(alias = "title-lines")]
connect_title_lines_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId597     fn connect_title_lines_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
598 
599     #[doc(alias = "use-underline")]
connect_use_underline_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId600     fn connect_use_underline_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
601 }
602 
603 impl<O: IsA<ActionRow>> ActionRowExt for O {
activate(&self)604     fn activate(&self) {
605         unsafe {
606             ffi::hdy_action_row_activate(self.as_ref().to_glib_none().0);
607         }
608     }
609 
add_prefix<P: IsA<gtk::Widget>>(&self, widget: &P)610     fn add_prefix<P: IsA<gtk::Widget>>(&self, widget: &P) {
611         unsafe {
612             ffi::hdy_action_row_add_prefix(
613                 self.as_ref().to_glib_none().0,
614                 widget.as_ref().to_glib_none().0,
615             );
616         }
617     }
618 
activatable_widget(&self) -> Option<gtk::Widget>619     fn activatable_widget(&self) -> Option<gtk::Widget> {
620         unsafe {
621             from_glib_none(ffi::hdy_action_row_get_activatable_widget(
622                 self.as_ref().to_glib_none().0,
623             ))
624         }
625     }
626 
icon_name(&self) -> Option<glib::GString>627     fn icon_name(&self) -> Option<glib::GString> {
628         unsafe {
629             from_glib_none(ffi::hdy_action_row_get_icon_name(
630                 self.as_ref().to_glib_none().0,
631             ))
632         }
633     }
634 
subtitle(&self) -> Option<glib::GString>635     fn subtitle(&self) -> Option<glib::GString> {
636         unsafe {
637             from_glib_none(ffi::hdy_action_row_get_subtitle(
638                 self.as_ref().to_glib_none().0,
639             ))
640         }
641     }
642 
643     #[cfg(any(feature = "v1_2", feature = "dox"))]
644     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
subtitle_lines(&self) -> i32645     fn subtitle_lines(&self) -> i32 {
646         unsafe { ffi::hdy_action_row_get_subtitle_lines(self.as_ref().to_glib_none().0) }
647     }
648 
649     #[cfg(any(feature = "v1_2", feature = "dox"))]
650     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
title_lines(&self) -> i32651     fn title_lines(&self) -> i32 {
652         unsafe { ffi::hdy_action_row_get_title_lines(self.as_ref().to_glib_none().0) }
653     }
654 
set_activatable_widget<P: IsA<gtk::Widget>>(&self, widget: Option<&P>)655     fn set_activatable_widget<P: IsA<gtk::Widget>>(&self, widget: Option<&P>) {
656         unsafe {
657             ffi::hdy_action_row_set_activatable_widget(
658                 self.as_ref().to_glib_none().0,
659                 widget.map(|p| p.as_ref()).to_glib_none().0,
660             );
661         }
662     }
663 
set_icon_name(&self, icon_name: &str)664     fn set_icon_name(&self, icon_name: &str) {
665         unsafe {
666             ffi::hdy_action_row_set_icon_name(
667                 self.as_ref().to_glib_none().0,
668                 icon_name.to_glib_none().0,
669             );
670         }
671     }
672 
set_subtitle(&self, subtitle: Option<&str>)673     fn set_subtitle(&self, subtitle: Option<&str>) {
674         unsafe {
675             ffi::hdy_action_row_set_subtitle(
676                 self.as_ref().to_glib_none().0,
677                 subtitle.to_glib_none().0,
678             );
679         }
680     }
681 
682     #[cfg(any(feature = "v1_2", feature = "dox"))]
683     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
set_subtitle_lines(&self, subtitle_lines: i32)684     fn set_subtitle_lines(&self, subtitle_lines: i32) {
685         unsafe {
686             ffi::hdy_action_row_set_subtitle_lines(self.as_ref().to_glib_none().0, subtitle_lines);
687         }
688     }
689 
690     #[cfg(any(feature = "v1_2", feature = "dox"))]
691     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
set_title_lines(&self, title_lines: i32)692     fn set_title_lines(&self, title_lines: i32) {
693         unsafe {
694             ffi::hdy_action_row_set_title_lines(self.as_ref().to_glib_none().0, title_lines);
695         }
696     }
697 
connect_activated<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId698     fn connect_activated<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
699         unsafe extern "C" fn activated_trampoline<P: IsA<ActionRow>, F: Fn(&P) + 'static>(
700             this: *mut ffi::HdyActionRow,
701             f: glib::ffi::gpointer,
702         ) {
703             let f: &F = &*(f as *const F);
704             f(ActionRow::from_glib_borrow(this).unsafe_cast_ref())
705         }
706         unsafe {
707             let f: Box_<F> = Box_::new(f);
708             connect_raw(
709                 self.as_ptr() as *mut _,
710                 b"activated\0".as_ptr() as *const _,
711                 Some(transmute::<_, unsafe extern "C" fn()>(
712                     activated_trampoline::<Self, F> as *const (),
713                 )),
714                 Box_::into_raw(f),
715             )
716         }
717     }
718 
connect_activatable_widget_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId719     fn connect_activatable_widget_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
720         unsafe extern "C" fn notify_activatable_widget_trampoline<
721             P: IsA<ActionRow>,
722             F: Fn(&P) + 'static,
723         >(
724             this: *mut ffi::HdyActionRow,
725             _param_spec: glib::ffi::gpointer,
726             f: glib::ffi::gpointer,
727         ) {
728             let f: &F = &*(f as *const F);
729             f(ActionRow::from_glib_borrow(this).unsafe_cast_ref())
730         }
731         unsafe {
732             let f: Box_<F> = Box_::new(f);
733             connect_raw(
734                 self.as_ptr() as *mut _,
735                 b"notify::activatable-widget\0".as_ptr() as *const _,
736                 Some(transmute::<_, unsafe extern "C" fn()>(
737                     notify_activatable_widget_trampoline::<Self, F> as *const (),
738                 )),
739                 Box_::into_raw(f),
740             )
741         }
742     }
743 
connect_icon_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId744     fn connect_icon_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
745         unsafe extern "C" fn notify_icon_name_trampoline<P: IsA<ActionRow>, F: Fn(&P) + 'static>(
746             this: *mut ffi::HdyActionRow,
747             _param_spec: glib::ffi::gpointer,
748             f: glib::ffi::gpointer,
749         ) {
750             let f: &F = &*(f as *const F);
751             f(ActionRow::from_glib_borrow(this).unsafe_cast_ref())
752         }
753         unsafe {
754             let f: Box_<F> = Box_::new(f);
755             connect_raw(
756                 self.as_ptr() as *mut _,
757                 b"notify::icon-name\0".as_ptr() as *const _,
758                 Some(transmute::<_, unsafe extern "C" fn()>(
759                     notify_icon_name_trampoline::<Self, F> as *const (),
760                 )),
761                 Box_::into_raw(f),
762             )
763         }
764     }
765 
connect_subtitle_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId766     fn connect_subtitle_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
767         unsafe extern "C" fn notify_subtitle_trampoline<P: IsA<ActionRow>, F: Fn(&P) + 'static>(
768             this: *mut ffi::HdyActionRow,
769             _param_spec: glib::ffi::gpointer,
770             f: glib::ffi::gpointer,
771         ) {
772             let f: &F = &*(f as *const F);
773             f(ActionRow::from_glib_borrow(this).unsafe_cast_ref())
774         }
775         unsafe {
776             let f: Box_<F> = Box_::new(f);
777             connect_raw(
778                 self.as_ptr() as *mut _,
779                 b"notify::subtitle\0".as_ptr() as *const _,
780                 Some(transmute::<_, unsafe extern "C" fn()>(
781                     notify_subtitle_trampoline::<Self, F> as *const (),
782                 )),
783                 Box_::into_raw(f),
784             )
785         }
786     }
787 
788     #[cfg(any(feature = "v1_2", feature = "dox"))]
789     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
connect_subtitle_lines_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId790     fn connect_subtitle_lines_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
791         unsafe extern "C" fn notify_subtitle_lines_trampoline<
792             P: IsA<ActionRow>,
793             F: Fn(&P) + 'static,
794         >(
795             this: *mut ffi::HdyActionRow,
796             _param_spec: glib::ffi::gpointer,
797             f: glib::ffi::gpointer,
798         ) {
799             let f: &F = &*(f as *const F);
800             f(ActionRow::from_glib_borrow(this).unsafe_cast_ref())
801         }
802         unsafe {
803             let f: Box_<F> = Box_::new(f);
804             connect_raw(
805                 self.as_ptr() as *mut _,
806                 b"notify::subtitle-lines\0".as_ptr() as *const _,
807                 Some(transmute::<_, unsafe extern "C" fn()>(
808                     notify_subtitle_lines_trampoline::<Self, F> as *const (),
809                 )),
810                 Box_::into_raw(f),
811             )
812         }
813     }
814 
815     #[cfg(any(feature = "v1_2", feature = "dox"))]
816     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
connect_title_lines_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId817     fn connect_title_lines_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
818         unsafe extern "C" fn notify_title_lines_trampoline<
819             P: IsA<ActionRow>,
820             F: Fn(&P) + 'static,
821         >(
822             this: *mut ffi::HdyActionRow,
823             _param_spec: glib::ffi::gpointer,
824             f: glib::ffi::gpointer,
825         ) {
826             let f: &F = &*(f as *const F);
827             f(ActionRow::from_glib_borrow(this).unsafe_cast_ref())
828         }
829         unsafe {
830             let f: Box_<F> = Box_::new(f);
831             connect_raw(
832                 self.as_ptr() as *mut _,
833                 b"notify::title-lines\0".as_ptr() as *const _,
834                 Some(transmute::<_, unsafe extern "C" fn()>(
835                     notify_title_lines_trampoline::<Self, F> as *const (),
836                 )),
837                 Box_::into_raw(f),
838             )
839         }
840     }
841 
connect_use_underline_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId842     fn connect_use_underline_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
843         unsafe extern "C" fn notify_use_underline_trampoline<
844             P: IsA<ActionRow>,
845             F: Fn(&P) + 'static,
846         >(
847             this: *mut ffi::HdyActionRow,
848             _param_spec: glib::ffi::gpointer,
849             f: glib::ffi::gpointer,
850         ) {
851             let f: &F = &*(f as *const F);
852             f(ActionRow::from_glib_borrow(this).unsafe_cast_ref())
853         }
854         unsafe {
855             let f: Box_<F> = Box_::new(f);
856             connect_raw(
857                 self.as_ptr() as *mut _,
858                 b"notify::use-underline\0".as_ptr() as *const _,
859                 Some(transmute::<_, unsafe extern "C" fn()>(
860                     notify_use_underline_trampoline::<Self, F> as *const (),
861                 )),
862                 Box_::into_raw(f),
863             )
864         }
865     }
866 }
867 
868 impl fmt::Display for ActionRow {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result869     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
870         f.write_str("ActionRow")
871     }
872 }
873