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

module GI.Gtk.Objects.FileChooserButton
    ( 

-- * Exported types
    FileChooserButton(..)                   ,
    FileChooserButtonK                      ,
    toFileChooserButton                     ,
    noFileChooserButton                     ,


 -- * Methods
-- ** fileChooserButtonGetFocusOnClick
    fileChooserButtonGetFocusOnClick        ,


-- ** fileChooserButtonGetTitle
    fileChooserButtonGetTitle               ,


-- ** fileChooserButtonGetWidthChars
    fileChooserButtonGetWidthChars          ,


-- ** fileChooserButtonNew
    fileChooserButtonNew                    ,


-- ** fileChooserButtonNewWithDialog
    fileChooserButtonNewWithDialog          ,


-- ** fileChooserButtonSetFocusOnClick
    fileChooserButtonSetFocusOnClick        ,


-- ** fileChooserButtonSetTitle
    fileChooserButtonSetTitle               ,


-- ** fileChooserButtonSetWidthChars
    fileChooserButtonSetWidthChars          ,




 -- * Properties
-- ** Dialog
    FileChooserButtonDialogPropertyInfo     ,
    constructFileChooserButtonDialog        ,


-- ** FocusOnClick
    FileChooserButtonFocusOnClickPropertyInfo,
    constructFileChooserButtonFocusOnClick  ,
    getFileChooserButtonFocusOnClick        ,
    setFileChooserButtonFocusOnClick        ,


-- ** Title
    FileChooserButtonTitlePropertyInfo      ,
    constructFileChooserButtonTitle         ,
    getFileChooserButtonTitle               ,
    setFileChooserButtonTitle               ,


-- ** WidthChars
    FileChooserButtonWidthCharsPropertyInfo ,
    constructFileChooserButtonWidthChars    ,
    getFileChooserButtonWidthChars          ,
    setFileChooserButtonWidthChars          ,




 -- * Signals
-- ** FileSet
    FileChooserButtonFileSetCallback        ,
    FileChooserButtonFileSetCallbackC       ,
    FileChooserButtonFileSetSignalInfo      ,
    afterFileChooserButtonFileSet           ,
    fileChooserButtonFileSetCallbackWrapper ,
    fileChooserButtonFileSetClosure         ,
    mkFileChooserButtonFileSetCallback      ,
    noFileChooserButtonFileSetCallback      ,
    onFileChooserButtonFileSet              ,




    ) where

import Prelude ()
import Data.GI.Base.ShortPrelude

import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map

import GI.Gtk.Types
import GI.Gtk.Callbacks
import qualified GI.Atk as Atk
import qualified GI.GObject as GObject

newtype FileChooserButton = FileChooserButton (ForeignPtr FileChooserButton)
foreign import ccall "gtk_file_chooser_button_get_type"
    c_gtk_file_chooser_button_get_type :: IO GType

type instance ParentTypes FileChooserButton = FileChooserButtonParentTypes
type FileChooserButtonParentTypes = '[Box, Container, Widget, GObject.Object, Atk.ImplementorIface, Buildable, FileChooser, Orientable]

instance GObject FileChooserButton where
    gobjectIsInitiallyUnowned _ = True
    gobjectType _ = c_gtk_file_chooser_button_get_type
    

class GObject o => FileChooserButtonK o
instance (GObject o, IsDescendantOf FileChooserButton o) => FileChooserButtonK o

toFileChooserButton :: FileChooserButtonK o => o -> IO FileChooserButton
toFileChooserButton = unsafeCastTo FileChooserButton

noFileChooserButton :: Maybe FileChooserButton
noFileChooserButton = Nothing

-- signal FileChooserButton::file-set
type FileChooserButtonFileSetCallback =
    IO ()

noFileChooserButtonFileSetCallback :: Maybe FileChooserButtonFileSetCallback
noFileChooserButtonFileSetCallback = Nothing

type FileChooserButtonFileSetCallbackC =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

