gi-gtk4-4.0.12: Gtk 4.x bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.FontDialog

Description

Asynchronous API to present a font chooser dialog.

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 fontDialogChooseFont function or its variants.

See FontDialogButton for a convenient control that uses GtkFontDialog and presents the results.

Since: 4.10

Synopsis

Exported types

class (GObject o, IsDescendantOf FontDialog o) => IsFontDialog o Source #

Type class for types which can be safely cast to FontDialog, for instance with toFontDialog.

Instances

Instances details
(GObject o, IsDescendantOf FontDialog o) => IsFontDialog o Source # 
Instance details

Defined in GI.Gtk.Objects.FontDialog

toFontDialog :: (MonadIO m, IsFontDialog o) => o -> m FontDialog Source #

Cast to FontDialog, for types for which this is known to be safe. For general casts, use castTo.

Methods

chooseFace

fontDialogChooseFace Source #

Arguments

:: (HasCallStack, MonadIO m, IsFontDialog a, IsWindow b, IsFontFace c, IsCancellable d) 
=> a

self: a font dialog

-> Maybe b

parent: the parent window

-> Maybe c

initialValue: the initial value

-> Maybe d

cancellable: a cancellable to cancel the operation

-> Maybe AsyncReadyCallback

callback: a callback to call when the operation is complete

-> m () 

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.

Since: 4.10

chooseFaceFinish

fontDialogChooseFaceFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsFontDialog a, IsAsyncResult b) 
=> a

self: a font dialog

-> b

result: the result

-> m FontFace

Returns: the selected FontFace (Can throw GError)

Finishes the fontDialogChooseFace call.

Note that this function returns a [errorgtk.DialogError.DISMISSED] error if the user cancels the dialog.

Since: 4.10

chooseFamily

fontDialogChooseFamily Source #

Arguments

:: (HasCallStack, MonadIO m, IsFontDialog a, IsWindow b, IsFontFamily c, IsCancellable d) 
=> a

self: a font dialog

-> Maybe b

parent: the parent window

-> Maybe c

initialValue: the initial value

-> Maybe d

cancellable: a cancellable to cancel the operation

-> Maybe AsyncReadyCallback

callback: a callback to call when the operation is complete

-> m () 

Presents a font chooser dialog to the user.

The font chooser dialog will be set up for selecting a font family.

Since: 4.10

chooseFamilyFinish

fontDialogChooseFamilyFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsFontDialog a, IsAsyncResult b) 
=> a

self: a font dialog

-> b

result: the result

-> m FontFamily

Returns: the selected FontFamily (Can throw GError)

Finishes the fontDialogChooseFamily call.

Note that this function returns a [errorgtk.DialogError.DISMISSED] error if the user cancels the dialog.

Since: 4.10

chooseFont

fontDialogChooseFont Source #

Arguments

:: (HasCallStack, MonadIO m, IsFontDialog a, IsWindow b, IsCancellable c) 
=> a

self: a font dialog

-> Maybe b

parent: the parent window

-> Maybe FontDescription

initialValue: the font to select initially

-> Maybe c

cancellable: a cancellable to cancel the operation

-> Maybe AsyncReadyCallback

callback: a callback to call when the operation is complete

-> m () 

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 fontDialogChooseFontAndFeatures instead.

Since: 4.10

chooseFontAndFeatures

fontDialogChooseFontAndFeatures Source #

Arguments

:: (HasCallStack, MonadIO m, IsFontDialog a, IsWindow b, IsCancellable c) 
=> a

self: a font dialog

-> Maybe b

parent: the parent window

-> Maybe FontDescription

initialValue: the font to select initially

-> Maybe c

cancellable: a cancellable to cancel the operation

-> Maybe AsyncReadyCallback

callback: a callback to call when the operation is complete

-> m () 

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.

Since: 4.10

chooseFontAndFeaturesFinish

fontDialogChooseFontAndFeaturesFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsFontDialog a, IsAsyncResult b) 
=> a

self: a font dialog

-> b

result: the result

-> m (FontDescription, Text, Language)

(Can throw GError)

Finishes the fontDialogChooseFontAndFeatures call.

The selected font and features are returned in fontDesc and fontFeatures.

Note that this function returns a [errorgtk.DialogError.DISMISSED] error if the user cancels the dialog.

Since: 4.10

chooseFontFinish

fontDialogChooseFontFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsFontDialog a, IsAsyncResult b) 
=> a

self: a font dialog

-> b

result: the result

-> m FontDescription

Returns: a FontDescription describing the selected font (Can throw GError)

Finishes the fontDialogChooseFont call.

Note that this function returns a [errorgtk.DialogError.DISMISSED] error if the user cancels the dialog.

Since: 4.10

getFilter

fontDialogGetFilter Source #

Arguments

:: (HasCallStack, MonadIO m, IsFontDialog a) 
=> a

self: a font dialog

-> m (Maybe Filter)

Returns: the filter

Returns the filter that decides which fonts to display in the font chooser dialog.

Since: 4.10

getFontMap

fontDialogGetFontMap Source #

Arguments

:: (HasCallStack, MonadIO m, IsFontDialog a) 
=> a

self: a font dialog

-> m (Maybe FontMap)

Returns: the fontmap

Returns the fontmap from which fonts are selected, or NULL for the default fontmap.

Since: 4.10

getLanguage

fontDialogGetLanguage Source #

Arguments

:: (HasCallStack, MonadIO m, IsFontDialog a) 
=> a

self: a font dialog

-> m (Maybe Language)

Returns: the language for font features

Returns the language for which font features are applied.

Since: 4.10

getModal

fontDialogGetModal Source #

Arguments

:: (HasCallStack, MonadIO m, IsFontDialog a) 
=> a

self: a font dialog

-> m Bool

