{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)

'GI.Gtk.Interfaces.FontChooser.FontChooser' is an interface that can be implemented by widgets
displaying the list of fonts. In GTK+, the main objects
that implement this interface are 'GI.Gtk.Objects.FontChooserWidget.FontChooserWidget',
'GI.Gtk.Objects.FontChooserDialog.FontChooserDialog' and 'GI.Gtk.Objects.FontButton.FontButton'. The GtkFontChooser interface
has been introducted in GTK+ 3.2.
-}

#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
       && !defined(__HADDOCK_VERSION__))

module GI.Gtk.Interfaces.FontChooser
    (

-- * Exported types
    FontChooser(..)                         ,
    noFontChooser                           ,
    IsFontChooser                           ,
    toFontChooser                           ,


 -- * Methods
-- ** getFont #method:getFont#

#if ENABLE_OVERLOADING
    FontChooserGetFontMethodInfo            ,
#endif
    fontChooserGetFont                      ,


-- ** getFontDesc #method:getFontDesc#

#if ENABLE_OVERLOADING
    FontChooserGetFontDescMethodInfo        ,
#endif
    fontChooserGetFontDesc                  ,


-- ** getFontFace #method:getFontFace#

#if ENABLE_OVERLOADING
    FontChooserGetFontFaceMethodInfo        ,
#endif
    fontChooserGetFontFace                  ,


-- ** getFontFamily #method:getFontFamily#

#if ENABLE_OVERLOADING
    FontChooserGetFontFamilyMethodInfo      ,
#endif
    fontChooserGetFontFamily                ,


-- ** getFontMap #method:getFontMap#

#if ENABLE_OVERLOADING
    FontChooserGetFontMapMethodInfo         ,
#endif
    fontChooserGetFontMap                   ,


-- ** getFontSize #method:getFontSize#

#if ENABLE_OVERLOADING
    FontChooserGetFontSizeMethodInfo        ,
#endif
    fontChooserGetFontSize                  ,


-- ** getPreviewText #method:getPreviewText#

#if ENABLE_OVERLOADING
    FontChooserGetPreviewTextMethodInfo     ,
#endif
    fontChooserGetPreviewText               ,


-- ** getShowPreviewEntry #method:getShowPreviewEntry#

#if ENABLE_OVERLOADING
    FontChooserGetShowPreviewEntryMethodInfo,
#endif
    fontChooserGetShowPreviewEntry          ,


-- ** setFilterFunc #method:setFilterFunc#

#if ENABLE_OVERLOADING
    FontChooserSetFilterFuncMethodInfo      ,
#endif
    fontChooserSetFilterFunc                ,


-- ** setFont #method:setFont#

#if ENABLE_OVERLOADING
    FontChooserSetFontMethodInfo            ,
#endif
    fontChooserSetFont                      ,


-- ** setFontDesc #method:setFontDesc#

#if ENABLE_OVERLOADING
    FontChooserSetFontDescMethodInfo        ,
#endif
    fontChooserSetFontDesc                  ,


-- ** setFontMap #method:setFontMap#

#if ENABLE_OVERLOADING
    FontChooserSetFontMapMethodInfo         ,
#endif
    fontChooserSetFontMap                   ,


-- ** setPreviewText #method:setPreviewText#

#if ENABLE_OVERLOADING
    FontChooserSetPreviewTextMethodInfo     ,
#endif
    fontChooserSetPreviewText               ,


-- ** setShowPreviewEntry #method:setShowPreviewEntry#

#if ENABLE_OVERLOADING
    FontChooserSetShowPreviewEntryMethodInfo,
#endif
    fontChooserSetShowPreviewEntry          ,




 -- * Properties
-- ** font #attr:font#
{- | The font description as a string, e.g. \"Sans Italic 12\".
-}
#if ENABLE_OVERLOADING
    FontChooserFontPropertyInfo             ,
#endif
    constructFontChooserFont                ,
#if ENABLE_OVERLOADING
    fontChooserFont                         ,
#endif
    getFontChooserFont                      ,
    setFontChooserFont                      ,


-- ** fontDesc #attr:fontDesc#
{- | The font description as a 'GI.Pango.Structs.FontDescription.FontDescription'.
-}
#if ENABLE_OVERLOADING
    FontChooserFontDescPropertyInfo         ,
#endif
    constructFontChooserFontDesc            ,
#if ENABLE_OVERLOADING
    fontChooserFontDesc                     ,
#endif
    getFontChooserFontDesc                  ,
    setFontChooserFontDesc                  ,


-- ** previewText #attr:previewText#
{- | The string with which to preview the font.
-}
#if ENABLE_OVERLOADING
    FontChooserPreviewTextPropertyInfo      ,
#endif
    constructFontChooserPreviewText         ,
#if ENABLE_OVERLOADING
    fontChooserPreviewText                  ,
#endif
    getFontChooserPreviewText               ,
    setFontChooserPreviewText               ,


-- ** showPreviewEntry #attr:showPreviewEntry#
{- | Whether to show an entry to change the preview text.
-}
#if ENABLE_OVERLOADING
    FontChooserShowPreviewEntryPropertyInfo ,
#endif
    constructFontChooserShowPreviewEntry    ,
#if ENABLE_OVERLOADING
    fontChooserShowPreviewEntry             ,
#endif
    getFontChooserShowPreviewEntry          ,
    setFontChooserShowPreviewEntry          ,




 -- * Signals
-- ** fontActivated #signal:fontActivated#

    C_FontChooserFontActivatedCallback      ,
    FontChooserFontActivatedCallback        ,
#if ENABLE_OVERLOADING
    FontChooserFontActivatedSignalInfo      ,
#endif
    afterFontChooserFontActivated           ,
    genClosure_FontChooserFontActivated     ,
    mk_FontChooserFontActivatedCallback     ,
    noFontChooserFontActivatedCallback      ,
    onFontChooserFontActivated              ,
    wrap_FontChooserFontActivatedCallback   ,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP

import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gtk.Callbacks as Gtk.Callbacks
import qualified GI.Pango.Objects.FontFace as Pango.FontFace
import qualified GI.Pango.Objects.FontFamily as Pango.FontFamily
import qualified GI.Pango.Objects.FontMap as Pango.FontMap
import qualified GI.Pango.Structs.FontDescription as Pango.FontDescription

-- interface FontChooser 
-- | Memory-managed wrapper type.
newtype FontChooser = FontChooser (ManagedPtr FontChooser)
-- | A convenience alias for `Nothing` :: `Maybe` `FontChooser`.
noFontChooser :: Maybe FontChooser
noFontChooser = Nothing

-- signal FontChooser::font-activated
{- |
Emitted when a font is activated.
This usually happens when the user double clicks an item,
or an item is selected and the user presses one of the keys
Space, Shift+Space, Return or Enter.
-}
type FontChooserFontActivatedCallback =
    T.Text
    {- ^ /@fontname@/: the font name -}
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `FontChooserFontActivatedCallback`@.
noFontChooserFontActivatedCallback :: Maybe FontChooserFontActivatedCallback
noFontChooserFontActivatedCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_FontChooserFontActivatedCallback =
    Ptr () ->                               -- object
    CString ->
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_FontChooserFontActivatedCallback`.
foreign import ccall "wrapper"
    mk_FontChooserFontActivatedCallback :: C_FontChooserFontActivatedCallback -> IO (FunPtr C_FontChooserFontActivatedCallback)

-- | Wrap the callback into a `Closure`.
genClosure_FontChooserFontActivated :: FontChooserFontActivatedCallback -> IO Closure
genClosure_FontChooserFontActivated cb = do
    let cb' = wrap_FontChooserFontActivatedCallback cb
    mk_FontChooserFontActivatedCallback cb' >>= newCClosure


-- | Wrap a `FontChooserFontActivatedCallback` into a `C_FontChooserFontActivatedCallback`.
wrap_FontChooserFontActivatedCallback ::
    FontChooserFontActivatedCallback ->
    C_FontChooserFontActivatedCallback
wrap_FontChooserFontActivatedCallback _cb _ fontname _ = do
    fontname' <- cstringToText fontname
    _cb  fontname'


{- |
Connect a signal handler for the “@font-activated@” signal, to be run before the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.on' fontChooser #fontActivated callback
@
-}
onFontChooserFontActivated :: (IsFontChooser a, MonadIO m) => a -> FontChooserFontActivatedCallback -> m SignalHandlerId
onFontChooserFontActivated obj cb = liftIO $ do
    let cb' = wrap_FontChooserFontActivatedCallback cb
    cb'' <- mk_FontChooserFontActivatedCallback cb'
    connectSignalFunPtr obj "font-activated" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@font-activated@” signal, to be run after the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.after' fontChooser #fontActivated callback
@
-}
afterFontChooserFontActivated :: (IsFontChooser a, MonadIO m) => a -> FontChooserFontActivatedCallback -> m SignalHandlerId
afterFontChooserFontActivated obj cb = liftIO $ do
    let cb' = wrap_FontChooserFontActivatedCallback cb
    cb'' <- mk_FontChooserFontActivatedCallback cb'
    connectSignalFunPtr obj "font-activated" cb'' SignalConnectAfter


#if ENABLE_OVERLOADING
data FontChooserFontActivatedSignalInfo
instance SignalInfo FontChooserFontActivatedSignalInfo where
    type HaskellCallbackType FontChooserFontActivatedSignalInfo = FontChooserFontActivatedCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_FontChooserFontActivatedCallback cb
        cb'' <- mk_FontChooserFontActivatedCallback cb'
        connectSignalFunPtr obj "font-activated" cb'' connectMode

type instance O.SignalList FontChooser = FontChooserSignalList
type FontChooserSignalList = ('[ '("fontActivated", FontChooserFontActivatedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

#endif

foreign import ccall "gtk_font_chooser_get_type"
    c_gtk_font_chooser_get_type :: IO GType

instance GObject FontChooser where
    gobjectType _ = c_gtk_font_chooser_get_type


-- | Type class for types which can be safely cast to `FontChooser`, for instance with `toFontChooser`.
class GObject o => IsFontChooser o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError FontChooser a) =>
    IsFontChooser a
#endif
instance IsFontChooser FontChooser
instance GObject.Object.IsObject FontChooser

-- | Cast to `FontChooser`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toFontChooser :: (MonadIO m, IsFontChooser o) => o -> m FontChooser
toFontChooser = liftIO . unsafeCastTo FontChooser

-- VVV Prop "font"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Just False)

{- |
Get the value of the “@font@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' fontChooser #font
@
-}
getFontChooserFont :: (MonadIO m, IsFontChooser o) => o -> m (Maybe T.Text)
getFontChooserFont obj = liftIO $ getObjectPropertyString obj "font"

{- |
Set the value of the “@font@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' fontChooser [ #font 'Data.GI.Base.Attributes.:=' value ]
@
-}
setFontChooserFont :: (MonadIO m, IsFontChooser o) => o -> T.Text -> m ()
setFontChooserFont obj val = liftIO $ setObjectPropertyString obj "font" (Just val)

{- |
Construct a `GValueConstruct` with valid value for the “@font@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructFontChooserFont :: (IsFontChooser o) => T.Text -> IO (GValueConstruct o)
constructFontChooserFont val = constructObjectPropertyString "font" (Just val)

#if ENABLE_OVERLOADING
data FontChooserFontPropertyInfo
instance AttrInfo FontChooserFontPropertyInfo where
    type AttrAllowedOps FontChooserFontPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint FontChooserFontPropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint FontChooserFontPropertyInfo = IsFontChooser
    type AttrGetType FontChooserFontPropertyInfo = (Maybe T.Text)
    type AttrLabel FontChooserFontPropertyInfo = "font"
    type AttrOrigin FontChooserFontPropertyInfo = FontChooser
    attrGet _ = getFontChooserFont
    attrSet _ = setFontChooserFont
    attrConstruct _ = constructFontChooserFont
    attrClear _ = undefined
#endif

-- VVV Prop "font-desc"
   -- Type: TInterface (Name {namespace = "Pango", name = "FontDescription"})
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Just False)

{- |
Get the value of the “@font-desc@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' fontChooser #fontDesc
@
-}
getFontChooserFontDesc :: (MonadIO m, IsFontChooser o) => o -> m (Maybe Pango.FontDescription.FontDescription)
getFontChooserFontDesc obj = liftIO $ getObjectPropertyBoxed obj "font-desc" Pango.FontDescription.FontDescription

{- |
Set the value of the “@font-desc@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' fontChooser [ #fontDesc 'Data.GI.Base.Attributes.:=' value ]
@
-}
setFontChooserFontDesc :: (MonadIO m, IsFontChooser o) => o -> Pango.FontDescription.FontDescription -> m ()
setFontChooserFontDesc obj val = liftIO $ setObjectPropertyBoxed obj "font-desc" (Just val)

{- |
Construct a `GValueConstruct` with valid value for the “@font-desc@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructFontChooserFontDesc :: (IsFontChooser o) => Pango.FontDescription.FontDescription -> IO (GValueConstruct o)
constructFontChooserFontDesc val = constructObjectPropertyBoxed "font-desc" (Just val)

#if ENABLE_OVERLOADING
data FontChooserFontDescPropertyInfo
instance AttrInfo FontChooserFontDescPropertyInfo where
    type AttrAllowedOps FontChooserFontDescPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint FontChooserFontDescPropertyInfo = (~) Pango.FontDescription.FontDescription
    type AttrBaseTypeConstraint FontChooserFontDescPropertyInfo = IsFontChooser
    type AttrGetType FontChooserFontDescPropertyInfo = (Maybe Pango.FontDescription.FontDescription)
    type AttrLabel FontChooserFontDescPropertyInfo = "font-desc"
    type AttrOrigin FontChooserFontDescPropertyInfo = FontChooser
    attrGet _ = getFontChooserFontDesc
    attrSet _ = setFontChooserFontDesc
    attrConstruct _ = constructFontChooserFontDesc
    attrClear _ = undefined
#endif

-- VVV Prop "preview-text"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Just False)

{- |
Get the value of the “@preview-text@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' fontChooser #previewText
@
-}
getFontChooserPreviewText :: (MonadIO m, IsFontChooser o) => o -> m (Maybe T.Text)
getFontChooserPreviewText obj = liftIO $ getObjectPropertyString obj "preview-text"

{- |
Set the value of the “@preview-text@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' fontChooser [ #previewText 'Data.GI.Base.Attributes.:=' value ]
@
-}
setFontChooserPreviewText :: (MonadIO m, IsFontChooser o) => o -> T.Text -> m ()
setFontChooserPreviewText obj val = liftIO $ setObjectPropertyString obj "preview-text" (Just val)

{- |
Construct a `GValueConstruct` with valid value for the “@preview-text@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructFontChooserPreviewText :: (IsFontChooser o) => T.Text -> IO (GValueConstruct o)
constructFontChooserPreviewText val = constructObjectPropertyString "preview-text" (Just val)

#if ENABLE_OVERLOADING
data FontChooserPreviewTextPropertyInfo
instance AttrInfo FontChooserPreviewTextPropertyInfo where
    type AttrAllowedOps FontChooserPreviewTextPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint FontChooserPreviewTextPropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint FontChooserPreviewTextPropertyInfo = IsFontChooser
    type AttrGetType FontChooserPreviewTextPropertyInfo = (Maybe T.Text)
    type AttrLabel FontChooserPreviewTextPropertyInfo = "preview-text"
    type AttrOrigin FontChooserPreviewTextPropertyInfo = FontChooser
    attrGet _ = getFontChooserPreviewText
    attrSet _ = setFontChooserPreviewText
    attrConstruct _ = constructFontChooserPreviewText
    attrClear _ = undefined
#endif

-- VVV Prop "show-preview-entry"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

{- |
Get the value of the “@show-preview-entry@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' fontChooser #showPreviewEntry
@
-}
getFontChooserShowPreviewEntry :: (MonadIO m, IsFontChooser o) => o -> m Bool
getFontChooserShowPreviewEntry obj = liftIO $ getObjectPropertyBool obj "show-preview-entry"

{- |
Set the value of the “@show-preview-entry@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' fontChooser [ #showPreviewEntry 'Data.GI.Base.Attributes.:=' value ]
@
-}
setFontChooserShowPreviewEntry :: (MonadIO m, IsFontChooser o) => o -> Bool -> m ()
setFontChooserShowPreviewEntry obj val = liftIO $ setObjectPropertyBool obj "show-preview-entry" val

{- |
Construct a `GValueConstruct` with valid value for the “@show-preview-entry@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructFontChooserShowPreviewEntry :: (IsFontChooser o) => Bool -> IO (GValueConstruct o)
constructFontChooserShowPreviewEntry val = constructObjectPropertyBool "show-preview-entry" val

#if ENABLE_OVERLOADING
data FontChooserShowPreviewEntryPropertyInfo
instance AttrInfo FontChooserShowPreviewEntryPropertyInfo where
    type AttrAllowedOps FontChooserShowPreviewEntryPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint FontChooserShowPreviewEntryPropertyInfo = (~) Bool
    type AttrBaseTypeConstraint FontChooserShowPreviewEntryPropertyInfo = IsFontChooser
    type AttrGetType FontChooserShowPreviewEntryPropertyInfo = Bool
    type AttrLabel FontChooserShowPreviewEntryPropertyInfo = "show-preview-entry"
    type AttrOrigin FontChooserShowPreviewEntryPropertyInfo = FontChooser
    attrGet _ = getFontChooserShowPreviewEntry
    attrSet _ = setFontChooserShowPreviewEntry
    attrConstruct _ = constructFontChooserShowPreviewEntry
    attrClear _ = undefined
#endif

#if ENABLE_OVERLOADING
instance O.HasAttributeList FontChooser
type instance O.AttributeList FontChooser = FontChooserAttributeList
type FontChooserAttributeList = ('[ '("font", FontChooserFontPropertyInfo), '("fontDesc", FontChooserFontDescPropertyInfo), '("previewText", FontChooserPreviewTextPropertyInfo), '("showPreviewEntry", FontChooserShowPreviewEntryPropertyInfo)] :: [(Symbol, *)])
#endif

#if ENABLE_OVERLOADING
fontChooserFont :: AttrLabelProxy "font"
fontChooserFont = AttrLabelProxy

fontChooserFontDesc :: AttrLabelProxy "fontDesc"
fontChooserFontDesc = AttrLabelProxy

fontChooserPreviewText :: AttrLabelProxy "previewText"
fontChooserPreviewText = AttrLabelProxy

fontChooserShowPreviewEntry :: AttrLabelProxy "showPreviewEntry"
fontChooserShowPreviewEntry = AttrLabelProxy

#endif

#if ENABLE_OVERLOADING
type family ResolveFontChooserMethod (t :: Symbol) (o :: *) :: * where
    ResolveFontChooserMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveFontChooserMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveFontChooserMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveFontChooserMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveFontChooserMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveFontChooserMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveFontChooserMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveFontChooserMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveFontChooserMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveFontChooserMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveFontChooserMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveFontChooserMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveFontChooserMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveFontChooserMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveFontChooserMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveFontChooserMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveFontChooserMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveFontChooserMethod "getFont" o = FontChooserGetFontMethodInfo
    ResolveFontChooserMethod "getFontDesc" o = FontChooserGetFontDescMethodInfo
    ResolveFontChooserMethod "getFontFace" o = FontChooserGetFontFaceMethodInfo
    ResolveFontChooserMethod "getFontFamily" o = FontChooserGetFontFamilyMethodInfo
    ResolveFontChooserMethod "getFontMap" o = FontChooserGetFontMapMethodInfo
    ResolveFontChooserMethod "getFontSize" o = FontChooserGetFontSizeMethodInfo
    ResolveFontChooserMethod "getPreviewText" o = FontChooserGetPreviewTextMethodInfo
    ResolveFontChooserMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveFontChooserMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveFontChooserMethod "getShowPreviewEntry" o = FontChooserGetShowPreviewEntryMethodInfo
    ResolveFontChooserMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveFontChooserMethod "setFilterFunc" o = FontChooserSetFilterFuncMethodInfo
    ResolveFontChooserMethod "setFont" o = FontChooserSetFontMethodInfo
    ResolveFontChooserMethod "setFontDesc" o = FontChooserSetFontDescMethodInfo
    ResolveFontChooserMethod "setFontMap" o = FontChooserSetFontMapMethodInfo
    ResolveFontChooserMethod "setPreviewText" o = FontChooserSetPreviewTextMethodInfo
    ResolveFontChooserMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveFontChooserMethod "setShowPreviewEntry" o = FontChooserSetShowPreviewEntryMethodInfo
    ResolveFontChooserMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveFontChooserMethod t FontChooser, O.MethodInfo info FontChooser p) => O.IsLabelProxy t (FontChooser -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveFontChooserMethod t FontChooser, O.MethodInfo info FontChooser p) => O.IsLabel t (FontChooser -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif

#endif

-- method FontChooser::get_font
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "fontchooser", argType = TInterface (Name {namespace = "Gtk", name = "FontChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFontChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_font_chooser_get_font" gtk_font_chooser_get_font ::
    Ptr FontChooser ->                      -- fontchooser : TInterface (Name {namespace = "Gtk", name = "FontChooser"})
    IO CString

{- |
Gets the currently-selected font name.

Note that this can be a different string than what you set with
'GI.Gtk.Interfaces.FontChooser.fontChooserSetFont', as the font chooser widget may
normalize font names and thus return a string with a different
structure. For example, “Helvetica Italic Bold 12” could be
normalized to “Helvetica Bold Italic 12”.

Use 'GI.Pango.Structs.FontDescription.fontDescriptionEqual' if you want to compare two
font descriptions.

/Since: 3.2/
-}
fontChooserGetFont ::
    (B.CallStack.HasCallStack, MonadIO m, IsFontChooser a) =>
    a
    {- ^ /@fontchooser@/: a 'GI.Gtk.Interfaces.FontChooser.FontChooser' -}
    -> m (Maybe T.Text)
    {- ^ __Returns:__ A string with the name
    of the current font, or 'Nothing' if  no font is selected. You must
    free this string with 'GI.GLib.Functions.free'. -}
fontChooserGetFont fontchooser = liftIO $ do
    fontchooser' <- unsafeManagedPtrCastPtr fontchooser
    result <- gtk_font_chooser_get_font fontchooser'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- cstringToText result'
        freeMem result'
        return result''
    touchManagedPtr fontchooser
    return maybeResult

#if ENABLE_OVERLOADING
data FontChooserGetFontMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsFontChooser a) => O.MethodInfo FontChooserGetFontMethodInfo a signature where
    overloadedMethod _ = fontChooserGetFont

#endif

-- method FontChooser::get_font_desc
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "fontchooser", argType = TInterface (Name {namespace = "Gtk", name = "FontChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFontChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Pango", name = "FontDescription"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_font_chooser_get_font_desc" gtk_font_chooser_get_font_desc ::
    Ptr FontChooser ->                      -- fontchooser : TInterface (Name {namespace = "Gtk", name = "FontChooser"})
    IO (Ptr Pango.FontDescription.FontDescription)

{- |
Gets the currently-selected font.

Note that this can be a different string than what you set with
'GI.Gtk.Interfaces.FontChooser.fontChooserSetFont', as the font chooser widget may
normalize font names and thus return a string with a different
structure. For example, “Helvetica Italic Bold 12” could be
normalized to “Helvetica Bold Italic 12”.

Use 'GI.Pango.Structs.FontDescription.fontDescriptionEqual' if you want to compare two
font descriptions.

/Since: 3.2/
-}
fontChooserGetFontDesc ::
    (B.CallStack.HasCallStack, MonadIO m, IsFontChooser a) =>
    a
    {- ^ /@fontchooser@/: a 'GI.Gtk.Interfaces.FontChooser.FontChooser' -}
    -> m (Maybe Pango.FontDescription.FontDescription)
    {- ^ __Returns:__ A 'GI.Pango.Structs.FontDescription.FontDescription' for the
    current font, or 'Nothing' if  no font is selected. -}
fontChooserGetFontDesc fontchooser = liftIO $ do
    fontchooser' <- unsafeManagedPtrCastPtr fontchooser
    result <- gtk_font_chooser_get_font_desc fontchooser'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (wrapBoxed Pango.FontDescription.FontDescription) result'
        return result''
    touchManagedPtr fontchooser
    return maybeResult

#if ENABLE_OVERLOADING
data FontChooserGetFontDescMethodInfo
instance (signature ~ (m (Maybe Pango.FontDescription.FontDescription)), MonadIO m, IsFontChooser a) => O.MethodInfo FontChooserGetFontDescMethodInfo a signature where
    overloadedMethod _ = fontChooserGetFontDesc

#endif

-- method FontChooser::get_font_face
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "fontchooser", argType = TInterface (Name {namespace = "Gtk", name = "FontChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFontChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Pango", name = "FontFace"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_font_chooser_get_font_face" gtk_font_chooser_get_font_face ::
    Ptr FontChooser ->                      -- fontchooser : TInterface (Name {namespace = "Gtk", name = "FontChooser"})
    IO (Ptr Pango.FontFace.FontFace)

{- |
Gets the 'GI.Pango.Objects.FontFace.FontFace' representing the selected font group
details (i.e. family, slant, weight, width, etc).

If the selected font is not installed, returns 'Nothing'.

/Since: 3.2/
-}
fontChooserGetFontFace ::
    (B.CallStack.HasCallStack, MonadIO m, IsFontChooser a) =>
    a
    {- ^ /@fontchooser@/: a 'GI.Gtk.Interfaces.FontChooser.FontChooser' -}
    -> m (Maybe Pango.FontFace.FontFace)
    {- ^ __Returns:__ A 'GI.Pango.Objects.FontFace.FontFace' representing the
    selected font group details, or 'Nothing'. The returned object is owned by
    /@fontchooser@/ and must not be modified or freed. -}
fontChooserGetFontFace fontchooser = liftIO $ do
    fontchooser' <- unsafeManagedPtrCastPtr fontchooser
    result <- gtk_font_chooser_get_font_face fontchooser'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (newObject Pango.FontFace.FontFace) result'
        return result''
    touchManagedPtr fontchooser
    return maybeResult

#if ENABLE_OVERLOADING
data FontChooserGetFontFaceMethodInfo
instance (signature ~ (m (Maybe Pango.FontFace.FontFace)), MonadIO m, IsFontChooser a) => O.MethodInfo FontChooserGetFontFaceMethodInfo a signature where
    overloadedMethod _ = fontChooserGetFontFace

#endif

-- method FontChooser::get_font_family
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "fontchooser", argType = TInterface (Name {namespace = "Gtk", name = "FontChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFontChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Pango", name = "FontFamily"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_font_chooser_get_font_family" gtk_font_chooser_get_font_family ::
    Ptr FontChooser ->                      -- fontchooser : TInterface (Name {namespace = "Gtk", name = "FontChooser"})
    IO (Ptr Pango.FontFamily.FontFamily)

{- |
Gets the 'GI.Pango.Objects.FontFamily.FontFamily' representing the selected font family.
Font families are a collection of font faces.

If the selected font is not installed, returns 'Nothing'.

/Since: 3.2/
-}
fontChooserGetFontFamily ::
    (B.CallStack.HasCallStack, MonadIO m, IsFontChooser a) =>
    a
    {- ^ /@fontchooser@/: a 'GI.Gtk.Interfaces.FontChooser.FontChooser' -}
    -> m (Maybe Pango.FontFamily.FontFamily)
    {- ^ __Returns:__ A 'GI.Pango.Objects.FontFamily.FontFamily' representing the
    selected font family, or 'Nothing'. The returned object is owned by /@fontchooser@/
    and must not be modified or freed. -}
fontChooserGetFontFamily fontchooser = liftIO $ do
    fontchooser' <- unsafeManagedPtrCastPtr fontchooser
    result <- gtk_font_chooser_get_font_family fontchooser'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (newObject Pango.FontFamily.FontFamily) result'
        return result''
    touchManagedPtr fontchooser
    return maybeResult

#if ENABLE_OVERLOADING
data FontChooserGetFontFamilyMethodInfo
instance (signature ~ (m (Maybe Pango.FontFamily.FontFamily)), MonadIO m, IsFontChooser a) => O.MethodInfo FontChooserGetFontFamilyMethodInfo a signature where
    overloadedMethod _ = fontChooserGetFontFamily

#endif

-- method FontChooser::get_font_map
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "fontchooser", argType = TInterface (Name {namespace = "Gtk", name = "FontChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFontChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Pango", name = "FontMap"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_font_chooser_get_font_map" gtk_font_chooser_get_font_map ::
    Ptr FontChooser ->                      -- fontchooser : TInterface (Name {namespace = "Gtk", name = "FontChooser"})
    IO (Ptr Pango.FontMap.FontMap)

{- |
Gets the custom font map of this font chooser widget,
or 'Nothing' if it does not have one.

/Since: 3.18/
-}
fontChooserGetFontMap ::
    (B.CallStack.HasCallStack, MonadIO m, IsFontChooser a) =>
    a
    {- ^ /@fontchooser@/: a 'GI.Gtk.Interfaces.FontChooser.FontChooser' -}
    -> m (Maybe Pango.FontMap.FontMap)
    {- ^ __Returns:__ a 'GI.Pango.Objects.FontMap.FontMap', or 'Nothing' -}
fontChooserGetFontMap fontchooser = liftIO $ do
    fontchooser' <- unsafeManagedPtrCastPtr fontchooser
    result <- gtk_font_chooser_get_font_map fontchooser'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (wrapObject Pango.FontMap.FontMap) result'
        return result''
    touchManagedPtr fontchooser
    return maybeResult

#if ENABLE_OVERLOADING
data FontChooserGetFontMapMethodInfo
instance (signature ~ (m (Maybe Pango.FontMap.FontMap)), MonadIO m, IsFontChooser a) => O.MethodInfo FontChooserGetFontMapMethodInfo a signature where
    overloadedMethod _ = fontChooserGetFontMap

#endif

-- method FontChooser::get_font_size
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "fontchooser", argType = TInterface (Name {namespace = "Gtk", name = "FontChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFontChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_font_chooser_get_font_size" gtk_font_chooser_get_font_size ::
    Ptr FontChooser ->                      -- fontchooser : TInterface (Name {namespace = "Gtk", name = "FontChooser"})
    IO Int32

{- |
The selected font size.

/Since: 3.2/
-}
fontChooserGetFontSize ::
    (B.CallStack.HasCallStack, MonadIO m, IsFontChooser a) =>
    a
    {- ^ /@fontchooser@/: a 'GI.Gtk.Interfaces.FontChooser.FontChooser' -}
    -> m Int32
    {- ^ __Returns:__ A n integer representing the selected font size,
    or -1 if no font size is selected. -}
fontChooserGetFontSize fontchooser = liftIO $ do
    fontchooser' <- unsafeManagedPtrCastPtr fontchooser
    result <- gtk_font_chooser_get_font_size fontchooser'
    touchManagedPtr fontchooser
    return result

#if ENABLE_OVERLOADING
data FontChooserGetFontSizeMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsFontChooser a) => O.MethodInfo FontChooserGetFontSizeMethodInfo a signature where
    overloadedMethod _ = fontChooserGetFontSize

#endif

-- method FontChooser::get_preview_text
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "fontchooser", argType = TInterface (Name {namespace = "Gtk", name = "FontChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFontChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_font_chooser_get_preview_text" gtk_font_chooser_get_preview_text ::
    Ptr FontChooser ->                      -- fontchooser : TInterface (Name {namespace = "Gtk", name = "FontChooser"})
    IO CString

{- |
Gets the text displayed in the preview area.

/Since: 3.2/
-}
fontChooserGetPreviewText ::
    (B.CallStack.HasCallStack, MonadIO m, IsFontChooser a) =>
    a
    {- ^ /@fontchooser@/: a 'GI.Gtk.Interfaces.FontChooser.FontChooser' -}
    -> m T.Text
    {- ^ __Returns:__ the text displayed in the
    preview area -}
fontChooserGetPreviewText fontchooser = liftIO $ do
    fontchooser' <- unsafeManagedPtrCastPtr fontchooser
    result <- gtk_font_chooser_get_preview_text fontchooser'
    checkUnexpectedReturnNULL "fontChooserGetPreviewText" result
    result' <- cstringToText result
    freeMem result
    touchManagedPtr fontchooser
    return result'

#if ENABLE_OVERLOADING
data FontChooserGetPreviewTextMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsFontChooser a) => O.MethodInfo FontChooserGetPreviewTextMethodInfo a signature where
    overloadedMethod _ = fontChooserGetPreviewText

#endif

-- method FontChooser::get_show_preview_entry
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "fontchooser", argType = TInterface (Name {namespace = "Gtk", name = "FontChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFontChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_font_chooser_get_show_preview_entry" gtk_font_chooser_get_show_preview_entry ::
    Ptr FontChooser ->                      -- fontchooser : TInterface (Name {namespace = "Gtk", name = "FontChooser"})
    IO CInt

{- |
Returns whether the preview entry is shown or not.

/Since: 3.2/
-}
fontChooserGetShowPreviewEntry ::
    (B.CallStack.HasCallStack, MonadIO m, IsFontChooser a) =>
    a
    {- ^ /@fontchooser@/: a 'GI.Gtk.Interfaces.FontChooser.FontChooser' -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the preview entry is shown
    or 'False' if it is hidden. -}
fontChooserGetShowPreviewEntry fontchooser = liftIO $ do
    fontchooser' <- unsafeManagedPtrCastPtr fontchooser
    result <- gtk_font_chooser_get_show_preview_entry fontchooser'
    let result' = (/= 0) result
    touchManagedPtr fontchooser
    return result'

#if ENABLE_OVERLOADING
data FontChooserGetShowPreviewEntryMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsFontChooser a) => O.MethodInfo FontChooserGetShowPreviewEntryMethodInfo a signature where
    overloadedMethod _ = fontChooserGetShowPreviewEntry

#endif

-- method FontChooser::set_filter_func
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "fontchooser", argType = TInterface (Name {namespace = "Gtk", name = "FontChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFontChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "filter", argType = TInterface (Name {namespace = "Gtk", name = "FontFilterFunc"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GtkFontFilterFunc, or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeNotified, argClosure = 2, argDestroy = 3, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data to pass to @filter", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "destroy", argType = TInterface (Name {namespace = "GLib", name = "DestroyNotify"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "function to call to free @data when it is no longer needed", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_font_chooser_set_filter_func" gtk_font_chooser_set_filter_func ::
    Ptr FontChooser ->                      -- fontchooser : TInterface (Name {namespace = "Gtk", name = "FontChooser"})
    FunPtr Gtk.Callbacks.C_FontFilterFunc -> -- filter : TInterface (Name {namespace = "Gtk", name = "FontFilterFunc"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    FunPtr GLib.Callbacks.C_DestroyNotify -> -- destroy : TInterface (Name {namespace = "GLib", name = "DestroyNotify"})
    IO ()

{- |
Adds a filter function that decides which fonts to display
in the font chooser.

/Since: 3.2/
-}
fontChooserSetFilterFunc ::
    (B.CallStack.HasCallStack, MonadIO m, IsFontChooser a) =>
    a
    {- ^ /@fontchooser@/: a 'GI.Gtk.Interfaces.FontChooser.FontChooser' -}
    -> Maybe (Gtk.Callbacks.FontFilterFunc)
    {- ^ /@filter@/: a 'GI.Gtk.Callbacks.FontFilterFunc', or 'Nothing' -}
    -> m ()
fontChooserSetFilterFunc fontchooser filter = liftIO $ do
    fontchooser' <- unsafeManagedPtrCastPtr fontchooser
    maybeFilter <- case filter of
        Nothing -> return (castPtrToFunPtr nullPtr)
        Just jFilter -> do
            jFilter' <- Gtk.Callbacks.mk_FontFilterFunc (Gtk.Callbacks.wrap_FontFilterFunc Nothing (Gtk.Callbacks.drop_closures_FontFilterFunc jFilter))
            return jFilter'
    let userData = castFunPtrToPtr maybeFilter
    let destroy = safeFreeFunPtrPtr
    gtk_font_chooser_set_filter_func fontchooser' maybeFilter userData destroy
    touchManagedPtr fontchooser
    return ()

#if ENABLE_OVERLOADING
data FontChooserSetFilterFuncMethodInfo
instance (signature ~ (Maybe (Gtk.Callbacks.FontFilterFunc) -> m ()), MonadIO m, IsFontChooser a) => O.MethodInfo FontChooserSetFilterFuncMethodInfo a signature where
    overloadedMethod _ = fontChooserSetFilterFunc

#endif

-- method FontChooser::set_font
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "fontchooser", argType = TInterface (Name {namespace = "Gtk", name = "FontChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFontChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "fontname", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a font name like \8220Helvetica 12\8221 or \8220Times Bold 18\8221", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_font_chooser_set_font" gtk_font_chooser_set_font ::
    Ptr FontChooser ->                      -- fontchooser : TInterface (Name {namespace = "Gtk", name = "FontChooser"})
    CString ->                              -- fontname : TBasicType TUTF8
    IO ()

{- |
Sets the currently-selected font.

/Since: 3.2/
-}
fontChooserSetFont ::
    (B.CallStack.HasCallStack, MonadIO m, IsFontChooser a) =>
    a
    {- ^ /@fontchooser@/: a 'GI.Gtk.Interfaces.FontChooser.FontChooser' -}
    -> T.Text
    {- ^ /@fontname@/: a font name like “Helvetica 12” or “Times Bold 18” -}
    -> m ()
fontChooserSetFont fontchooser fontname = liftIO $ do
    fontchooser' <- unsafeManagedPtrCastPtr fontchooser
    fontname' <- textToCString fontname
    gtk_font_chooser_set_font fontchooser' fontname'
    touchManagedPtr fontchooser
    freeMem fontname'
    return ()

#if ENABLE_OVERLOADING
data FontChooserSetFontMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsFontChooser a) => O.MethodInfo FontChooserSetFontMethodInfo a signature where
    overloadedMethod _ = fontChooserSetFont

#endif

-- method FontChooser::set_font_desc
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "fontchooser", argType = TInterface (Name {namespace = "Gtk", name = "FontChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFontChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "font_desc", argType = TInterface (Name {namespace = "Pango", name = "FontDescription"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PangoFontDescription", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_font_chooser_set_font_desc" gtk_font_chooser_set_font_desc ::
    Ptr FontChooser ->                      -- fontchooser : TInterface (Name {namespace = "Gtk", name = "FontChooser"})
    Ptr Pango.FontDescription.FontDescription -> -- font_desc : TInterface (Name {namespace = "Pango", name = "FontDescription"})
    IO ()

{- |
Sets the currently-selected font from /@fontDesc@/.

/Since: 3.2/
-}
fontChooserSetFontDesc ::
    (B.CallStack.HasCallStack, MonadIO m, IsFontChooser a) =>
    a
    {- ^ /@fontchooser@/: a 'GI.Gtk.Interfaces.FontChooser.FontChooser' -}
    -> Pango.FontDescription.FontDescription
    {- ^ /@fontDesc@/: a 'GI.Pango.Structs.FontDescription.FontDescription' -}
    -> m ()
fontChooserSetFontDesc fontchooser fontDesc = liftIO $ do
    fontchooser' <- unsafeManagedPtrCastPtr fontchooser
    fontDesc' <- unsafeManagedPtrGetPtr fontDesc
    gtk_font_chooser_set_font_desc fontchooser' fontDesc'
    touchManagedPtr fontchooser
    touchManagedPtr fontDesc
    return ()

#if ENABLE_OVERLOADING
data FontChooserSetFontDescMethodInfo
instance (signature ~ (Pango.FontDescription.FontDescription -> m ()), MonadIO m, IsFontChooser a) => O.MethodInfo FontChooserSetFontDescMethodInfo a signature where
    overloadedMethod _ = fontChooserSetFontDesc

#endif

-- method FontChooser::set_font_map
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "fontchooser", argType = TInterface (Name {namespace = "Gtk", name = "FontChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFontChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "fontmap", argType = TInterface (Name {namespace = "Pango", name = "FontMap"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #PangoFontMap", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_font_chooser_set_font_map" gtk_font_chooser_set_font_map ::
    Ptr FontChooser ->                      -- fontchooser : TInterface (Name {namespace = "Gtk", name = "FontChooser"})
    Ptr Pango.FontMap.FontMap ->            -- fontmap : TInterface (Name {namespace = "Pango", name = "FontMap"})
    IO ()

{- |
Sets a custom font map to use for this font chooser widget.
A custom font map can be used to present application-specific
fonts instead of or in addition to the normal system fonts.


=== /C code/
>
>FcConfig *config;
>PangoFontMap *fontmap;
>
>config = FcInitLoadConfigAndFonts ();
>FcConfigAppFontAddFile (config, my_app_font_file);
>
>fontmap = pango_cairo_font_map_new_for_font_type (CAIRO_FONT_TYPE_FT);
>pango_fc_font_map_set_config (PANGO_FC_FONT_MAP (fontmap), config);
>
>gtk_font_chooser_set_font_map (font_chooser, fontmap);


Note that other GTK+ widgets will only be able to use the application-specific
font if it is present in the font map they use:

>
>context = gtk_widget_get_pango_context (label);
>pango_context_set_font_map (context, fontmap);


/Since: 3.18/
-}
fontChooserSetFontMap ::
    (B.CallStack.HasCallStack, MonadIO m, IsFontChooser a, Pango.FontMap.IsFontMap b) =>
    a
    {- ^ /@fontchooser@/: a 'GI.Gtk.Interfaces.FontChooser.FontChooser' -}
    -> Maybe (b)
    {- ^ /@fontmap@/: a 'GI.Pango.Objects.FontMap.FontMap' -}
    -> m ()
fontChooserSetFontMap fontchooser fontmap = liftIO $ do
    fontchooser' <- unsafeManagedPtrCastPtr fontchooser
    maybeFontmap <- case fontmap of
        Nothing -> return nullPtr
        Just jFontmap -> do
            jFontmap' <- unsafeManagedPtrCastPtr jFontmap
            return jFontmap'
    gtk_font_chooser_set_font_map fontchooser' maybeFontmap
    touchManagedPtr fontchooser
    whenJust fontmap touchManagedPtr
    return ()

#if ENABLE_OVERLOADING
data FontChooserSetFontMapMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsFontChooser a, Pango.FontMap.IsFontMap b) => O.MethodInfo FontChooserSetFontMapMethodInfo a signature where
    overloadedMethod _ = fontChooserSetFontMap

#endif

-- method FontChooser::set_preview_text
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "fontchooser", argType = TInterface (Name {namespace = "Gtk", name = "FontChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFontChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "text", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the text to display in the preview area", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_font_chooser_set_preview_text" gtk_font_chooser_set_preview_text ::
    Ptr FontChooser ->                      -- fontchooser : TInterface (Name {namespace = "Gtk", name = "FontChooser"})
    CString ->                              -- text : TBasicType TUTF8
    IO ()

{- |
Sets the text displayed in the preview area.
The /@text@/ is used to show how the selected font looks.

/Since: 3.2/
-}
fontChooserSetPreviewText ::
    (B.CallStack.HasCallStack, MonadIO m, IsFontChooser a) =>
    a
    {- ^ /@fontchooser@/: a 'GI.Gtk.Interfaces.FontChooser.FontChooser' -}
    -> T.Text
    {- ^ /@text@/: the text to display in the preview area -}
    -> m ()
fontChooserSetPreviewText fontchooser text = liftIO $ do
    fontchooser' <- unsafeManagedPtrCastPtr fontchooser
    text' <- textToCString text
    gtk_font_chooser_set_preview_text fontchooser' text'
    touchManagedPtr fontchooser
    freeMem text'
    return ()

#if ENABLE_OVERLOADING
data FontChooserSetPreviewTextMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsFontChooser a) => O.MethodInfo FontChooserSetPreviewTextMethodInfo a signature where
    overloadedMethod _ = fontChooserSetPreviewText

#endif

-- method FontChooser::set_show_preview_entry
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "fontchooser", argType = TInterface (Name {namespace = "Gtk", name = "FontChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFontChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "show_preview_entry", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "whether to show the editable preview entry or not", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_font_chooser_set_show_preview_entry" gtk_font_chooser_set_show_preview_entry ::
    Ptr FontChooser ->                      -- fontchooser : TInterface (Name {namespace = "Gtk", name = "FontChooser"})
    CInt ->                                 -- show_preview_entry : TBasicType TBoolean
    IO ()

{- |
Shows or hides the editable preview entry.

/Since: 3.2/
-}
fontChooserSetShowPreviewEntry ::
    (B.CallStack.HasCallStack, MonadIO m, IsFontChooser a) =>
    a
    {- ^ /@fontchooser@/: a 'GI.Gtk.Interfaces.FontChooser.FontChooser' -}
    -> Bool
    {- ^ /@showPreviewEntry@/: whether to show the editable preview entry or not -}
    -> m ()
fontChooserSetShowPreviewEntry fontchooser showPreviewEntry = liftIO $ do
    fontchooser' <- unsafeManagedPtrCastPtr fontchooser
    let showPreviewEntry' = (fromIntegral . fromEnum) showPreviewEntry
    gtk_font_chooser_set_show_preview_entry fontchooser' showPreviewEntry'
    touchManagedPtr fontchooser
    return ()

#if ENABLE_OVERLOADING
data FontChooserSetShowPreviewEntryMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsFontChooser a) => O.MethodInfo FontChooserSetShowPreviewEntryMethodInfo a signature where
    overloadedMethod _ = fontChooserSetShowPreviewEntry

#endif