foreign import ccall "wrapper"
    mkFileChooserButtonFileSetCallback :: FileChooserButtonFileSetCallbackC -> IO (FunPtr FileChooserButtonFileSetCallbackC)

fileChooserButtonFileSetClosure :: FileChooserButtonFileSetCallback -> IO Closure
fileChooserButtonFileSetClosure cb = newCClosure =<< mkFileChooserButtonFileSetCallback wrapped
    where wrapped = fileChooserButtonFileSetCallbackWrapper cb

fileChooserButtonFileSetCallbackWrapper ::
    FileChooserButtonFileSetCallback ->
    Ptr () ->
    Ptr () ->
    IO ()
fileChooserButtonFileSetCallbackWrapper _cb _ _ = do
    _cb 

onFileChooserButtonFileSet :: (GObject a, MonadIO m) => a -> FileChooserButtonFileSetCallback -> m SignalHandlerId
onFileChooserButtonFileSet obj cb = liftIO $ connectFileChooserButtonFileSet obj cb SignalConnectBefore
afterFileChooserButtonFileSet :: (GObject a, MonadIO m) => a -> FileChooserButtonFileSetCallback -> m SignalHandlerId
afterFileChooserButtonFileSet obj cb = connectFileChooserButtonFileSet obj cb SignalConnectAfter

connectFileChooserButtonFileSet :: (GObject a, MonadIO m) =>
                                   a -> FileChooserButtonFileSetCallback -> SignalConnectMode -> m SignalHandlerId
connectFileChooserButtonFileSet obj cb after = liftIO $ do
    cb' <- mkFileChooserButtonFileSetCallback (fileChooserButtonFileSetCallbackWrapper cb)
    connectSignalFunPtr obj "file-set" cb' after

-- VVV Prop "dialog"
   -- Type: TInterface "Gtk" "FileChooser"
   -- Flags: [PropertyWritable,PropertyConstructOnly]

constructFileChooserButtonDialog :: (FileChooserK a) => a -> IO ([Char], GValue)
constructFileChooserButtonDialog val = constructObjectPropertyObject "dialog" val

data FileChooserButtonDialogPropertyInfo
instance AttrInfo FileChooserButtonDialogPropertyInfo where
    type AttrAllowedOps FileChooserButtonDialogPropertyInfo = '[ 'AttrConstruct]
    type AttrSetTypeConstraint FileChooserButtonDialogPropertyInfo = FileChooserK
    type AttrBaseTypeConstraint FileChooserButtonDialogPropertyInfo = FileChooserButtonK
    type AttrGetType FileChooserButtonDialogPropertyInfo = ()
    type AttrLabel FileChooserButtonDialogPropertyInfo = "FileChooserButton::dialog"
    attrGet _ = undefined
    attrSet _ = undefined
    attrConstruct _ = constructFileChooserButtonDialog

-- VVV Prop "focus-on-click"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]

getFileChooserButtonFocusOnClick :: (MonadIO m, FileChooserButtonK o) => o -> m Bool
getFileChooserButtonFocusOnClick obj = liftIO $ getObjectPropertyBool obj "focus-on-click"

setFileChooserButtonFocusOnClick :: (MonadIO m, FileChooserButtonK o) => o -> Bool -> m ()
setFileChooserButtonFocusOnClick obj val = liftIO $ setObjectPropertyBool obj "focus-on-click" val

constructFileChooserButtonFocusOnClick :: Bool -> IO ([Char], GValue)
constructFileChooserButtonFocusOnClick val = constructObjectPropertyBool "focus-on-click" val

