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

'GI.Gtk.Interfaces.FileChooser.FileChooser' is an interface that can be implemented by file
selection widgets.  In GTK+, the main objects that implement this
interface are 'GI.Gtk.Objects.FileChooserWidget.FileChooserWidget', 'GI.Gtk.Objects.FileChooserDialog.FileChooserDialog', and
'GI.Gtk.Objects.FileChooserButton.FileChooserButton'.  You do not need to write an object that
implements the 'GI.Gtk.Interfaces.FileChooser.FileChooser' interface unless you are trying to
adapt an existing file selector to expose a standard programming
interface.

'GI.Gtk.Interfaces.FileChooser.FileChooser' allows for shortcuts to various places in the filesystem.
In the default implementation these are displayed in the left pane. It
may be a bit confusing at first that these shortcuts come from various
sources and in various flavours, so lets explain the terminology here:

* Bookmarks: are created by the user, by dragging folders from the
right pane to the left pane, or by using the “Add”. Bookmarks
can be renamed and deleted by the user.
* Shortcuts: can be provided by the application. For example, a Paint
program may want to add a shortcut for a Clipart folder. Shortcuts
cannot be modified by the user.
* Volumes: are provided by the underlying filesystem abstraction. They are
the “roots” of the filesystem.


= File Names and Encodings

When the user is finished selecting files in a
'GI.Gtk.Interfaces.FileChooser.FileChooser', your program can get the selected names
either as filenames or as URIs.  For URIs, the normal escaping
rules are applied if the URI contains non-ASCII characters.
However, filenames are always returned in
the character set specified by the
@G_FILENAME_ENCODING@ environment variable.
Please see the GLib documentation for more details about this
variable.

This means that while you can pass the result of
'GI.Gtk.Interfaces.FileChooser.fileChooserGetFilename' to @/open()/@ or @/fopen()/@,
you may not be able to directly set it as the text of a
'GI.Gtk.Objects.Label.Label' widget unless you convert it first to UTF-8,
which all GTK+ widgets expect. You should use 'GI.GLib.Functions.filenameToUtf8'
to convert filenames into strings that can be passed to GTK+
widgets.

= Adding a Preview Widget

You can add a custom preview widget to a file chooser and then
get notification about when the preview needs to be updated.
To install a preview widget, use
'GI.Gtk.Interfaces.FileChooser.fileChooserSetPreviewWidget'.  Then, connect to the
'GI.Gtk.Interfaces.FileChooser.FileChooser'::@/update-preview/@ signal to get notified when
you need to update the contents of the preview.

Your callback should use
'GI.Gtk.Interfaces.FileChooser.fileChooserGetPreviewFilename' to see what needs
previewing.  Once you have generated the preview for the
corresponding file, you must call
'GI.Gtk.Interfaces.FileChooser.fileChooserSetPreviewWidgetActive' with a boolean
flag that indicates whether your callback could successfully
generate a preview.

## Example: Using a Preview Widget ## {@/gtkfilechooser/@-preview}

=== /C code/
>
>{
>  GtkImage *preview;
>
>  ...
>
>  preview = gtk_image_new ();
>
>  gtk_file_chooser_set_preview_widget (my_file_chooser, preview);
>  g_signal_connect (my_file_chooser, "update-preview",
>		    G_CALLBACK (update_preview_cb), preview);
>}
>
>static void
>update_preview_cb (GtkFileChooser *file_chooser, gpointer data)
>{
>  GtkWidget *preview;
>  char *filename;
>  GdkPixbuf *pixbuf;
>  gboolean have_preview;
>
>  preview = GTK_WIDGET (data);
>  filename = gtk_file_chooser_get_preview_filename (file_chooser);
>
>  pixbuf = gdk_pixbuf_new_from_file_at_size (filename, 128, 128, NULL);
>  have_preview = (pixbuf != NULL);
>  g_free (filename);
>
>  gtk_image_set_from_pixbuf (GTK_IMAGE (preview), pixbuf);
>  if (pixbuf)
>    g_object_unref (pixbuf);
>
>  gtk_file_chooser_set_preview_widget_active (file_chooser, have_preview);
>}


= Adding Extra Widgets

You can add extra widgets to a file chooser to provide options
that are not present in the default design.  For example, you
can add a toggle button to give the user the option to open a
file in read-only mode.  You can use
'GI.Gtk.Interfaces.FileChooser.fileChooserSetExtraWidget' to insert additional
widgets in a file chooser.

An example for adding extra widgets:

=== /C code/
>
>
>  GtkWidget *toggle;
>
>  ...
>
>  toggle = gtk_check_button_new_with_label ("Open file read-only");
>  gtk_widget_show (toggle);
>  gtk_file_chooser_set_extra_widget (my_file_chooser, toggle);
>}


If you want to set more than one extra widget in the file
chooser, you can a container such as a 'GI.Gtk.Objects.Box.Box' or a 'GI.Gtk.Objects.Grid.Grid'
and include your widgets in it.  Then, set the container as
the whole extra widget.
-}

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

module GI.Gtk.Interfaces.FileChooser
    (

-- * Exported types
    FileChooser(..)                         ,
    noFileChooser                           ,
    IsFileChooser                           ,
    toFileChooser                           ,


 -- * Methods
-- ** addChoice #method:addChoice#

#if ENABLE_OVERLOADING
    FileChooserAddChoiceMethodInfo          ,
#endif
    fileChooserAddChoice                    ,


-- ** addFilter #method:addFilter#

#if ENABLE_OVERLOADING
    FileChooserAddFilterMethodInfo          ,
#endif
    fileChooserAddFilter                    ,


-- ** addShortcutFolder #method:addShortcutFolder#

#if ENABLE_OVERLOADING
    FileChooserAddShortcutFolderMethodInfo  ,
#endif
    fileChooserAddShortcutFolder            ,


-- ** addShortcutFolderUri #method:addShortcutFolderUri#

#if ENABLE_OVERLOADING
    FileChooserAddShortcutFolderUriMethodInfo,
#endif
    fileChooserAddShortcutFolderUri         ,


-- ** getAction #method:getAction#

#if ENABLE_OVERLOADING
    FileChooserGetActionMethodInfo          ,
#endif
    fileChooserGetAction                    ,


-- ** getChoice #method:getChoice#

#if ENABLE_OVERLOADING
    FileChooserGetChoiceMethodInfo          ,
#endif
    fileChooserGetChoice                    ,


-- ** getCreateFolders #method:getCreateFolders#

#if ENABLE_OVERLOADING
    FileChooserGetCreateFoldersMethodInfo   ,
#endif
    fileChooserGetCreateFolders             ,


-- ** getCurrentFolder #method:getCurrentFolder#

#if ENABLE_OVERLOADING
    FileChooserGetCurrentFolderMethodInfo   ,
#endif
    fileChooserGetCurrentFolder             ,


-- ** getCurrentFolderFile #method:getCurrentFolderFile#

#if ENABLE_OVERLOADING
    FileChooserGetCurrentFolderFileMethodInfo,
#endif
    fileChooserGetCurrentFolderFile         ,


-- ** getCurrentFolderUri #method:getCurrentFolderUri#

#if ENABLE_OVERLOADING
    FileChooserGetCurrentFolderUriMethodInfo,
#endif
    fileChooserGetCurrentFolderUri          ,


-- ** getCurrentName #method:getCurrentName#

#if ENABLE_OVERLOADING
    FileChooserGetCurrentNameMethodInfo     ,
#endif
    fileChooserGetCurrentName               ,


-- ** getDoOverwriteConfirmation #method:getDoOverwriteConfirmation#

#if ENABLE_OVERLOADING
    FileChooserGetDoOverwriteConfirmationMethodInfo,
#endif
    fileChooserGetDoOverwriteConfirmation   ,


-- ** getExtraWidget #method:getExtraWidget#

#if ENABLE_OVERLOADING
    FileChooserGetExtraWidgetMethodInfo     ,
#endif
    fileChooserGetExtraWidget               ,


-- ** getFile #method:getFile#

#if ENABLE_OVERLOADING
    FileChooserGetFileMethodInfo            ,
#endif
    fileChooserGetFile                      ,


-- ** getFilename #method:getFilename#

#if ENABLE_OVERLOADING
    FileChooserGetFilenameMethodInfo        ,
#endif
    fileChooserGetFilename                  ,


-- ** getFilenames #method:getFilenames#

#if ENABLE_OVERLOADING
    FileChooserGetFilenamesMethodInfo       ,
#endif
    fileChooserGetFilenames                 ,


-- ** getFiles #method:getFiles#

#if ENABLE_OVERLOADING
    FileChooserGetFilesMethodInfo           ,
#endif
    fileChooserGetFiles                     ,


-- ** getFilter #method:getFilter#

#if ENABLE_OVERLOADING
    FileChooserGetFilterMethodInfo          ,
#endif
    fileChooserGetFilter                    ,


-- ** getLocalOnly #method:getLocalOnly#

#if ENABLE_OVERLOADING
    FileChooserGetLocalOnlyMethodInfo       ,
#endif
    fileChooserGetLocalOnly                 ,


-- ** getPreviewFile #method:getPreviewFile#

#if ENABLE_OVERLOADING
    FileChooserGetPreviewFileMethodInfo     ,
#endif
    fileChooserGetPreviewFile               ,


-- ** getPreviewFilename #method:getPreviewFilename#

#if ENABLE_OVERLOADING
    FileChooserGetPreviewFilenameMethodInfo ,
#endif
    fileChooserGetPreviewFilename           ,


-- ** getPreviewUri #method:getPreviewUri#

#if ENABLE_OVERLOADING
    FileChooserGetPreviewUriMethodInfo      ,
#endif
    fileChooserGetPreviewUri                ,


-- ** getPreviewWidget #method:getPreviewWidget#

#if ENABLE_OVERLOADING
    FileChooserGetPreviewWidgetMethodInfo   ,
#endif
    fileChooserGetPreviewWidget             ,


-- ** getPreviewWidgetActive #method:getPreviewWidgetActive#

#if ENABLE_OVERLOADING
    FileChooserGetPreviewWidgetActiveMethodInfo,
#endif
    fileChooserGetPreviewWidgetActive       ,


-- ** getSelectMultiple #method:getSelectMultiple#

#if ENABLE_OVERLOADING
    FileChooserGetSelectMultipleMethodInfo  ,
#endif
    fileChooserGetSelectMultiple            ,


-- ** getShowHidden #method:getShowHidden#

#if ENABLE_OVERLOADING
    FileChooserGetShowHiddenMethodInfo      ,
#endif
    fileChooserGetShowHidden                ,


-- ** getUri #method:getUri#

#if ENABLE_OVERLOADING
    FileChooserGetUriMethodInfo             ,
#endif
    fileChooserGetUri                       ,


-- ** getUris #method:getUris#

#if ENABLE_OVERLOADING
    FileChooserGetUrisMethodInfo            ,
#endif
    fileChooserGetUris                      ,


-- ** getUsePreviewLabel #method:getUsePreviewLabel#

#if ENABLE_OVERLOADING
    FileChooserGetUsePreviewLabelMethodInfo ,
#endif
    fileChooserGetUsePreviewLabel           ,


-- ** listFilters #method:listFilters#

#if ENABLE_OVERLOADING
    FileChooserListFiltersMethodInfo        ,
#endif
    fileChooserListFilters                  ,


-- ** listShortcutFolderUris #method:listShortcutFolderUris#

#if ENABLE_OVERLOADING
    FileChooserListShortcutFolderUrisMethodInfo,
#endif
    fileChooserListShortcutFolderUris       ,


-- ** listShortcutFolders #method:listShortcutFolders#

#if ENABLE_OVERLOADING
    FileChooserListShortcutFoldersMethodInfo,
#endif
    fileChooserListShortcutFolders          ,


-- ** removeChoice #method:removeChoice#

#if ENABLE_OVERLOADING
    FileChooserRemoveChoiceMethodInfo       ,
#endif
    fileChooserRemoveChoice                 ,


-- ** removeFilter #method:removeFilter#

#if ENABLE_OVERLOADING
    FileChooserRemoveFilterMethodInfo       ,
#endif
    fileChooserRemoveFilter                 ,


-- ** removeShortcutFolder #method:removeShortcutFolder#

#if ENABLE_OVERLOADING
    FileChooserRemoveShortcutFolderMethodInfo,
#endif
    fileChooserRemoveShortcutFolder         ,


-- ** removeShortcutFolderUri #method:removeShortcutFolderUri#

#if ENABLE_OVERLOADING
    FileChooserRemoveShortcutFolderUriMethodInfo,
#endif
    fileChooserRemoveShortcutFolderUri      ,


-- ** selectAll #method:selectAll#

#if ENABLE_OVERLOADING
    FileChooserSelectAllMethodInfo          ,
#endif
    fileChooserSelectAll                    ,


-- ** selectFile #method:selectFile#

#if ENABLE_OVERLOADING
    FileChooserSelectFileMethodInfo         ,
#endif
    fileChooserSelectFile                   ,


-- ** selectFilename #method:selectFilename#

#if ENABLE_OVERLOADING
    FileChooserSelectFilenameMethodInfo     ,
#endif
    fileChooserSelectFilename               ,


-- ** selectUri #method:selectUri#

#if ENABLE_OVERLOADING
    FileChooserSelectUriMethodInfo          ,
#endif
    fileChooserSelectUri                    ,


-- ** setAction #method:setAction#

#if ENABLE_OVERLOADING
    FileChooserSetActionMethodInfo          ,
#endif
    fileChooserSetAction                    ,


-- ** setChoice #method:setChoice#

#if ENABLE_OVERLOADING
    FileChooserSetChoiceMethodInfo          ,
#endif
    fileChooserSetChoice                    ,


-- ** setCreateFolders #method:setCreateFolders#

#if ENABLE_OVERLOADING
    FileChooserSetCreateFoldersMethodInfo   ,
#endif
    fileChooserSetCreateFolders             ,


-- ** setCurrentFolder #method:setCurrentFolder#

#if ENABLE_OVERLOADING
    FileChooserSetCurrentFolderMethodInfo   ,
#endif
    fileChooserSetCurrentFolder             ,


-- ** setCurrentFolderFile #method:setCurrentFolderFile#

#if ENABLE_OVERLOADING
    FileChooserSetCurrentFolderFileMethodInfo,
#endif
    fileChooserSetCurrentFolderFile         ,


-- ** setCurrentFolderUri #method:setCurrentFolderUri#

#if ENABLE_OVERLOADING
    FileChooserSetCurrentFolderUriMethodInfo,
#endif
    fileChooserSetCurrentFolderUri          ,


-- ** setCurrentName #method:setCurrentName#

#if ENABLE_OVERLOADING
    FileChooserSetCurrentNameMethodInfo     ,
#endif
    fileChooserSetCurrentName               ,


-- ** setDoOverwriteConfirmation #method:setDoOverwriteConfirmation#

#if ENABLE_OVERLOADING
    FileChooserSetDoOverwriteConfirmationMethodInfo,
#endif
    fileChooserSetDoOverwriteConfirmation   ,


-- ** setExtraWidget #method:setExtraWidget#

#if ENABLE_OVERLOADING
    FileChooserSetExtraWidgetMethodInfo     ,
#endif
    fileChooserSetExtraWidget               ,


-- ** setFile #method:setFile#

#if ENABLE_OVERLOADING
    FileChooserSetFileMethodInfo            ,
#endif
    fileChooserSetFile                      ,


-- ** setFilename #method:setFilename#

#if ENABLE_OVERLOADING
    FileChooserSetFilenameMethodInfo        ,
#endif
    fileChooserSetFilename                  ,


-- ** setFilter #method:setFilter#

#if ENABLE_OVERLOADING
    FileChooserSetFilterMethodInfo          ,
#endif
    fileChooserSetFilter                    ,


-- ** setLocalOnly #method:setLocalOnly#

#if ENABLE_OVERLOADING
    FileChooserSetLocalOnlyMethodInfo       ,
#endif
    fileChooserSetLocalOnly                 ,


-- ** setPreviewWidget #method:setPreviewWidget#

#if ENABLE_OVERLOADING
    FileChooserSetPreviewWidgetMethodInfo   ,
#endif
    fileChooserSetPreviewWidget             ,


-- ** setPreviewWidgetActive #method:setPreviewWidgetActive#

#if ENABLE_OVERLOADING
    FileChooserSetPreviewWidgetActiveMethodInfo,
#endif
    fileChooserSetPreviewWidgetActive       ,


-- ** setSelectMultiple #method:setSelectMultiple#

#if ENABLE_OVERLOADING
    FileChooserSetSelectMultipleMethodInfo  ,
#endif
    fileChooserSetSelectMultiple            ,


-- ** setShowHidden #method:setShowHidden#

#if ENABLE_OVERLOADING
    FileChooserSetShowHiddenMethodInfo      ,
#endif
    fileChooserSetShowHidden                ,


-- ** setUri #method:setUri#

#if ENABLE_OVERLOADING
    FileChooserSetUriMethodInfo             ,
#endif
    fileChooserSetUri                       ,


-- ** setUsePreviewLabel #method:setUsePreviewLabel#

#if ENABLE_OVERLOADING
    FileChooserSetUsePreviewLabelMethodInfo ,
#endif
    fileChooserSetUsePreviewLabel           ,


-- ** unselectAll #method:unselectAll#

#if ENABLE_OVERLOADING
    FileChooserUnselectAllMethodInfo        ,
#endif
    fileChooserUnselectAll                  ,


-- ** unselectFile #method:unselectFile#

#if ENABLE_OVERLOADING
    FileChooserUnselectFileMethodInfo       ,
#endif
    fileChooserUnselectFile                 ,


-- ** unselectFilename #method:unselectFilename#

#if ENABLE_OVERLOADING
    FileChooserUnselectFilenameMethodInfo   ,
#endif
    fileChooserUnselectFilename             ,


-- ** unselectUri #method:unselectUri#

#if ENABLE_OVERLOADING
    FileChooserUnselectUriMethodInfo        ,
#endif
    fileChooserUnselectUri                  ,




 -- * Properties
-- ** action #attr:action#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    FileChooserActionPropertyInfo           ,
#endif
    constructFileChooserAction              ,
#if ENABLE_OVERLOADING
    fileChooserAction                       ,
#endif
    getFileChooserAction                    ,
    setFileChooserAction                    ,


-- ** createFolders #attr:createFolders#
{- | Whether a file chooser not in 'GI.Gtk.Enums.FileChooserActionOpen' mode
will offer the user to create new folders.

/Since: 2.18/
-}
#if ENABLE_OVERLOADING
    FileChooserCreateFoldersPropertyInfo    ,
#endif
    constructFileChooserCreateFolders       ,
#if ENABLE_OVERLOADING
    fileChooserCreateFolders                ,
#endif
    getFileChooserCreateFolders             ,
    setFileChooserCreateFolders             ,


-- ** doOverwriteConfirmation #attr:doOverwriteConfirmation#
{- | Whether a file chooser in 'GI.Gtk.Enums.FileChooserActionSave' mode
will present an overwrite confirmation dialog if the user
selects a file name that already exists.

/Since: 2.8/
-}
#if ENABLE_OVERLOADING
    FileChooserDoOverwriteConfirmationPropertyInfo,
#endif
    constructFileChooserDoOverwriteConfirmation,
#if ENABLE_OVERLOADING
    fileChooserDoOverwriteConfirmation      ,
#endif
    getFileChooserDoOverwriteConfirmation   ,
    setFileChooserDoOverwriteConfirmation   ,


-- ** extraWidget #attr:extraWidget#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    FileChooserExtraWidgetPropertyInfo      ,
#endif
    constructFileChooserExtraWidget         ,
#if ENABLE_OVERLOADING
    fileChooserExtraWidget                  ,
#endif
    getFileChooserExtraWidget               ,
    setFileChooserExtraWidget               ,


-- ** filter #attr:filter#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    FileChooserFilterPropertyInfo           ,
#endif
    constructFileChooserFilter              ,
#if ENABLE_OVERLOADING
    fileChooserFilter                       ,
#endif
    getFileChooserFilter                    ,
    setFileChooserFilter                    ,


-- ** localOnly #attr:localOnly#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    FileChooserLocalOnlyPropertyInfo        ,
#endif
    constructFileChooserLocalOnly           ,
#if ENABLE_OVERLOADING
    fileChooserLocalOnly                    ,
#endif
    getFileChooserLocalOnly                 ,
    setFileChooserLocalOnly                 ,


-- ** previewWidget #attr:previewWidget#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    FileChooserPreviewWidgetPropertyInfo    ,
#endif
    constructFileChooserPreviewWidget       ,
#if ENABLE_OVERLOADING
    fileChooserPreviewWidget                ,
#endif
    getFileChooserPreviewWidget             ,
    setFileChooserPreviewWidget             ,


-- ** previewWidgetActive #attr:previewWidgetActive#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    FileChooserPreviewWidgetActivePropertyInfo,
#endif
    constructFileChooserPreviewWidgetActive ,
#if ENABLE_OVERLOADING
    fileChooserPreviewWidgetActive          ,
#endif
    getFileChooserPreviewWidgetActive       ,
    setFileChooserPreviewWidgetActive       ,


-- ** selectMultiple #attr:selectMultiple#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    FileChooserSelectMultiplePropertyInfo   ,
#endif
    constructFileChooserSelectMultiple      ,
#if ENABLE_OVERLOADING
    fileChooserSelectMultiple               ,
#endif
    getFileChooserSelectMultiple            ,
    setFileChooserSelectMultiple            ,


-- ** showHidden #attr:showHidden#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    FileChooserShowHiddenPropertyInfo       ,
#endif
    constructFileChooserShowHidden          ,
#if ENABLE_OVERLOADING
    fileChooserShowHidden                   ,
#endif
    getFileChooserShowHidden                ,
    setFileChooserShowHidden                ,


-- ** usePreviewLabel #attr:usePreviewLabel#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    FileChooserUsePreviewLabelPropertyInfo  ,
#endif
    constructFileChooserUsePreviewLabel     ,
#if ENABLE_OVERLOADING
    fileChooserUsePreviewLabel              ,
#endif
    getFileChooserUsePreviewLabel           ,
    setFileChooserUsePreviewLabel           ,




 -- * Signals
-- ** confirmOverwrite #signal:confirmOverwrite#

    C_FileChooserConfirmOverwriteCallback   ,
    FileChooserConfirmOverwriteCallback     ,
#if ENABLE_OVERLOADING
    FileChooserConfirmOverwriteSignalInfo   ,
#endif
    afterFileChooserConfirmOverwrite        ,
    genClosure_FileChooserConfirmOverwrite  ,
    mk_FileChooserConfirmOverwriteCallback  ,
    noFileChooserConfirmOverwriteCallback   ,
    onFileChooserConfirmOverwrite           ,
    wrap_FileChooserConfirmOverwriteCallback,


-- ** currentFolderChanged #signal:currentFolderChanged#

    C_FileChooserCurrentFolderChangedCallback,
    FileChooserCurrentFolderChangedCallback ,
#if ENABLE_OVERLOADING
    FileChooserCurrentFolderChangedSignalInfo,
#endif
    afterFileChooserCurrentFolderChanged    ,
    genClosure_FileChooserCurrentFolderChanged,
    mk_FileChooserCurrentFolderChangedCallback,
    noFileChooserCurrentFolderChangedCallback,
    onFileChooserCurrentFolderChanged       ,
    wrap_FileChooserCurrentFolderChangedCallback,


-- ** fileActivated #signal:fileActivated#

    C_FileChooserFileActivatedCallback      ,
    FileChooserFileActivatedCallback        ,
#if ENABLE_OVERLOADING
    FileChooserFileActivatedSignalInfo      ,
#endif
    afterFileChooserFileActivated           ,
    genClosure_FileChooserFileActivated     ,
    mk_FileChooserFileActivatedCallback     ,
    noFileChooserFileActivatedCallback      ,
    onFileChooserFileActivated              ,
    wrap_FileChooserFileActivatedCallback   ,


-- ** selectionChanged #signal:selectionChanged#

    C_FileChooserSelectionChangedCallback   ,
    FileChooserSelectionChangedCallback     ,
#if ENABLE_OVERLOADING
    FileChooserSelectionChangedSignalInfo   ,
#endif
    afterFileChooserSelectionChanged        ,
    genClosure_FileChooserSelectionChanged  ,
    mk_FileChooserSelectionChangedCallback  ,
    noFileChooserSelectionChangedCallback   ,
    onFileChooserSelectionChanged           ,
    wrap_FileChooserSelectionChangedCallback,


-- ** updatePreview #signal:updatePreview#

    C_FileChooserUpdatePreviewCallback      ,
    FileChooserUpdatePreviewCallback        ,
#if ENABLE_OVERLOADING
    FileChooserUpdatePreviewSignalInfo      ,
#endif
    afterFileChooserUpdatePreview           ,
    genClosure_FileChooserUpdatePreview     ,
    mk_FileChooserUpdatePreviewCallback     ,
    noFileChooserUpdatePreviewCallback      ,
    onFileChooserUpdatePreview              ,
    wrap_FileChooserUpdatePreviewCallback   ,




    ) 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.GClosure as B.GClosure
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.GI.Base.Properties as B.Properties
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 GHC.OverloadedLabels as OL

