Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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
- 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 (Maybe 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 (Maybe 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 ()
- fontDialogChooseFontFinish :: (HasCallStack, MonadIO m, IsFontDialog a, IsAsyncResult b) => a -> b -> m (Maybe 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.
FontDialog (ManagedPtr FontDialog) |
Instances
Eq FontDialog Source # | |
Defined in GI.Gtk.Objects.FontDialog (==) :: FontDialog -> FontDialog -> Bool # (/=) :: FontDialog -> FontDialog -> Bool # | |
GObject FontDialog Source # | |
Defined in GI.Gtk.Objects.FontDialog | |
ManagedPtrNewtype FontDialog Source # | |
Defined in GI.Gtk.Objects.FontDialog toManagedPtr :: FontDialog -> ManagedPtr FontDialog | |
TypedObject FontDialog Source # | |
Defined in GI.Gtk.Objects.FontDialog | |
HasParentTypes FontDialog Source # | |
Defined in GI.Gtk.Objects.FontDialog | |
IsGValue (Maybe FontDialog) Source # | Convert |
Defined in GI.Gtk.Objects.FontDialog gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe FontDialog -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe FontDialog) | |
type ParentTypes FontDialog Source # | |
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
(GObject o, IsDescendantOf FontDialog o) => IsFontDialog o Source # | |
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
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
:: (HasCallStack, MonadIO m, IsFontDialog a, IsWindow b, IsFontFace c, IsCancellable d) | |
=> a |
|
-> Maybe b |
|
-> Maybe c |
|
-> Maybe d |
|
-> Maybe AsyncReadyCallback |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsFontDialog a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m (Maybe FontFace) | Returns: the selected font face (Can throw |
Finishes the fontDialogChooseFace
call
and returns the resulting font face.
Since: 4.10
chooseFamily
fontDialogChooseFamily Source #
:: (HasCallStack, MonadIO m, IsFontDialog a, IsWindow b, IsFontFamily c, IsCancellable d) | |
=> a |
|
-> Maybe b |
|
-> Maybe c |
|
-> Maybe d |
|
-> Maybe AsyncReadyCallback |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsFontDialog a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m (Maybe FontFamily) | Returns: the selected family (Can throw |
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
:: (HasCallStack, MonadIO m, IsFontDialog a, IsWindow b, IsCancellable c) | |
=> a |
|
-> Maybe b |
|
-> Maybe FontDescription |
|
-> Maybe c |
|
-> Maybe AsyncReadyCallback |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsFontDialog a, IsWindow b, IsCancellable c) | |
=> a |
|
-> Maybe b |
|
-> Maybe FontDescription |
|
-> Maybe c |
|
-> Maybe AsyncReadyCallback |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsFontDialog a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m (Maybe FontDescription) | Returns: the selected font (Can throw |
Finishes the fontDialogChooseFont
call
and returns the resulting font description.
Since: 4.10
getFilter
:: (HasCallStack, MonadIO m, IsFontDialog a) | |
=> a |
|
-> m (Maybe Filter) | Returns: the filter |
Returns the filter that decides which fonts to display in the font chooser dialog.
Since: 4.10
getFontMap
:: (HasCallStack, MonadIO m, IsFontDialog a) | |
=> a |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsFontDialog a) | |
=> a |
|
-> m (Maybe Language) | Returns: the language for font features |
Returns the language for which font features are applied.
Since: 4.10
getModal
:: (HasCallStack, MonadIO m, IsFontDialog a) | |
=> a |
|
-> m Bool | Returns: |
Returns whether the font chooser dialog blocks interaction with the parent window while it is presented.
Since: 4.10
getTitle
:: (HasCallStack, MonadIO m, IsFontDialog a) | |
=> a |
|
-> m Text | Returns: the title |
Returns the title that will be shown on the font chooser dialog.
Since: 4.10
new
:: (HasCallStack, MonadIO m) | |
=> m FontDialog | Returns: the new |
Creates a new GtkFontDialog
object.
Since: 4.10
setFilter
:: (HasCallStack, MonadIO m, IsFontDialog a, IsFilter b) | |
=> a |
|
-> Maybe b |
|
-> 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
:: (HasCallStack, MonadIO m, IsFontDialog a, IsFontMap b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets the fontmap from which fonts are selected.
If fontmap
is NULL
, the default fontmap is used.
Since: 4.10
setLanguage
fontDialogSetLanguage Source #
:: (HasCallStack, MonadIO m, IsFontDialog a) | |
=> a |
|
-> Language |
|
-> m () |
Sets the language for which font features are applied.
Since: 4.10
setModal
:: (HasCallStack, MonadIO m, IsFontDialog a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether the font chooser dialog blocks interaction with the parent window while it is presented.
Since: 4.10
setTitle
:: (HasCallStack, MonadIO m, IsFontDialog a) | |
=> a |
|
-> Text |
|
-> 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 ]