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 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
-
Field Summary
Fields inherited from class io.github.jwharm.javagi.base.ProxyInstance
address
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new FontDialog.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) Presents a font chooser dialog to the user.chooseFaceFinish
(AsyncResult result) void
chooseFamily
(@Nullable Window parent, @Nullable FontFamily initialValue, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Presents a font chooser dialog to the user.chooseFamilyFinish
(AsyncResult result) void
chooseFont
(@Nullable Window parent, @Nullable FontDescription initialValue, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Presents a font chooser dialog to the user.void
chooseFontAndFeatures
(@Nullable Window parent, @Nullable FontDescription initialValue, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Presents a font chooser dialog to the user.chooseFontFinish
(AsyncResult result) 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, 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 new FontDialog.
-
-
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) 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.- Parameters:
result
- the result- Returns:
- the selected font face
- Throws:
GErrorException
- seeGError
- Since:
- 4.10
-
chooseFamily
public void chooseFamily(@Nullable @Nullable Window parent, @Nullable @Nullable FontFamily initialValue, @Nullable @Nullable Cancellable cancellable, @Nullable @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.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
- the result- Returns:
- the selected family
- Throws:
GErrorException
- seeGError
- Since:
- 4.10
-
chooseFont
public void chooseFont(@Nullable @Nullable Window parent, @Nullable @Nullable FontDescription initialValue, @Nullable @Nullable Cancellable cancellable, @Nullable @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 @Nullable Window parent, @Nullable @Nullable FontDescription initialValue, @Nullable @Nullable Cancellable cancellable, @Nullable @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.- Parameters:
result
- the result- Returns:
- 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, orNULL
for 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
PangoFontFamily
andPangoFontFace
objects.- Parameters:
filter
- the filter- Since:
- 4.10
-
setFontMap
Sets the fontmap from which fonts are selected.If
fontmap
isNULL
, 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.Builder
object constructs aFontDialog
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withFontDialog.Builder.build()
.
-