gtk4/auto/
page_setup_unix_dialog.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4
5use crate::{
6    ffi, Accessible, AccessibleRole, Align, Application, Buildable, ConstraintTarget, Dialog,
7    LayoutManager, Native, Overflow, PageSetup, PrintSettings, Root, ShortcutManager, Widget,
8    Window,
9};
10use glib::{prelude::*, translate::*};
11
12glib::wrapper! {
13    /// Presents a page setup dialog for platforms which don’t provide
14    /// a native page setup dialog, like Unix.
15    ///
16    /// <picture>
17    ///   <source srcset="pagesetupdialog-dark.png" media="(prefers-color-scheme: dark)">
18    ///   <img alt="An example GtkPageSetupUnixDialog" src="pagesetupdialog.png">
19    /// </picture>
20    ///
21    /// It can be used very much like any other GTK dialog, at the
22    /// cost of the portability offered by the high-level printing
23    /// API in [`PrintOperation`][crate::PrintOperation].
24    ///
25    /// ## CSS nodes
26    ///
27    /// [`PageSetupUnixDialog`][crate::PageSetupUnixDialog] has a single CSS node with the name `window` and
28    /// style class `.pagesetup`.
29    ///
30    /// # Implements
31    ///
32    /// [`DialogExt`][trait@crate::prelude::DialogExt], [`GtkWindowExt`][trait@crate::prelude::GtkWindowExt], [`WidgetExt`][trait@crate::prelude::WidgetExt], [`trait@glib::ObjectExt`], [`AccessibleExt`][trait@crate::prelude::AccessibleExt], [`BuildableExt`][trait@crate::prelude::BuildableExt], [`ConstraintTargetExt`][trait@crate::prelude::ConstraintTargetExt], [`NativeExt`][trait@crate::prelude::NativeExt], [`RootExt`][trait@crate::prelude::RootExt], [`ShortcutManagerExt`][trait@crate::prelude::ShortcutManagerExt], [`DialogExtManual`][trait@crate::prelude::DialogExtManual], [`WidgetExtManual`][trait@crate::prelude::WidgetExtManual], [`AccessibleExtManual`][trait@crate::prelude::AccessibleExtManual]
33    #[doc(alias = "GtkPageSetupUnixDialog")]
34    pub struct PageSetupUnixDialog(Object<ffi::GtkPageSetupUnixDialog>) @extends Dialog, Window, Widget, @implements Accessible, Buildable, ConstraintTarget, Native, Root, ShortcutManager;
35
36    match fn {
37        type_ => || ffi::gtk_page_setup_unix_dialog_get_type(),
38    }
39}
40
41impl PageSetupUnixDialog {
42    /// Creates a new page setup dialog.
43    /// ## `title`
44    /// the title of the dialog
45    /// ## `parent`
46    /// transient parent of the dialog
47    ///
48    /// # Returns
49    ///
50    /// the new [`PageSetupUnixDialog`][crate::PageSetupUnixDialog]
51    #[doc(alias = "gtk_page_setup_unix_dialog_new")]
52    pub fn new(title: Option<&str>, parent: Option<&impl IsA<Window>>) -> PageSetupUnixDialog {
53        assert_initialized_main_thread!();
54        unsafe {
55            Widget::from_glib_none(ffi::gtk_page_setup_unix_dialog_new(
56                title.to_glib_none().0,
57                parent.map(|p| p.as_ref()).to_glib_none().0,
58            ))
59            .unsafe_cast()
60        }
61    }
62
63    // rustdoc-stripper-ignore-next
64    /// Creates a new builder-pattern struct instance to construct [`PageSetupUnixDialog`] objects.
65    ///
66    /// This method returns an instance of [`PageSetupUnixDialogBuilder`](crate::builders::PageSetupUnixDialogBuilder) which can be used to create [`PageSetupUnixDialog`] objects.
67    pub fn builder() -> PageSetupUnixDialogBuilder {
68        PageSetupUnixDialogBuilder::new()
69    }
70
71    /// Gets the currently selected page setup from the dialog.
72    ///
73    /// # Returns
74    ///
75    /// the current page setup
76    #[doc(alias = "gtk_page_setup_unix_dialog_get_page_setup")]
77    #[doc(alias = "get_page_setup")]
78    pub fn page_setup(&self) -> PageSetup {
79        unsafe {
80            from_glib_none(ffi::gtk_page_setup_unix_dialog_get_page_setup(
81                self.to_glib_none().0,
82            ))
83        }
84    }
85
86    /// Gets the current print settings from the dialog.
87    ///
88    /// # Returns
89    ///
90    /// the current print settings
91    #[doc(alias = "gtk_page_setup_unix_dialog_get_print_settings")]
92    #[doc(alias = "get_print_settings")]
93    pub fn print_settings(&self) -> Option<PrintSettings> {
94        unsafe {
95            from_glib_none(ffi::gtk_page_setup_unix_dialog_get_print_settings(
96                self.to_glib_none().0,
97            ))
98        }
99    }
100
101    /// Sets the [`PageSetup`][crate::PageSetup] from which the page setup
102    /// dialog takes its values.
103    /// ## `page_setup`
104    /// a [`PageSetup`][crate::PageSetup]
105    #[doc(alias = "gtk_page_setup_unix_dialog_set_page_setup")]
106    pub fn set_page_setup(&self, page_setup: &PageSetup) {
107        unsafe {
108            ffi::gtk_page_setup_unix_dialog_set_page_setup(
109                self.to_glib_none().0,
110                page_setup.to_glib_none().0,
111            );
112        }
113    }
114
115    /// Sets the [`PrintSettings`][crate::PrintSettings] from which the page setup dialog
116    /// takes its values.
117    /// ## `print_settings`
118    /// a [`PrintSettings`][crate::PrintSettings]
119    #[doc(alias = "gtk_page_setup_unix_dialog_set_print_settings")]
120    pub fn set_print_settings(&self, print_settings: Option<&PrintSettings>) {
121        unsafe {
122            ffi::gtk_page_setup_unix_dialog_set_print_settings(
123                self.to_glib_none().0,
124                print_settings.to_glib_none().0,
125            );
126        }
127    }
128}
129
130impl Default for PageSetupUnixDialog {
131    fn default() -> Self {
132        glib::object::Object::new::<Self>()
133    }
134}
135
136// rustdoc-stripper-ignore-next
137/// A [builder-pattern] type to construct [`PageSetupUnixDialog`] objects.
138///
139/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
140#[must_use = "The builder must be built to be used"]
141pub struct PageSetupUnixDialogBuilder {
142    builder: glib::object::ObjectBuilder<'static, PageSetupUnixDialog>,
143}
144
145impl PageSetupUnixDialogBuilder {
146    fn new() -> Self {
147        Self {
148            builder: glib::object::Object::builder(),
149        }
150    }
151
152    /// [`true`] if the dialog uses a headerbar for action buttons
153    /// instead of the action-area.
154    ///
155    /// For technical reasons, this property is declared as an integer
156    /// property, but you should only set it to [`true`] or [`false`].
157    ///
158    /// ## Creating a dialog with headerbar
159    ///
160    /// Builtin [`Dialog`][crate::Dialog] subclasses such as [`ColorChooserDialog`][crate::ColorChooserDialog]
161    /// set this property according to platform conventions (using the
162    /// [`gtk-dialogs-use-header`][struct@crate::Settings#gtk-dialogs-use-header] setting).
163    ///
164    /// Here is how you can achieve the same:
165    ///
166    /// **⚠️ The following code is in c ⚠️**
167    ///
168    /// ```c
169    /// g_object_get (settings, "gtk-dialogs-use-header", &header, NULL);
170    /// dialog = g_object_new (GTK_TYPE_DIALOG, header, TRUE, NULL);
171    /// ```
172    /// Use [`Window`][crate::Window] instead
173    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
174    pub fn use_header_bar(self, use_header_bar: i32) -> Self {
175        Self {
176            builder: self.builder.property("use-header-bar", use_header_bar),
177        }
178    }
179
180    /// The [`Application`][crate::Application] associated with the window.
181    ///
182    /// The application will be kept alive for at least as long as it
183    /// has any windows associated with it (see g_application_hold()
184    /// for a way to keep it alive without windows).
185    ///
186    /// Normally, the connection between the application and the window
187    /// will remain until the window is destroyed, but you can explicitly
188    /// remove it by setting the this property to `NULL`.
189    pub fn application(self, application: &impl IsA<Application>) -> Self {
190        Self {
191            builder: self
192                .builder
193                .property("application", application.clone().upcast()),
194        }
195    }
196
197    /// The child widget.
198    pub fn child(self, child: &impl IsA<Widget>) -> Self {
199        Self {
200            builder: self.builder.property("child", child.clone().upcast()),
201        }
202    }
203
204    /// Whether the window should have a frame (also known as *decorations*).
205    pub fn decorated(self, decorated: bool) -> Self {
206        Self {
207            builder: self.builder.property("decorated", decorated),
208        }
209    }
210
211    /// The default height of the window.
212    pub fn default_height(self, default_height: i32) -> Self {
213        Self {
214            builder: self.builder.property("default-height", default_height),
215        }
216    }
217
218    /// The default widget.
219    pub fn default_widget(self, default_widget: &impl IsA<Widget>) -> Self {
220        Self {
221            builder: self
222                .builder
223                .property("default-widget", default_widget.clone().upcast()),
224        }
225    }
226
227    /// The default width of the window.
228    pub fn default_width(self, default_width: i32) -> Self {
229        Self {
230            builder: self.builder.property("default-width", default_width),
231        }
232    }
233
234    /// Whether the window frame should have a close button.
235    pub fn deletable(self, deletable: bool) -> Self {
236        Self {
237            builder: self.builder.property("deletable", deletable),
238        }
239    }
240
241    /// If this window should be destroyed when the parent is destroyed.
242    pub fn destroy_with_parent(self, destroy_with_parent: bool) -> Self {
243        Self {
244            builder: self
245                .builder
246                .property("destroy-with-parent", destroy_with_parent),
247        }
248    }
249
250    /// The display that will display this window.
251    pub fn display(self, display: &impl IsA<gdk::Display>) -> Self {
252        Self {
253            builder: self.builder.property("display", display.clone().upcast()),
254        }
255    }
256
257    /// Whether 'focus rectangles' are currently visible in this window.
258    ///
259    /// This property is maintained by GTK based on user input
260    /// and should not be set by applications.
261    pub fn focus_visible(self, focus_visible: bool) -> Self {
262        Self {
263            builder: self.builder.property("focus-visible", focus_visible),
264        }
265    }
266
267    /// The focus widget.
268    pub fn focus_widget(self, focus_widget: &impl IsA<Widget>) -> Self {
269        Self {
270            builder: self
271                .builder
272                .property("focus-widget", focus_widget.clone().upcast()),
273        }
274    }
275
276    /// Whether the window is fullscreen.
277    ///
278    /// Setting this property is the equivalent of calling
279    /// [`GtkWindowExt::fullscreen()`][crate::prelude::GtkWindowExt::fullscreen()] or [`GtkWindowExt::unfullscreen()`][crate::prelude::GtkWindowExt::unfullscreen()];
280    /// either operation is asynchronous, which means you will need to
281    /// connect to the ::notify signal in order to know whether the
282    /// operation was successful.
283    pub fn fullscreened(self, fullscreened: bool) -> Self {
284        Self {
285            builder: self.builder.property("fullscreened", fullscreened),
286        }
287    }
288
289    /// Whether the window frame should handle <kbd>F10</kbd> for activating
290    /// menubars.
291    #[cfg(feature = "v4_2")]
292    #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))]
293    pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self {
294        Self {
295            builder: self
296                .builder
297                .property("handle-menubar-accel", handle_menubar_accel),
298        }
299    }
300
301    /// If this window should be hidden instead of destroyed when the user clicks
302    /// the close button.
303    pub fn hide_on_close(self, hide_on_close: bool) -> Self {
304        Self {
305            builder: self.builder.property("hide-on-close", hide_on_close),
306        }
307    }
308
309    /// Specifies the name of the themed icon to use as the window icon.
310    ///
311    /// See [`IconTheme`][crate::IconTheme] for more details.
312    pub fn icon_name(self, icon_name: impl Into<glib::GString>) -> Self {
313        Self {
314            builder: self.builder.property("icon-name", icon_name.into()),
315        }
316    }
317
318    /// Whether the window is maximized.
319    ///
320    /// Setting this property is the equivalent of calling
321    /// [`GtkWindowExt::maximize()`][crate::prelude::GtkWindowExt::maximize()] or [`GtkWindowExt::unmaximize()`][crate::prelude::GtkWindowExt::unmaximize()];
322    /// either operation is asynchronous, which means you will need to
323    /// connect to the ::notify signal in order to know whether the
324    /// operation was successful.
325    pub fn maximized(self, maximized: bool) -> Self {
326        Self {
327            builder: self.builder.property("maximized", maximized),
328        }
329    }
330
331    /// Whether mnemonics are currently visible in this window.
332    ///
333    /// This property is maintained by GTK based on user input,
334    /// and should not be set by applications.
335    pub fn mnemonics_visible(self, mnemonics_visible: bool) -> Self {
336        Self {
337            builder: self
338                .builder
339                .property("mnemonics-visible", mnemonics_visible),
340        }
341    }
342
343    /// If true, the window is modal.
344    pub fn modal(self, modal: bool) -> Self {
345        Self {
346            builder: self.builder.property("modal", modal),
347        }
348    }
349
350    /// If true, users can resize the window.
351    pub fn resizable(self, resizable: bool) -> Self {
352        Self {
353            builder: self.builder.property("resizable", resizable),
354        }
355    }
356
357    /// A write-only property for setting window's startup notification identifier.
358    pub fn startup_id(self, startup_id: impl Into<glib::GString>) -> Self {
359        Self {
360            builder: self.builder.property("startup-id", startup_id.into()),
361        }
362    }
363
364    /// The title of the window.
365    pub fn title(self, title: impl Into<glib::GString>) -> Self {
366        Self {
367            builder: self.builder.property("title", title.into()),
368        }
369    }
370
371    /// The titlebar widget.
372    #[cfg(feature = "v4_6")]
373    #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
374    pub fn titlebar(self, titlebar: &impl IsA<Widget>) -> Self {
375        Self {
376            builder: self.builder.property("titlebar", titlebar.clone().upcast()),
377        }
378    }
379
380    /// The transient parent of the window.
381    pub fn transient_for(self, transient_for: &impl IsA<Window>) -> Self {
382        Self {
383            builder: self
384                .builder
385                .property("transient-for", transient_for.clone().upcast()),
386        }
387    }
388
389    /// Whether the widget or any of its descendents can accept
390    /// the input focus.
391    ///
392    /// This property is meant to be set by widget implementations,
393    /// typically in their instance init function.
394    pub fn can_focus(self, can_focus: bool) -> Self {
395        Self {
396            builder: self.builder.property("can-focus", can_focus),
397        }
398    }
399
400    /// Whether the widget can receive pointer events.
401    pub fn can_target(self, can_target: bool) -> Self {
402        Self {
403            builder: self.builder.property("can-target", can_target),
404        }
405    }
406
407    /// A list of css classes applied to this widget.
408    pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
409        Self {
410            builder: self.builder.property("css-classes", css_classes.into()),
411        }
412    }
413
414    /// The name of this widget in the CSS tree.
415    ///
416    /// This property is meant to be set by widget implementations,
417    /// typically in their instance init function.
418    pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
419        Self {
420            builder: self.builder.property("css-name", css_name.into()),
421        }
422    }
423
424    /// The cursor used by @widget.
425    pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
426        Self {
427            builder: self.builder.property("cursor", cursor.clone()),
428        }
429    }
430
431    /// Whether the widget should grab focus when it is clicked with the mouse.
432    ///
433    /// This property is only relevant for widgets that can take focus.
434    pub fn focus_on_click(self, focus_on_click: bool) -> Self {
435        Self {
436            builder: self.builder.property("focus-on-click", focus_on_click),
437        }
438    }
439
440    /// Whether this widget itself will accept the input focus.
441    pub fn focusable(self, focusable: bool) -> Self {
442        Self {
443            builder: self.builder.property("focusable", focusable),
444        }
445    }
446
447    /// How to distribute horizontal space if widget gets extra space.
448    pub fn halign(self, halign: Align) -> Self {
449        Self {
450            builder: self.builder.property("halign", halign),
451        }
452    }
453
454    /// Enables or disables the emission of the [`query-tooltip`][struct@crate::Widget#query-tooltip]
455    /// signal on @widget.
456    ///
457    /// A true value indicates that @widget can have a tooltip, in this case
458    /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to
459    /// determine whether it will provide a tooltip or not.
460    pub fn has_tooltip(self, has_tooltip: bool) -> Self {
461        Self {
462            builder: self.builder.property("has-tooltip", has_tooltip),
463        }
464    }
465
466    /// Overrides for height request of the widget.
467    ///
468    /// If this is -1, the natural request will be used.
469    pub fn height_request(self, height_request: i32) -> Self {
470        Self {
471            builder: self.builder.property("height-request", height_request),
472        }
473    }
474
475    /// Whether to expand horizontally.
476    pub fn hexpand(self, hexpand: bool) -> Self {
477        Self {
478            builder: self.builder.property("hexpand", hexpand),
479        }
480    }
481
482    /// Whether to use the `hexpand` property.
483    pub fn hexpand_set(self, hexpand_set: bool) -> Self {
484        Self {
485            builder: self.builder.property("hexpand-set", hexpand_set),
486        }
487    }
488
489    /// The [`LayoutManager`][crate::LayoutManager] instance to use to compute
490    /// the preferred size of the widget, and allocate its children.
491    ///
492    /// This property is meant to be set by widget implementations,
493    /// typically in their instance init function.
494    pub fn layout_manager(self, layout_manager: &impl IsA<LayoutManager>) -> Self {
495        Self {
496            builder: self
497                .builder
498                .property("layout-manager", layout_manager.clone().upcast()),
499        }
500    }
501
502    /// Makes this widget act like a modal dialog, with respect to
503    /// event delivery.
504    ///
505    /// Global event controllers will not handle events with targets
506    /// inside the widget, unless they are set up to ignore propagation
507    /// limits. See [`EventControllerExt::set_propagation_limit()`][crate::prelude::EventControllerExt::set_propagation_limit()].
508    #[cfg(feature = "v4_18")]
509    #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
510    pub fn limit_events(self, limit_events: bool) -> Self {
511        Self {
512            builder: self.builder.property("limit-events", limit_events),
513        }
514    }
515
516    /// Margin on bottom side of widget.
517    ///
518    /// This property adds margin outside of the widget's normal size
519    /// request, the margin will be added in addition to the size from
520    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
521    pub fn margin_bottom(self, margin_bottom: i32) -> Self {
522        Self {
523            builder: self.builder.property("margin-bottom", margin_bottom),
524        }
525    }
526
527    /// Margin on end of widget, horizontally.
528    ///
529    /// This property supports left-to-right and right-to-left text
530    /// directions.
531    ///
532    /// This property adds margin outside of the widget's normal size
533    /// request, the margin will be added in addition to the size from
534    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
535    pub fn margin_end(self, margin_end: i32) -> Self {
536        Self {
537            builder: self.builder.property("margin-end", margin_end),
538        }
539    }
540
541    /// Margin on start of widget, horizontally.
542    ///
543    /// This property supports left-to-right and right-to-left text
544    /// directions.
545    ///
546    /// This property adds margin outside of the widget's normal size
547    /// request, the margin will be added in addition to the size from
548    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
549    pub fn margin_start(self, margin_start: i32) -> Self {
550        Self {
551            builder: self.builder.property("margin-start", margin_start),
552        }
553    }
554
555    /// Margin on top side of widget.
556    ///
557    /// This property adds margin outside of the widget's normal size
558    /// request, the margin will be added in addition to the size from
559    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
560    pub fn margin_top(self, margin_top: i32) -> Self {
561        Self {
562            builder: self.builder.property("margin-top", margin_top),
563        }
564    }
565
566    /// The name of the widget.
567    pub fn name(self, name: impl Into<glib::GString>) -> Self {
568        Self {
569            builder: self.builder.property("name", name.into()),
570        }
571    }
572
573    /// The requested opacity of the widget.
574    pub fn opacity(self, opacity: f64) -> Self {
575        Self {
576            builder: self.builder.property("opacity", opacity),
577        }
578    }
579
580    /// How content outside the widget's content area is treated.
581    ///
582    /// This property is meant to be set by widget implementations,
583    /// typically in their instance init function.
584    pub fn overflow(self, overflow: Overflow) -> Self {
585        Self {
586            builder: self.builder.property("overflow", overflow),
587        }
588    }
589
590    /// Whether the widget will receive the default action when it is focused.
591    pub fn receives_default(self, receives_default: bool) -> Self {
592        Self {
593            builder: self.builder.property("receives-default", receives_default),
594        }
595    }
596
597    /// Whether the widget responds to input.
598    pub fn sensitive(self, sensitive: bool) -> Self {
599        Self {
600            builder: self.builder.property("sensitive", sensitive),
601        }
602    }
603
604    /// Sets the text of tooltip to be the given string, which is marked up
605    /// with Pango markup.
606    ///
607    /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
608    ///
609    /// This is a convenience property which will take care of getting the
610    /// tooltip shown if the given string is not `NULL`:
611    /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
612    /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
613    /// the default signal handler.
614    ///
615    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
616    /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
617    pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
618        Self {
619            builder: self
620                .builder
621                .property("tooltip-markup", tooltip_markup.into()),
622        }
623    }
624
625    /// Sets the text of tooltip to be the given string.
626    ///
627    /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
628    ///
629    /// This is a convenience property which will take care of getting the
630    /// tooltip shown if the given string is not `NULL`:
631    /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
632    /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
633    /// the default signal handler.
634    ///
635    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
636    /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
637    pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
638        Self {
639            builder: self.builder.property("tooltip-text", tooltip_text.into()),
640        }
641    }
642
643    /// How to distribute vertical space if widget gets extra space.
644    pub fn valign(self, valign: Align) -> Self {
645        Self {
646            builder: self.builder.property("valign", valign),
647        }
648    }
649
650    /// Whether to expand vertically.
651    pub fn vexpand(self, vexpand: bool) -> Self {
652        Self {
653            builder: self.builder.property("vexpand", vexpand),
654        }
655    }
656
657    /// Whether to use the `vexpand` property.
658    pub fn vexpand_set(self, vexpand_set: bool) -> Self {
659        Self {
660            builder: self.builder.property("vexpand-set", vexpand_set),
661        }
662    }
663
664    /// Whether the widget is visible.
665    pub fn visible(self, visible: bool) -> Self {
666        Self {
667            builder: self.builder.property("visible", visible),
668        }
669    }
670
671    /// Overrides for width request of the widget.
672    ///
673    /// If this is -1, the natural request will be used.
674    pub fn width_request(self, width_request: i32) -> Self {
675        Self {
676            builder: self.builder.property("width-request", width_request),
677        }
678    }
679
680    /// The accessible role of the given [`Accessible`][crate::Accessible] implementation.
681    ///
682    /// The accessible role cannot be changed once set.
683    pub fn accessible_role(self, accessible_role: AccessibleRole) -> Self {
684        Self {
685            builder: self.builder.property("accessible-role", accessible_role),
686        }
687    }
688
689    // rustdoc-stripper-ignore-next
690    /// Build the [`PageSetupUnixDialog`].
691    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
692    pub fn build(self) -> PageSetupUnixDialog {
693        assert_initialized_main_thread!();
694        self.builder.build()
695    }
696}