import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Interfaces.File as Gio.File
import {-# SOURCE #-} qualified GI.Gtk.Enums as Gtk.Enums
import {-# SOURCE #-} qualified GI.Gtk.Objects.FileFilter as Gtk.FileFilter
import {-# SOURCE #-} qualified GI.Gtk.Objects.Widget as Gtk.Widget

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

-- signal FileChooser::confirm-overwrite
{- |
This signal gets emitted whenever it is appropriate to present a
confirmation dialog when the user has selected a file name that
already exists.  The signal only gets emitted when the file
chooser is in 'GI.Gtk.Enums.FileChooserActionSave' mode.

Most applications just need to turn on the
'GI.Gtk.Interfaces.FileChooser.FileChooser':@/do-overwrite-confirmation/@ property (or call the
'GI.Gtk.Interfaces.FileChooser.fileChooserSetDoOverwriteConfirmation' function), and
they will automatically get a stock confirmation dialog.
Applications which need to customize this behavior should do
that, and also connect to the 'GI.Gtk.Interfaces.FileChooser.FileChooser'::@/confirm-overwrite/@
signal.

A signal handler for this signal must return a
'GI.Gtk.Enums.FileChooserConfirmation' value, which indicates the action to
take.  If the handler determines that the user wants to select a
different filename, it should return
'GI.Gtk.Enums.FileChooserConfirmationSelectAgain'.  If it determines
that the user is satisfied with his choice of file name, it
should return 'GI.Gtk.Enums.FileChooserConfirmationAcceptFilename'.
On the other hand, if it determines that the stock confirmation
dialog should be used, it should return
'GI.Gtk.Enums.FileChooserConfirmationConfirm'. The following example
illustrates this.

## Custom confirmation ## {@/gtkfilechooser/@-confirmation}


=== /C code/
>
>static GtkFileChooserConfirmation
>confirm_overwrite_callback (GtkFileChooser *chooser, gpointer data)
>{
>  char *uri;
>
>  uri = gtk_file_chooser_get_uri (chooser);
>
>  if (is_uri_read_only (uri))
>    {
>      if (user_wants_to_replace_read_only_file (uri))
>        return GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME;
>      else
>        return GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN;
>    } else
>      return GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM; // fall back to the default dialog
>}
>
>...
>
>chooser = gtk_file_chooser_dialog_new (...);
>
>gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE);
>g_signal_connect (chooser, "confirm-overwrite",
>                  G_CALLBACK (confirm_overwrite_callback), NULL);
>
>if (gtk_dialog_run (chooser) == GTK_RESPONSE_ACCEPT)
>        save_to_file (gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser));
>
>gtk_widget_destroy (chooser);


/Since: 2.8/
-}
type FileChooserConfirmOverwriteCallback =
    IO Gtk.Enums.FileChooserConfirmation
    {- ^ __Returns:__ a 'GI.Gtk.Enums.FileChooserConfirmation' value that indicates which
 action to take after emitting the signal. -}

-- | A convenience synonym for @`Nothing` :: `Maybe` `FileChooserConfirmOverwriteCallback`@.
noFileChooserConfirmOverwriteCallback :: Maybe FileChooserConfirmOverwriteCallback
noFileChooserConfirmOverwriteCallback = Nothing

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

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

-- | Wrap the callback into a `GClosure`.
genClosure_FileChooserConfirmOverwrite :: MonadIO m => FileChooserConfirmOverwriteCallback -> m (GClosure C_FileChooserConfirmOverwriteCallback)
genClosure_FileChooserConfirmOverwrite cb = liftIO $ do
    let cb' = wrap_FileChooserConfirmOverwriteCallback cb
    mk_FileChooserConfirmOverwriteCallback cb' >>= B.GClosure.newGClosure


-- | Wrap a `FileChooserConfirmOverwriteCallback` into a `C_FileChooserConfirmOverwriteCallback`.
wrap_FileChooserConfirmOverwriteCallback ::
    FileChooserConfirmOverwriteCallback ->
    C_FileChooserConfirmOverwriteCallback
wrap_FileChooserConfirmOverwriteCallback _cb _ _ = do
    result <- _cb
    let result' = (fromIntegral . fromEnum) result
    return result'


{- |
Connect a signal handler for the “@confirm-overwrite@” 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' fileChooser #confirmOverwrite callback
@
-}
onFileChooserConfirmOverwrite :: (IsFileChooser a, MonadIO m) => a -> FileChooserConfirmOverwriteCallback -> m SignalHandlerId
onFileChooserConfirmOverwrite obj cb = liftIO $ do
    let cb' = wrap_FileChooserConfirmOverwriteCallback cb
    cb'' <- mk_FileChooserConfirmOverwriteCallback cb'
    connectSignalFunPtr obj "confirm-overwrite" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@confirm-overwrite@” 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' fileChooser #confirmOverwrite callback
@
-}
afterFileChooserConfirmOverwrite :: (IsFileChooser a, MonadIO m) => a -> FileChooserConfirmOverwriteCallback -> m SignalHandlerId
afterFileChooserConfirmOverwrite obj cb = liftIO $ do
    let cb' = wrap_FileChooserConfirmOverwriteCallback cb
    cb'' <- mk_FileChooserConfirmOverwriteCallback cb'
    connectSignalFunPtr obj "confirm-overwrite" cb'' SignalConnectAfter


-- signal FileChooser::current-folder-changed
{- |
This signal is emitted when the current folder in a 'GI.Gtk.Interfaces.FileChooser.FileChooser'
changes.  This can happen due to the user performing some action that
changes folders, such as selecting a bookmark or visiting a folder on the
file list.  It can also happen as a result of calling a function to
explicitly change the current folder in a file chooser.

Normally you do not need to connect to this signal, unless you need to keep
track of which folder a file chooser is showing.

See also:  'GI.Gtk.Interfaces.FileChooser.fileChooserSetCurrentFolder',
'GI.Gtk.Interfaces.FileChooser.fileChooserGetCurrentFolder',
'GI.Gtk.Interfaces.FileChooser.fileChooserSetCurrentFolderUri',
'GI.Gtk.Interfaces.FileChooser.fileChooserGetCurrentFolderUri'.
-}
type FileChooserCurrentFolderChangedCallback =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `FileChooserCurrentFolderChangedCallback`@.
noFileChooserCurrentFolderChangedCallback :: Maybe FileChooserCurrentFolderChangedCallback
noFileChooserCurrentFolderChangedCallback = Nothing

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

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

-- | Wrap the callback into a `GClosure`.
genClosure_FileChooserCurrentFolderChanged :: MonadIO m => FileChooserCurrentFolderChangedCallback -> m (GClosure C_FileChooserCurrentFolderChangedCallback)
genClosure_FileChooserCurrentFolderChanged cb = liftIO $ do
    let cb' = wrap_FileChooserCurrentFolderChangedCallback cb
    mk_FileChooserCurrentFolderChangedCallback cb' >>= B.GClosure.newGClosure


-- | Wrap a `FileChooserCurrentFolderChangedCallback` into a `C_FileChooserCurrentFolderChangedCallback`.
wrap_FileChooserCurrentFolderChangedCallback ::
    FileChooserCurrentFolderChangedCallback ->
    C_FileChooserCurrentFolderChangedCallback
wrap_FileChooserCurrentFolderChangedCallback _cb _ _ = do
    _cb


{- |
Connect a signal handler for the “@current-folder-changed@” 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' fileChooser #currentFolderChanged callback
@
-}
onFileChooserCurrentFolderChanged :: (IsFileChooser a, MonadIO m) => a -> FileChooserCurrentFolderChangedCallback -> m SignalHandlerId
onFileChooserCurrentFolderChanged obj cb = liftIO $ do
    let cb' = wrap_FileChooserCurrentFolderChangedCallback cb
    cb'' <- mk_FileChooserCurrentFolderChangedCallback cb'
    connectSignalFunPtr obj "current-folder-changed" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@current-folder-changed@” 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' fileChooser #currentFolderChanged callback
@
-}
afterFileChooserCurrentFolderChanged :: (IsFileChooser a, MonadIO m) => a -> FileChooserCurrentFolderChangedCallback -> m SignalHandlerId
afterFileChooserCurrentFolderChanged obj cb = liftIO $ do
    let cb' = wrap_FileChooserCurrentFolderChangedCallback cb
    cb'' <- mk_FileChooserCurrentFolderChangedCallback cb'
    connectSignalFunPtr obj "current-folder-changed" cb'' SignalConnectAfter


-- signal FileChooser::file-activated
{- |
This signal is emitted when the user \"activates\" a file in the file
chooser.  This can happen by double-clicking on a file in the file list, or
by pressing @Enter@.

Normally you do not need to connect to this signal.  It is used internally
by 'GI.Gtk.Objects.FileChooserDialog.FileChooserDialog' to know when to activate the default button in the
dialog.

See also: 'GI.Gtk.Interfaces.FileChooser.fileChooserGetFilename',
'GI.Gtk.Interfaces.FileChooser.fileChooserGetFilenames', 'GI.Gtk.Interfaces.FileChooser.fileChooserGetUri',
'GI.Gtk.Interfaces.FileChooser.fileChooserGetUris'.
-}
type FileChooserFileActivatedCallback =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `FileChooserFileActivatedCallback`@.
noFileChooserFileActivatedCallback :: Maybe FileChooserFileActivatedCallback
noFileChooserFileActivatedCallback = Nothing

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

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

-- | Wrap the callback into a `GClosure`.
genClosure_FileChooserFileActivated :: MonadIO m => FileChooserFileActivatedCallback -> m (GClosure C_FileChooserFileActivatedCallback)
genClosure_FileChooserFileActivated cb = liftIO $ do
    let cb' = wrap_FileChooserFileActivatedCallback cb
    mk_FileChooserFileActivatedCallback cb' >>= B.GClosure.newGClosure


-- | Wrap a `FileChooserFileActivatedCallback` into a `C_FileChooserFileActivatedCallback`.
wrap_FileChooserFileActivatedCallback ::
    FileChooserFileActivatedCallback ->
    C_FileChooserFileActivatedCallback
wrap_FileChooserFileActivatedCallback _cb _ _ = do
    _cb


{- |
Connect a signal handler for the “@file-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' fileChooser #fileActivated callback
@
-}
onFileChooserFileActivated :: (IsFileChooser a, MonadIO m) => a -> FileChooserFileActivatedCallback -> m SignalHandlerId
onFileChooserFileActivated obj cb = liftIO $ do
    let cb' = wrap_FileChooserFileActivatedCallback cb
    cb'' <- mk_FileChooserFileActivatedCallback cb'
    connectSignalFunPtr obj "file-activated" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@file-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' fileChooser #fileActivated callback
@
-}
afterFileChooserFileActivated :: (IsFileChooser a, MonadIO m) => a -> FileChooserFileActivatedCallback -> m SignalHandlerId
afterFileChooserFileActivated obj cb = liftIO $ do
    let cb' = wrap_FileChooserFileActivatedCallback cb
    cb'' <- mk_FileChooserFileActivatedCallback cb'
    connectSignalFunPtr obj "file-activated" cb'' SignalConnectAfter


-- signal FileChooser::selection-changed
{- |
This signal is emitted when there is a change in the set of selected files
in a 'GI.Gtk.Interfaces.FileChooser.FileChooser'.  This can happen when the user modifies the selection
with the mouse or the keyboard, or when explicitly calling functions to
change the selection.

Normally you do not need to connect to this signal, as it is easier to wait
for the file chooser to finish running, and then to get the list of
selected files using the functions mentioned below.

See also: 'GI.Gtk.Interfaces.FileChooser.fileChooserSelectFilename',
'GI.Gtk.Interfaces.FileChooser.fileChooserUnselectFilename', 'GI.Gtk.Interfaces.FileChooser.fileChooserGetFilename',
'GI.Gtk.Interfaces.FileChooser.fileChooserGetFilenames', 'GI.Gtk.Interfaces.FileChooser.fileChooserSelectUri',
'GI.Gtk.Interfaces.FileChooser.fileChooserUnselectUri', 'GI.Gtk.Interfaces.FileChooser.fileChooserGetUri',
'GI.Gtk.Interfaces.FileChooser.fileChooserGetUris'.
-}
type FileChooserSelectionChangedCallback =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `FileChooserSelectionChangedCallback`@.
noFileChooserSelectionChangedCallback :: Maybe FileChooserSelectionChangedCallback
noFileChooserSelectionChangedCallback = Nothing

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

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

-- | Wrap the callback into a `GClosure`.
genClosure_FileChooserSelectionChanged :: MonadIO m => FileChooserSelectionChangedCallback -> m (GClosure C_FileChooserSelectionChangedCallback)
genClosure_FileChooserSelectionChanged cb = liftIO $ do
    let cb' = wrap_FileChooserSelectionChangedCallback cb
    mk_FileChooserSelectionChangedCallback cb' >>= B.GClosure.newGClosure


