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