data FileChooserButtonFocusOnClickPropertyInfo
instance AttrInfo FileChooserButtonFocusOnClickPropertyInfo where
    type AttrAllowedOps FileChooserButtonFocusOnClickPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint FileChooserButtonFocusOnClickPropertyInfo = (~) Bool
    type AttrBaseTypeConstraint FileChooserButtonFocusOnClickPropertyInfo = FileChooserButtonK
    type AttrGetType FileChooserButtonFocusOnClickPropertyInfo = Bool
    type AttrLabel FileChooserButtonFocusOnClickPropertyInfo = "FileChooserButton::focus-on-click"
    attrGet _ = getFileChooserButtonFocusOnClick
    attrSet _ = setFileChooserButtonFocusOnClick
    attrConstruct _ = constructFileChooserButtonFocusOnClick

-- VVV Prop "title"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable]

getFileChooserButtonTitle :: (MonadIO m, FileChooserButtonK o) => o -> m T.Text
getFileChooserButtonTitle obj = liftIO $ getObjectPropertyString obj "title"

setFileChooserButtonTitle :: (MonadIO m, FileChooserButtonK o) => o -> T.Text -> m ()
setFileChooserButtonTitle obj val = liftIO $ setObjectPropertyString obj "title" val

constructFileChooserButtonTitle :: T.Text -> IO ([Char], GValue)
constructFileChooserButtonTitle val = constructObjectPropertyString "title" val

data FileChooserButtonTitlePropertyInfo
instance AttrInfo FileChooserButtonTitlePropertyInfo where
    type AttrAllowedOps FileChooserButtonTitlePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint FileChooserButtonTitlePropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint FileChooserButtonTitlePropertyInfo = FileChooserButtonK
    type AttrGetType FileChooserButtonTitlePropertyInfo = T.Text
    type AttrLabel FileChooserButtonTitlePropertyInfo = "FileChooserButton::title"
    attrGet _ = getFileChooserButtonTitle
    attrSet _ = setFileChooserButtonTitle
    attrConstruct _ = constructFileChooserButtonTitle

-- VVV Prop "width-chars"
   -- Type: TBasicType TInt32
   -- Flags: [PropertyReadable,PropertyWritable]

getFileChooserButtonWidthChars :: (MonadIO m, FileChooserButtonK o) => o -> m Int32
getFileChooserButtonWidthChars obj = liftIO $ getObjectPropertyCInt obj "width-chars"

setFileChooserButtonWidthChars :: (MonadIO m, FileChooserButtonK o) => o -> Int32 -> m ()
setFileChooserButtonWidthChars obj val = liftIO $ setObjectPropertyCInt obj "width-chars" val

constructFileChooserButtonWidthChars :: Int32 -> IO ([Char], GValue)
constructFileChooserButtonWidthChars val = constructObjectPropertyCInt "width-chars" val

data FileChooserButtonWidthCharsPropertyInfo
instance AttrInfo FileChooserButtonWidthCharsPropertyInfo where
    type AttrAllowedOps FileChooserButtonWidthCharsPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint FileChooserButtonWidthCharsPropertyInfo = (~) Int32
    type AttrBaseTypeConstraint FileChooserButtonWidthCharsPropertyInfo = FileChooserButtonK
    type AttrGetType FileChooserButtonWidthCharsPropertyInfo = Int32
    type AttrLabel FileChooserButtonWidthCharsPropertyInfo = "FileChooserButton::width-chars"
    attrGet _ = getFileChooserButtonWidthChars
    attrSet _ = setFileChooserButtonWidthChars
    attrConstruct _ = constructFileChooserButtonWidthChars

