|
gtkmm 4.15.1
|
A Gtk::FontDialog object collects the arguments that are needed to present a font chooser dialog to the user, such as a title for the dialog and whether it should be modal. More...
#include <gtkmm/fontdialog.h>

Public Member Functions | |
| FontDialog (FontDialog &&src) noexcept | |
| FontDialog & | operator= (FontDialog &&src) noexcept |
| ~FontDialog () noexcept override | |
| GtkFontDialog * | gobj () |
| Provides access to the underlying C GObject. | |
| const GtkFontDialog * | gobj () const |
| Provides access to the underlying C GObject. | |
| GtkFontDialog * | gobj_copy () |
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
| Glib::ustring | get_title () const |
| Returns the title that will be shown on the font chooser dialog. | |
| void | set_title (const Glib::ustring &title) |
| Sets the title that will be shown on the font chooser dialog. | |
| bool | get_modal () const |
| Returns whether the font chooser dialog blocks interaction with the parent window while it is presented. | |
| void | set_modal (bool modal=true) |
| Sets whether the font chooser dialog blocks interaction with the parent window while it is presented. | |
| Pango::Language | get_language () const |
| Returns the language for which font features are applied. | |
| void | set_language (const Pango::Language &language) |
| Sets the language for which font features are applied. | |
| Glib::RefPtr< Pango::FontMap > | get_font_map () |
Returns the fontmap from which fonts are selected, or nullptr for the default fontmap. | |
| Glib::RefPtr< const Pango::FontMap > | get_font_map () const |
Returns the fontmap from which fonts are selected, or nullptr for the default fontmap. | |
| void | set_font_map (const Glib::RefPtr< Pango::FontMap > &fontmap) |
| Sets the fontmap from which fonts are selected. | |
| Glib::RefPtr< Filter > | get_filter () |
| Returns the filter that decides which fonts to display in the font chooser dialog. | |
| Glib::RefPtr< const Filter > | get_filter () const |
| Returns the filter that decides which fonts to display in the font chooser dialog. | |
| void | set_filter (const Glib::RefPtr< Filter > &filter) |
| Adds a filter that decides which fonts to display in the font chooser dialog. | |
| void | choose_family (Window & parent, const Gio::SlotAsyncReady & slot, const Glib::RefPtr< Pango::FontFamily > &initial_value={}, const Glib::RefPtr< Gio::Cancellable > &cancellable={}) |
| This function initiates a font selection operation by presenting a dialog to the user for selecting a font family. | |
| void | choose_family (const Gio::SlotAsyncReady & slot, const Glib::RefPtr< Pango::FontFamily > &initial_value={}, const Glib::RefPtr< Gio::Cancellable > &cancellable={}) |
| A choose_family() convenience overload. | |
| Glib::RefPtr< Pango::FontFamily > | choose_family_finish (const Glib::RefPtr< Gio::AsyncResult > &result) |
| Finishes the choose_family() call and returns the resulting family. | |
| void | choose_face (Window & parent, const Gio::SlotAsyncReady & slot, const Glib::RefPtr< Pango::FontFace > &initial_value={}, const Glib::RefPtr< Gio::Cancellable > &cancellable={}) |
| This function initiates a font selection operation by presenting a dialog to the user for selecting a font face (i.e. a font family and style, but not a specific font size). | |
| void | choose_face (const Gio::SlotAsyncReady & slot, const Glib::RefPtr< Pango::FontFace > &initial_value={}, const Glib::RefPtr< Gio::Cancellable > &cancellable={}) |
| A choose_face() convenience overload. | |
| Glib::RefPtr< Pango::FontFace > | choose_face_finish (const Glib::RefPtr< Gio::AsyncResult > &result) |
| Finishes the choose_face() call and returns the resulting font face. | |
| void | choose_font (Window & parent, const Gio::SlotAsyncReady & slot, const Pango::FontDescription &initial_value, const Glib::RefPtr< Gio::Cancellable > &cancellable={}) const |
| This function initiates a font selection operation by presenting a dialog to the user for selecting a font. | |
| void | choose_font (Window & parent, const Gio::SlotAsyncReady & slot, const Glib::RefPtr< Gio::Cancellable > &cancellable={}) const |
| A choose_font() convenience overload. | |
| void | choose_font (const Gio::SlotAsyncReady & slot, const Pango::FontDescription &initial_value, const Glib::RefPtr< Gio::Cancellable > &cancellable={}) const |
| A choose_font() convenience overload. | |
| void | choose_font (const Gio::SlotAsyncReady & slot, const Glib::RefPtr< Gio::Cancellable > &cancellable={}) const |
| A choose_font() convenience overload. | |
| Pango::FontDescription | choose_font_finish (const Glib::RefPtr< Gio::AsyncResult > &result) const |
| Finishes the choose_font() call and returns the resulting font description. | |
| void | choose_font_and_features (Window & parent, const Gio::SlotAsyncReady & slot, const Pango::FontDescription &initial_value, const Glib::RefPtr< Gio::Cancellable > &cancellable={}) const |
| This function initiates a font selection operation by presenting a dialog to the user for selecting a font and font features. | |
| void | choose_font_and_features (Window & parent, const Gio::SlotAsyncReady & slot, const Glib::RefPtr< Gio::Cancellable > &cancellable={}) const |
| A choose_font_and_features() convenience overload. | |
| void | choose_font_and_features (const Gio::SlotAsyncReady & slot, const Pango::FontDescription &initial_value, const Glib::RefPtr< Gio::Cancellable > &cancellable={}) const |
| A choose_font_and_features() convenience overload. | |
| void | choose_font_and_features (const Gio::SlotAsyncReady & slot, const Glib::RefPtr< Gio::Cancellable > &cancellable={}) const |
| A choose_font_and_features() convenience overload. | |
| std::tuple< Pango::FontDescription, Glib::ustring, Pango::Language > | choose_font_and_features_finish (const Glib::RefPtr< Gio::AsyncResult > &result) const |
| Finishes the choose_font_and_features() call and returns the resulting font description and font features. | |
| Glib::PropertyProxy< Glib::ustring > | property_title () |
| A title that may be shown on the font chooser dialog that is presented by Gtk::FontDialog::choose_font(). | |
| Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_title () const |
| A title that may be shown on the font chooser dialog that is presented by Gtk::FontDialog::choose_font(). | |
| Glib::PropertyProxy< bool > | property_modal () |
| Whether the font chooser dialog is modal. | |
| Glib::PropertyProxy_ReadOnly< bool > | property_modal () const |
| Whether the font chooser dialog is modal. | |
| Glib::PropertyProxy< Pango::Language > | property_language () |
| The language for which the font features are selected. | |
| Glib::PropertyProxy_ReadOnly< Pango::Language > | property_language () const |
| The language for which the font features are selected. | |
| Glib::PropertyProxy< Glib::RefPtr< Pango::FontMap > > | property_font_map () |
| Sets a custom font map to select fonts from. | |
| Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Pango::FontMap > > | property_font_map () const |
| Sets a custom font map to select fonts from. | |
| Glib::PropertyProxy< Glib::RefPtr< Filter > > | property_filter () |
| Sets a filter to restrict what fonts are shown in the font chooser dialog. | |
| Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Filter > > | property_filter () const |
| Sets a filter to restrict what fonts are shown in the font chooser dialog. | |
Public Member Functions inherited from Glib::Object | |
| Object (const Object &)=delete | |
| Object & | operator= (const Object &)=delete |
| Object (Object &&src) noexcept | |
| Object & | operator= (Object &&src) noexcept |
| void * | get_data (const QueryQuark &key) |
| void | set_data (const Quark &key, void *data) |
| void | set_data_with_c_callback (const Quark &key, void *data, GDestroyNotify notify) |
| void | set_data (const Quark &key, void *data, DestroyNotify notify) |
| void | remove_data (const QueryQuark &quark) |
| void * | steal_data (const QueryQuark &quark) |
| Glib::RefPtr< Glib::Object > | wrap (GObject *object, bool take_copy=false) |
Public Member Functions inherited from Glib::ObjectBase | |
| ObjectBase (const ObjectBase &)=delete | |
| ObjectBase & | operator= (const ObjectBase &)=delete |
| void | set_property_value (const Glib::ustring &property_name, const Glib::ValueBase &value) |
| void | get_property_value (const Glib::ustring &property_name, Glib::ValueBase &value) const |
| void | set_property (const Glib::ustring &property_name, const PropertyType &value) |
| void | get_property (const Glib::ustring &property_name, PropertyType &value) const |
| PropertyType | get_property (const Glib::ustring &property_name) const |
| sigc::connection | connect_property_changed (const Glib::ustring &property_name, const sigc::slot< void()> &slot) |
| sigc::connection | connect_property_changed (const Glib::ustring &property_name, sigc::slot< void()> &&slot) |
| void | freeze_notify () |
| void | thaw_notify () |
| virtual void | reference () const |
| virtual void | unreference () const |
| GObject * | gobj () |
| const GObject * | gobj () const |
| GObject * | gobj_copy () const |
Public Member Functions inherited from sigc::trackable | |
| trackable () noexcept | |
| trackable (const trackable &src) noexcept | |
| trackable (trackable &&src) noexcept | |
| ~trackable () | |
| void | add_destroy_notify_callback (notifiable *data, func_destroy_notify func) const |
| void | notify_callbacks () |
| trackable & | operator= (const trackable &src) |
| trackable & | operator= (trackable &&src) noexcept |
| void | remove_destroy_notify_callback (notifiable *data) const |
Static Public Member Functions | |
| static GType | get_type () |
| Get the GType for this class, for use with the underlying GObject type system. | |
| static Glib::RefPtr< FontDialog > | create () |
Protected Member Functions | |
| FontDialog () | |
Protected Member Functions inherited from Glib::Object | |
| Object () | |
| Object (const Glib::ConstructParams &construct_params) | |
| Object (GObject *castitem) | |
| ~Object () noexcept override | |
Protected Member Functions inherited from Glib::ObjectBase | |
| ObjectBase () | |
| ObjectBase (const char *custom_type_name) | |
| ObjectBase (const std::type_info &custom_type_info) | |
| ObjectBase (ObjectBase &&src) noexcept | |
| ObjectBase & | operator= (ObjectBase &&src) noexcept |
| virtual | ~ObjectBase () noexcept=0 |
| void | initialize (GObject *castitem) |
| void | initialize_move (GObject *castitem, Glib::ObjectBase *previous_wrapper) |
Related Symbols | |
(Note that these are not member symbols.) | |
| Glib::RefPtr< Gtk::FontDialog > | wrap (GtkFontDialog *object, bool take_copy=false) |
| A Glib::wrap() method for this object. | |
Additional Inherited Members | |
Public Types inherited from Glib::Object | |
| typedef void(*)(gpointer data | DestroyNotify) |
Public Types inherited from sigc::trackable | |
| typedef internal::func_destroy_notify | func_destroy_notify |
Public Types inherited from sigc::notifiable | |
| typedef internal::func_destroy_notify | func_destroy_notify |
A Gtk::FontDialog object collects the arguments that are needed to present a font chooser dialog to the user, such as a title for the dialog and whether it should be modal.
The dialog is shown with the choose_font() method or its variants. This API follows the GIO async pattern, and the result can be obtained by calling the corresponding finish method, such as choose_font_finish().
See Gtk::FontDialogButton for a convenient control that uses Gtk::FontDialog and presents the results.
|
noexcept |
|
overridenoexcept |
|
protected |
| void Gtk::FontDialog::choose_face | ( | const Gio::SlotAsyncReady & | slot, |
| const Glib::RefPtr< Pango::FontFace > & | initial_value = {}, |
||
| const Glib::RefPtr< Gio::Cancellable > & | cancellable = {} |
||
| ) |
A choose_face() convenience overload.
| void Gtk::FontDialog::choose_face | ( | Window & | parent, |
| const Gio::SlotAsyncReady & | slot, | ||
| const Glib::RefPtr< Pango::FontFace > & | initial_value = {}, |
||
| const Glib::RefPtr< Gio::Cancellable > & | cancellable = {} |
||
| ) |
This function initiates a font selection operation by presenting a dialog to the user for selecting a font face (i.e. a font family and style, but not a specific font size).
| parent | The parent Gtk::Window. |
| initial_value | The initial value. |
| cancellable | A Cancellable to cancel the operation. |
| slot | A callback to call when the operation is complete. |
| Glib::RefPtr< Pango::FontFace > Gtk::FontDialog::choose_face_finish | ( | const Glib::RefPtr< Gio::AsyncResult > & | result | ) |
Finishes the choose_face() call and returns the resulting font face.
| result | A Gio::AsyncResult. |
| Gtk::DialogError |
| void Gtk::FontDialog::choose_family | ( | const Gio::SlotAsyncReady & | slot, |
| const Glib::RefPtr< Pango::FontFamily > & | initial_value = {}, |
||
| const Glib::RefPtr< Gio::Cancellable > & | cancellable = {} |
||
| ) |
A choose_family() convenience overload.
| void Gtk::FontDialog::choose_family | ( | Window & | parent, |
| const Gio::SlotAsyncReady & | slot, | ||
| const Glib::RefPtr< Pango::FontFamily > & | initial_value = {}, |
||
| const Glib::RefPtr< Gio::Cancellable > & | cancellable = {} |
||
| ) |
This function initiates a font selection operation by presenting a dialog to the user for selecting a font family.
| parent | The parent Gtk::Window. |
| initial_value | The initial value. |
| cancellable | A Cancellable to cancel the operation. |
| slot | A callback to call when the operation is complete. |
| Glib::RefPtr< Pango::FontFamily > Gtk::FontDialog::choose_family_finish | ( | const Glib::RefPtr< Gio::AsyncResult > & | result | ) |
Finishes the choose_family() call and returns the resulting family.
This function never returns an error. If the operation is not finished successfully, the value passed as initial_value to choose_family() is returned.
| result | A Gio::AsyncResult. |
| Gtk::DialogError |
| void Gtk::FontDialog::choose_font | ( | const Gio::SlotAsyncReady & | slot, |
| const Glib::RefPtr< Gio::Cancellable > & | cancellable = {} |
||
| ) | const |
A choose_font() convenience overload.
| void Gtk::FontDialog::choose_font | ( | const Gio::SlotAsyncReady & | slot, |
| const Pango::FontDescription & | initial_value, | ||
| const Glib::RefPtr< Gio::Cancellable > & | cancellable = {} |
||
| ) | const |
A choose_font() convenience overload.
| void Gtk::FontDialog::choose_font | ( | Window & | parent, |
| const Gio::SlotAsyncReady & | slot, | ||
| const Glib::RefPtr< Gio::Cancellable > & | cancellable = {} |
||
| ) | const |
A choose_font() convenience overload.
| void Gtk::FontDialog::choose_font | ( | Window & | parent, |
| const Gio::SlotAsyncReady & | slot, | ||
| const Pango::FontDescription & | initial_value, | ||
| const Glib::RefPtr< Gio::Cancellable > & | cancellable = {} |
||
| ) | const |
This function initiates a font selection operation by presenting a dialog to the user for selecting a font.
If you want to let the user select font features as well, use choose_font_and_features() instead.
| parent | The parent Gtk::Window. |
| initial_value | The font to select initially. |
| cancellable | A Cancellable to cancel the operation. |
| slot | A callback to call when the operation is complete. |
| void Gtk::FontDialog::choose_font_and_features | ( | const Gio::SlotAsyncReady & | slot, |
| const Glib::RefPtr< Gio::Cancellable > & | cancellable = {} |
||
| ) | const |
A choose_font_and_features() convenience overload.
| void Gtk::FontDialog::choose_font_and_features | ( | const Gio::SlotAsyncReady & | slot, |
| const Pango::FontDescription & | initial_value, | ||
| const Glib::RefPtr< Gio::Cancellable > & | cancellable = {} |
||
| ) | const |
A choose_font_and_features() convenience overload.
| void Gtk::FontDialog::choose_font_and_features | ( | Window & | parent, |
| const Gio::SlotAsyncReady & | slot, | ||
| const Glib::RefPtr< Gio::Cancellable > & | cancellable = {} |
||
| ) | const |
A choose_font_and_features() convenience overload.
| void Gtk::FontDialog::choose_font_and_features | ( | Window & | parent, |
| const Gio::SlotAsyncReady & | slot, | ||
| const Pango::FontDescription & | initial_value, | ||
| const Glib::RefPtr< Gio::Cancellable > & | cancellable = {} |
||
| ) | const |
This function initiates a font selection operation by presenting a dialog to the user for selecting a font and font features.
Font features affect how the font is rendered, for example enabling glyph variants or ligatures.
| parent | The parent Gtk::Window. |
| initial_value | The font to select initially. |
| cancellable | A Cancellable to cancel the operation. |
| slot | A callback to call when the operation is complete. |
| std::tuple< Pango::FontDescription, Glib::ustring, Pango::Language > Gtk::FontDialog::choose_font_and_features_finish | ( | const Glib::RefPtr< Gio::AsyncResult > & | result | ) | const |
Finishes the choose_font_and_features() call and returns the resulting font description and font features.
You can use structured binding or std::tie() to get the return value.
| result | A Gio::AsyncResult. |
| Gtk::DialogError |
| Pango::FontDescription Gtk::FontDialog::choose_font_finish | ( | const Glib::RefPtr< Gio::AsyncResult > & | result | ) | const |
Finishes the choose_font() call and returns the resulting font description.
| result | A Gio::AsyncResult. |
| Gtk::DialogError |
|
static |
| Glib::RefPtr< Filter > Gtk::FontDialog::get_filter | ( | ) |
Returns the filter that decides which fonts to display in the font chooser dialog.
| Glib::RefPtr< const Filter > Gtk::FontDialog::get_filter | ( | ) | const |
Returns the filter that decides which fonts to display in the font chooser dialog.
| Glib::RefPtr< Pango::FontMap > Gtk::FontDialog::get_font_map | ( | ) |
Returns the fontmap from which fonts are selected, or nullptr for the default fontmap.
| Glib::RefPtr< const Pango::FontMap > Gtk::FontDialog::get_font_map | ( | ) | const |
Returns the fontmap from which fonts are selected, or nullptr for the default fontmap.
| Pango::Language Gtk::FontDialog::get_language | ( | ) | const |
Returns the language for which font features are applied.
| bool Gtk::FontDialog::get_modal | ( | ) | const |
Returns whether the font chooser dialog blocks interaction with the parent window while it is presented.
true if the font chooser dialog is modal. | Glib::ustring Gtk::FontDialog::get_title | ( | ) | const |
Returns the title that will be shown on the font chooser dialog.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
| GtkFontDialog * Gtk::FontDialog::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
|
noexcept |
| Glib::PropertyProxy< Glib::RefPtr< Filter > > Gtk::FontDialog::property_filter | ( | ) |
Sets a filter to restrict what fonts are shown in the font chooser dialog.
| Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Filter > > Gtk::FontDialog::property_filter | ( | ) | const |
Sets a filter to restrict what fonts are shown in the font chooser dialog.
| Glib::PropertyProxy< Glib::RefPtr< Pango::FontMap > > Gtk::FontDialog::property_font_map | ( | ) |
Sets a custom font map to select fonts from.
A custom font map can be used to present application-specific fonts instead of or in addition to the normal system fonts.
| Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Pango::FontMap > > Gtk::FontDialog::property_font_map | ( | ) | const |
Sets a custom font map to select fonts from.
A custom font map can be used to present application-specific fonts instead of or in addition to the normal system fonts.
| Glib::PropertyProxy< Pango::Language > Gtk::FontDialog::property_language | ( | ) |
The language for which the font features are selected.
| Glib::PropertyProxy_ReadOnly< Pango::Language > Gtk::FontDialog::property_language | ( | ) | const |
The language for which the font features are selected.
| Glib::PropertyProxy< bool > Gtk::FontDialog::property_modal | ( | ) |
Whether the font chooser dialog is modal.
Default value: true
| Glib::PropertyProxy_ReadOnly< bool > Gtk::FontDialog::property_modal | ( | ) | const |
Whether the font chooser dialog is modal.
Default value: true
| Glib::PropertyProxy< Glib::ustring > Gtk::FontDialog::property_title | ( | ) |
A title that may be shown on the font chooser dialog that is presented by Gtk::FontDialog::choose_font().
Default value: ""
| Glib::PropertyProxy_ReadOnly< Glib::ustring > Gtk::FontDialog::property_title | ( | ) | const |
A title that may be shown on the font chooser dialog that is presented by Gtk::FontDialog::choose_font().
Default value: ""
| void Gtk::FontDialog::set_filter | ( | const Glib::RefPtr< Filter > & | filter | ) |
Adds a filter that decides which fonts to display in the font chooser dialog.
The Gtk::Filter must be able to handle both Pango::FontFamily and Pango::FontFace objects.
| filter | A Gtk::Filter. |
| void Gtk::FontDialog::set_font_map | ( | const Glib::RefPtr< Pango::FontMap > & | fontmap | ) |
Sets the fontmap from which fonts are selected.
If fontmap is nullptr, the default fontmap is used.
| fontmap | The fontmap. |
| void Gtk::FontDialog::set_language | ( | const Pango::Language & | language | ) |
Sets the language for which font features are applied.
| language | The language for font features. |
Sets whether the font chooser dialog blocks interaction with the parent window while it is presented.
| modal | The new value. |
| void Gtk::FontDialog::set_title | ( | const Glib::ustring & | title | ) |
Sets the title that will be shown on the font chooser dialog.
| title | The new title. |
|
related |
A Glib::wrap() method for this object.
| object | The C instance. |
| take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |