Class FontDialog
- All Implemented Interfaces:
Proxy
GtkFontDialog
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 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.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
FontDialog.Builder<B extends FontDialog.Builder<B>>
Inner class implementing a builder pattern to construct a GObject with properties.static class
Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
-
Constructor Summary
ConstructorDescriptionCreates a newGtkFontDialog
object.FontDialog
(MemorySegment address) Create a FontDialog proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected FontDialog
asParent()
Returns this instance as if it were its parent type.static FontDialog.Builder
<? extends FontDialog.Builder> builder()
AFontDialog.Builder
object constructs aFontDialog
with the specified properties.void
chooseFace
(@Nullable Window parent, @Nullable FontFace initialValue, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) This function initiates a font selection operation by presenting a dialog to the user for selecting a font face (i.e.chooseFaceFinish
(AsyncResult result) Finishes thechooseFace(org.gnome.gtk.Window, org.gnome.pango.FontFace, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)
call and returns the resulting font face.void
chooseFamily
(@Nullable Window parent, @Nullable FontFamily initialValue, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) This function initiates a font selection operation by presenting a dialog to the user for selecting a font family.chooseFamilyFinish
(AsyncResult result) Finishes thechooseFamily(org.gnome.gtk.Window, org.gnome.pango.FontFamily, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)
call and returns the resulting family.void
chooseFont
(@Nullable Window parent, @Nullable FontDescription initialValue, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) This function initiates a font selection operation by presenting a dialog to the user for selecting a font.void
chooseFontAndFeatures
(@Nullable Window parent, @Nullable FontDescription initialValue, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) This function initiates a font selection operation by presenting a dialog to the user for selecting a font and font features.chooseFontFinish
(AsyncResult result) Finishes thechooseFont(org.gnome.gtk.Window, org.gnome.pango.FontDescription, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)
call and returns the resulting font description.Returns the filter that decides which fonts to display in the font chooser dialog.Returns the fontmap from which fonts are selected, orNULL
for the default fontmap.Returns the language for which font features are applied.boolean
getModal()
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 Type
getType()
Get the GType of the FontDialog classvoid
Adds a filter that decides which fonts to display in the font chooser dialog.void
setFontMap
(@Nullable FontMap fontmap) Sets the fontmap from which fonts are selected.void
setLanguage
(Language language) Sets the language for which font features are applied.void
setModal
(boolean modal) Sets whether the font chooser dialog blocks interaction with the parent window while it is presented.void
Sets 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, 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, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.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 newGtkFontDialog
object.
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, 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 @Nullable Window parent, @Nullable @Nullable FontFace initialValue, @Nullable @Nullable Cancellable cancellable, @Nullable @Nullable AsyncReadyCallback callback) 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).- Parameters:
parent
- the parentGtkWindow
initialValue
- the initial valuecancellable
- aGCancellable
to cancel the operationcallback
- a callback to call when the operation is complete
-
chooseFaceFinish
Finishes thechooseFace(org.gnome.gtk.Window, org.gnome.pango.FontFace, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)
call and returns the resulting font face.- Parameters:
result
- aGAsyncResult
- Returns:
- the selected font face
- Throws:
GErrorException
- seeGError
-
chooseFamily
public void chooseFamily(@Nullable @Nullable Window parent, @Nullable @Nullable FontFamily initialValue, @Nullable @Nullable Cancellable cancellable, @Nullable @Nullable AsyncReadyCallback callback) This function initiates a font selection operation by presenting a dialog to the user for selecting a font family.- Parameters:
parent
- the parentGtkWindow
initialValue
- the initial valuecancellable
- aGCancellable
to cancel the operationcallback
- a callback to call when the operation is complete
-
chooseFamilyFinish
Finishes thechooseFamily(org.gnome.gtk.Window, org.gnome.pango.FontFamily, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)
call and returns the resulting family.This function never returns an error. If the operation is not finished successfully, the value passed as
initialValue
tochooseFamily(org.gnome.gtk.Window, org.gnome.pango.FontFamily, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)
is returned.- Parameters:
result
- aGAsyncResult
- Returns:
- the selected family
- Throws:
GErrorException
- seeGError
-
chooseFont
public void chooseFont(@Nullable @Nullable Window parent, @Nullable @Nullable FontDescription initialValue, @Nullable @Nullable Cancellable cancellable, @Nullable @Nullable AsyncReadyCallback callback) 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
chooseFontAndFeatures(org.gnome.gtk.Window, org.gnome.pango.FontDescription, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)
instead.- Parameters:
parent
- the parentGtkWindow
initialValue
- the font to select initiallycancellable
- aGCancellable
to cancel the operationcallback
- a callback to call when the operation is complete
-
chooseFontAndFeatures
public void chooseFontAndFeatures(@Nullable @Nullable Window parent, @Nullable @Nullable FontDescription initialValue, @Nullable @Nullable Cancellable cancellable, @Nullable @Nullable AsyncReadyCallback callback) 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.
- Parameters:
parent
- the parentGtkWindow
initialValue
- the font to select initiallycancellable
- aGCancellable
to cancel the operationcallback
- a callback to call when the operation is complete
-
chooseFontFinish
Finishes thechooseFont(org.gnome.gtk.Window, org.gnome.pango.FontDescription, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)
call and returns the resulting font description.- Parameters:
result
- aGAsyncResult
- Returns:
- the selected font
- Throws:
GErrorException
- seeGError
-
getFilter
Returns the filter that decides which fonts to display in the font chooser dialog.- Returns:
- the filter
-
getFontMap
Returns the fontmap from which fonts are selected, orNULL
for the default fontmap.- Returns:
- the fontmap
-
getLanguage
Returns the language for which font features are applied.- Returns:
- the language for font features
-
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
-
getTitle
Returns the title that will be shown on the font chooser dialog.- Returns:
- the title
-
setFilter
Adds a filter that decides which fonts to display in the font chooser dialog.The
GtkFilter
must be able to handle bothPangoFontFamily
andPangoFontFace
objects.- Parameters:
filter
- aGtkFilter
-
setFontMap
Sets the fontmap from which fonts are selected.If
fontmap
isNULL
, the default fontmap is used.- Parameters:
fontmap
- the fontmap
-
setLanguage
Sets the language for which font features are applied.- Parameters:
language
- the language for font features
-
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
-
setTitle
Sets the title that will be shown on the font chooser dialog.- Parameters:
title
- the new title
-
builder
AFontDialog.Builder
object constructs aFontDialog
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withFontDialog.Builder.build()
.
-