-- | Wrap a `FileChooserSelectionChangedCallback` into a `C_FileChooserSelectionChangedCallback`.
wrap_FileChooserSelectionChangedCallback ::
    FileChooserSelectionChangedCallback ->
    C_FileChooserSelectionChangedCallback
wrap_FileChooserSelectionChangedCallback _cb _ _ = do
    _cb


{- |
Connect a signal handler for the “@selection-changed@” 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' fileChooser #selectionChanged callback
@
-}
onFileChooserSelectionChanged :: (IsFileChooser a, MonadIO m) => a -> FileChooserSelectionChangedCallback -> m SignalHandlerId
onFileChooserSelectionChanged obj cb = liftIO $ do
    let cb' = wrap_FileChooserSelectionChangedCallback cb
    cb'' <- mk_FileChooserSelectionChangedCallback cb'
    connectSignalFunPtr obj "selection-changed" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@selection-changed@” 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' fileChooser #selectionChanged callback
@
-}
afterFileChooserSelectionChanged :: (IsFileChooser a, MonadIO m) => a -> FileChooserSelectionChangedCallback -> m SignalHandlerId
afterFileChooserSelectionChanged obj cb = liftIO $ do
    let cb' = wrap_FileChooserSelectionChangedCallback cb
    cb'' <- mk_FileChooserSelectionChangedCallback cb'
    connectSignalFunPtr obj "selection-changed" cb'' SignalConnectAfter


-- signal FileChooser::update-preview
{- |
This signal is emitted when the preview in a file chooser should be
regenerated.  For example, this can happen when the currently selected file
changes.  You should use this signal if you want your file chooser to have
a preview widget.

Once you have installed a preview widget with
'GI.Gtk.Interfaces.FileChooser.fileChooserSetPreviewWidget', you should update it when this
signal is emitted.  You can use the functions
'GI.Gtk.Interfaces.FileChooser.fileChooserGetPreviewFilename' or
'GI.Gtk.Interfaces.FileChooser.fileChooserGetPreviewUri' to get the name of the file to preview.
Your widget may not be able to preview all kinds of files; your callback
must call 'GI.Gtk.Interfaces.FileChooser.fileChooserSetPreviewWidgetActive' to inform the file
chooser about whether the preview was generated successfully or not.

Please see the example code in
[Using a Preview Widget][gtkfilechooser-preview].

See also: 'GI.Gtk.Interfaces.FileChooser.fileChooserSetPreviewWidget',
'GI.Gtk.Interfaces.FileChooser.fileChooserSetPreviewWidgetActive',
'GI.Gtk.Interfaces.FileChooser.fileChooserSetUsePreviewLabel',
'GI.Gtk.Interfaces.FileChooser.fileChooserGetPreviewFilename',
'GI.Gtk.Interfaces.FileChooser.fileChooserGetPreviewUri'.
-}
type FileChooserUpdatePreviewCallback =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `FileChooserUpdatePreviewCallback`@.
noFileChooserUpdatePreviewCallback :: Maybe FileChooserUpdatePreviewCallback
noFileChooserUpdatePreviewCallback = Nothing

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

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

-- | Wrap the callback into a `GClosure`.
genClosure_FileChooserUpdatePreview :: MonadIO m => FileChooserUpdatePreviewCallback -> m (GClosure C_FileChooserUpdatePreviewCallback)
genClosure_FileChooserUpdatePreview cb = liftIO $ do
    let cb' = wrap_FileChooserUpdatePreviewCallback cb
    mk_FileChooserUpdatePreviewCallback cb' >>= B.GClosure.newGClosure


-- | Wrap a `FileChooserUpdatePreviewCallback` into a `C_FileChooserUpdatePreviewCallback`.
wrap_FileChooserUpdatePreviewCallback ::
    FileChooserUpdatePreviewCallback ->
    C_FileChooserUpdatePreviewCallback
wrap_FileChooserUpdatePreviewCallback _cb _ _ = do
    _cb


{- |
Connect a signal handler for the “@update-preview@” 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' fileChooser #updatePreview callback
@
-}
onFileChooserUpdatePreview :: (IsFileChooser a, MonadIO m) => a -> FileChooserUpdatePreviewCallback -> m SignalHandlerId
onFileChooserUpdatePreview obj cb = liftIO $ do
    let cb' = wrap_FileChooserUpdatePreviewCallback cb
    cb'' <- mk_FileChooserUpdatePreviewCallback cb'
    connectSignalFunPtr obj "update-preview" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@update-preview@” 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' fileChooser #updatePreview callback
@
-}
afterFileChooserUpdatePreview :: (IsFileChooser a, MonadIO m) => a -> FileChooserUpdatePreviewCallback -> m SignalHandlerId
afterFileChooserUpdatePreview obj cb = liftIO $ do
    let cb' = wrap_FileChooserUpdatePreviewCallback cb
    cb'' <- mk_FileChooserUpdatePreviewCallback cb'
    connectSignalFunPtr obj "update-preview" cb'' SignalConnectAfter


#if ENABLE_OVERLOADING
data FileChooserConfirmOverwriteSignalInfo
instance SignalInfo FileChooserConfirmOverwriteSignalInfo where
    type HaskellCallbackType FileChooserConfirmOverwriteSignalInfo = FileChooserConfirmOverwriteCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_FileChooserConfirmOverwriteCallback cb
        cb'' <- mk_FileChooserConfirmOverwriteCallback cb'
        connectSignalFunPtr obj "confirm-overwrite" cb'' connectMode

data FileChooserCurrentFolderChangedSignalInfo
instance SignalInfo FileChooserCurrentFolderChangedSignalInfo where
    type HaskellCallbackType FileChooserCurrentFolderChangedSignalInfo = FileChooserCurrentFolderChangedCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_FileChooserCurrentFolderChangedCallback cb
        cb'' <- mk_FileChooserCurrentFolderChangedCallback cb'
        connectSignalFunPtr obj "current-folder-changed" cb'' connectMode

data FileChooserFileActivatedSignalInfo
instance SignalInfo FileChooserFileActivatedSignalInfo where
    type HaskellCallbackType FileChooserFileActivatedSignalInfo = FileChooserFileActivatedCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_FileChooserFileActivatedCallback cb
        cb'' <- mk_FileChooserFileActivatedCallback cb'
        connectSignalFunPtr obj "file-activated" cb'' connectMode

data FileChooserSelectionChangedSignalInfo
instance SignalInfo FileChooserSelectionChangedSignalInfo where
    type HaskellCallbackType FileChooserSelectionChangedSignalInfo = FileChooserSelectionChangedCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_FileChooserSelectionChangedCallback cb
        cb'' <- mk_FileChooserSelectionChangedCallback cb'
        connectSignalFunPtr obj "selection-changed" cb'' connectMode

data FileChooserUpdatePreviewSignalInfo
instance SignalInfo FileChooserUpdatePreviewSignalInfo where
    type HaskellCallbackType FileChooserUpdatePreviewSignalInfo = FileChooserUpdatePreviewCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_FileChooserUpdatePreviewCallback cb
        cb'' <- mk_FileChooserUpdatePreviewCallback cb'
        connectSignalFunPtr obj "update-preview" cb'' connectMode

type instance O.SignalList FileChooser = FileChooserSignalList
type FileChooserSignalList = ('[ '("confirmOverwrite", FileChooserConfirmOverwriteSignalInfo), '("currentFolderChanged", FileChooserCurrentFolderChangedSignalInfo), '("fileActivated", FileChooserFileActivatedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("selectionChanged", FileChooserSelectionChangedSignalInfo), '("updatePreview", FileChooserUpdatePreviewSignalInfo)] :: [(Symbol, *)])

#endif

foreign import ccall "gtk_file_chooser_get_type"
    c_gtk_file_chooser_get_type :: IO GType

instance GObject FileChooser where
    gobjectType = c_gtk_file_chooser_get_type


-- | Type class for types which can be safely cast to `FileChooser`, for instance with `toFileChooser`.
class (GObject o, O.IsDescendantOf FileChooser o) => IsFileChooser o
instance (GObject o, O.IsDescendantOf FileChooser o) => IsFileChooser o

instance O.HasParentTypes FileChooser
type instance O.ParentTypes FileChooser = '[GObject.Object.Object]

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

-- VVV Prop "action"
   -- Type: TInterface (Name {namespace = "Gtk", name = "FileChooserAction"})
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

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

@
'Data.GI.Base.Attributes.get' fileChooser #action
@
-}
getFileChooserAction :: (MonadIO m, IsFileChooser o) => o -> m Gtk.Enums.FileChooserAction
getFileChooserAction obj = liftIO $ B.Properties.getObjectPropertyEnum obj "action"

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

@
'Data.GI.Base.Attributes.set' fileChooser [ #action 'Data.GI.Base.Attributes.:=' value ]
@
-}
setFileChooserAction :: (MonadIO m, IsFileChooser o) => o -> Gtk.Enums.FileChooserAction -> m ()
setFileChooserAction obj val = liftIO $ B.Properties.setObjectPropertyEnum obj "action" val

{- |
Construct a `GValueConstruct` with valid value for the “@action@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructFileChooserAction :: (IsFileChooser o) => Gtk.Enums.FileChooserAction -> IO (GValueConstruct o)
constructFileChooserAction val = B.Properties.constructObjectPropertyEnum "action" val

#if ENABLE_OVERLOADING
data FileChooserActionPropertyInfo
instance AttrInfo FileChooserActionPropertyInfo where
    type AttrAllowedOps FileChooserActionPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint FileChooserActionPropertyInfo = (~) Gtk.Enums.FileChooserAction
    type AttrBaseTypeConstraint FileChooserActionPropertyInfo = IsFileChooser
    type AttrGetType FileChooserActionPropertyInfo = Gtk.Enums.FileChooserAction
    type AttrLabel FileChooserActionPropertyInfo = "action"
    type AttrOrigin FileChooserActionPropertyInfo = FileChooser
    attrGet _ = getFileChooserAction
    attrSet _ = setFileChooserAction
    attrConstruct _ = constructFileChooserAction
    attrClear _ = undefined
#endif

-- VVV Prop "create-folders"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

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

@
'Data.GI.Base.Attributes.get' fileChooser #createFolders
@
-}
getFileChooserCreateFolders :: (MonadIO m, IsFileChooser o) => o -> m Bool
getFileChooserCreateFolders obj = liftIO $ B.Properties.getObjectPropertyBool obj "create-folders"

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

@
'Data.GI.Base.Attributes.set' fileChooser [ #createFolders 'Data.GI.Base.Attributes.:=' value ]
@
-}
setFileChooserCreateFolders :: (MonadIO m, IsFileChooser o) => o -> Bool -> m ()
setFileChooserCreateFolders obj val = liftIO $ B.Properties.setObjectPropertyBool obj "create-folders" val

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

#if ENABLE_OVERLOADING
data FileChooserCreateFoldersPropertyInfo
instance AttrInfo FileChooserCreateFoldersPropertyInfo where
    type AttrAllowedOps FileChooserCreateFoldersPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint FileChooserCreateFoldersPropertyInfo = (~) Bool
    type AttrBaseTypeConstraint FileChooserCreateFoldersPropertyInfo = IsFileChooser
    type AttrGetType FileChooserCreateFoldersPropertyInfo = Bool
    type AttrLabel FileChooserCreateFoldersPropertyInfo = "create-folders"
    type AttrOrigin FileChooserCreateFoldersPropertyInfo = FileChooser
    attrGet _ = getFileChooserCreateFolders
    attrSet _ = setFileChooserCreateFolders
    attrConstruct _ = constructFileChooserCreateFolders
    attrClear _ = undefined
#endif

-- VVV Prop "do-overwrite-confirmation"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

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

@
'Data.GI.Base.Attributes.get' fileChooser #doOverwriteConfirmation
@
-}
getFileChooserDoOverwriteConfirmation :: (MonadIO m, IsFileChooser o) => o -> m Bool
getFileChooserDoOverwriteConfirmation obj = liftIO $ B.Properties.getObjectPropertyBool obj "do-overwrite-confirmation"

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

@
'Data.GI.Base.Attributes.set' fileChooser [ #doOverwriteConfirmation 'Data.GI.Base.Attributes.:=' value ]
@
-}
setFileChooserDoOverwriteConfirmation :: (MonadIO m, IsFileChooser o) => o -> Bool -> m ()
setFileChooserDoOverwriteConfirmation obj val = liftIO $ B.Properties.setObjectPropertyBool obj "do-overwrite-confirmation" val

{- |
Construct a `GValueConstruct` with valid value for the “@do-overwrite-confirmation@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructFileChooserDoOverwriteConfirmation :: (IsFileChooser o) => Bool -> IO (GValueConstruct o)
constructFileChooserDoOverwriteConfirmation val = B.Properties.constructObjectPropertyBool "do-overwrite-confirmation" val

#if ENABLE_OVERLOADING
data FileChooserDoOverwriteConfirmationPropertyInfo
instance AttrInfo FileChooserDoOverwriteConfirmationPropertyInfo where
    type AttrAllowedOps FileChooserDoOverwriteConfirmationPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint FileChooserDoOverwriteConfirmationPropertyInfo = (~) Bool
    type AttrBaseTypeConstraint FileChooserDoOverwriteConfirmationPropertyInfo = IsFileChooser
    type AttrGetType FileChooserDoOverwriteConfirmationPropertyInfo = Bool
    type AttrLabel FileChooserDoOverwriteConfirmationPropertyInfo = "do-overwrite-confirmation"
    type AttrOrigin FileChooserDoOverwriteConfirmationPropertyInfo = FileChooser
    attrGet _ = getFileChooserDoOverwriteConfirmation
    attrSet _ = setFileChooserDoOverwriteConfirmation
    attrConstruct _ = constructFileChooserDoOverwriteConfirmation
    attrClear _ = undefined
#endif

-- VVV Prop "extra-widget"
   -- Type: TInterface (Name {namespace = "Gtk", name = "Widget"})
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just True,Just False)

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

@
'Data.GI.Base.Attributes.get' fileChooser #extraWidget
@
-}
getFileChooserExtraWidget :: (MonadIO m, IsFileChooser o) => o -> m (Maybe Gtk.Widget.Widget)
getFileChooserExtraWidget obj = liftIO $ B.Properties.getObjectPropertyObject obj "extra-widget" Gtk.Widget.Widget

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

@
'Data.GI.Base.Attributes.set' fileChooser [ #extraWidget 'Data.GI.Base.Attributes.:=' value ]
@
-}
setFileChooserExtraWidget :: (MonadIO m, IsFileChooser o, Gtk.Widget.IsWidget a) => o -> a -> m ()
setFileChooserExtraWidget obj val = liftIO $ B.Properties.setObjectPropertyObject obj "extra-widget" (Just val)

{- |
Construct a `GValueConstruct` with valid value for the “@extra-widget@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructFileChooserExtraWidget :: (IsFileChooser o, Gtk.Widget.IsWidget a) => a -> IO (GValueConstruct o)
constructFileChooserExtraWidget val = B.Properties.constructObjectPropertyObject "extra-widget" (Just val)

#if ENABLE_OVERLOADING
data FileChooserExtraWidgetPropertyInfo
instance AttrInfo FileChooserExtraWidgetPropertyInfo where
    type AttrAllowedOps FileChooserExtraWidgetPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint FileChooserExtraWidgetPropertyInfo = Gtk.Widget.IsWidget
    type AttrBaseTypeConstraint FileChooserExtraWidgetPropertyInfo = IsFileChooser
    type AttrGetType FileChooserExtraWidgetPropertyInfo = (Maybe Gtk.Widget.Widget)
    type AttrLabel FileChooserExtraWidgetPropertyInfo = "extra-widget"
    type AttrOrigin FileChooserExtraWidgetPropertyInfo = FileChooser
    attrGet _ = getFileChooserExtraWidget
    attrSet _ = setFileChooserExtraWidget
    attrConstruct _ = constructFileChooserExtraWidget
    attrClear _ = undefined
#endif

-- VVV Prop "filter"
   -- Type: TInterface (Name {namespace = "Gtk", name = "FileFilter"})
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just True,Just False)

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

@
'Data.GI.Base.Attributes.get' fileChooser #filter
@
-}
getFileChooserFilter :: (MonadIO m, IsFileChooser o) => o -> m (Maybe Gtk.FileFilter.FileFilter)
getFileChooserFilter obj = liftIO $ B.Properties.getObjectPropertyObject obj "filter" Gtk.FileFilter.FileFilter

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

@
'Data.GI.Base.Attributes.set' fileChooser [ #filter 'Data.GI.Base.Attributes.:=' value ]
@
-}
setFileChooserFilter :: (MonadIO m, IsFileChooser o, Gtk.FileFilter.IsFileFilter a) => o -> a -> m ()
setFileChooserFilter obj val = liftIO $ B.Properties.setObjectPropertyObject obj "filter" (Just val)

{- |
Construct a `GValueConstruct` with valid value for the “@filter@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructFileChooserFilter :: (IsFileChooser o, Gtk.FileFilter.IsFileFilter a) => a -> IO (GValueConstruct o)
constructFileChooserFilter val = B.Properties.constructObjectPropertyObject "filter" (Just val)

#if ENABLE_OVERLOADING
data FileChooserFilterPropertyInfo
instance AttrInfo FileChooserFilterPropertyInfo where
    type AttrAllowedOps FileChooserFilterPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint FileChooserFilterPropertyInfo = Gtk.FileFilter.IsFileFilter
    type AttrBaseTypeConstraint FileChooserFilterPropertyInfo = IsFileChooser
    type AttrGetType FileChooserFilterPropertyInfo = (Maybe Gtk.FileFilter.FileFilter)
    type AttrLabel FileChooserFilterPropertyInfo = "filter"
    type AttrOrigin FileChooserFilterPropertyInfo = FileChooser
    attrGet _ = getFileChooserFilter
    attrSet _ = setFileChooserFilter
    attrConstruct _ = constructFileChooserFilter
    attrClear _ = undefined
#endif

-- VVV Prop "local-only"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

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

@
'Data.GI.Base.Attributes.get' fileChooser #localOnly
@
-}
getFileChooserLocalOnly :: (MonadIO m, IsFileChooser o) => o -> m Bool
getFileChooserLocalOnly obj = liftIO $ B.Properties.getObjectPropertyBool obj "local-only"

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

@
'Data.GI.Base.Attributes.set' fileChooser [ #localOnly 'Data.GI.Base.Attributes.:=' value ]
@
-}
setFileChooserLocalOnly :: (MonadIO m, IsFileChooser o) => o -> Bool -> m ()
setFileChooserLocalOnly obj val = liftIO $ B.Properties.setObjectPropertyBool obj "local-only" val

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

