gi-gtk4-4.0.12: Gtk 4.x bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gtk.Objects.FontDialog

Contents

- Exported types
- Methods
  - chooseFace
  - chooseFaceFinish
  - chooseFamily
  - chooseFamilyFinish
  - chooseFont
  - chooseFontAndFeatures
  - chooseFontAndFeaturesFinish
  - chooseFontFinish
  - getFilter
  - getFontMap
  - getLanguage
  - getModal
  - getTitle
  - new
  - setFilter
  - setFontMap
  - setLanguage
  - setModal
  - setTitle
- Properties
  - filter
  - fontMap
  - language
  - modal
  - title

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

- newtype FontDialog = FontDialog (ManagedPtr FontDialog)
- class (GObject o, IsDescendantOf FontDialog o) => IsFontDialog o
- toFontDialog :: (MonadIO m, IsFontDialog o) => o -> m FontDialog
- fontDialogChooseFace :: (HasCallStack, MonadIO m, IsFontDialog a, IsWindow b, IsFontFace c, IsCancellable d) => a -> Maybe b -> Maybe c -> Maybe d -> Maybe AsyncReadyCallback -> m ()
- fontDialogChooseFaceFinish :: (HasCallStack, MonadIO m, IsFontDialog a, IsAsyncResult b) => a -> b -> m FontFace
- fontDialogChooseFamily :: (HasCallStack, MonadIO m, IsFontDialog a, IsWindow b, IsFontFamily c, IsCancellable d) => a -> Maybe b -> Maybe c -> Maybe d -> Maybe AsyncReadyCallback -> m ()
- fontDialogChooseFamilyFinish :: (HasCallStack, MonadIO m, IsFontDialog a, IsAsyncResult b) => a -> b -> m FontFamily
- fontDialogChooseFont :: (HasCallStack, MonadIO m, IsFontDialog a, IsWindow b, IsCancellable c) => a -> Maybe b -> Maybe FontDescription -> Maybe c -> Maybe AsyncReadyCallback -> m ()
- fontDialogChooseFontAndFeatures :: (HasCallStack, MonadIO m, IsFontDialog a, IsWindow b, IsCancellable c) => a -> Maybe b -> Maybe FontDescription -> Maybe c -> Maybe AsyncReadyCallback -> m ()
- fontDialogChooseFontAndFeaturesFinish :: (HasCallStack, MonadIO m, IsFontDialog a, IsAsyncResult b) => a -> b -> m (FontDescription, Text, Language)
- fontDialogChooseFontFinish :: (HasCallStack, MonadIO m, IsFontDialog a, IsAsyncResult b) => a -> b -> m FontDescription
- fontDialogGetFilter :: (HasCallStack, MonadIO m, IsFontDialog a) => a -> m (Maybe Filter)
- fontDialogGetFontMap :: (HasCallStack, MonadIO m, IsFontDialog a) => a -> m (Maybe FontMap)
- fontDialogGetLanguage :: (HasCallStack, MonadIO m, IsFontDialog a) => a -> m (Maybe Language)
- fontDialogGetModal :: (HasCallStack, MonadIO m, IsFontDialog a) => a -> m Bool
- fontDialogGetTitle :: (HasCallStack, MonadIO m, IsFontDialog a) => a -> m Text
- fontDialogNew :: (HasCallStack, MonadIO m) => m FontDialog
- fontDialogSetFilter :: (HasCallStack, MonadIO m, IsFontDialog a, IsFilter b) => a -> Maybe b -> m ()
- fontDialogSetFontMap :: (HasCallStack, MonadIO m, IsFontDialog a, IsFontMap b) => a -> Maybe b -> m ()
- fontDialogSetLanguage :: (HasCallStack, MonadIO m, IsFontDialog a) => a -> Language -> m ()
- fontDialogSetModal :: (HasCallStack, MonadIO m, IsFontDialog a) => a -> Bool -> m ()
- fontDialogSetTitle :: (HasCallStack, MonadIO m, IsFontDialog a) => a -> Text -> m ()
- clearFontDialogFilter :: (MonadIO m, IsFontDialog o) => o -> m ()
- constructFontDialogFilter :: (IsFontDialog o, MonadIO m, IsFilter a) => a -> m (GValueConstruct o)
- getFontDialogFilter :: (MonadIO m, IsFontDialog o) => o -> m (Maybe Filter)
- setFontDialogFilter :: (MonadIO m, IsFontDialog o, IsFilter a) => o -> a -> m ()
- clearFontDialogFontMap :: (MonadIO m, IsFontDialog o) => o -> m ()
- constructFontDialogFontMap :: (IsFontDialog o, MonadIO m, IsFontMap a) => a -> m (GValueConstruct o)
- getFontDialogFontMap :: (MonadIO m, IsFontDialog o) => o -> m (Maybe FontMap)
- setFontDialogFontMap :: (MonadIO m, IsFontDialog o, IsFontMap a) => o -> a -> m ()
- constructFontDialogLanguage :: (IsFontDialog o, MonadIO m) => Language -> m (GValueConstruct o)
- getFontDialogLanguage :: (MonadIO m, IsFontDialog o) => o -> m (Maybe Language)
- setFontDialogLanguage :: (MonadIO m, IsFontDialog o) => o -> Language -> m ()
- constructFontDialogModal :: (IsFontDialog o, MonadIO m) => Bool -> m (GValueConstruct o)
- getFontDialogModal :: (MonadIO m, IsFontDialog o) => o -> m Bool
- setFontDialogModal :: (MonadIO m, IsFontDialog o) => o -> Bool -> m ()
- constructFontDialogTitle :: (IsFontDialog o, MonadIO m) => Text -> m (GValueConstruct o)
- getFontDialogTitle :: (MonadIO m, IsFontDialog o) => o -> m Text
- setFontDialogTitle :: (MonadIO m, IsFontDialog o) => o -> Text -> m ()

# 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 Methods (==) :: FontDialog -> FontDialog -> Bool Source # (/=) :: FontDialog -> FontDialog -> Bool Source #
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 Source #
TypedObject FontDialog Source # |
Instance details Defined in GI.Gtk.Objects.FontDialog Methods glibType :: IO GType Source #
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 Source # gvalueSet_ :: Ptr GValue -> Maybe FontDialog -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe FontDialog) Source #
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

### Click to display all available methods, including inherited ones

Expand

#### Methods

bindProperty, bindPropertyFull, chooseFace, chooseFaceFinish, chooseFamily, chooseFamilyFinish, chooseFont, chooseFontAndFeatures, chooseFontAndFeaturesFinish, chooseFontFinish, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.

#### Getters

getData, getFilter, getFontMap, getLanguage, getModal, getProperty, getQdata, getTitle.

#### Setters

setData, setDataFull, setFilter, setFontMap, setLanguage, setModal, setProperty, setTitle.

## 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 [error`gtk`.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 [error`gtk`.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 [error`gtk`.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 [error`gtk`.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 ]