Skip to main content

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