#if ENABLE_OVERLOADING
data FileChooserLocalOnlyPropertyInfo
instance AttrInfo FileChooserLocalOnlyPropertyInfo where
    type AttrAllowedOps FileChooserLocalOnlyPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint FileChooserLocalOnlyPropertyInfo = (~) Bool
    type AttrBaseTypeConstraint FileChooserLocalOnlyPropertyInfo = IsFileChooser
    type AttrGetType FileChooserLocalOnlyPropertyInfo = Bool
    type AttrLabel FileChooserLocalOnlyPropertyInfo = "local-only"
    type AttrOrigin FileChooserLocalOnlyPropertyInfo = FileChooser
    attrGet _ = getFileChooserLocalOnly
    attrSet _ = setFileChooserLocalOnly
    attrConstruct _ = constructFileChooserLocalOnly
    attrClear _ = undefined
#endif

-- VVV Prop "preview-widget"
   -- Type: TInterface (Name {namespace = "Gtk", name = "Widget"})
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just True,Just False)

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

@
'Data.GI.Base.Attributes.get' fileChooser #previewWidget
@
-}
getFileChooserPreviewWidget :: (MonadIO m, IsFileChooser o) => o -> m (Maybe Gtk.Widget.Widget)
getFileChooserPreviewWidget obj = liftIO $ B.Properties.getObjectPropertyObject obj "preview-widget" Gtk.Widget.Widget

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

@
'Data.GI.Base.Attributes.set' fileChooser [ #previewWidget 'Data.GI.Base.Attributes.:=' value ]
@
-}
setFileChooserPreviewWidget :: (MonadIO m, IsFileChooser o, Gtk.Widget.IsWidget a) => o -> a -> m ()
setFileChooserPreviewWidget obj val = liftIO $ B.Properties.setObjectPropertyObject obj "preview-widget" (Just val)

{- |
Construct a `GValueConstruct` with valid value for the “@preview-widget@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructFileChooserPreviewWidget :: (IsFileChooser o, Gtk.Widget.IsWidget a) => a -> IO (GValueConstruct o)
constructFileChooserPreviewWidget val = B.Properties.constructObjectPropertyObject "preview-widget" (Just val)

#if ENABLE_OVERLOADING
data FileChooserPreviewWidgetPropertyInfo
instance AttrInfo FileChooserPreviewWidgetPropertyInfo where
    type AttrAllowedOps FileChooserPreviewWidgetPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint FileChooserPreviewWidgetPropertyInfo = Gtk.Widget.IsWidget
    type AttrBaseTypeConstraint FileChooserPreviewWidgetPropertyInfo = IsFileChooser
    type AttrGetType FileChooserPreviewWidgetPropertyInfo = (Maybe Gtk.Widget.Widget)
    type AttrLabel FileChooserPreviewWidgetPropertyInfo = "preview-widget"
    type AttrOrigin FileChooserPreviewWidgetPropertyInfo = FileChooser
    attrGet _ = getFileChooserPreviewWidget
    attrSet _ = setFileChooserPreviewWidget
    attrConstruct _ = constructFileChooserPreviewWidget
    attrClear _ = undefined
#endif

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

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

@
'Data.GI.Base.Attributes.get' fileChooser #previewWidgetActive
@
-}
getFileChooserPreviewWidgetActive :: (MonadIO m, IsFileChooser o) => o -> m Bool
getFileChooserPreviewWidgetActive obj = liftIO $ B.Properties.getObjectPropertyBool obj "preview-widget-active"

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

@
'Data.GI.Base.Attributes.set' fileChooser [ #previewWidgetActive 'Data.GI.Base.Attributes.:=' value ]
@
-}
setFileChooserPreviewWidgetActive :: (MonadIO m, IsFileChooser o) => o -> Bool -> m ()
setFileChooserPreviewWidgetActive obj val = liftIO $ B.Properties.setObjectPropertyBool obj "preview-widget-active" val

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

#if ENABLE_OVERLOADING
data FileChooserPreviewWidgetActivePropertyInfo
instance AttrInfo FileChooserPreviewWidgetActivePropertyInfo where
    type AttrAllowedOps FileChooserPreviewWidgetActivePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint FileChooserPreviewWidgetActivePropertyInfo = (~) Bool
    type AttrBaseTypeConstraint FileChooserPreviewWidgetActivePropertyInfo = IsFileChooser
    type AttrGetType FileChooserPreviewWidgetActivePropertyInfo = Bool
    type AttrLabel FileChooserPreviewWidgetActivePropertyInfo = "preview-widget-active"
    type AttrOrigin FileChooserPreviewWidgetActivePropertyInfo = FileChooser
    attrGet _ = getFileChooserPreviewWidgetActive
    attrSet _ = setFileChooserPreviewWidgetActive
    attrConstruct _ = constructFileChooserPreviewWidgetActive
    attrClear _ = undefined
#endif

-- VVV Prop "select-multiple"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

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

@
'Data.GI.Base.Attributes.get' fileChooser #selectMultiple
@
-}
getFileChooserSelectMultiple :: (MonadIO m, IsFileChooser o) => o -> m Bool
getFileChooserSelectMultiple obj = liftIO $ B.Properties.getObjectPropertyBool obj "select-multiple"

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

@
'Data.GI.Base.Attributes.set' fileChooser [ #selectMultiple 'Data.GI.Base.Attributes.:=' value ]
@
-}
setFileChooserSelectMultiple :: (MonadIO m, IsFileChooser o) => o -> Bool -> m ()
setFileChooserSelectMultiple obj val = liftIO $ B.Properties.setObjectPropertyBool obj "select-multiple" val

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

#if ENABLE_OVERLOADING
data FileChooserSelectMultiplePropertyInfo
instance AttrInfo FileChooserSelectMultiplePropertyInfo where
    type AttrAllowedOps FileChooserSelectMultiplePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint FileChooserSelectMultiplePropertyInfo = (~) Bool
    type AttrBaseTypeConstraint FileChooserSelectMultiplePropertyInfo = IsFileChooser
    type AttrGetType FileChooserSelectMultiplePropertyInfo = Bool
    type AttrLabel FileChooserSelectMultiplePropertyInfo = "select-multiple"
    type AttrOrigin FileChooserSelectMultiplePropertyInfo = FileChooser
    attrGet _ = getFileChooserSelectMultiple
    attrSet _ = setFileChooserSelectMultiple
    attrConstruct _ = constructFileChooserSelectMultiple
    attrClear _ = undefined
#endif

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

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

@
'Data.GI.Base.Attributes.get' fileChooser #showHidden
@
-}
getFileChooserShowHidden :: (MonadIO m, IsFileChooser o) => o -> m Bool
getFileChooserShowHidden obj = liftIO $ B.Properties.getObjectPropertyBool obj "show-hidden"

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

@
'Data.GI.Base.Attributes.set' fileChooser [ #showHidden 'Data.GI.Base.Attributes.:=' value ]
@
-}
setFileChooserShowHidden :: (MonadIO m, IsFileChooser o) => o -> Bool -> m ()
setFileChooserShowHidden obj val = liftIO $ B.Properties.setObjectPropertyBool obj "show-hidden" val

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

#if ENABLE_OVERLOADING
data FileChooserShowHiddenPropertyInfo
instance AttrInfo FileChooserShowHiddenPropertyInfo where
    type AttrAllowedOps FileChooserShowHiddenPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint FileChooserShowHiddenPropertyInfo = (~) Bool
    type AttrBaseTypeConstraint FileChooserShowHiddenPropertyInfo = IsFileChooser
    type AttrGetType FileChooserShowHiddenPropertyInfo = Bool
    type AttrLabel FileChooserShowHiddenPropertyInfo = "show-hidden"
    type AttrOrigin FileChooserShowHiddenPropertyInfo = FileChooser
    attrGet _ = getFileChooserShowHidden
    attrSet _ = setFileChooserShowHidden
    attrConstruct _ = constructFileChooserShowHidden
    attrClear _ = undefined
#endif

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

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

@
'Data.GI.Base.Attributes.get' fileChooser #usePreviewLabel
@
-}
getFileChooserUsePreviewLabel :: (MonadIO m, IsFileChooser o) => o -> m Bool
getFileChooserUsePreviewLabel obj = liftIO $ B.Properties.getObjectPropertyBool obj "use-preview-label"

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

@
'Data.GI.Base.Attributes.set' fileChooser [ #usePreviewLabel 'Data.GI.Base.Attributes.:=' value ]
@
-}
setFileChooserUsePreviewLabel :: (MonadIO m, IsFileChooser o) => o -> Bool -> m ()
setFileChooserUsePreviewLabel obj val = liftIO $ B.Properties.setObjectPropertyBool obj "use-preview-label" val

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

#if ENABLE_OVERLOADING
data FileChooserUsePreviewLabelPropertyInfo
instance AttrInfo FileChooserUsePreviewLabelPropertyInfo where
    type AttrAllowedOps FileChooserUsePreviewLabelPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint FileChooserUsePreviewLabelPropertyInfo = (~) Bool
    type AttrBaseTypeConstraint FileChooserUsePreviewLabelPropertyInfo = IsFileChooser
    type AttrGetType FileChooserUsePreviewLabelPropertyInfo = Bool
    type AttrLabel FileChooserUsePreviewLabelPropertyInfo = "use-preview-label"
    type AttrOrigin FileChooserUsePreviewLabelPropertyInfo = FileChooser
    attrGet _ = getFileChooserUsePreviewLabel
    attrSet _ = setFileChooserUsePreviewLabel
    attrConstruct _ = constructFileChooserUsePreviewLabel
    attrClear _ = undefined
#endif

#if ENABLE_OVERLOADING
instance O.HasAttributeList FileChooser
type instance O.AttributeList FileChooser = FileChooserAttributeList
type FileChooserAttributeList = ('[ '("action", FileChooserActionPropertyInfo), '("createFolders", FileChooserCreateFoldersPropertyInfo), '("doOverwriteConfirmation", FileChooserDoOverwriteConfirmationPropertyInfo), '("extraWidget", FileChooserExtraWidgetPropertyInfo), '("filter", FileChooserFilterPropertyInfo), '("localOnly", FileChooserLocalOnlyPropertyInfo), '("previewWidget", FileChooserPreviewWidgetPropertyInfo), '("previewWidgetActive", FileChooserPreviewWidgetActivePropertyInfo), '("selectMultiple", FileChooserSelectMultiplePropertyInfo), '("showHidden", FileChooserShowHiddenPropertyInfo), '("usePreviewLabel", FileChooserUsePreviewLabelPropertyInfo)] :: [(Symbol, *)])
#endif

#if ENABLE_OVERLOADING
fileChooserAction :: AttrLabelProxy "action"
fileChooserAction = AttrLabelProxy

fileChooserCreateFolders :: AttrLabelProxy "createFolders"
fileChooserCreateFolders = AttrLabelProxy

fileChooserDoOverwriteConfirmation :: AttrLabelProxy "doOverwriteConfirmation"
fileChooserDoOverwriteConfirmation = AttrLabelProxy

fileChooserExtraWidget :: AttrLabelProxy "extraWidget"
fileChooserExtraWidget = AttrLabelProxy

fileChooserFilter :: AttrLabelProxy "filter"
fileChooserFilter = AttrLabelProxy

fileChooserLocalOnly :: AttrLabelProxy "localOnly"
fileChooserLocalOnly = AttrLabelProxy

fileChooserPreviewWidget :: AttrLabelProxy "previewWidget"
fileChooserPreviewWidget = AttrLabelProxy

fileChooserPreviewWidgetActive :: AttrLabelProxy "previewWidgetActive"
fileChooserPreviewWidgetActive = AttrLabelProxy

fileChooserSelectMultiple :: AttrLabelProxy "selectMultiple"
fileChooserSelectMultiple = AttrLabelProxy

fileChooserShowHidden :: AttrLabelProxy "showHidden"
fileChooserShowHidden = AttrLabelProxy

fileChooserUsePreviewLabel :: AttrLabelProxy "usePreviewLabel"
fileChooserUsePreviewLabel = AttrLabelProxy

#endif

