gi-gtk-4.0.8: Gtk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gtk.Objects.FontDialog

Description

A 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 fontDialogChooseFont function or its variants. This API follows the GIO async pattern, and the result can be obtained by calling the corresponding finish function, such as fontDialogChooseFontFinish.

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

Since: 4.10

Synopsis

Exported types

newtype FontDialog Source #

Memory-managed wrapper type.

Constructors

FontDialog (ManagedPtr FontDialog) 

Instances

Instances details
Eq FontDialog Source # 
Instance details

Defined in GI.Gtk.Objects.FontDialog

GObject FontDialog Source # 
Instance details

Defined in GI.Gtk.Objects.FontDialog

ManagedPtrNewtype FontDialog Source # 
Instance details

Defined in GI.Gtk.Objects.FontDialog

Methods

toManagedPtr :: FontDialog -> ManagedPtr FontDialog

TypedObject FontDialog Source # 
Instance details

Defined in GI.Gtk.Objects.FontDialog

Methods

glibType :: IO GType

HasParentTypes FontDialog Source # 
Instance details

Defined in GI.Gtk.Objects.FontDialog

IsGValue (Maybe FontDialog) Source #

Convert FontDialog to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.FontDialog

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe FontDialog -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe FontDialog)

type ParentTypes FontDialog Source # 
Instance details

Defined in GI.Gtk.Objects.FontDialog

type ParentTypes FontDialog = '[Object]

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 GtkFontDialog

-> Maybe b

parent: the parent GtkWindow

-> Maybe c

initialValue: the initial value

-> Maybe d

cancellable: a GCancellable to cancel the operation

-> Maybe AsyncReadyCallback

callback: a callback to call when the operation is complete

-> m () 

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).

The callback will be called when the dialog is dismissed. It should call fontDialogChooseFaceFinish to obtain the result.

Since: 4.10

chooseFaceFinish

fontDialogChooseFaceFinish Source #

Arguments

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

self: a GtkFontDialog

-> b

result: a GAsyncResult

-> m (Maybe FontFace)

Returns: the selected font face (Can throw GError)

Finishes the fontDialogChooseFace call and returns the resulting font face.

Since: 4.10

chooseFamily

fontDialogChooseFamily Source #

Arguments

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

self: a GtkFontDialog

-> Maybe b

parent: the parent GtkWindow

-> Maybe c

initialValue: the initial value

-> Maybe d

cancellable: a GCancellable to cancel the operation

-> Maybe AsyncReadyCallback

callback: a callback to call when the operation is complete

-> m () 

This function initiates a font selection operation by presenting a dialog to the user for selecting a font family.

The callback will be called when the dialog is dismissed. It should call fontDialogChooseFamilyFinish to obtain the result.

Since: 4.10

chooseFamilyFinish

fontDialogChooseFamilyFinish Source #

Arguments

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

self: a GtkFontDialog

-> b

result: a GAsyncResult

-> m (Maybe FontFamily)

Returns: the selected family (Can throw GError)

Finishes the fontDialogChooseFamily call and returns the resulting family.

This function never returns an error. If the operation is not finished successfully, the value passed as initialValue to fontDialogChooseFamily is returned.

Since: 4.10

chooseFont

fontDialogChooseFont Source #

Arguments

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

self: a GtkFontDialog

-> Maybe b

parent: the parent GtkWindow

-> Maybe FontDescription

initialValue: the font to select initially

-> Maybe c

cancellable: a GCancellable to cancel the operation

-> Maybe AsyncReadyCallback

callback: a callback to call when the operation is complete

-> m () 

This function initiates a font selection operation by presenting a dialog to the user for selecting a font.

The callback will be called when the dialog is dismissed. It should call fontDialogChooseFontFinish to obtain the result.

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 GtkFontDialog

-> Maybe b

parent: the parent GtkWindow

-> Maybe FontDescription

initialValue: the font to select initially

-> Maybe c

cancellable: a GCancellable to cancel the operation

-> Maybe AsyncReadyCallback

callback: a callback to call when the operation is complete

-> m () 

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.

The callback will be called when the dialog is dismissed. It should call fontDialogChooseFontAndFeaturesFinish to obtain the result.

Since: 4.10

chooseFontFinish

fontDialogChooseFontFinish Source #

Arguments

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

self: a GtkFontDialog

-> b

result: a GAsyncResult

-> m (Maybe FontDescription)

Returns: the selected font (Can throw GError)

Finishes the fontDialogChooseFont call and returns the resulting font description.

Since: 4.10

getFilter

fontDialogGetFilter Source #

Arguments

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

self: a GtkFontDialog

-> 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 GtkFontDialog

-> 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 GtkFontDialog

-> 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 GtkFontDialog

-> 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 GtkFontDialog

-> 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 GtkFontDialog

-> Maybe b

filter: a GtkFilter

-> m () 

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

The GtkFilter 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 GtkFontDialog

-> 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 GtkFontDialog

-> 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 GtkFontDialog

-> 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 GtkFontDialog

-> Text

title: the new title

-> m () 

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

Since: 4.10

Properties

filter

Sets 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

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.

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 ]