type instance AttributeList FileChooserButton = FileChooserButtonAttributeList
type FileChooserButtonAttributeList = ('[ '("action", FileChooserActionPropertyInfo), '("app-paintable", WidgetAppPaintablePropertyInfo), '("baseline-position", BoxBaselinePositionPropertyInfo), '("border-width", ContainerBorderWidthPropertyInfo), '("can-default", WidgetCanDefaultPropertyInfo), '("can-focus", WidgetCanFocusPropertyInfo), '("child", ContainerChildPropertyInfo), '("composite-child", WidgetCompositeChildPropertyInfo), '("create-folders", FileChooserCreateFoldersPropertyInfo), '("dialog", FileChooserButtonDialogPropertyInfo), '("do-overwrite-confirmation", FileChooserDoOverwriteConfirmationPropertyInfo), '("double-buffered", WidgetDoubleBufferedPropertyInfo), '("events", WidgetEventsPropertyInfo), '("expand", WidgetExpandPropertyInfo), '("extra-widget", FileChooserExtraWidgetPropertyInfo), '("filter", FileChooserFilterPropertyInfo), '("focus-on-click", FileChooserButtonFocusOnClickPropertyInfo), '("halign", WidgetHalignPropertyInfo), '("has-default", WidgetHasDefaultPropertyInfo), '("has-focus", WidgetHasFocusPropertyInfo), '("has-tooltip", WidgetHasTooltipPropertyInfo), '("height-request", WidgetHeightRequestPropertyInfo), '("hexpand", WidgetHexpandPropertyInfo), '("hexpand-set", WidgetHexpandSetPropertyInfo), '("homogeneous", BoxHomogeneousPropertyInfo), '("is-focus", WidgetIsFocusPropertyInfo), '("local-only", FileChooserLocalOnlyPropertyInfo), '("margin", WidgetMarginPropertyInfo), '("margin-bottom", WidgetMarginBottomPropertyInfo), '("margin-end", WidgetMarginEndPropertyInfo), '("margin-left", WidgetMarginLeftPropertyInfo), '("margin-right", WidgetMarginRightPropertyInfo), '("margin-start", WidgetMarginStartPropertyInfo), '("margin-top", WidgetMarginTopPropertyInfo), '("name", WidgetNamePropertyInfo), '("no-show-all", WidgetNoShowAllPropertyInfo), '("opacity", WidgetOpacityPropertyInfo), '("orientation", OrientableOrientationPropertyInfo), '("parent", WidgetParentPropertyInfo), '("preview-widget", FileChooserPreviewWidgetPropertyInfo), '("preview-widget-active", FileChooserPreviewWidgetActivePropertyInfo), '("receives-default", WidgetReceivesDefaultPropertyInfo), '("resize-mode", ContainerResizeModePropertyInfo), '("scale-factor", WidgetScaleFactorPropertyInfo), '("select-multiple", FileChooserSelectMultiplePropertyInfo), '("sensitive", WidgetSensitivePropertyInfo), '("show-hidden", FileChooserShowHiddenPropertyInfo), '("spacing", BoxSpacingPropertyInfo), '("style", WidgetStylePropertyInfo), '("title", FileChooserButtonTitlePropertyInfo), '("tooltip-markup", WidgetTooltipMarkupPropertyInfo), '("tooltip-text", WidgetTooltipTextPropertyInfo), '("use-preview-label", FileChooserUsePreviewLabelPropertyInfo), '("valign", WidgetValignPropertyInfo), '("vexpand", WidgetVexpandPropertyInfo), '("vexpand-set", WidgetVexpandSetPropertyInfo), '("visible", WidgetVisiblePropertyInfo), '("width-chars", FileChooserButtonWidthCharsPropertyInfo), '("width-request", WidgetWidthRequestPropertyInfo), '("window", WidgetWindowPropertyInfo)] :: [(Symbol, *)])

data FileChooserButtonFileSetSignalInfo
instance SignalInfo FileChooserButtonFileSetSignalInfo where
    type HaskellCallbackType FileChooserButtonFileSetSignalInfo = FileChooserButtonFileSetCallback
    connectSignal _ = connectFileChooserButtonFileSet

type instance SignalList FileChooserButton = FileChooserButtonSignalList
type FileChooserButtonSignalList = ('[ '("accel-closures-changed", WidgetAccelClosuresChangedSignalInfo), '("add", ContainerAddSignalInfo), '("button-press-event", WidgetButtonPressEventSignalInfo), '("button-release-event", WidgetButtonReleaseEventSignalInfo), '("can-activate-accel", WidgetCanActivateAccelSignalInfo), '("check-resize", ContainerCheckResizeSignalInfo), '("child-notify", WidgetChildNotifySignalInfo), '("composited-changed", WidgetCompositedChangedSignalInfo), '("configure-event", WidgetConfigureEventSignalInfo), '("confirm-overwrite", FileChooserConfirmOverwriteSignalInfo), '("current-folder-changed", FileChooserCurrentFolderChangedSignalInfo), '("damage-event", WidgetDamageEventSignalInfo), '("delete-event", WidgetDeleteEventSignalInfo), '("destroy", WidgetDestroySignalInfo), '("destroy-event", WidgetDestroyEventSignalInfo), '("direction-changed", WidgetDirectionChangedSignalInfo), '("drag-begin", WidgetDragBeginSignalInfo), '("drag-data-delete", WidgetDragDataDeleteSignalInfo), '("drag-data-get", WidgetDragDataGetSignalInfo), '("drag-data-received", WidgetDragDataReceivedSignalInfo), '("drag-drop", WidgetDragDropSignalInfo), '("drag-end", WidgetDragEndSignalInfo), '("drag-failed", WidgetDragFailedSignalInfo), '("drag-leave", WidgetDragLeaveSignalInfo), '("drag-motion", WidgetDragMotionSignalInfo), '("draw", WidgetDrawSignalInfo), '("enter-notify-event", WidgetEnterNotifyEventSignalInfo), '("event", WidgetEventSignalInfo), '("event-after", WidgetEventAfterSignalInfo), '("file-activated", FileChooserFileActivatedSignalInfo), '("file-set", FileChooserButtonFileSetSignalInfo), '("focus", WidgetFocusSignalInfo), '("focus-in-event", WidgetFocusInEventSignalInfo), '("focus-out-event", WidgetFocusOutEventSignalInfo), '("grab-broken-event", WidgetGrabBrokenEventSignalInfo), '("grab-focus", WidgetGrabFocusSignalInfo), '("grab-notify", WidgetGrabNotifySignalInfo), '("hide", WidgetHideSignalInfo), '("hierarchy-changed", WidgetHierarchyChangedSignalInfo), '("key-press-event", WidgetKeyPressEventSignalInfo), '("key-release-event", WidgetKeyReleaseEventSignalInfo), '("keynav-failed", WidgetKeynavFailedSignalInfo), '("leave-notify-event", WidgetLeaveNotifyEventSignalInfo), '("map", WidgetMapSignalInfo), '("map-event", WidgetMapEventSignalInfo), '("mnemonic-activate", WidgetMnemonicActivateSignalInfo), '("motion-notify-event", WidgetMotionNotifyEventSignalInfo), '("move-focus", WidgetMoveFocusSignalInfo), '("notify", GObject.ObjectNotifySignalInfo), '("parent-set", WidgetParentSetSignalInfo), '("popup-menu", WidgetPopupMenuSignalInfo), '("property-notify-event", WidgetPropertyNotifyEventSignalInfo), '("proximity-in-event", WidgetProximityInEventSignalInfo), '("proximity-out-event", WidgetProximityOutEventSignalInfo), '("query-tooltip", WidgetQueryTooltipSignalInfo), '("realize", WidgetRealizeSignalInfo), '("remove", ContainerRemoveSignalInfo), '("screen-changed", WidgetScreenChangedSignalInfo), '("scroll-event", WidgetScrollEventSignalInfo), '("selection-changed", FileChooserSelectionChangedSignalInfo), '("selection-clear-event", WidgetSelectionClearEventSignalInfo), '("selection-get", WidgetSelectionGetSignalInfo), '("selection-notify-event", WidgetSelectionNotifyEventSignalInfo), '("selection-received", WidgetSelectionReceivedSignalInfo), '("selection-request-event", WidgetSelectionRequestEventSignalInfo), '("set-focus-child", ContainerSetFocusChildSignalInfo), '("show", WidgetShowSignalInfo), '("show-help", WidgetShowHelpSignalInfo), '("size-allocate", WidgetSizeAllocateSignalInfo), '("state-changed", WidgetStateChangedSignalInfo), '("state-flags-changed", WidgetStateFlagsChangedSignalInfo), '("style-set", WidgetStyleSetSignalInfo), '("style-updated", WidgetStyleUpdatedSignalInfo), '("touch-event", WidgetTouchEventSignalInfo), '("unmap", WidgetUnmapSignalInfo), '("unmap-event", WidgetUnmapEventSignalInfo), '("unrealize", WidgetUnrealizeSignalInfo), '("update-preview", FileChooserUpdatePreviewSignalInfo), '("visibility-notify-event", WidgetVisibilityNotifyEventSignalInfo), '("window-state-event", WidgetWindowStateEventSignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])

-- method FileChooserButton::new
-- method type : Constructor
-- Args : [Arg {argName = "title", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "action", argType = TInterface "Gtk" "FileChooserAction", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "title", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "action", argType = TInterface "Gtk" "FileChooserAction", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TInterface "Gtk" "FileChooserButton"
-- throws : False
-- Skip return : False

foreign import ccall "gtk_file_chooser_button_new" gtk_file_chooser_button_new :: 
    CString ->                              -- title : TBasicType TUTF8
    CUInt ->                                -- action : TInterface "Gtk" "FileChooserAction"
    IO (Ptr FileChooserButton)


fileChooserButtonNew ::
    (MonadIO m) =>
    T.Text ->                               -- title
    FileChooserAction ->                    -- action
    m FileChooserButton
fileChooserButtonNew title action = liftIO $ do
    title' <- textToCString title
    let action' = (fromIntegral . fromEnum) action
    result <- gtk_file_chooser_button_new title' action'
    checkUnexpectedReturnNULL "gtk_file_chooser_button_new" result
    result' <- (newObject FileChooserButton) result
    freeMem title'
    return result'

-- method FileChooserButton::new_with_dialog
-- method type : Constructor
-- Args : [Arg {argName = "dialog", argType = TInterface "Gtk" "Dialog", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "dialog", argType = TInterface "Gtk" "Dialog", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TInterface "Gtk" "FileChooserButton"
-- throws : False
-- Skip return : False

foreign import ccall "gtk_file_chooser_button_new_with_dialog" gtk_file_chooser_button_new_with_dialog :: 
    Ptr Dialog ->                           -- dialog : TInterface "Gtk" "Dialog"
    IO (Ptr FileChooserButton)


fileChooserButtonNewWithDialog ::
    (MonadIO m, DialogK a) =>
    a ->                                    -- dialog
    m FileChooserButton
fileChooserButtonNewWithDialog dialog = liftIO $ do
    let dialog' = unsafeManagedPtrCastPtr dialog
    result <- gtk_file_chooser_button_new_with_dialog dialog'
    checkUnexpectedReturnNULL "gtk_file_chooser_button_new_with_dialog" result
    result' <- (newObject FileChooserButton) result
    touchManagedPtr dialog
    return result'

-- method FileChooserButton::get_focus_on_click
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "FileChooserButton", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "FileChooserButton", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TBoolean
-- throws : False
-- Skip return : False

foreign import ccall "gtk_file_chooser_button_get_focus_on_click" gtk_file_chooser_button_get_focus_on_click :: 
    Ptr FileChooserButton ->                -- _obj : TInterface "Gtk" "FileChooserButton"
    IO CInt


fileChooserButtonGetFocusOnClick ::
    (MonadIO m, FileChooserButtonK a) =>
    a ->                                    -- _obj
    m Bool
fileChooserButtonGetFocusOnClick _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- gtk_file_chooser_button_get_focus_on_click _obj'
    let result' = (/= 0) result
    touchManagedPtr _obj
    return result'

-- method FileChooserButton::get_title
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "FileChooserButton", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "FileChooserButton", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TUTF8
-- throws : False
-- Skip return : False

foreign import ccall "gtk_file_chooser_button_get_title" gtk_file_chooser_button_get_title :: 
    Ptr FileChooserButton ->                -- _obj : TInterface "Gtk" "FileChooserButton"
    IO CString


fileChooserButtonGetTitle ::
    (MonadIO m, FileChooserButtonK a) =>
    a ->                                    -- _obj
    m T.Text
fileChooserButtonGetTitle _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- gtk_file_chooser_button_get_title _obj'
    checkUnexpectedReturnNULL "gtk_file_chooser_button_get_title" result
    result' <- cstringToText result
    touchManagedPtr _obj
    return result'

-- method FileChooserButton::get_width_chars
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "FileChooserButton", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "FileChooserButton", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TInt32
-- throws : False
-- Skip return : False

foreign import ccall "gtk_file_chooser_button_get_width_chars" gtk_file_chooser_button_get_width_chars :: 
    Ptr FileChooserButton ->                -- _obj : TInterface "Gtk" "FileChooserButton"
    IO Int32


fileChooserButtonGetWidthChars ::
    (MonadIO m, FileChooserButtonK a) =>
    a ->                                    -- _obj
    m Int32
fileChooserButtonGetWidthChars _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- gtk_file_chooser_button_get_width_chars _obj'
    touchManagedPtr _obj
    return result

-- method FileChooserButton::set_focus_on_click
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "FileChooserButton", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "focus_on_click", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "FileChooserButton", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "focus_on_click", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False

foreign import ccall "gtk_file_chooser_button_set_focus_on_click" gtk_file_chooser_button_set_focus_on_click :: 
    Ptr FileChooserButton ->                -- _obj : TInterface "Gtk" "FileChooserButton"
    CInt ->                                 -- focus_on_click : TBasicType TBoolean
    IO ()


fileChooserButtonSetFocusOnClick ::
    (MonadIO m, FileChooserButtonK a) =>
    a ->                                    -- _obj
    Bool ->                                 -- focus_on_click
    m ()
fileChooserButtonSetFocusOnClick _obj focus_on_click = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    let focus_on_click' = (fromIntegral . fromEnum) focus_on_click
    gtk_file_chooser_button_set_focus_on_click _obj' focus_on_click'
    touchManagedPtr _obj
    return ()

-- method FileChooserButton::set_title
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "FileChooserButton", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "title", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "FileChooserButton", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "title", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False

foreign import ccall "gtk_file_chooser_button_set_title" gtk_file_chooser_button_set_title :: 
    Ptr FileChooserButton ->                -- _obj : TInterface "Gtk" "FileChooserButton"
    CString ->                              -- title : TBasicType TUTF8
    IO ()


fileChooserButtonSetTitle ::
    (MonadIO m, FileChooserButtonK a) =>
    a ->                                    -- _obj
    T.Text ->                               -- title
    m ()
fileChooserButtonSetTitle _obj title = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    title' <- textToCString title
    gtk_file_chooser_button_set_title _obj' title'
    touchManagedPtr _obj
    freeMem title'
    return ()

-- method FileChooserButton::set_width_chars
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "FileChooserButton", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "n_chars", argType = TBasicType TInt32, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "FileChooserButton", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "n_chars", argType = TBasicType TInt32, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False

foreign import ccall "gtk_file_chooser_button_set_width_chars" gtk_file_chooser_button_set_width_chars :: 
    Ptr FileChooserButton ->                -- _obj : TInterface "Gtk" "FileChooserButton"
    Int32 ->                                -- n_chars : TBasicType TInt32
    IO ()


fileChooserButtonSetWidthChars ::
    (MonadIO m, FileChooserButtonK a) =>
    a ->                                    -- _obj
    Int32 ->                                -- n_chars
    m ()
fileChooserButtonSetWidthChars _obj n_chars = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    gtk_file_chooser_button_set_width_chars _obj' n_chars
    touchManagedPtr _obj
    return ()