#if ENABLE_OVERLOADING
type family ResolveFileChooserMethod (t :: Symbol) (o :: *) :: * where
    ResolveFileChooserMethod "addChoice" o = FileChooserAddChoiceMethodInfo
    ResolveFileChooserMethod "addFilter" o = FileChooserAddFilterMethodInfo
    ResolveFileChooserMethod "addShortcutFolder" o = FileChooserAddShortcutFolderMethodInfo
    ResolveFileChooserMethod "addShortcutFolderUri" o = FileChooserAddShortcutFolderUriMethodInfo
    ResolveFileChooserMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveFileChooserMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveFileChooserMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveFileChooserMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveFileChooserMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveFileChooserMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveFileChooserMethod "listFilters" o = FileChooserListFiltersMethodInfo
    ResolveFileChooserMethod "listShortcutFolderUris" o = FileChooserListShortcutFolderUrisMethodInfo
    ResolveFileChooserMethod "listShortcutFolders" o = FileChooserListShortcutFoldersMethodInfo
    ResolveFileChooserMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveFileChooserMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveFileChooserMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveFileChooserMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveFileChooserMethod "removeChoice" o = FileChooserRemoveChoiceMethodInfo
    ResolveFileChooserMethod "removeFilter" o = FileChooserRemoveFilterMethodInfo
    ResolveFileChooserMethod "removeShortcutFolder" o = FileChooserRemoveShortcutFolderMethodInfo
    ResolveFileChooserMethod "removeShortcutFolderUri" o = FileChooserRemoveShortcutFolderUriMethodInfo
    ResolveFileChooserMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveFileChooserMethod "selectAll" o = FileChooserSelectAllMethodInfo
    ResolveFileChooserMethod "selectFile" o = FileChooserSelectFileMethodInfo
    ResolveFileChooserMethod "selectFilename" o = FileChooserSelectFilenameMethodInfo
    ResolveFileChooserMethod "selectUri" o = FileChooserSelectUriMethodInfo
    ResolveFileChooserMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveFileChooserMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveFileChooserMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveFileChooserMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveFileChooserMethod "unselectAll" o = FileChooserUnselectAllMethodInfo
    ResolveFileChooserMethod "unselectFile" o = FileChooserUnselectFileMethodInfo
    ResolveFileChooserMethod "unselectFilename" o = FileChooserUnselectFilenameMethodInfo
    ResolveFileChooserMethod "unselectUri" o = FileChooserUnselectUriMethodInfo
    ResolveFileChooserMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveFileChooserMethod "getAction" o = FileChooserGetActionMethodInfo
    ResolveFileChooserMethod "getChoice" o = FileChooserGetChoiceMethodInfo
    ResolveFileChooserMethod "getCreateFolders" o = FileChooserGetCreateFoldersMethodInfo
    ResolveFileChooserMethod "getCurrentFolder" o = FileChooserGetCurrentFolderMethodInfo
    ResolveFileChooserMethod "getCurrentFolderFile" o = FileChooserGetCurrentFolderFileMethodInfo
    ResolveFileChooserMethod "getCurrentFolderUri" o = FileChooserGetCurrentFolderUriMethodInfo
    ResolveFileChooserMethod "getCurrentName" o = FileChooserGetCurrentNameMethodInfo
    ResolveFileChooserMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveFileChooserMethod "getDoOverwriteConfirmation" o = FileChooserGetDoOverwriteConfirmationMethodInfo
    ResolveFileChooserMethod "getExtraWidget" o = FileChooserGetExtraWidgetMethodInfo
    ResolveFileChooserMethod "getFile" o = FileChooserGetFileMethodInfo
    ResolveFileChooserMethod "getFilename" o = FileChooserGetFilenameMethodInfo
    ResolveFileChooserMethod "getFilenames" o = FileChooserGetFilenamesMethodInfo
    ResolveFileChooserMethod "getFiles" o = FileChooserGetFilesMethodInfo
    ResolveFileChooserMethod "getFilter" o = FileChooserGetFilterMethodInfo
    ResolveFileChooserMethod "getLocalOnly" o = FileChooserGetLocalOnlyMethodInfo
    ResolveFileChooserMethod "getPreviewFile" o = FileChooserGetPreviewFileMethodInfo
    ResolveFileChooserMethod "getPreviewFilename" o = FileChooserGetPreviewFilenameMethodInfo
    ResolveFileChooserMethod "getPreviewUri" o = FileChooserGetPreviewUriMethodInfo
    ResolveFileChooserMethod "getPreviewWidget" o = FileChooserGetPreviewWidgetMethodInfo
    ResolveFileChooserMethod "getPreviewWidgetActive" o = FileChooserGetPreviewWidgetActiveMethodInfo
    ResolveFileChooserMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveFileChooserMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveFileChooserMethod "getSelectMultiple" o = FileChooserGetSelectMultipleMethodInfo
    ResolveFileChooserMethod "getShowHidden" o = FileChooserGetShowHiddenMethodInfo
    ResolveFileChooserMethod "getUri" o = FileChooserGetUriMethodInfo
    ResolveFileChooserMethod "getUris" o = FileChooserGetUrisMethodInfo
    ResolveFileChooserMethod "getUsePreviewLabel" o = FileChooserGetUsePreviewLabelMethodInfo
    ResolveFileChooserMethod "setAction" o = FileChooserSetActionMethodInfo
    ResolveFileChooserMethod "setChoice" o = FileChooserSetChoiceMethodInfo
    ResolveFileChooserMethod "setCreateFolders" o = FileChooserSetCreateFoldersMethodInfo
    ResolveFileChooserMethod "setCurrentFolder" o = FileChooserSetCurrentFolderMethodInfo
    ResolveFileChooserMethod "setCurrentFolderFile" o = FileChooserSetCurrentFolderFileMethodInfo
    ResolveFileChooserMethod "setCurrentFolderUri" o = FileChooserSetCurrentFolderUriMethodInfo
    ResolveFileChooserMethod "setCurrentName" o = FileChooserSetCurrentNameMethodInfo
    ResolveFileChooserMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveFileChooserMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveFileChooserMethod "setDoOverwriteConfirmation" o = FileChooserSetDoOverwriteConfirmationMethodInfo
    ResolveFileChooserMethod "setExtraWidget" o = FileChooserSetExtraWidgetMethodInfo
    ResolveFileChooserMethod "setFile" o = FileChooserSetFileMethodInfo
    ResolveFileChooserMethod "setFilename" o = FileChooserSetFilenameMethodInfo
    ResolveFileChooserMethod "setFilter" o = FileChooserSetFilterMethodInfo
    ResolveFileChooserMethod "setLocalOnly" o = FileChooserSetLocalOnlyMethodInfo
    ResolveFileChooserMethod "setPreviewWidget" o = FileChooserSetPreviewWidgetMethodInfo
    ResolveFileChooserMethod "setPreviewWidgetActive" o = FileChooserSetPreviewWidgetActiveMethodInfo
    ResolveFileChooserMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveFileChooserMethod "setSelectMultiple" o = FileChooserSetSelectMultipleMethodInfo
    ResolveFileChooserMethod "setShowHidden" o = FileChooserSetShowHiddenMethodInfo
    ResolveFileChooserMethod "setUri" o = FileChooserSetUriMethodInfo
    ResolveFileChooserMethod "setUsePreviewLabel" o = FileChooserSetUsePreviewLabelMethodInfo
    ResolveFileChooserMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveFileChooserMethod t FileChooser, O.MethodInfo info FileChooser p) => OL.IsLabel t (FileChooser -> 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

-- method FileChooser::add_choice
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "id", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "id for the added choice", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "label", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "user-visible label for the added choice", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "options", argType = TCArray True (-1) (-1) (TBasicType TUTF8), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "ids for the options of the choice, or %NULL for a boolean choice", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "option_labels", argType = TCArray True (-1) (-1) (TBasicType TUTF8), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user-visible labels for the options, must be the same length as @options", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_file_chooser_add_choice" gtk_file_chooser_add_choice ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    CString ->                              -- id : TBasicType TUTF8
    CString ->                              -- label : TBasicType TUTF8
    Ptr CString ->                          -- options : TCArray True (-1) (-1) (TBasicType TUTF8)
    Ptr CString ->                          -- option_labels : TCArray True (-1) (-1) (TBasicType TUTF8)
    IO ()

{- |
Adds a \'choice\' to the file chooser. This is typically implemented
as a combobox or, for boolean choices, as a checkbutton. You can select
a value using 'GI.Gtk.Interfaces.FileChooser.fileChooserSetChoice' before the dialog is shown,
and you can obtain the user-selected value in the ::response signal handler
using 'GI.Gtk.Interfaces.FileChooser.fileChooserGetChoice'.

Compare 'GI.Gtk.Interfaces.FileChooser.fileChooserSetExtraWidget'.

/Since: 3.22/
-}
fileChooserAddChoice ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> T.Text
    {- ^ /@id@/: id for the added choice -}
    -> T.Text
    {- ^ /@label@/: user-visible label for the added choice -}
    -> Maybe ([T.Text])
    {- ^ /@options@/: ids for the options of the choice, or 'Nothing' for a boolean choice -}
    -> Maybe ([T.Text])
    {- ^ /@optionLabels@/: user-visible labels for the options, must be the same length as /@options@/ -}
    -> m ()
fileChooserAddChoice chooser id label options optionLabels = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    id' <- textToCString id
    label' <- textToCString label
    maybeOptions <- case options of
        Nothing -> return nullPtr
        Just jOptions -> do
            jOptions' <- packZeroTerminatedUTF8CArray jOptions
            return jOptions'
    maybeOptionLabels <- case optionLabels of
        Nothing -> return nullPtr
        Just jOptionLabels -> do
            jOptionLabels' <- packZeroTerminatedUTF8CArray jOptionLabels
            return jOptionLabels'
    gtk_file_chooser_add_choice chooser' id' label' maybeOptions maybeOptionLabels
    touchManagedPtr chooser
    freeMem id'
    freeMem label'
    mapZeroTerminatedCArray freeMem maybeOptions
    freeMem maybeOptions
    mapZeroTerminatedCArray freeMem maybeOptionLabels
    freeMem maybeOptionLabels
    return ()

#if ENABLE_OVERLOADING
data FileChooserAddChoiceMethodInfo
instance (signature ~ (T.Text -> T.Text -> Maybe ([T.Text]) -> Maybe ([T.Text]) -> m ()), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserAddChoiceMethodInfo a signature where
    overloadedMethod _ = fileChooserAddChoice

#endif

-- method FileChooser::add_filter
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "filter", argType = TInterface (Name {namespace = "Gtk", name = "FileFilter"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileFilter", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_file_chooser_add_filter" gtk_file_chooser_add_filter ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    Ptr Gtk.FileFilter.FileFilter ->        -- filter : TInterface (Name {namespace = "Gtk", name = "FileFilter"})
    IO ()

{- |
Adds /@filter@/ to the list of filters that the user can select between.
When a filter is selected, only files that are passed by that
filter are displayed.

Note that the /@chooser@/ takes ownership of the filter, so you have to
ref and sink it if you want to keep a reference.

/Since: 2.4/
-}
fileChooserAddFilter ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a, Gtk.FileFilter.IsFileFilter b) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> b
    {- ^ /@filter@/: a 'GI.Gtk.Objects.FileFilter.FileFilter' -}
    -> m ()
fileChooserAddFilter chooser filter = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    filter' <- B.ManagedPtr.disownObject filter
    gtk_file_chooser_add_filter chooser' filter'
    touchManagedPtr chooser
    touchManagedPtr filter
    return ()

#if ENABLE_OVERLOADING
data FileChooserAddFilterMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsFileChooser a, Gtk.FileFilter.IsFileFilter b) => O.MethodInfo FileChooserAddFilterMethodInfo a signature where
    overloadedMethod _ = fileChooserAddFilter

#endif

-- method FileChooser::add_shortcut_folder
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "folder", argType = TBasicType TFileName, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "filename of the folder to add", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "gtk_file_chooser_add_shortcut_folder" gtk_file_chooser_add_shortcut_folder ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    CString ->                              -- folder : TBasicType TFileName
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Adds a folder to be displayed with the shortcut folders in a file chooser.
Note that shortcut folders do not get saved, as they are provided by the
application.  For example, you can use this to add a
“\/usr\/share\/mydrawprogram\/Clipart” folder to the volume list.

/Since: 2.4/
-}
fileChooserAddShortcutFolder ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> [Char]
    {- ^ /@folder@/: filename of the folder to add -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
fileChooserAddShortcutFolder chooser folder = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    folder' <- stringToCString folder
    onException (do
        _ <- propagateGError $ gtk_file_chooser_add_shortcut_folder chooser' folder'
        touchManagedPtr chooser
        freeMem folder'
        return ()
     ) (do
        freeMem folder'
     )

#if ENABLE_OVERLOADING
data FileChooserAddShortcutFolderMethodInfo
instance (signature ~ ([Char] -> m ()), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserAddShortcutFolderMethodInfo a signature where
    overloadedMethod _ = fileChooserAddShortcutFolder

#endif

-- method FileChooser::add_shortcut_folder_uri
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "uri", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "URI of the folder to add", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "gtk_file_chooser_add_shortcut_folder_uri" gtk_file_chooser_add_shortcut_folder_uri ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    CString ->                              -- uri : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Adds a folder URI to be displayed with the shortcut folders in a file
chooser.  Note that shortcut folders do not get saved, as they are provided
by the application.  For example, you can use this to add a
“file:\/\/\/usr\/share\/mydrawprogram\/Clipart” folder to the volume list.

/Since: 2.4/
-}
fileChooserAddShortcutFolderUri ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> T.Text
    {- ^ /@uri@/: URI of the folder to add -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
fileChooserAddShortcutFolderUri chooser uri = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    uri' <- textToCString uri
    onException (do
        _ <- propagateGError $ gtk_file_chooser_add_shortcut_folder_uri chooser' uri'
        touchManagedPtr chooser
        freeMem uri'
        return ()
     ) (do
        freeMem uri'
     )

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

#endif

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

foreign import ccall "gtk_file_chooser_get_action" gtk_file_chooser_get_action ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    IO CUInt

{- |
Gets the type of operation that the file chooser is performing; see
'GI.Gtk.Interfaces.FileChooser.fileChooserSetAction'.

/Since: 2.4/
-}
fileChooserGetAction ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> m Gtk.Enums.FileChooserAction
    {- ^ __Returns:__ the action that the file selector is performing -}
fileChooserGetAction chooser = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    result <- gtk_file_chooser_get_action chooser'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr chooser
    return result'

#if ENABLE_OVERLOADING
data FileChooserGetActionMethodInfo
instance (signature ~ (m Gtk.Enums.FileChooserAction), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserGetActionMethodInfo a signature where
    overloadedMethod _ = fileChooserGetAction

#endif

-- method FileChooser::get_choice
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "id", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the ID of the choice to get", 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_file_chooser_get_choice" gtk_file_chooser_get_choice ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    CString ->                              -- id : TBasicType TUTF8
    IO CString

{- |
Gets the currently selected option in the \'choice\' with the given ID.

/Since: 3.22/
-}
fileChooserGetChoice ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> T.Text
    {- ^ /@id@/: the ID of the choice to get -}
    -> m T.Text
    {- ^ __Returns:__ the ID of the currenly selected option -}
fileChooserGetChoice chooser id = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    id' <- textToCString id
    result <- gtk_file_chooser_get_choice chooser' id'
    checkUnexpectedReturnNULL "fileChooserGetChoice" result
    result' <- cstringToText result
    touchManagedPtr chooser
    freeMem id'
    return result'

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

#endif

-- method FileChooser::get_create_folders
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", 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_file_chooser_get_create_folders" gtk_file_chooser_get_create_folders ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    IO CInt

{- |
Gets whether file choser will offer to create new folders.
See 'GI.Gtk.Interfaces.FileChooser.fileChooserSetCreateFolders'.

/Since: 2.18/
-}
fileChooserGetCreateFolders ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the Create Folder button should be displayed. -}
fileChooserGetCreateFolders chooser = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    result <- gtk_file_chooser_get_create_folders chooser'
    let result' = (/= 0) result
    touchManagedPtr chooser
    return result'

#if ENABLE_OVERLOADING
data FileChooserGetCreateFoldersMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserGetCreateFoldersMethodInfo a signature where
    overloadedMethod _ = fileChooserGetCreateFolders

#endif

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

foreign import ccall "gtk_file_chooser_get_current_folder" gtk_file_chooser_get_current_folder ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    IO CString

{- |
Gets the current folder of /@chooser@/ as a local filename.
See 'GI.Gtk.Interfaces.FileChooser.fileChooserSetCurrentFolder'.

Note that this is the folder that the file chooser is currently displaying
(e.g. \"\/home\/username\/Documents\"), which is not the same
as the currently-selected folder if the chooser is in
'GI.Gtk.Enums.FileChooserActionSelectFolder' mode
(e.g. \"\/home\/username\/Documents\/selected-folder\/\".  To get the
currently-selected folder in that mode, use 'GI.Gtk.Interfaces.FileChooser.fileChooserGetUri' as the
usual way to get the selection.

/Since: 2.4/
-}
fileChooserGetCurrentFolder ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> m (Maybe [Char])
    {- ^ __Returns:__ the full path of the current
folder, or 'Nothing' if the current path cannot be represented as a local
filename.  Free with 'GI.GLib.Functions.free'.  This function will also return
'Nothing' if the file chooser was unable to load the last folder that
was requested from it; for example, as would be for calling
'GI.Gtk.Interfaces.FileChooser.fileChooserSetCurrentFolder' on a nonexistent folder. -}
fileChooserGetCurrentFolder chooser = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    result <- gtk_file_chooser_get_current_folder chooser'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- cstringToString result'
        freeMem result'
        return result''
    touchManagedPtr chooser
    return maybeResult

#if ENABLE_OVERLOADING
data FileChooserGetCurrentFolderMethodInfo
instance (signature ~ (m (Maybe [Char])), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserGetCurrentFolderMethodInfo a signature where
    overloadedMethod _ = fileChooserGetCurrentFolder

#endif

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

foreign import ccall "gtk_file_chooser_get_current_folder_file" gtk_file_chooser_get_current_folder_file ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    IO (Ptr Gio.File.File)

{- |
Gets the current folder of /@chooser@/ as 'GI.Gio.Interfaces.File.File'.
See 'GI.Gtk.Interfaces.FileChooser.fileChooserGetCurrentFolderUri'.

/Since: 2.14/
-}
fileChooserGetCurrentFolderFile ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> m Gio.File.File
    {- ^ __Returns:__ the 'GI.Gio.Interfaces.File.File' for the current folder. -}
fileChooserGetCurrentFolderFile chooser = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    result <- gtk_file_chooser_get_current_folder_file chooser'
    checkUnexpectedReturnNULL "fileChooserGetCurrentFolderFile" result
    result' <- (wrapObject Gio.File.File) result
    touchManagedPtr chooser
    return result'

#if ENABLE_OVERLOADING
data FileChooserGetCurrentFolderFileMethodInfo
instance (signature ~ (m Gio.File.File), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserGetCurrentFolderFileMethodInfo a signature where
    overloadedMethod _ = fileChooserGetCurrentFolderFile

#endif

-- method FileChooser::get_current_folder_uri
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", 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_file_chooser_get_current_folder_uri" gtk_file_chooser_get_current_folder_uri ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    IO CString

{- |
Gets the current folder of /@chooser@/ as an URI.
See 'GI.Gtk.Interfaces.FileChooser.fileChooserSetCurrentFolderUri'.

Note that this is the folder that the file chooser is currently displaying
(e.g. \"file:\/\/\/home\/username\/Documents\"), which is not the same
as the currently-selected folder if the chooser is in
'GI.Gtk.Enums.FileChooserActionSelectFolder' mode
(e.g. \"file:\/\/\/home\/username\/Documents\/selected-folder\/\".  To get the
currently-selected folder in that mode, use 'GI.Gtk.Interfaces.FileChooser.fileChooserGetUri' as the
usual way to get the selection.

/Since: 2.4/
-}
fileChooserGetCurrentFolderUri ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> m (Maybe T.Text)
    {- ^ __Returns:__ the URI for the current folder.
Free with 'GI.GLib.Functions.free'.  This function will also return 'Nothing' if the file chooser
was unable to load the last folder that was requested from it; for example,
as would be for calling 'GI.Gtk.Interfaces.FileChooser.fileChooserSetCurrentFolderUri' on a
nonexistent folder. -}
fileChooserGetCurrentFolderUri chooser = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    result <- gtk_file_chooser_get_current_folder_uri chooser'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- cstringToText result'
        freeMem result'
        return result''
    touchManagedPtr chooser
    return maybeResult

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

#endif

-- method FileChooser::get_current_name
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", 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_file_chooser_get_current_name" gtk_file_chooser_get_current_name ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    IO CString

{- |
Gets the current name in the file selector, as entered by the user in the
text entry for “Name”.

This is meant to be used in save dialogs, to get the currently typed filename
when the file itself does not exist yet.  For example, an application that
adds a custom extra widget to the file chooser for “file format” may want to
change the extension of the typed filename based on the chosen format, say,
from “.jpg” to “.png”.

/Since: 3.10/
-}
fileChooserGetCurrentName ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> m T.Text
    {- ^ __Returns:__ The raw text from the file chooser’s “Name” entry.  Free this with
'GI.GLib.Functions.free'.  Note that this string is not a full pathname or URI; it is
whatever the contents of the entry are.  Note also that this string is in
UTF-8 encoding, which is not necessarily the system’s encoding for filenames. -}
fileChooserGetCurrentName chooser = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    result <- gtk_file_chooser_get_current_name chooser'
    checkUnexpectedReturnNULL "fileChooserGetCurrentName" result
    result' <- cstringToText result
    freeMem result
    touchManagedPtr chooser
    return result'

#if ENABLE_OVERLOADING
data FileChooserGetCurrentNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserGetCurrentNameMethodInfo a signature where
    overloadedMethod _ = fileChooserGetCurrentName

#endif

-- method FileChooser::get_do_overwrite_confirmation
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", 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_file_chooser_get_do_overwrite_confirmation" gtk_file_chooser_get_do_overwrite_confirmation ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    IO CInt

{- |
Queries whether a file chooser is set to confirm for overwriting when the user
types a file name that already exists.

/Since: 2.8/
-}
fileChooserGetDoOverwriteConfirmation ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the file chooser will present a confirmation dialog;
'False' otherwise. -}
fileChooserGetDoOverwriteConfirmation chooser = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    result <- gtk_file_chooser_get_do_overwrite_confirmation chooser'
    let result' = (/= 0) result
    touchManagedPtr chooser
    return result'

#if ENABLE_OVERLOADING
data FileChooserGetDoOverwriteConfirmationMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserGetDoOverwriteConfirmationMethodInfo a signature where
    overloadedMethod _ = fileChooserGetDoOverwriteConfirmation

#endif

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

foreign import ccall "gtk_file_chooser_get_extra_widget" gtk_file_chooser_get_extra_widget ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    IO (Ptr Gtk.Widget.Widget)

{- |
Gets the current extra widget; see
'GI.Gtk.Interfaces.FileChooser.fileChooserSetExtraWidget'.

/Since: 2.4/
-}
fileChooserGetExtraWidget ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> m (Maybe Gtk.Widget.Widget)
    {- ^ __Returns:__ the current extra widget, or 'Nothing' -}
fileChooserGetExtraWidget chooser = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    result <- gtk_file_chooser_get_extra_widget chooser'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (newObject Gtk.Widget.Widget) result'
        return result''
    touchManagedPtr chooser
    return maybeResult

#if ENABLE_OVERLOADING
data FileChooserGetExtraWidgetMethodInfo
instance (signature ~ (m (Maybe Gtk.Widget.Widget)), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserGetExtraWidgetMethodInfo a signature where
    overloadedMethod _ = fileChooserGetExtraWidget

#endif

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

foreign import ccall "gtk_file_chooser_get_file" gtk_file_chooser_get_file ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    IO (Ptr Gio.File.File)

{- |
Gets the 'GI.Gio.Interfaces.File.File' for the currently selected file in
the file selector. If multiple files are selected,
one of the files will be returned at random.

If the file chooser is in folder mode, this function returns the selected
folder.

/Since: 2.14/
-}
fileChooserGetFile ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> m Gio.File.File
    {- ^ __Returns:__ a selected 'GI.Gio.Interfaces.File.File'. You own the returned file;
    use 'GI.GObject.Objects.Object.objectUnref' to release it. -}
fileChooserGetFile chooser = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    result <- gtk_file_chooser_get_file chooser'
    checkUnexpectedReturnNULL "fileChooserGetFile" result
    result' <- (wrapObject Gio.File.File) result
    touchManagedPtr chooser
    return result'

#if ENABLE_OVERLOADING
data FileChooserGetFileMethodInfo
instance (signature ~ (m Gio.File.File), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserGetFileMethodInfo a signature where
    overloadedMethod _ = fileChooserGetFile

#endif

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

foreign import ccall "gtk_file_chooser_get_filename" gtk_file_chooser_get_filename ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    IO CString

{- |
Gets the filename for the currently selected file in
the file selector. The filename is returned as an absolute path. If
multiple files are selected, one of the filenames will be returned at
random.

If the file chooser is in folder mode, this function returns the selected
folder.

/Since: 2.4/
-}
fileChooserGetFilename ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> m (Maybe [Char])
    {- ^ __Returns:__ The currently selected filename,
 or 'Nothing' if no file is selected, or the selected file can\'t
 be represented with a local filename. Free with 'GI.GLib.Functions.free'. -}
fileChooserGetFilename chooser = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    result <- gtk_file_chooser_get_filename chooser'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- cstringToString result'
        freeMem result'
        return result''
    touchManagedPtr chooser
    return maybeResult

#if ENABLE_OVERLOADING
data FileChooserGetFilenameMethodInfo
instance (signature ~ (m (Maybe [Char])), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserGetFilenameMethodInfo a signature where
    overloadedMethod _ = fileChooserGetFilename

#endif

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

foreign import ccall "gtk_file_chooser_get_filenames" gtk_file_chooser_get_filenames ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    IO (Ptr (GSList CString))

{- |
Lists all the selected files and subfolders in the current folder of
/@chooser@/. The returned names are full absolute paths. If files in the current
folder cannot be represented as local filenames they will be ignored. (See
'GI.Gtk.Interfaces.FileChooser.fileChooserGetUris')

/Since: 2.4/
-}
fileChooserGetFilenames ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> m [[Char]]
    {- ^ __Returns:__ a 'GI.GLib.Structs.SList.SList'
   containing the filenames of all selected files and subfolders in
   the current folder. Free the returned list with @/g_slist_free()/@,
   and the filenames with 'GI.GLib.Functions.free'. -}
fileChooserGetFilenames chooser = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    result <- gtk_file_chooser_get_filenames chooser'
    result' <- unpackGSList result
    result'' <- mapM cstringToString result'
    mapGSList freeMem result
    g_slist_free result
    touchManagedPtr chooser
    return result''

#if ENABLE_OVERLOADING
data FileChooserGetFilenamesMethodInfo
instance (signature ~ (m [[Char]]), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserGetFilenamesMethodInfo a signature where
    overloadedMethod _ = fileChooserGetFilenames

#endif

-- method FileChooser::get_files
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TGSList (TInterface (Name {namespace = "Gio", name = "File"})))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_file_chooser_get_files" gtk_file_chooser_get_files ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    IO (Ptr (GSList (Ptr Gio.File.File)))

{- |
Lists all the selected files and subfolders in the current folder of /@chooser@/
as 'GI.Gio.Interfaces.File.File'. An internal function, see 'GI.Gtk.Interfaces.FileChooser.fileChooserGetUris'.

/Since: 2.14/
-}
fileChooserGetFiles ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> m [Gio.File.File]
    {- ^ __Returns:__ a 'GI.GLib.Structs.SList.SList'
  containing a 'GI.Gio.Interfaces.File.File' for each selected file and subfolder in the
  current folder.  Free the returned list with @/g_slist_free()/@, and
  the files with 'GI.GObject.Objects.Object.objectUnref'. -}
fileChooserGetFiles chooser = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    result <- gtk_file_chooser_get_files chooser'
    result' <- unpackGSList result
    result'' <- mapM (wrapObject Gio.File.File) result'
    g_slist_free result
    touchManagedPtr chooser
    return result''

#if ENABLE_OVERLOADING
data FileChooserGetFilesMethodInfo
instance (signature ~ (m [Gio.File.File]), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserGetFilesMethodInfo a signature where
    overloadedMethod _ = fileChooserGetFiles

#endif

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

foreign import ccall "gtk_file_chooser_get_filter" gtk_file_chooser_get_filter ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    IO (Ptr Gtk.FileFilter.FileFilter)

{- |
Gets the current filter; see 'GI.Gtk.Interfaces.FileChooser.fileChooserSetFilter'.

/Since: 2.4/
-}
fileChooserGetFilter ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> m (Maybe Gtk.FileFilter.FileFilter)
    {- ^ __Returns:__ the current filter, or 'Nothing' -}
fileChooserGetFilter chooser = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    result <- gtk_file_chooser_get_filter chooser'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (newObject Gtk.FileFilter.FileFilter) result'
        return result''
    touchManagedPtr chooser
    return maybeResult

#if ENABLE_OVERLOADING
data FileChooserGetFilterMethodInfo
instance (signature ~ (m (Maybe Gtk.FileFilter.FileFilter)), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserGetFilterMethodInfo a signature where
    overloadedMethod _ = fileChooserGetFilter

#endif

-- method FileChooser::get_local_only
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", 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_file_chooser_get_local_only" gtk_file_chooser_get_local_only ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    IO CInt

{- |
Gets whether only local files can be selected in the
file selector. See 'GI.Gtk.Interfaces.FileChooser.fileChooserSetLocalOnly'

/Since: 2.4/
-}
fileChooserGetLocalOnly ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> m Bool
    {- ^ __Returns:__ 'True' if only local files can be selected. -}
fileChooserGetLocalOnly chooser = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    result <- gtk_file_chooser_get_local_only chooser'
    let result' = (/= 0) result
    touchManagedPtr chooser
    return result'

#if ENABLE_OVERLOADING
data FileChooserGetLocalOnlyMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserGetLocalOnlyMethodInfo a signature where
    overloadedMethod _ = fileChooserGetLocalOnly

#endif

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

foreign import ccall "gtk_file_chooser_get_preview_file" gtk_file_chooser_get_preview_file ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    IO (Ptr Gio.File.File)

{- |
Gets the 'GI.Gio.Interfaces.File.File' that should be previewed in a custom preview
Internal function, see 'GI.Gtk.Interfaces.FileChooser.fileChooserGetPreviewUri'.

/Since: 2.14/
-}
fileChooserGetPreviewFile ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> m (Maybe Gio.File.File)
    {- ^ __Returns:__ the 'GI.Gio.Interfaces.File.File' for the file to preview,
    or 'Nothing' if no file is selected. Free with 'GI.GObject.Objects.Object.objectUnref'. -}
fileChooserGetPreviewFile chooser = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    result <- gtk_file_chooser_get_preview_file chooser'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (wrapObject Gio.File.File) result'
        return result''
    touchManagedPtr chooser
    return maybeResult

#if ENABLE_OVERLOADING
data FileChooserGetPreviewFileMethodInfo
instance (signature ~ (m (Maybe Gio.File.File)), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserGetPreviewFileMethodInfo a signature where
    overloadedMethod _ = fileChooserGetPreviewFile

#endif

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

foreign import ccall "gtk_file_chooser_get_preview_filename" gtk_file_chooser_get_preview_filename ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    IO CString

{- |
Gets the filename that should be previewed in a custom preview
widget. See 'GI.Gtk.Interfaces.FileChooser.fileChooserSetPreviewWidget'.

/Since: 2.4/
-}
fileChooserGetPreviewFilename ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> m (Maybe [Char])
    {- ^ __Returns:__ the filename to preview, or 'Nothing' if
 no file is selected, or if the selected file cannot be represented
 as a local filename. Free with 'GI.GLib.Functions.free' -}
fileChooserGetPreviewFilename chooser = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    result <- gtk_file_chooser_get_preview_filename chooser'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- cstringToString result'
        freeMem result'
        return result''
    touchManagedPtr chooser
    return maybeResult

#if ENABLE_OVERLOADING
data FileChooserGetPreviewFilenameMethodInfo
instance (signature ~ (m (Maybe [Char])), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserGetPreviewFilenameMethodInfo a signature where
    overloadedMethod _ = fileChooserGetPreviewFilename

#endif

-- method FileChooser::get_preview_uri
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", 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_file_chooser_get_preview_uri" gtk_file_chooser_get_preview_uri ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    IO CString

{- |
Gets the URI that should be previewed in a custom preview
widget. See 'GI.Gtk.Interfaces.FileChooser.fileChooserSetPreviewWidget'.

/Since: 2.4/
-}
fileChooserGetPreviewUri ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> m (Maybe T.Text)
    {- ^ __Returns:__ the URI for the file to preview,
    or 'Nothing' if no file is selected. Free with 'GI.GLib.Functions.free'. -}
fileChooserGetPreviewUri chooser = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    result <- gtk_file_chooser_get_preview_uri chooser'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- cstringToText result'
        freeMem result'
        return result''
    touchManagedPtr chooser
    return maybeResult

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

#endif

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

foreign import ccall "gtk_file_chooser_get_preview_widget" gtk_file_chooser_get_preview_widget ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    IO (Ptr Gtk.Widget.Widget)

{- |
Gets the current preview widget; see
'GI.Gtk.Interfaces.FileChooser.fileChooserSetPreviewWidget'.

/Since: 2.4/
-}
fileChooserGetPreviewWidget ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> m (Maybe Gtk.Widget.Widget)
    {- ^ __Returns:__ the current preview widget, or 'Nothing' -}
fileChooserGetPreviewWidget chooser = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    result <- gtk_file_chooser_get_preview_widget chooser'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (newObject Gtk.Widget.Widget) result'
        return result''
    touchManagedPtr chooser
    return maybeResult

#if ENABLE_OVERLOADING
data FileChooserGetPreviewWidgetMethodInfo
instance (signature ~ (m (Maybe Gtk.Widget.Widget)), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserGetPreviewWidgetMethodInfo a signature where
    overloadedMethod _ = fileChooserGetPreviewWidget

#endif

-- method FileChooser::get_preview_widget_active
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", 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_file_chooser_get_preview_widget_active" gtk_file_chooser_get_preview_widget_active ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    IO CInt

{- |
Gets whether the preview widget set by 'GI.Gtk.Interfaces.FileChooser.fileChooserSetPreviewWidget'
should be shown for the current filename. See
'GI.Gtk.Interfaces.FileChooser.fileChooserSetPreviewWidgetActive'.

/Since: 2.4/
-}
fileChooserGetPreviewWidgetActive ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the preview widget is active for the current filename. -}
fileChooserGetPreviewWidgetActive chooser = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    result <- gtk_file_chooser_get_preview_widget_active chooser'
    let result' = (/= 0) result
    touchManagedPtr chooser
    return result'

#if ENABLE_OVERLOADING
data FileChooserGetPreviewWidgetActiveMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserGetPreviewWidgetActiveMethodInfo a signature where
    overloadedMethod _ = fileChooserGetPreviewWidgetActive

#endif

-- method FileChooser::get_select_multiple
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", 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_file_chooser_get_select_multiple" gtk_file_chooser_get_select_multiple ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    IO CInt

{- |
Gets whether multiple files can be selected in the file
selector. See 'GI.Gtk.Interfaces.FileChooser.fileChooserSetSelectMultiple'.

/Since: 2.4/
-}
fileChooserGetSelectMultiple ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> m Bool
    {- ^ __Returns:__ 'True' if multiple files can be selected. -}
fileChooserGetSelectMultiple chooser = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    result <- gtk_file_chooser_get_select_multiple chooser'
    let result' = (/= 0) result
    touchManagedPtr chooser
    return result'

#if ENABLE_OVERLOADING
data FileChooserGetSelectMultipleMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserGetSelectMultipleMethodInfo a signature where
    overloadedMethod _ = fileChooserGetSelectMultiple

#endif

-- method FileChooser::get_show_hidden
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", 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_file_chooser_get_show_hidden" gtk_file_chooser_get_show_hidden ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    IO CInt

{- |
Gets whether hidden files and folders are displayed in the file selector.
See 'GI.Gtk.Interfaces.FileChooser.fileChooserSetShowHidden'.

/Since: 2.6/
-}
fileChooserGetShowHidden ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> m Bool
    {- ^ __Returns:__ 'True' if hidden files and folders are displayed. -}
fileChooserGetShowHidden chooser = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    result <- gtk_file_chooser_get_show_hidden chooser'
    let result' = (/= 0) result
    touchManagedPtr chooser
    return result'

#if ENABLE_OVERLOADING
data FileChooserGetShowHiddenMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserGetShowHiddenMethodInfo a signature where
    overloadedMethod _ = fileChooserGetShowHidden

#endif

-- method FileChooser::get_uri
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", 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_file_chooser_get_uri" gtk_file_chooser_get_uri ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    IO CString

{- |
Gets the URI for the currently selected file in
the file selector. If multiple files are selected,
one of the filenames will be returned at random.

If the file chooser is in folder mode, this function returns the selected
folder.

/Since: 2.4/
-}
fileChooserGetUri ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> m (Maybe T.Text)
    {- ^ __Returns:__ The currently selected URI, or 'Nothing'
   if no file is selected. If 'GI.Gtk.Interfaces.FileChooser.fileChooserSetLocalOnly' is set to
   'True' (the default) a local URI will be returned for any FUSE locations.
   Free with 'GI.GLib.Functions.free' -}
fileChooserGetUri chooser = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    result <- gtk_file_chooser_get_uri chooser'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- cstringToText result'
        freeMem result'
        return result''
    touchManagedPtr chooser
    return maybeResult

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

#endif

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

foreign import ccall "gtk_file_chooser_get_uris" gtk_file_chooser_get_uris ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    IO (Ptr (GSList CString))

{- |
Lists all the selected files and subfolders in the current folder of
/@chooser@/. The returned names are full absolute URIs.

/Since: 2.4/
-}
fileChooserGetUris ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> m [T.Text]
    {- ^ __Returns:__ a 'GI.GLib.Structs.SList.SList' containing the URIs of all selected
  files and subfolders in the current folder. Free the returned list
  with @/g_slist_free()/@, and the filenames with 'GI.GLib.Functions.free'. -}
fileChooserGetUris chooser = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    result <- gtk_file_chooser_get_uris chooser'
    result' <- unpackGSList result
    result'' <- mapM cstringToText result'
    mapGSList freeMem result
    g_slist_free result
    touchManagedPtr chooser
    return result''

#if ENABLE_OVERLOADING
data FileChooserGetUrisMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserGetUrisMethodInfo a signature where
    overloadedMethod _ = fileChooserGetUris

#endif

-- method FileChooser::get_use_preview_label
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", 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_file_chooser_get_use_preview_label" gtk_file_chooser_get_use_preview_label ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    IO CInt

{- |
Gets whether a stock label should be drawn with the name of the previewed
file.  See 'GI.Gtk.Interfaces.FileChooser.fileChooserSetUsePreviewLabel'.
-}
fileChooserGetUsePreviewLabel ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the file chooser is set to display a label with the
name of the previewed file, 'False' otherwise. -}
fileChooserGetUsePreviewLabel chooser = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    result <- gtk_file_chooser_get_use_preview_label chooser'
    let result' = (/= 0) result
    touchManagedPtr chooser
    return result'

#if ENABLE_OVERLOADING
data FileChooserGetUsePreviewLabelMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserGetUsePreviewLabelMethodInfo a signature where
    overloadedMethod _ = fileChooserGetUsePreviewLabel

#endif

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

foreign import ccall "gtk_file_chooser_list_filters" gtk_file_chooser_list_filters ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    IO (Ptr (GSList (Ptr Gtk.FileFilter.FileFilter)))

{- |
Lists the current set of user-selectable filters; see
'GI.Gtk.Interfaces.FileChooser.fileChooserAddFilter', 'GI.Gtk.Interfaces.FileChooser.fileChooserRemoveFilter'.

/Since: 2.4/
-}
fileChooserListFilters ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> m [Gtk.FileFilter.FileFilter]
    {- ^ __Returns:__ a
 'GI.GLib.Structs.SList.SList' containing the current set of user selectable filters. The
 contents of the list are owned by GTK+, but you must free the list
 itself with @/g_slist_free()/@ when you are done with it. -}
fileChooserListFilters chooser = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    result <- gtk_file_chooser_list_filters chooser'
    result' <- unpackGSList result
    result'' <- mapM (newObject Gtk.FileFilter.FileFilter) result'
    g_slist_free result
    touchManagedPtr chooser
    return result''

#if ENABLE_OVERLOADING
data FileChooserListFiltersMethodInfo
instance (signature ~ (m [Gtk.FileFilter.FileFilter]), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserListFiltersMethodInfo a signature where
    overloadedMethod _ = fileChooserListFilters

#endif

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

foreign import ccall "gtk_file_chooser_list_shortcut_folder_uris" gtk_file_chooser_list_shortcut_folder_uris ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    IO (Ptr (GSList CString))

{- |
Queries the list of shortcut folders in the file chooser, as set by
'GI.Gtk.Interfaces.FileChooser.fileChooserAddShortcutFolderUri'.

/Since: 2.4/
-}
fileChooserListShortcutFolderUris ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> m [T.Text]
    {- ^ __Returns:__ A list of
folder URIs, or 'Nothing' if there are no shortcut folders.  Free the
returned list with @/g_slist_free()/@, and the URIs with 'GI.GLib.Functions.free'. -}
fileChooserListShortcutFolderUris chooser = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    result <- gtk_file_chooser_list_shortcut_folder_uris chooser'
    result' <- unpackGSList result
    result'' <- mapM cstringToText result'
    mapGSList freeMem result
    g_slist_free result
    touchManagedPtr chooser
    return result''

#if ENABLE_OVERLOADING
data FileChooserListShortcutFolderUrisMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserListShortcutFolderUrisMethodInfo a signature where
    overloadedMethod _ = fileChooserListShortcutFolderUris

#endif

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

foreign import ccall "gtk_file_chooser_list_shortcut_folders" gtk_file_chooser_list_shortcut_folders ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    IO (Ptr (GSList CString))

{- |
Queries the list of shortcut folders in the file chooser, as set by
'GI.Gtk.Interfaces.FileChooser.fileChooserAddShortcutFolder'.

/Since: 2.4/
-}
fileChooserListShortcutFolders ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> m [[Char]]
    {- ^ __Returns:__ A list
of folder filenames, or 'Nothing' if there are no shortcut folders.
Free the returned list with @/g_slist_free()/@, and the filenames with
'GI.GLib.Functions.free'. -}
fileChooserListShortcutFolders chooser = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    result <- gtk_file_chooser_list_shortcut_folders chooser'
    result' <- unpackGSList result
    result'' <- mapM cstringToString result'
    mapGSList freeMem result
    g_slist_free result
    touchManagedPtr chooser
    return result''

#if ENABLE_OVERLOADING
data FileChooserListShortcutFoldersMethodInfo
instance (signature ~ (m [[Char]]), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserListShortcutFoldersMethodInfo a signature where
    overloadedMethod _ = fileChooserListShortcutFolders

#endif

-- method FileChooser::remove_choice
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "id", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the ID of the choice to remove", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_file_chooser_remove_choice" gtk_file_chooser_remove_choice ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    CString ->                              -- id : TBasicType TUTF8
    IO ()

{- |
Removes a \'choice\' that has been added with 'GI.Gtk.Interfaces.FileChooser.fileChooserAddChoice'.

/Since: 3.22/
-}
fileChooserRemoveChoice ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> T.Text
    {- ^ /@id@/: the ID of the choice to remove -}
    -> m ()
fileChooserRemoveChoice chooser id = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    id' <- textToCString id
    gtk_file_chooser_remove_choice chooser' id'
    touchManagedPtr chooser
    freeMem id'
    return ()

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

#endif

-- method FileChooser::remove_filter
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "filter", argType = TInterface (Name {namespace = "Gtk", name = "FileFilter"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileFilter", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_file_chooser_remove_filter" gtk_file_chooser_remove_filter ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    Ptr Gtk.FileFilter.FileFilter ->        -- filter : TInterface (Name {namespace = "Gtk", name = "FileFilter"})
    IO ()

{- |
Removes /@filter@/ from the list of filters that the user can select between.

/Since: 2.4/
-}
fileChooserRemoveFilter ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a, Gtk.FileFilter.IsFileFilter b) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> b
    {- ^ /@filter@/: a 'GI.Gtk.Objects.FileFilter.FileFilter' -}
    -> m ()
fileChooserRemoveFilter chooser filter = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    filter' <- unsafeManagedPtrCastPtr filter
    gtk_file_chooser_remove_filter chooser' filter'
    touchManagedPtr chooser
    touchManagedPtr filter
    return ()

#if ENABLE_OVERLOADING
data FileChooserRemoveFilterMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsFileChooser a, Gtk.FileFilter.IsFileFilter b) => O.MethodInfo FileChooserRemoveFilterMethodInfo a signature where
    overloadedMethod _ = fileChooserRemoveFilter

#endif

-- method FileChooser::remove_shortcut_folder
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "folder", argType = TBasicType TFileName, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "filename of the folder to remove", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "gtk_file_chooser_remove_shortcut_folder" gtk_file_chooser_remove_shortcut_folder ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    CString ->                              -- folder : TBasicType TFileName
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Removes a folder from a file chooser’s list of shortcut folders.

/Since: 2.4/
-}
fileChooserRemoveShortcutFolder ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> [Char]
    {- ^ /@folder@/: filename of the folder to remove -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
fileChooserRemoveShortcutFolder chooser folder = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    folder' <- stringToCString folder
    onException (do
        _ <- propagateGError $ gtk_file_chooser_remove_shortcut_folder chooser' folder'
        touchManagedPtr chooser
        freeMem folder'
        return ()
     ) (do
        freeMem folder'
     )

#if ENABLE_OVERLOADING
data FileChooserRemoveShortcutFolderMethodInfo
instance (signature ~ ([Char] -> m ()), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserRemoveShortcutFolderMethodInfo a signature where
    overloadedMethod _ = fileChooserRemoveShortcutFolder

#endif

-- method FileChooser::remove_shortcut_folder_uri
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "uri", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "URI of the folder to remove", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "gtk_file_chooser_remove_shortcut_folder_uri" gtk_file_chooser_remove_shortcut_folder_uri ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    CString ->                              -- uri : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Removes a folder URI from a file chooser’s list of shortcut folders.

/Since: 2.4/
-}
fileChooserRemoveShortcutFolderUri ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> T.Text
    {- ^ /@uri@/: URI of the folder to remove -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
fileChooserRemoveShortcutFolderUri chooser uri = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    uri' <- textToCString uri
    onException (do
        _ <- propagateGError $ gtk_file_chooser_remove_shortcut_folder_uri chooser' uri'
        touchManagedPtr chooser
        freeMem uri'
        return ()
     ) (do
        freeMem uri'
     )

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

#endif

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

foreign import ccall "gtk_file_chooser_select_all" gtk_file_chooser_select_all ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    IO ()

{- |
Selects all the files in the current folder of a file chooser.

/Since: 2.4/
-}
fileChooserSelectAll ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> m ()
fileChooserSelectAll chooser = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    gtk_file_chooser_select_all chooser'
    touchManagedPtr chooser
    return ()

#if ENABLE_OVERLOADING
data FileChooserSelectAllMethodInfo
instance (signature ~ (m ()), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserSelectAllMethodInfo a signature where
    overloadedMethod _ = fileChooserSelectAll

#endif

-- method FileChooser::select_file
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "file", argType = TInterface (Name {namespace = "Gio", name = "File"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the file to select", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "gtk_file_chooser_select_file" gtk_file_chooser_select_file ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    Ptr Gio.File.File ->                    -- file : TInterface (Name {namespace = "Gio", name = "File"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Selects the file referred to by /@file@/. An internal function. See
@/_gtk_file_chooser_select_uri()/@.

/Since: 2.14/
-}
fileChooserSelectFile ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a, Gio.File.IsFile b) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> b
    {- ^ /@file@/: the file to select -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
fileChooserSelectFile chooser file = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    file' <- unsafeManagedPtrCastPtr file
    onException (do
        _ <- propagateGError $ gtk_file_chooser_select_file chooser' file'
        touchManagedPtr chooser
        touchManagedPtr file
        return ()
     ) (do
        return ()
     )

#if ENABLE_OVERLOADING
data FileChooserSelectFileMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsFileChooser a, Gio.File.IsFile b) => O.MethodInfo FileChooserSelectFileMethodInfo a signature where
    overloadedMethod _ = fileChooserSelectFile

#endif

-- method FileChooser::select_filename
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "filename", argType = TBasicType TFileName, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the filename to select", 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_file_chooser_select_filename" gtk_file_chooser_select_filename ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    CString ->                              -- filename : TBasicType TFileName
    IO CInt

{- |
Selects a filename. If the file name isn’t in the current
folder of /@chooser@/, then the current folder of /@chooser@/ will
be changed to the folder containing /@filename@/.

/Since: 2.4/
-}
fileChooserSelectFilename ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> [Char]
    {- ^ /@filename@/: the filename to select -}
    -> m Bool
    {- ^ __Returns:__ Not useful.

See also: 'GI.Gtk.Interfaces.FileChooser.fileChooserSetFilename' -}
fileChooserSelectFilename chooser filename = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    filename' <- stringToCString filename
    result <- gtk_file_chooser_select_filename chooser' filename'
    let result' = (/= 0) result
    touchManagedPtr chooser
    freeMem filename'
    return result'

#if ENABLE_OVERLOADING
data FileChooserSelectFilenameMethodInfo
instance (signature ~ ([Char] -> m Bool), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserSelectFilenameMethodInfo a signature where
    overloadedMethod _ = fileChooserSelectFilename

#endif

-- method FileChooser::select_uri
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "uri", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the URI to select", 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_file_chooser_select_uri" gtk_file_chooser_select_uri ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    CString ->                              -- uri : TBasicType TUTF8
    IO CInt

{- |
Selects the file to by /@uri@/. If the URI doesn’t refer to a
file in the current folder of /@chooser@/, then the current folder of
/@chooser@/ will be changed to the folder containing /@filename@/.

/Since: 2.4/
-}
fileChooserSelectUri ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> T.Text
    {- ^ /@uri@/: the URI to select -}
    -> m Bool
    {- ^ __Returns:__ Not useful. -}
fileChooserSelectUri chooser uri = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    uri' <- textToCString uri
    result <- gtk_file_chooser_select_uri chooser' uri'
    let result' = (/= 0) result
    touchManagedPtr chooser
    freeMem uri'
    return result'

#if ENABLE_OVERLOADING
data FileChooserSelectUriMethodInfo
instance (signature ~ (T.Text -> m Bool), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserSelectUriMethodInfo a signature where
    overloadedMethod _ = fileChooserSelectUri

#endif

-- method FileChooser::set_action
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "action", argType = TInterface (Name {namespace = "Gtk", name = "FileChooserAction"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the action that the file selector is performing", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_file_chooser_set_action" gtk_file_chooser_set_action ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    CUInt ->                                -- action : TInterface (Name {namespace = "Gtk", name = "FileChooserAction"})
    IO ()

{- |
Sets the type of operation that the chooser is performing; the
user interface is adapted to suit the selected action. For example,
an option to create a new folder might be shown if the action is
'GI.Gtk.Enums.FileChooserActionSave' but not if the action is
'GI.Gtk.Enums.FileChooserActionOpen'.

/Since: 2.4/
-}
fileChooserSetAction ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> Gtk.Enums.FileChooserAction
    {- ^ /@action@/: the action that the file selector is performing -}
    -> m ()
fileChooserSetAction chooser action = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    let action' = (fromIntegral . fromEnum) action
    gtk_file_chooser_set_action chooser' action'
    touchManagedPtr chooser
    return ()

#if ENABLE_OVERLOADING
data FileChooserSetActionMethodInfo
instance (signature ~ (Gtk.Enums.FileChooserAction -> m ()), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserSetActionMethodInfo a signature where
    overloadedMethod _ = fileChooserSetAction

#endif

-- method FileChooser::set_choice
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "id", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the ID of the choice to set", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "option", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the ID of the option to select", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_file_chooser_set_choice" gtk_file_chooser_set_choice ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    CString ->                              -- id : TBasicType TUTF8
    CString ->                              -- option : TBasicType TUTF8
    IO ()

{- |
Selects an option in a \'choice\' that has been added with
'GI.Gtk.Interfaces.FileChooser.fileChooserAddChoice'. For a boolean choice, the
possible options are \"true\" and \"false\".

/Since: 3.22/
-}
fileChooserSetChoice ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> T.Text
    {- ^ /@id@/: the ID of the choice to set -}
    -> T.Text
    {- ^ /@option@/: the ID of the option to select -}
    -> m ()
fileChooserSetChoice chooser id option = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    id' <- textToCString id
    option' <- textToCString option
    gtk_file_chooser_set_choice chooser' id' option'
    touchManagedPtr chooser
    freeMem id'
    freeMem option'
    return ()

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

#endif

-- method FileChooser::set_create_folders
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "create_folders", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "%TRUE if the Create Folder button should be displayed", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_file_chooser_set_create_folders" gtk_file_chooser_set_create_folders ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    CInt ->                                 -- create_folders : TBasicType TBoolean
    IO ()

{- |
Sets whether file choser will offer to create new folders.
This is only relevant if the action is not set to be
'GI.Gtk.Enums.FileChooserActionOpen'.

/Since: 2.18/
-}
fileChooserSetCreateFolders ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> Bool
    {- ^ /@createFolders@/: 'True' if the Create Folder button should be displayed -}
    -> m ()
fileChooserSetCreateFolders chooser createFolders = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    let createFolders' = (fromIntegral . fromEnum) createFolders
    gtk_file_chooser_set_create_folders chooser' createFolders'
    touchManagedPtr chooser
    return ()

#if ENABLE_OVERLOADING
data FileChooserSetCreateFoldersMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserSetCreateFoldersMethodInfo a signature where
    overloadedMethod _ = fileChooserSetCreateFolders

#endif

-- method FileChooser::set_current_folder
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "filename", argType = TBasicType TFileName, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the full path of the new current folder", 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_file_chooser_set_current_folder" gtk_file_chooser_set_current_folder ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    CString ->                              -- filename : TBasicType TFileName
    IO CInt

{- |
Sets the current folder for /@chooser@/ from a local filename.
The user will be shown the full contents of the current folder,
plus user interface elements for navigating to other folders.

In general, you should not use this function.  See the
[section on setting up a file chooser dialog][gtkfilechooserdialog-setting-up]
for the rationale behind this.

/Since: 2.4/
-}
fileChooserSetCurrentFolder ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> [Char]
    {- ^ /@filename@/: the full path of the new current folder -}
    -> m Bool
    {- ^ __Returns:__ Not useful. -}
fileChooserSetCurrentFolder chooser filename = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    filename' <- stringToCString filename
    result <- gtk_file_chooser_set_current_folder chooser' filename'
    let result' = (/= 0) result
    touchManagedPtr chooser
    freeMem filename'
    return result'

#if ENABLE_OVERLOADING
data FileChooserSetCurrentFolderMethodInfo
instance (signature ~ ([Char] -> m Bool), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserSetCurrentFolderMethodInfo a signature where
    overloadedMethod _ = fileChooserSetCurrentFolder

#endif

-- method FileChooser::set_current_folder_file
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "file", argType = TInterface (Name {namespace = "Gio", name = "File"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GFile for the new folder", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "gtk_file_chooser_set_current_folder_file" gtk_file_chooser_set_current_folder_file ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    Ptr Gio.File.File ->                    -- file : TInterface (Name {namespace = "Gio", name = "File"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Sets the current folder for /@chooser@/ from a 'GI.Gio.Interfaces.File.File'.
Internal function, see 'GI.Gtk.Interfaces.FileChooser.fileChooserSetCurrentFolderUri'.

/Since: 2.14/
-}
fileChooserSetCurrentFolderFile ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a, Gio.File.IsFile b) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> b
    {- ^ /@file@/: the 'GI.Gio.Interfaces.File.File' for the new folder -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
fileChooserSetCurrentFolderFile chooser file = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    file' <- unsafeManagedPtrCastPtr file
    onException (do
        _ <- propagateGError $ gtk_file_chooser_set_current_folder_file chooser' file'
        touchManagedPtr chooser
        touchManagedPtr file
        return ()
     ) (do
        return ()
     )

#if ENABLE_OVERLOADING
data FileChooserSetCurrentFolderFileMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsFileChooser a, Gio.File.IsFile b) => O.MethodInfo FileChooserSetCurrentFolderFileMethodInfo a signature where
    overloadedMethod _ = fileChooserSetCurrentFolderFile

#endif

-- method FileChooser::set_current_folder_uri
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "uri", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the URI for the new current folder", 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_file_chooser_set_current_folder_uri" gtk_file_chooser_set_current_folder_uri ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    CString ->                              -- uri : TBasicType TUTF8
    IO CInt

{- |
Sets the current folder for /@chooser@/ from an URI.
The user will be shown the full contents of the current folder,
plus user interface elements for navigating to other folders.

In general, you should not use this function.  See the
[section on setting up a file chooser dialog][gtkfilechooserdialog-setting-up]
for the rationale behind this.

/Since: 2.4/
-}
fileChooserSetCurrentFolderUri ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> T.Text
    {- ^ /@uri@/: the URI for the new current folder -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the folder could be changed successfully, 'False'
otherwise. -}
fileChooserSetCurrentFolderUri chooser uri = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    uri' <- textToCString uri
    result <- gtk_file_chooser_set_current_folder_uri chooser' uri'
    let result' = (/= 0) result
    touchManagedPtr chooser
    freeMem uri'
    return result'

#if ENABLE_OVERLOADING
data FileChooserSetCurrentFolderUriMethodInfo
instance (signature ~ (T.Text -> m Bool), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserSetCurrentFolderUriMethodInfo a signature where
    overloadedMethod _ = fileChooserSetCurrentFolderUri

#endif

-- method FileChooser::set_current_name
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "name", argType = TBasicType TFileName, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the filename to use, as a UTF-8 string", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_file_chooser_set_current_name" gtk_file_chooser_set_current_name ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    CString ->                              -- name : TBasicType TFileName
    IO ()

{- |
Sets the current name in the file selector, as if entered
by the user. Note that the name passed in here is a UTF-8
string rather than a filename. This function is meant for
such uses as a suggested name in a “Save As...” dialog.  You can
pass “Untitled.doc” or a similarly suitable suggestion for the /@name@/.

If you want to preselect a particular existing file, you should use
'GI.Gtk.Interfaces.FileChooser.fileChooserSetFilename' or 'GI.Gtk.Interfaces.FileChooser.fileChooserSetUri' instead.
Please see the documentation for those functions for an example of using
'GI.Gtk.Interfaces.FileChooser.fileChooserSetCurrentName' as well.

/Since: 2.4/
-}
fileChooserSetCurrentName ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> [Char]
    {- ^ /@name@/: the filename to use, as a UTF-8 string -}
    -> m ()
fileChooserSetCurrentName chooser name = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    name' <- stringToCString name
    gtk_file_chooser_set_current_name chooser' name'
    touchManagedPtr chooser
    freeMem name'
    return ()

#if ENABLE_OVERLOADING
data FileChooserSetCurrentNameMethodInfo
instance (signature ~ ([Char] -> m ()), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserSetCurrentNameMethodInfo a signature where
    overloadedMethod _ = fileChooserSetCurrentName

#endif

-- method FileChooser::set_do_overwrite_confirmation
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "do_overwrite_confirmation", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "whether to confirm overwriting in save mode", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_file_chooser_set_do_overwrite_confirmation" gtk_file_chooser_set_do_overwrite_confirmation ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    CInt ->                                 -- do_overwrite_confirmation : TBasicType TBoolean
    IO ()

{- |
Sets whether a file chooser in 'GI.Gtk.Enums.FileChooserActionSave' mode will present
a confirmation dialog if the user types a file name that already exists.  This
is 'False' by default.

If set to 'True', the /@chooser@/ will emit the
'GI.Gtk.Interfaces.FileChooser.FileChooser'::@/confirm-overwrite/@ signal when appropriate.

If all you need is the stock confirmation dialog, set this property to 'True'.
You can override the way confirmation is done by actually handling the
'GI.Gtk.Interfaces.FileChooser.FileChooser'::@/confirm-overwrite/@ signal; please refer to its documentation
for the details.

/Since: 2.8/
-}
fileChooserSetDoOverwriteConfirmation ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> Bool
    {- ^ /@doOverwriteConfirmation@/: whether to confirm overwriting in save mode -}
    -> m ()
fileChooserSetDoOverwriteConfirmation chooser doOverwriteConfirmation = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    let doOverwriteConfirmation' = (fromIntegral . fromEnum) doOverwriteConfirmation
    gtk_file_chooser_set_do_overwrite_confirmation chooser' doOverwriteConfirmation'
    touchManagedPtr chooser
    return ()

#if ENABLE_OVERLOADING
data FileChooserSetDoOverwriteConfirmationMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserSetDoOverwriteConfirmationMethodInfo a signature where
    overloadedMethod _ = fileChooserSetDoOverwriteConfirmation

#endif

-- method FileChooser::set_extra_widget
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "extra_widget", argType = TInterface (Name {namespace = "Gtk", name = "Widget"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "widget for extra options", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_file_chooser_set_extra_widget" gtk_file_chooser_set_extra_widget ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    Ptr Gtk.Widget.Widget ->                -- extra_widget : TInterface (Name {namespace = "Gtk", name = "Widget"})
    IO ()

{- |
Sets an application-supplied widget to provide extra options to the user.

/Since: 2.4/
-}
fileChooserSetExtraWidget ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a, Gtk.Widget.IsWidget b) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> b
    {- ^ /@extraWidget@/: widget for extra options -}
    -> m ()
fileChooserSetExtraWidget chooser extraWidget = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    extraWidget' <- unsafeManagedPtrCastPtr extraWidget
    gtk_file_chooser_set_extra_widget chooser' extraWidget'
    touchManagedPtr chooser
    touchManagedPtr extraWidget
    return ()

#if ENABLE_OVERLOADING
data FileChooserSetExtraWidgetMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsFileChooser a, Gtk.Widget.IsWidget b) => O.MethodInfo FileChooserSetExtraWidgetMethodInfo a signature where
    overloadedMethod _ = fileChooserSetExtraWidget

#endif

-- method FileChooser::set_file
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "file", argType = TInterface (Name {namespace = "Gio", name = "File"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GFile to set as current", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "gtk_file_chooser_set_file" gtk_file_chooser_set_file ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    Ptr Gio.File.File ->                    -- file : TInterface (Name {namespace = "Gio", name = "File"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Sets /@file@/ as the current filename for the file chooser, by changing
to the file’s parent folder and actually selecting the file in list.  If
the /@chooser@/ is in 'GI.Gtk.Enums.FileChooserActionSave' mode, the file’s base name
will also appear in the dialog’s file name entry.

If the file name isn’t in the current folder of /@chooser@/, then the current
folder of /@chooser@/ will be changed to the folder containing /@filename@/. This
is equivalent to a sequence of 'GI.Gtk.Interfaces.FileChooser.fileChooserUnselectAll' followed by
'GI.Gtk.Interfaces.FileChooser.fileChooserSelectFilename'.

Note that the file must exist, or nothing will be done except
for the directory change.

If you are implementing a save dialog,
you should use this function if you already have a file name to which the
user may save; for example, when the user opens an existing file and then
does Save As...  If you don’t have
a file name already — for example, if the user just created a new
file and is saving it for the first time, do not call this function.
Instead, use something similar to this:

=== /C code/
>
>if (document_is_new)
>  {
>    // the user just created a new document
>    gtk_file_chooser_set_current_folder_file (chooser, default_file_for_saving);
>    gtk_file_chooser_set_current_name (chooser, "Untitled document");
>  }
>else
>  {
>    // the user edited an existing document
>    gtk_file_chooser_set_file (chooser, existing_file);
>  }


/Since: 2.14/
-}
fileChooserSetFile ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a, Gio.File.IsFile b) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> b
    {- ^ /@file@/: the 'GI.Gio.Interfaces.File.File' to set as current -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
fileChooserSetFile chooser file = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    file' <- unsafeManagedPtrCastPtr file
    onException (do
        _ <- propagateGError $ gtk_file_chooser_set_file chooser' file'
        touchManagedPtr chooser
        touchManagedPtr file
        return ()
     ) (do
        return ()
     )

#if ENABLE_OVERLOADING
data FileChooserSetFileMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsFileChooser a, Gio.File.IsFile b) => O.MethodInfo FileChooserSetFileMethodInfo a signature where
    overloadedMethod _ = fileChooserSetFile

#endif

-- method FileChooser::set_filename
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "filename", argType = TBasicType TFileName, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the filename to set as current", 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_file_chooser_set_filename" gtk_file_chooser_set_filename ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    CString ->                              -- filename : TBasicType TFileName
    IO CInt

{- |
Sets /@filename@/ as the current filename for the file chooser, by changing to
the file’s parent folder and actually selecting the file in list; all other
files will be unselected.  If the /@chooser@/ is in
'GI.Gtk.Enums.FileChooserActionSave' mode, the file’s base name will also appear in
the dialog’s file name entry.

Note that the file must exist, or nothing will be done except
for the directory change.

You should use this function only when implementing a save
dialog for which you already have a file name to which
the user may save.  For example, when the user opens an existing file and
then does Save As... to save a copy or
a modified version.  If you don’t have a file name already — for
example, if the user just created a new file and is saving it for the first
time, do not call this function.  Instead, use something similar to this:

=== /C code/
>
>if (document_is_new)
>  {
>    // the user just created a new document
>    gtk_file_chooser_set_current_name (chooser, "Untitled document");
>  }
>else
>  {
>    // the user edited an existing document
>    gtk_file_chooser_set_filename (chooser, existing_filename);
>  }


In the first case, the file chooser will present the user with useful suggestions
as to where to save his new file.  In the second case, the file’s existing location
is already known, so the file chooser will use it.

/Since: 2.4/
-}
fileChooserSetFilename ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> [Char]
    {- ^ /@filename@/: the filename to set as current -}
    -> m Bool
    {- ^ __Returns:__ Not useful. -}
fileChooserSetFilename chooser filename = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    filename' <- stringToCString filename
    result <- gtk_file_chooser_set_filename chooser' filename'
    let result' = (/= 0) result
    touchManagedPtr chooser
    freeMem filename'
    return result'

#if ENABLE_OVERLOADING
data FileChooserSetFilenameMethodInfo
instance (signature ~ ([Char] -> m Bool), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserSetFilenameMethodInfo a signature where
    overloadedMethod _ = fileChooserSetFilename

#endif

-- method FileChooser::set_filter
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "filter", argType = TInterface (Name {namespace = "Gtk", name = "FileFilter"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileFilter", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_file_chooser_set_filter" gtk_file_chooser_set_filter ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    Ptr Gtk.FileFilter.FileFilter ->        -- filter : TInterface (Name {namespace = "Gtk", name = "FileFilter"})
    IO ()

{- |
Sets the current filter; only the files that pass the
filter will be displayed. If the user-selectable list of filters
is non-empty, then the filter should be one of the filters
in that list. Setting the current filter when the list of
filters is empty is useful if you want to restrict the displayed
set of files without letting the user change it.

/Since: 2.4/
-}
fileChooserSetFilter ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a, Gtk.FileFilter.IsFileFilter b) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> b
    {- ^ /@filter@/: a 'GI.Gtk.Objects.FileFilter.FileFilter' -}
    -> m ()
fileChooserSetFilter chooser filter = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    filter' <- unsafeManagedPtrCastPtr filter
    gtk_file_chooser_set_filter chooser' filter'
    touchManagedPtr chooser
    touchManagedPtr filter
    return ()

#if ENABLE_OVERLOADING
data FileChooserSetFilterMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsFileChooser a, Gtk.FileFilter.IsFileFilter b) => O.MethodInfo FileChooserSetFilterMethodInfo a signature where
    overloadedMethod _ = fileChooserSetFilter

#endif

-- method FileChooser::set_local_only
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "local_only", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "%TRUE if only local files can be selected", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_file_chooser_set_local_only" gtk_file_chooser_set_local_only ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    CInt ->                                 -- local_only : TBasicType TBoolean
    IO ()

{- |
Sets whether only local files can be selected in the
file selector. If /@localOnly@/ is 'True' (the default),
then the selected file or files are guaranteed to be
accessible through the operating systems native file
system and therefore the application only
needs to worry about the filename functions in
'GI.Gtk.Interfaces.FileChooser.FileChooser', like 'GI.Gtk.Interfaces.FileChooser.fileChooserGetFilename',
rather than the URI functions like
'GI.Gtk.Interfaces.FileChooser.fileChooserGetUri',

On some systems non-native files may still be
available using the native filesystem via a userspace
filesystem (FUSE).

/Since: 2.4/
-}
fileChooserSetLocalOnly ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> Bool
    {- ^ /@localOnly@/: 'True' if only local files can be selected -}
    -> m ()
fileChooserSetLocalOnly chooser localOnly = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    let localOnly' = (fromIntegral . fromEnum) localOnly
    gtk_file_chooser_set_local_only chooser' localOnly'
    touchManagedPtr chooser
    return ()

#if ENABLE_OVERLOADING
data FileChooserSetLocalOnlyMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserSetLocalOnlyMethodInfo a signature where
    overloadedMethod _ = fileChooserSetLocalOnly

#endif

-- method FileChooser::set_preview_widget
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "preview_widget", argType = TInterface (Name {namespace = "Gtk", name = "Widget"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "widget for displaying preview.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_file_chooser_set_preview_widget" gtk_file_chooser_set_preview_widget ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    Ptr Gtk.Widget.Widget ->                -- preview_widget : TInterface (Name {namespace = "Gtk", name = "Widget"})
    IO ()

{- |
Sets an application-supplied widget to use to display a custom preview
of the currently selected file. To implement a preview, after setting the
preview widget, you connect to the 'GI.Gtk.Interfaces.FileChooser.FileChooser'::@/update-preview/@
signal, and call 'GI.Gtk.Interfaces.FileChooser.fileChooserGetPreviewFilename' or
'GI.Gtk.Interfaces.FileChooser.fileChooserGetPreviewUri' on each change. If you can
display a preview of the new file, update your widget and
set the preview active using 'GI.Gtk.Interfaces.FileChooser.fileChooserSetPreviewWidgetActive'.
Otherwise, set the preview inactive.

When there is no application-supplied preview widget, or the
application-supplied preview widget is not active, the file chooser
will display no preview at all.

/Since: 2.4/
-}
fileChooserSetPreviewWidget ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a, Gtk.Widget.IsWidget b) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> b
    {- ^ /@previewWidget@/: widget for displaying preview. -}
    -> m ()
fileChooserSetPreviewWidget chooser previewWidget = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    previewWidget' <- unsafeManagedPtrCastPtr previewWidget
    gtk_file_chooser_set_preview_widget chooser' previewWidget'
    touchManagedPtr chooser
    touchManagedPtr previewWidget
    return ()

#if ENABLE_OVERLOADING
data FileChooserSetPreviewWidgetMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsFileChooser a, Gtk.Widget.IsWidget b) => O.MethodInfo FileChooserSetPreviewWidgetMethodInfo a signature where
    overloadedMethod _ = fileChooserSetPreviewWidget

#endif

-- method FileChooser::set_preview_widget_active
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "active", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "whether to display the user-specified preview widget", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_file_chooser_set_preview_widget_active" gtk_file_chooser_set_preview_widget_active ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    CInt ->                                 -- active : TBasicType TBoolean
    IO ()

{- |
Sets whether the preview widget set by
'GI.Gtk.Interfaces.FileChooser.fileChooserSetPreviewWidget' should be shown for the
current filename. When /@active@/ is set to false, the file chooser
may display an internally generated preview of the current file
or it may display no preview at all. See
'GI.Gtk.Interfaces.FileChooser.fileChooserSetPreviewWidget' for more details.

/Since: 2.4/
-}
fileChooserSetPreviewWidgetActive ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> Bool
    {- ^ /@active@/: whether to display the user-specified preview widget -}
    -> m ()
fileChooserSetPreviewWidgetActive chooser active = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    let active' = (fromIntegral . fromEnum) active
    gtk_file_chooser_set_preview_widget_active chooser' active'
    touchManagedPtr chooser
    return ()

#if ENABLE_OVERLOADING
data FileChooserSetPreviewWidgetActiveMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserSetPreviewWidgetActiveMethodInfo a signature where
    overloadedMethod _ = fileChooserSetPreviewWidgetActive

#endif

-- method FileChooser::set_select_multiple
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "select_multiple", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "%TRUE if multiple files can be selected.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_file_chooser_set_select_multiple" gtk_file_chooser_set_select_multiple ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    CInt ->                                 -- select_multiple : TBasicType TBoolean
    IO ()

{- |
Sets whether multiple files can be selected in the file selector.  This is
only relevant if the action is set to be 'GI.Gtk.Enums.FileChooserActionOpen' or
'GI.Gtk.Enums.FileChooserActionSelectFolder'.

/Since: 2.4/
-}
fileChooserSetSelectMultiple ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> Bool
    {- ^ /@selectMultiple@/: 'True' if multiple files can be selected. -}
    -> m ()
fileChooserSetSelectMultiple chooser selectMultiple = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    let selectMultiple' = (fromIntegral . fromEnum) selectMultiple
    gtk_file_chooser_set_select_multiple chooser' selectMultiple'
    touchManagedPtr chooser
    return ()

#if ENABLE_OVERLOADING
data FileChooserSetSelectMultipleMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserSetSelectMultipleMethodInfo a signature where
    overloadedMethod _ = fileChooserSetSelectMultiple

#endif

-- method FileChooser::set_show_hidden
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "show_hidden", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "%TRUE if hidden files and folders should be displayed.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_file_chooser_set_show_hidden" gtk_file_chooser_set_show_hidden ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    CInt ->                                 -- show_hidden : TBasicType TBoolean
    IO ()

{- |
Sets whether hidden files and folders are displayed in the file selector.

/Since: 2.6/
-}
fileChooserSetShowHidden ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> Bool
    {- ^ /@showHidden@/: 'True' if hidden files and folders should be displayed. -}
    -> m ()
fileChooserSetShowHidden chooser showHidden = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    let showHidden' = (fromIntegral . fromEnum) showHidden
    gtk_file_chooser_set_show_hidden chooser' showHidden'
    touchManagedPtr chooser
    return ()

#if ENABLE_OVERLOADING
data FileChooserSetShowHiddenMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserSetShowHiddenMethodInfo a signature where
    overloadedMethod _ = fileChooserSetShowHidden

#endif

-- method FileChooser::set_uri
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "uri", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the URI to set as current", 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_file_chooser_set_uri" gtk_file_chooser_set_uri ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    CString ->                              -- uri : TBasicType TUTF8
    IO CInt

{- |
Sets the file referred to by /@uri@/ as the current file for the file chooser,
by changing to the URI’s parent folder and actually selecting the URI in the
list.  If the /@chooser@/ is 'GI.Gtk.Enums.FileChooserActionSave' mode, the URI’s base
name will also appear in the dialog’s file name entry.

Note that the URI must exist, or nothing will be done except for the
directory change.

You should use this function only when implementing a save
dialog for which you already have a file name to which
the user may save.  For example, when the user opens an existing file and then
does Save As... to save a copy or a
modified version.  If you don’t have a file name already — for example,
if the user just created a new file and is saving it for the first time, do
not call this function.  Instead, use something similar to this:

=== /C code/
>
>if (document_is_new)
>  {
>    // the user just created a new document
>    gtk_file_chooser_set_current_name (chooser, "Untitled document");
>  }
>else
>  {
>    // the user edited an existing document
>    gtk_file_chooser_set_uri (chooser, existing_uri);
>  }



In the first case, the file chooser will present the user with useful suggestions
as to where to save his new file.  In the second case, the file’s existing location
is already known, so the file chooser will use it.

/Since: 2.4/
-}
fileChooserSetUri ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> T.Text
    {- ^ /@uri@/: the URI to set as current -}
    -> m Bool
    {- ^ __Returns:__ Not useful. -}
fileChooserSetUri chooser uri = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    uri' <- textToCString uri
    result <- gtk_file_chooser_set_uri chooser' uri'
    let result' = (/= 0) result
    touchManagedPtr chooser
    freeMem uri'
    return result'

#if ENABLE_OVERLOADING
data FileChooserSetUriMethodInfo
instance (signature ~ (T.Text -> m Bool), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserSetUriMethodInfo a signature where
    overloadedMethod _ = fileChooserSetUri

#endif

-- method FileChooser::set_use_preview_label
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "use_label", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "whether to display a stock label with the name of the previewed file", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_file_chooser_set_use_preview_label" gtk_file_chooser_set_use_preview_label ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    CInt ->                                 -- use_label : TBasicType TBoolean
    IO ()

{- |
Sets whether the file chooser should display a stock label with the name of
the file that is being previewed; the default is 'True'.  Applications that
want to draw the whole preview area themselves should set this to 'False' and
display the name themselves in their preview widget.

See also: 'GI.Gtk.Interfaces.FileChooser.fileChooserSetPreviewWidget'

/Since: 2.4/
-}
fileChooserSetUsePreviewLabel ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> Bool
    {- ^ /@useLabel@/: whether to display a stock label with the name of the previewed file -}
    -> m ()
fileChooserSetUsePreviewLabel chooser useLabel = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    let useLabel' = (fromIntegral . fromEnum) useLabel
    gtk_file_chooser_set_use_preview_label chooser' useLabel'
    touchManagedPtr chooser
    return ()

#if ENABLE_OVERLOADING
data FileChooserSetUsePreviewLabelMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserSetUsePreviewLabelMethodInfo a signature where
    overloadedMethod _ = fileChooserSetUsePreviewLabel

#endif

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

foreign import ccall "gtk_file_chooser_unselect_all" gtk_file_chooser_unselect_all ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    IO ()

{- |
Unselects all the files in the current folder of a file chooser.

/Since: 2.4/
-}
fileChooserUnselectAll ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> m ()
fileChooserUnselectAll chooser = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    gtk_file_chooser_unselect_all chooser'
    touchManagedPtr chooser
    return ()

#if ENABLE_OVERLOADING
data FileChooserUnselectAllMethodInfo
instance (signature ~ (m ()), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserUnselectAllMethodInfo a signature where
    overloadedMethod _ = fileChooserUnselectAll

#endif

-- method FileChooser::unselect_file
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "file", argType = TInterface (Name {namespace = "Gio", name = "File"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GFile", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_file_chooser_unselect_file" gtk_file_chooser_unselect_file ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    Ptr Gio.File.File ->                    -- file : TInterface (Name {namespace = "Gio", name = "File"})
    IO ()

{- |
Unselects the file referred to by /@file@/. If the file is not in the current
directory, does not exist, or is otherwise not currently selected, does nothing.

/Since: 2.14/
-}
fileChooserUnselectFile ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a, Gio.File.IsFile b) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> b
    {- ^ /@file@/: a 'GI.Gio.Interfaces.File.File' -}
    -> m ()
fileChooserUnselectFile chooser file = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    file' <- unsafeManagedPtrCastPtr file
    gtk_file_chooser_unselect_file chooser' file'
    touchManagedPtr chooser
    touchManagedPtr file
    return ()

#if ENABLE_OVERLOADING
data FileChooserUnselectFileMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsFileChooser a, Gio.File.IsFile b) => O.MethodInfo FileChooserUnselectFileMethodInfo a signature where
    overloadedMethod _ = fileChooserUnselectFile

#endif

-- method FileChooser::unselect_filename
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "filename", argType = TBasicType TFileName, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the filename to unselect", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_file_chooser_unselect_filename" gtk_file_chooser_unselect_filename ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    CString ->                              -- filename : TBasicType TFileName
    IO ()

{- |
Unselects a currently selected filename. If the filename
is not in the current directory, does not exist, or
is otherwise not currently selected, does nothing.

/Since: 2.4/
-}
fileChooserUnselectFilename ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> [Char]
    {- ^ /@filename@/: the filename to unselect -}
    -> m ()
fileChooserUnselectFilename chooser filename = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    filename' <- stringToCString filename
    gtk_file_chooser_unselect_filename chooser' filename'
    touchManagedPtr chooser
    freeMem filename'
    return ()

#if ENABLE_OVERLOADING
data FileChooserUnselectFilenameMethodInfo
instance (signature ~ ([Char] -> m ()), MonadIO m, IsFileChooser a) => O.MethodInfo FileChooserUnselectFilenameMethodInfo a signature where
    overloadedMethod _ = fileChooserUnselectFilename

#endif

-- method FileChooser::unselect_uri
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "Gtk", name = "FileChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkFileChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "uri", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the URI to unselect", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_file_chooser_unselect_uri" gtk_file_chooser_unselect_uri ::
    Ptr FileChooser ->                      -- chooser : TInterface (Name {namespace = "Gtk", name = "FileChooser"})
    CString ->                              -- uri : TBasicType TUTF8
    IO ()

{- |
Unselects the file referred to by /@uri@/. If the file
is not in the current directory, does not exist, or
is otherwise not currently selected, does nothing.

/Since: 2.4/
-}
fileChooserUnselectUri ::
    (B.CallStack.HasCallStack, MonadIO m, IsFileChooser a) =>
    a
    {- ^ /@chooser@/: a 'GI.Gtk.Interfaces.FileChooser.FileChooser' -}
    -> T.Text
    {- ^ /@uri@/: the URI to unselect -}
    -> m ()
fileChooserUnselectUri chooser uri = liftIO $ do
    chooser' <- unsafeManagedPtrCastPtr chooser
    uri' <- textToCString uri
    gtk_file_chooser_unselect_uri chooser' uri'
    touchManagedPtr chooser
    freeMem uri'
    return ()

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

#endif