Returns: true if the font chooser dialog is modal

Returns whether the font chooser dialog blocks interaction with the parent window while it is presented.

Since: 4.10

getTitle

fontDialogGetTitle Source #

Arguments

:: (HasCallStack, MonadIO m, IsFontDialog a) 
=> a

self: a font dialog

-> m Text

Returns: the title

Returns the title that will be shown on the font chooser dialog.

Since: 4.10

new

fontDialogNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m FontDialog

Returns: the new GtkFontDialog

Creates a new GtkFontDialog object.

Since: 4.10

setFilter

fontDialogSetFilter Source #

Arguments

:: (HasCallStack, MonadIO m, IsFontDialog a, IsFilter b) 
=> a

self: a font dialog

-> Maybe b

filter: the filter

-> m () 

Adds a filter that decides which fonts to display in the font chooser dialog.

The filter must be able to handle both PangoFontFamily and PangoFontFace objects.

Since: 4.10

setFontMap

fontDialogSetFontMap Source #

Arguments

:: (HasCallStack, MonadIO m, IsFontDialog a, IsFontMap b) 
=> a

self: a font dialog

-> Maybe b

fontmap: the fontmap

-> m () 

Sets the fontmap from which fonts are selected.

If fontmap is NULL, the default fontmap is used.

Since: 4.10

setLanguage

fontDialogSetLanguage Source #

Arguments

:: (HasCallStack, MonadIO m, IsFontDialog a) 
=> a

self: a font dialog

-> Language

language: the language for font features

-> m () 

Sets the language for which font features are applied.

Since: 4.10

setModal

fontDialogSetModal Source #

Arguments

:: (HasCallStack, MonadIO m, IsFontDialog a) 
=> a

self: a font dialog

-> Bool

modal: the new value

-> m () 

Sets whether the font chooser dialog blocks interaction with the parent window while it is presented.

Since: 4.10

setTitle

fontDialogSetTitle Source #

Arguments

:: (HasCallStack, MonadIO m, IsFontDialog a) 
=> a

self: a font dialog

-> Text

title: the new title

-> m () 

Sets the title that will be shown on the font chooser dialog.

Since: 4.10

Properties

filter

A filter to restrict what fonts are shown in the font chooser dialog.

Since: 4.10

clearFontDialogFilter :: (MonadIO m, IsFontDialog o) => o -> m () Source #

Set the value of the “filter” property to Nothing. When overloading is enabled, this is equivalent to

clear #filter

constructFontDialogFilter :: (IsFontDialog o, MonadIO m, IsFilter a) => a -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “filter” property. This is rarely needed directly, but it is used by new.

getFontDialogFilter :: (MonadIO m, IsFontDialog o) => o -> m (Maybe Filter) Source #

Get the value of the “filter” property. When overloading is enabled, this is equivalent to

get fontDialog #filter

setFontDialogFilter :: (MonadIO m, IsFontDialog o, IsFilter a) => o -> a -> m () Source #

Set the value of the “filter” property. When overloading is enabled, this is equivalent to

set fontDialog [ #filter := value ]

fontMap

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.

Since: 4.10

clearFontDialogFontMap :: (MonadIO m, IsFontDialog o) => o -> m () Source #

Set the value of the “font-map” property to Nothing. When overloading is enabled, this is equivalent to

clear #fontMap

constructFontDialogFontMap :: (IsFontDialog o, MonadIO m, IsFontMap a) => a -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “font-map” property. This is rarely needed directly, but it is used by new.

getFontDialogFontMap :: (MonadIO m, IsFontDialog o) => o -> m (Maybe FontMap) Source #

Get the value of the “font-map” property. When overloading is enabled, this is equivalent to

get fontDialog #fontMap

setFontDialogFontMap :: (MonadIO m, IsFontDialog o, IsFontMap a) => o -> a -> m () Source #

Set the value of the “font-map” property. When overloading is enabled, this is equivalent to

set fontDialog [ #fontMap := value ]

language

The language for which the font features are selected.

Since: 4.10

constructFontDialogLanguage :: (IsFontDialog o, MonadIO m) => Language -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “language” property. This is rarely needed directly, but it is used by new.

getFontDialogLanguage :: (MonadIO m, IsFontDialog o) => o -> m (Maybe Language) Source #

Get the value of the “language” property. When overloading is enabled, this is equivalent to

get fontDialog #language

setFontDialogLanguage :: (MonadIO m, IsFontDialog o) => o -> Language -> m () Source #

Set the value of the “language” property. When overloading is enabled, this is equivalent to

set fontDialog [ #language := value ]

modal

Whether the font chooser dialog is modal.

Since: 4.10

constructFontDialogModal :: (IsFontDialog o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “modal” property. This is rarely needed directly, but it is used by new.

getFontDialogModal :: (MonadIO m, IsFontDialog o) => o -> m Bool Source #

Get the value of the “modal” property. When overloading is enabled, this is equivalent to

get fontDialog #modal

setFontDialogModal :: (MonadIO m, IsFontDialog o) => o -> Bool -> m () Source #

Set the value of the “modal” property. When overloading is enabled, this is equivalent to

set fontDialog [ #modal := value ]

title

A title that may be shown on the font chooser dialog that is presented by fontDialogChooseFont.

Since: 4.10

constructFontDialogTitle :: (IsFontDialog o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “title” property. This is rarely needed directly, but it is used by new.

getFontDialogTitle :: (MonadIO m, IsFontDialog o) => o -> m Text Source #

Get the value of the “title” property. When overloading is enabled, this is equivalent to

get fontDialog #title

setFontDialogTitle :: (MonadIO m, IsFontDialog o) => o -> Text -> m () Source #

Set the value of the “title” property. When overloading is enabled, this is equivalent to

set fontDialog [ #title := value ]