Class FontDialog
- All Implemented Interfaces:
Proxy
GtkFontDialog collects the arguments that are needed to present
the dialog to the user, such as a title for the dialog and whether
it should be modal.
The dialog is shown with the chooseFont(org.gnome.gtk.Window, org.gnome.pango.FontDescription, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)
function or its variants.
See FontDialogButton for a convenient control
that uses GtkFontDialog and presents the results.
- Since:
- 4.10
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classFontDialog.Builder<B extends FontDialog.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.static classNested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new FontDialog.FontDialog(MemorySegment address) Create a FontDialog proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected FontDialogasParent()Returns this instance as if it were its parent type.static FontDialog.Builder<? extends FontDialog.Builder> builder()AFontDialog.Builderobject constructs aFontDialogwith the specified properties.voidchooseFace(@Nullable Window parent, @Nullable FontFace initialValue, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Presents a font chooser dialog to the user.chooseFaceFinish(AsyncResult result) voidchooseFamily(@Nullable Window parent, @Nullable FontFamily initialValue, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Presents a font chooser dialog to the user.chooseFamilyFinish(AsyncResult result) voidchooseFont(@Nullable Window parent, @Nullable FontDescription initialValue, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Presents a font chooser dialog to the user.voidchooseFontAndFeatures(@Nullable Window parent, @Nullable FontDescription initialValue, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Presents a font chooser dialog to the user.chooseFontFinish(AsyncResult result) @Nullable FilterReturns the filter that decides which fonts to display in the font chooser dialog.@Nullable FontMapReturns the fontmap from which fonts are selected, orNULLfor the default fontmap.@Nullable LanguageReturns the language for which font features are applied.booleangetModal()Returns whether the font chooser dialog blocks interaction with the parent window while it is presented.getTitle()Returns the title that will be shown on the font chooser dialog.static @Nullable TypegetType()Get the GType of the FontDialog classvoidAdds a filter that decides which fonts to display in the font chooser dialog.voidsetFontMap(@Nullable FontMap fontmap) Sets the fontmap from which fonts are selected.voidsetLanguage(Language language) Sets the language for which font features are applied.voidsetModal(boolean modal) Sets whether the font chooser dialog blocks interaction with the parent window while it is presented.voidSets the title that will be shown on the font chooser dialog.Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getMemoryLayout, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newv, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withPropertiesMethods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
FontDialog
Create a FontDialog proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
FontDialog
public FontDialog()Creates a new FontDialog.
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuperkeyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName(). This will call the native function pointer of this virtual method in the typeclass of the parent type. -
chooseFace
public void chooseFace(@Nullable Window parent, @Nullable FontFace initialValue, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Presents a font chooser dialog to the user.The font chooser dialog will be set up for selecting a font face.
A font face represents a font family and style, but no specific font size.
- Parameters:
parent- the parent windowinitialValue- the initial valuecancellable- a cancellable to cancel the operationcallback- a callback to call when the operation is complete- Since:
- 4.10
-
chooseFaceFinish
Finishes thechooseFace(org.gnome.gtk.Window, org.gnome.pango.FontFace, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)call.Note that this function returns a
Gtk.DialogError.DISMISSEDerror if the user cancels the dialog.- Parameters:
result- the result- Returns:
- the selected
FontFace - Throws:
GErrorException- seeGError- Since:
- 4.10
-
chooseFamily
public void chooseFamily(@Nullable Window parent, @Nullable FontFamily initialValue, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Presents a font chooser dialog to the user.The font chooser dialog will be set up for selecting a font family.
- Parameters:
parent- the parent windowinitialValue- the initial valuecancellable- a cancellable to cancel the operationcallback- a callback to call when the operation is complete- Since:
- 4.10
-
chooseFamilyFinish
Finishes thechooseFamily(org.gnome.gtk.Window, org.gnome.pango.FontFamily, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)call.Note that this function returns a
Gtk.DialogError.DISMISSEDerror if the user cancels the dialog.- Parameters:
result- the result- Returns:
- the selected
FontFamily - Throws:
GErrorException- seeGError- Since:
- 4.10
-
chooseFont
public void chooseFont(@Nullable Window parent, @Nullable FontDescription initialValue, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Presents a font chooser dialog to the user.The font chooser dialog will be set up for selecting a font.
If you want to let the user select font features as well, use
chooseFontAndFeatures(org.gnome.gtk.Window, org.gnome.pango.FontDescription, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)instead.- Parameters:
parent- the parent windowinitialValue- the font to select initiallycancellable- a cancellable to cancel the operationcallback- a callback to call when the operation is complete- Since:
- 4.10
-
chooseFontAndFeatures
public void chooseFontAndFeatures(@Nullable Window parent, @Nullable FontDescription initialValue, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Presents a font chooser dialog to the user.The font chooser dialog will be set up for selecting a font and specify features for the selected font.
Font features affect how the font is rendered, for example enabling glyph variants or ligatures.
- Parameters:
parent- the parent windowinitialValue- the font to select initiallycancellable- a cancellable to cancel the operationcallback- a callback to call when the operation is complete- Since:
- 4.10
-
chooseFontFinish
Finishes thechooseFont(org.gnome.gtk.Window, org.gnome.pango.FontDescription, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)call.Note that this function returns a
Gtk.DialogError.DISMISSEDerror if the user cancels the dialog.- Parameters:
result- the result- Returns:
- a
Pango.FontDescriptiondescribing the selected font - Throws:
GErrorException- seeGError- Since:
- 4.10
-
getFilter
Returns the filter that decides which fonts to display in the font chooser dialog.- Returns:
- the filter
- Since:
- 4.10
-
getFontMap
Returns the fontmap from which fonts are selected, orNULLfor the default fontmap.- Returns:
- the fontmap
- Since:
- 4.10
-
getLanguage
Returns the language for which font features are applied.- Returns:
- the language for font features
- Since:
- 4.10
-
getModal
public boolean getModal()Returns whether the font chooser dialog blocks interaction with the parent window while it is presented.- Returns:
- true if the font chooser dialog is modal
- Since:
- 4.10
-
getTitle
Returns the title that will be shown on the font chooser dialog.- Returns:
- the title
- Since:
- 4.10
-
setFilter
Adds a filter that decides which fonts to display in the font chooser dialog.The filter must be able to handle both
PangoFontFamilyandPangoFontFaceobjects.- Parameters:
filter- the filter- Since:
- 4.10
-
setFontMap
Sets the fontmap from which fonts are selected.If
fontmapisNULL, the default fontmap is used.- Parameters:
fontmap- the fontmap- Since:
- 4.10
-
setLanguage
Sets the language for which font features are applied.- Parameters:
language- the language for font features- Since:
- 4.10
-
setModal
public void setModal(boolean modal) Sets whether the font chooser dialog blocks interaction with the parent window while it is presented.- Parameters:
modal- the new value- Since:
- 4.10
-
setTitle
Sets the title that will be shown on the font chooser dialog.- Parameters:
title- the new title- Since:
- 4.10
-
builder
AFontDialog.Builderobject constructs aFontDialogwith the specified properties. Use the variousset...()methods to set properties, and finish construction withFontDialog.Builder.build().- Returns:
- the builder object
-