<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
]>
<!--ENTITY index-Objects-Grouped SYSTEM "objects_grouped.sgml"-->
<refentry id="GtkFileChooser">
<refmeta>
<refentrytitle role="top_of_page" id="GtkFileChooser.top_of_page">GtkFileChooser</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GtkFileChooser</refname>
<refpurpose>File chooser interface used by GtkFileChooserWidget and GtkFileChooserDialog</refpurpose>
</refnamediv>

<refsynopsisdiv id="GtkFileChooser.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>

#include &lt;gtk/gtk.h&gt;

                    <link linkend="GtkFileChooser-struct">GtkFileChooser</link>;
enum                <link linkend="GtkFileChooserAction">GtkFileChooserAction</link>;
enum                <link linkend="GtkFileChooserConfirmation">GtkFileChooserConfirmation</link>;
#define             <link linkend="GTK-FILE-CHOOSER-ERROR--CAPS">GTK_FILE_CHOOSER_ERROR</link>
enum                <link linkend="GtkFileChooserError">GtkFileChooserError</link>;
<link linkend="void">void</link>                <link linkend="gtk-file-chooser-set-action">gtk_file_chooser_set_action</link>         (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="GtkFileChooserAction">GtkFileChooserAction</link> action);
<link linkend="GtkFileChooserAction">GtkFileChooserAction</link>  <link linkend="gtk-file-chooser-get-action">gtk_file_chooser_get_action</link>       (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
<link linkend="void">void</link>                <link linkend="gtk-file-chooser-set-local-only">gtk_file_chooser_set_local_only</link>     (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="gboolean">gboolean</link> local_only);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-file-chooser-get-local-only">gtk_file_chooser_get_local_only</link>     (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
<link linkend="void">void</link>                <link linkend="gtk-file-chooser-set-select-multiple">gtk_file_chooser_set_select_multiple</link>
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="gboolean">gboolean</link> select_multiple);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-file-chooser-get-select-multiple">gtk_file_chooser_get_select_multiple</link>
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
<link linkend="void">void</link>                <link linkend="gtk-file-chooser-set-show-hidden">gtk_file_chooser_set_show_hidden</link>    (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="gboolean">gboolean</link> show_hidden);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-file-chooser-get-show-hidden">gtk_file_chooser_get_show_hidden</link>    (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
<link linkend="void">void</link>                <link linkend="gtk-file-chooser-set-do-overwrite-confirmation">gtk_file_chooser_set_do_overwrite_confirmation</link>
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="gboolean">gboolean</link> do_overwrite_confirmation);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-file-chooser-get-do-overwrite-confirmation">gtk_file_chooser_get_do_overwrite_confirmation</link>
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
<link linkend="void">void</link>                <link linkend="gtk-file-chooser-set-create-folders">gtk_file_chooser_set_create_folders</link> (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="gboolean">gboolean</link> create_folders);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-file-chooser-get-create-folders">gtk_file_chooser_get_create_folders</link> (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
<link linkend="void">void</link>                <link linkend="gtk-file-chooser-set-current-name">gtk_file_chooser_set_current_name</link>   (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         const <link linkend="gchar">gchar</link> *name);
<link linkend="gchar">gchar</link> *             <link linkend="gtk-file-chooser-get-filename">gtk_file_chooser_get_filename</link>       (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-file-chooser-set-filename">gtk_file_chooser_set_filename</link>       (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         const <link linkend="char">char</link> *filename);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-file-chooser-select-filename">gtk_file_chooser_select_filename</link>    (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         const <link linkend="char">char</link> *filename);
<link linkend="void">void</link>                <link linkend="gtk-file-chooser-unselect-filename">gtk_file_chooser_unselect_filename</link>  (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         const <link linkend="char">char</link> *filename);
<link linkend="void">void</link>                <link linkend="gtk-file-chooser-select-all">gtk_file_chooser_select_all</link>         (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
<link linkend="void">void</link>                <link linkend="gtk-file-chooser-unselect-all">gtk_file_chooser_unselect_all</link>       (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
<link linkend="GSList">GSList</link> *            <link linkend="gtk-file-chooser-get-filenames">gtk_file_chooser_get_filenames</link>      (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-file-chooser-set-current-folder">gtk_file_chooser_set_current_folder</link> (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         const <link linkend="gchar">gchar</link> *filename);
<link linkend="gchar">gchar</link> *             <link linkend="gtk-file-chooser-get-current-folder">gtk_file_chooser_get_current_folder</link> (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
<link linkend="gchar">gchar</link> *             <link linkend="gtk-file-chooser-get-uri">gtk_file_chooser_get_uri</link>            (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-file-chooser-set-uri">gtk_file_chooser_set_uri</link>            (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         const <link linkend="char">char</link> *uri);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-file-chooser-select-uri">gtk_file_chooser_select_uri</link>         (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         const <link linkend="char">char</link> *uri);
<link linkend="void">void</link>                <link linkend="gtk-file-chooser-unselect-uri">gtk_file_chooser_unselect_uri</link>       (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         const <link linkend="char">char</link> *uri);
<link linkend="GSList">GSList</link> *            <link linkend="gtk-file-chooser-get-uris">gtk_file_chooser_get_uris</link>           (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-file-chooser-set-current-folder-uri">gtk_file_chooser_set_current_folder_uri</link>
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         const <link linkend="gchar">gchar</link> *uri);
<link linkend="gchar">gchar</link> *             <link linkend="gtk-file-chooser-get-current-folder-uri">gtk_file_chooser_get_current_folder_uri</link>
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
<link linkend="void">void</link>                <link linkend="gtk-file-chooser-set-preview-widget">gtk_file_chooser_set_preview_widget</link> (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="GtkWidget">GtkWidget</link> *preview_widget);
<link linkend="GtkWidget">GtkWidget</link> *         <link linkend="gtk-file-chooser-get-preview-widget">gtk_file_chooser_get_preview_widget</link> (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
<link linkend="void">void</link>                <link linkend="gtk-file-chooser-set-preview-widget-active">gtk_file_chooser_set_preview_widget_active</link>
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="gboolean">gboolean</link> active);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-file-chooser-get-preview-widget-active">gtk_file_chooser_get_preview_widget_active</link>
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
<link linkend="void">void</link>                <link linkend="gtk-file-chooser-set-use-preview-label">gtk_file_chooser_set_use_preview_label</link>
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="gboolean">gboolean</link> use_label);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-file-chooser-get-use-preview-label">gtk_file_chooser_get_use_preview_label</link>
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
<link linkend="char">char</link> *              <link linkend="gtk-file-chooser-get-preview-filename">gtk_file_chooser_get_preview_filename</link>
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
<link linkend="char">char</link> *              <link linkend="gtk-file-chooser-get-preview-uri">gtk_file_chooser_get_preview_uri</link>    (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
<link linkend="void">void</link>                <link linkend="gtk-file-chooser-set-extra-widget">gtk_file_chooser_set_extra_widget</link>   (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="GtkWidget">GtkWidget</link> *extra_widget);
<link linkend="GtkWidget">GtkWidget</link> *         <link linkend="gtk-file-chooser-get-extra-widget">gtk_file_chooser_get_extra_widget</link>   (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
<link linkend="void">void</link>                <link linkend="gtk-file-chooser-add-filter">gtk_file_chooser_add_filter</link>         (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="GtkFileFilter">GtkFileFilter</link> *filter);
<link linkend="void">void</link>                <link linkend="gtk-file-chooser-remove-filter">gtk_file_chooser_remove_filter</link>      (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="GtkFileFilter">GtkFileFilter</link> *filter);
<link linkend="GSList">GSList</link> *            <link linkend="gtk-file-chooser-list-filters">gtk_file_chooser_list_filters</link>       (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
<link linkend="void">void</link>                <link linkend="gtk-file-chooser-set-filter">gtk_file_chooser_set_filter</link>         (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="GtkFileFilter">GtkFileFilter</link> *filter);
<link linkend="GtkFileFilter">GtkFileFilter</link> *     <link linkend="gtk-file-chooser-get-filter">gtk_file_chooser_get_filter</link>         (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-file-chooser-add-shortcut-folder">gtk_file_chooser_add_shortcut_folder</link>
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         const <link linkend="char">char</link> *folder,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-file-chooser-remove-shortcut-folder">gtk_file_chooser_remove_shortcut_folder</link>
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         const <link linkend="char">char</link> *folder,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="GSList">GSList</link> *            <link linkend="gtk-file-chooser-list-shortcut-folders">gtk_file_chooser_list_shortcut_folders</link>
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-file-chooser-add-shortcut-folder-uri">gtk_file_chooser_add_shortcut_folder_uri</link>
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         const <link linkend="char">char</link> *uri,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-file-chooser-remove-shortcut-folder-uri">gtk_file_chooser_remove_shortcut_folder_uri</link>
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         const <link linkend="char">char</link> *uri,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="GSList">GSList</link> *            <link linkend="gtk-file-chooser-list-shortcut-folder-uris">gtk_file_chooser_list_shortcut_folder_uris</link>
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
<link linkend="GFile">GFile</link> *             <link linkend="gtk-file-chooser-get-current-folder-file">gtk_file_chooser_get_current_folder_file</link>
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
<link linkend="GFile">GFile</link> *             <link linkend="gtk-file-chooser-get-file">gtk_file_chooser_get_file</link>           (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
<link linkend="GSList">GSList</link> *            <link linkend="gtk-file-chooser-get-files">gtk_file_chooser_get_files</link>          (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
<link linkend="GFile">GFile</link> *             <link linkend="gtk-file-chooser-get-preview-file">gtk_file_chooser_get_preview_file</link>   (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-file-chooser-select-file">gtk_file_chooser_select_file</link>        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="GFile">GFile</link> *file,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-file-chooser-set-current-folder-file">gtk_file_chooser_set_current_folder_file</link>
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="GFile">GFile</link> *file,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-file-chooser-set-file">gtk_file_chooser_set_file</link>           (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="GFile">GFile</link> *file,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="void">void</link>                <link linkend="gtk-file-chooser-unselect-file">gtk_file_chooser_unselect_file</link>      (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="GFile">GFile</link> *file);
</synopsis>
</refsynopsisdiv>

<refsect1 id="GtkFileChooser.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GInterface">GInterface</link>
   +----GtkFileChooser
</synopsis>
</refsect1>

<refsect1 id="GtkFileChooser.prerequisites" role="prerequisites">
<title role="prerequisites.title">Prerequisites</title>
<para>
GtkFileChooser requires
 <link linkend="GtkWidget">GtkWidget</link>.</para>
</refsect1>



<refsect1 id="GtkFileChooser.implementations" role="implementations">
<title role="implementations.title">Known Implementations</title>
<para>
GtkFileChooser is implemented by
 <link linkend="GtkFileChooserButton">GtkFileChooserButton</link>,  <link linkend="GtkFileChooserWidget">GtkFileChooserWidget</link> and  <link linkend="GtkFileChooserDialog">GtkFileChooserDialog</link>.</para>
</refsect1>

<refsect1 id="GtkFileChooser.properties" role="properties">
<title role="properties.title">Properties</title>
<synopsis>
  &quot;<link linkend="GtkFileChooser--action">action</link>&quot;                   <link linkend="GtkFileChooserAction">GtkFileChooserAction</link>  : Read / Write
  &quot;<link linkend="GtkFileChooser--create-folders">create-folders</link>&quot;           <link linkend="gboolean">gboolean</link>              : Read / Write
  &quot;<link linkend="GtkFileChooser--do-overwrite-confirmation">do-overwrite-confirmation</link>&quot; <link linkend="gboolean">gboolean</link>              : Read / Write
  &quot;<link linkend="GtkFileChooser--extra-widget">extra-widget</link>&quot;             <link linkend="GtkWidget">GtkWidget</link>*            : Read / Write
  &quot;<link linkend="GtkFileChooser--file-system-backend">file-system-backend</link>&quot;      <link linkend="gchar">gchar</link>*                : Write / Construct Only
  &quot;<link linkend="GtkFileChooser--filter">filter</link>&quot;                   <link linkend="GtkFileFilter">GtkFileFilter</link>*        : Read / Write
  &quot;<link linkend="GtkFileChooser--local-only">local-only</link>&quot;               <link linkend="gboolean">gboolean</link>              : Read / Write
  &quot;<link linkend="GtkFileChooser--preview-widget">preview-widget</link>&quot;           <link linkend="GtkWidget">GtkWidget</link>*            : Read / Write
  &quot;<link linkend="GtkFileChooser--preview-widget-active">preview-widget-active</link>&quot;    <link linkend="gboolean">gboolean</link>              : Read / Write
  &quot;<link linkend="GtkFileChooser--select-multiple">select-multiple</link>&quot;          <link linkend="gboolean">gboolean</link>              : Read / Write
  &quot;<link linkend="GtkFileChooser--show-hidden">show-hidden</link>&quot;              <link linkend="gboolean">gboolean</link>              : Read / Write
  &quot;<link linkend="GtkFileChooser--use-preview-label">use-preview-label</link>&quot;        <link linkend="gboolean">gboolean</link>              : Read / Write
</synopsis>
</refsect1>

<refsect1 id="GtkFileChooser.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<synopsis>
  &quot;<link linkend="GtkFileChooser-confirm-overwrite">confirm-overwrite</link>&quot;                              : Run Last
  &quot;<link linkend="GtkFileChooser-current-folder-changed">current-folder-changed</link>&quot;                         : Run Last
  &quot;<link linkend="GtkFileChooser-file-activated">file-activated</link>&quot;                                 : Run Last
  &quot;<link linkend="GtkFileChooser-selection-changed">selection-changed</link>&quot;                              : Run Last
  &quot;<link linkend="GtkFileChooser-update-preview">update-preview</link>&quot;                                 : Run Last
</synopsis>
</refsect1>


<refsect1 id="GtkFileChooser.description" role="desc">
<title role="desc.title">Description</title>
    <para>
      <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link> is an interface that can be implemented by file
      selection widgets.  In GTK+, the main objects that implement this
      interface are <link linkend="GtkFileChooserWidget"><type>GtkFileChooserWidget</type></link>, <link linkend="GtkFileChooserDialog"><type>GtkFileChooserDialog</type></link>, and
      <link linkend="GtkFileChooserButton"><type>GtkFileChooserButton</type></link>.  You do not need to write an object that
      implements the <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link> interface unless you are trying to
      adapt an existing file selector to expose a standard programming
      interface.
    </para>
    <para>
      <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link> 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 taht these shortcuts come from various
      sources and in various flavours, so lets explain the terminology here:
    </para>
      <variablelist>
         <varlistentry>
           <term>Bookmarks</term>
           <listitem><para>
             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.
           </para></listitem>
         </varlistentry>
         <varlistentry>
           <term>Shortcuts</term>
           <listitem><para>
             can be provided by the application or by the underlying filesystem
             abstraction (e.g. both the gnome-vfs and the Windows filesystems
             provide "Desktop" shortcuts). Shortcuts cannot be modified by the
             user.
           </para></listitem>
         </varlistentry>
         <varlistentry>
           <term>Volumes</term>
           <listitem><para>
             are provided by the underlying filesystem abstraction. They are
             the "roots" of the filesystem.
           </para></listitem>
         </varlistentry>
      </variablelist>
    <refsect2 id="gtkfilechooser-encodings">
      <title>File Names and Encodings</title>
      <para>
	When the user is finished selecting files in a
	<link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>, 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 <emphasis>always</emphasis> returned in
	the character set specified by the
	<envar>G_FILENAME_ENCODING</envar> environment variable.
	Please see the Glib documentation for more details about this
	variable.
      </para>
      <important>
	<para>
	  This means that while you can pass the result of
	  <link linkend="gtk-file-chooser-get-filename"><function>gtk_file_chooser_get_filename()</function></link> to
	  <function>open(2)</function> or
	  <function>fopen(3)</function>, you may not be able to
	  directly set it as the text of a <link linkend="GtkLabel"><type>GtkLabel</type></link> widget unless you
	  convert it first to UTF-8, which all GTK+ widgets expect.
	  You should use <link linkend="g-filename-to-utf8"><function>g_filename_to_utf8()</function></link> to convert filenames
	  into strings that can be passed to GTK+ widgets.
	</para>
      </important>
    </refsect2>
    <refsect2 id="gtkfilechooser-preview">
      <title>Adding a Preview Widget</title>
      <para>
	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
	<link linkend="gtk-file-chooser-set-preview-widget"><function>gtk_file_chooser_set_preview_widget()</function></link>.  Then, connect to the
	<link linkend="GtkFileChooser-update-preview"><type>"update-preview"</type></link> signal to get notified when
	you need to update the contents of the preview.
      </para>
      <para>
	Your callback should use
	<link linkend="gtk-file-chooser-get-preview-filename"><function>gtk_file_chooser_get_preview_filename()</function></link> to see what needs
	previewing.  Once you have generated the preview for the
	corresponding file, you must call
	<link linkend="gtk-file-chooser-set-preview-widget-active"><function>gtk_file_chooser_set_preview_widget_active()</function></link> with a boolean
	flag that indicates whether your callback could successfully
	generate a preview.
      </para>
      <example id="example-gtkfilechooser-preview">
	<title>Sample Usage</title>
	<programlisting>
{
  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);
}
	</programlisting>
      </example>
    </refsect2>
    <refsect2 id="gtkfilechooser-extra">
      <title>Adding Extra Widgets</title>
      <para>
	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
	<link linkend="gtk-file-chooser-set-extra-widget"><function>gtk_file_chooser_set_extra_widget()</function></link> to insert additional
	widgets in a file chooser.
      </para>
      <example id="example-gtkfilechooser-extra">
	<title>Sample Usage</title>
	<programlisting>
{
  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);
}
	</programlisting>
      </example>
      <note>
	<para>
	  If you want to set more than one extra widget in the file
	  chooser, you can a container such as a GtkVBox or a GtkTable
	  and include your widgets in it.  Then, set the container as
	  the whole extra widget.
	</para>
      </note>
    </refsect2>
    <refsect2 id="gtkfilechooser-key-bindings">
      <title>Key Bindings</title>
      <para>
	Internally, GTK+ implements a file chooser's graphical user
	interface with the private
	<classname>GtkFileChooserDefaultClass</classname>.  This
	widget has several <link linkend="gtk-Bindings">key
	bindings</link> and their associated signals.  This section
	describes the available key binding signals.
      </para>
      <example id="gtkfilechooser-key-binding-example">
	<title>GtkFileChooser key binding example</title>
	<para>
	  The default keys that activate the key-binding signals in
	  <classname>GtkFileChooserDefaultClass</classname> are as
	  follows:
	</para>
	<informaltable>
	  <tgroup cols="2">
	    <tbody>
	      <row>
		<entry>Signal name</entry>
		<entry>Default key combinations</entry>
	      </row>
	      <row>
		<entry>location-popup</entry>
		<entry>
		  <keycombo><keycap>Control</keycap><keycap>L</keycap></keycombo> (empty path);
		  <keycap>/</keycap> (path of "/")<footnote>
		    <para>
		      Both the individual <keycap>/</keycap> key and the
		      numeric keypad's "divide" key are supported.
		    </para>
		  </footnote>;
		  <keycap>~</keycap> (path of "~")
		</entry>
	      </row>
	      <row>
		<entry>up-folder</entry>
		<entry>
		  <keycombo><keycap>Alt</keycap><keycap>Up</keycap></keycombo><footnote>
		    <para>
		      Both the individual Up key and the numeric
		      keypad's Up key are supported.
		    </para>
		  </footnote>
		  ;
		  <keycap>Backspace</keycap>
		</entry>
	      </row>
	      <row>
		<entry>down-folder</entry>
		<entry><keycombo><keycap>Alt</keycap><keycap>Down</keycap></keycombo></entry>
	      </row>
	      <row>
		<entry>home-folder</entry>
		<entry><keycombo><keycap>Alt</keycap><keycap>Home</keycap></keycombo></entry>
	      </row>
	      <row>
		<entry>desktop-folder</entry>
		<entry><keycombo><keycap>Alt</keycap><keycap>D</keycap></keycombo></entry>
	      </row>
	      <row>
		<entry>quick-bookmark</entry>
		<entry><keycombo><keycap>Alt</keycap><keycap>1</keycap></keycombo> through <keycombo><keycap>Alt</keycap><keycap>0</keycap></keycombo></entry>
	      </row>
	    </tbody>
	  </tgroup>
	</informaltable>
	<para>
	  You can change these defaults to something else.  For
	  example, to add a <keycap>Shift</keycap> modifier to a few
	  of the default bindings, you can include the following
	  fragment in your <filename>.gtkrc-2.0</filename> file:
	</para>
	<programlisting>
binding "my-own-gtkfilechooser-bindings" {
	bind "&lt;Alt&gt;&lt;Shift&gt;Up" {
		"up-folder" ()
	}
	bind "&lt;Alt&gt;&lt;Shift&gt;Down" {
		"down-folder" ()
	}
	bind "&lt;Alt&gt;&lt;Shift&gt;Home" {
		"home-folder" ()
	}
}
class "GtkFileChooserDefault" binding "my-own-gtkfilechooser-bindings"
	</programlisting>
      </example>
      <refsect3 id="GtkFileChooserDefault-location-popup">
	<title>The &quot;GtkFileChooserDefault::location-popup&quot; signal</title>
	<programlisting>
          void user_function (GtkFileChooserDefault *chooser,
                              const char            *path,
                              <link linkend="gpointer">gpointer</link> user_data);
	</programlisting>
	<para>
	  This is used to make the file chooser show a "Location"
	  dialog which the user can use to manually type the name of
	  the file he wishes to select.  The
	  <parameter>path</parameter> argument is a string that gets
	  put in the text entry for the file name.  By default this is bound to
	  <keycombo><keycap>Control</keycap><keycap>L</keycap></keycombo>
	  with a <parameter>path</parameter> string of "" (the empty
	  string).  It is also bound to <keycap>/</keycap> with a
	  <parameter>path</parameter> string of "<literal>/</literal>"
	  (a slash):  this lets you type <keycap>/</keycap> and
	  immediately type a path name.  On Unix systems, this is bound to
	  <keycap>~</keycap> (tilde) with a <parameter>path</parameter> string
	  of "~" itself for access to home directories.
	</para>
	<variablelist role="params">
	  <varlistentry>
	    <term><parameter>chooser</parameter>&nbsp;:</term>
	    <listitem>
	      <simpara>
		the object which received the signal.
	      </simpara>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <term><parameter>path</parameter>&nbsp;:</term>
	    <listitem>
	      <simpara>
		default contents for the text entry for the file name
	      </simpara>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <term><parameter>user_data</parameter>&nbsp;:</term>
	    <listitem>
	      <simpara>
		user data set when the signal handler was connected.
	      </simpara>
	    </listitem>
	  </varlistentry>
	</variablelist>
	<tip>
	  <para>
	    You can create your own bindings for the
	    <symbol>location-popup</symbol> signal with custom
	    <parameter>path</parameter> strings, and have a crude form
	    of easily-to-type bookmarks.  For example, say you access
	    the path <filename>/home/username/misc</filename> very
	    frequently.  You could then create an <keycombo>
	    <keycap>Alt</keycap> <keycap>M</keycap> </keycombo>
	    shortcut by including the following in your
	    <filename>.gtkrc-2.0</filename>:
	  </para>
	  <programlisting>
binding "misc-shortcut" {
	bind "&lt;Alt&gt;M" {
		"location-popup" ("/home/username/misc")
	}
}
class "GtkFileChooserDefault" binding "misc-shortcut"
	  </programlisting>
	</tip>
      </refsect3>
      <refsect3 id="GtkFileChooserDefault-up-folder">
	<title>The &quot;GtkFileChooserDefault::up-folder&quot; signal</title>
	<programlisting>
          void user_function (GtkFileChooserDefault *chooser,
                              <link linkend="gpointer">gpointer</link> user_data);
	</programlisting>
	<para>
	  This is used to make the file chooser go to the parent of
	  the current folder in the file hierarchy.  By default this
	  is bound to <keycap>Backspace</keycap> and
	  <keycombo><keycap>Alt</keycap><keycap>Up</keycap></keycombo>
	  (the Up key in the numeric keypad also works).
	</para>
	<variablelist role="params">
	  <varlistentry>
	    <term><parameter>chooser</parameter>&nbsp;:</term>
	    <listitem>
	      <simpara>
		the object which received the signal.
	      </simpara>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <term><parameter>user_data</parameter>&nbsp;:</term>
	    <listitem>
	      <simpara>
		user data set when the signal handler was connected.
	      </simpara>
	    </listitem>
	  </varlistentry>
	</variablelist>
      </refsect3>
      <refsect3 id="GtkFileChooserDefault-down-folder">
	<title>The &quot;GtkFileChooserDefault::down-folder&quot; signal</title>
	<programlisting>
          void user_function (GtkFileChooserDefault *chooser,
                              <link linkend="gpointer">gpointer</link> user_data);
	</programlisting>
	<para>
	  This is used to make the file chooser go to a child of the
	  current folder in the file hierarchy.  The subfolder that
	  will be used is displayed in the path bar widget of the file
	  chooser.  For example, if the path bar is showing
	  "/foo/<emphasis>bar/</emphasis>baz", then this will cause
	  the file chooser to switch to the "baz" subfolder.  By
	  default this is bound to
	  <keycombo><keycap>Alt</keycap><keycap>Down</keycap></keycombo>
	  (the Down key in the numeric keypad also works).
	</para>
	<variablelist role="params">
	  <varlistentry>
	    <term><parameter>chooser</parameter>&nbsp;:</term>
	    <listitem>
	      <simpara>
		the object which received the signal.
	      </simpara>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <term><parameter>user_data</parameter>&nbsp;:</term>
	    <listitem>
	      <simpara>
		user data set when the signal handler was connected.
	      </simpara>
	    </listitem>
	  </varlistentry>
	</variablelist>
      </refsect3>
      <refsect3 id="GtkFileChooserDefault-home-folder">
	<title>The &quot;GtkFileChooserDefault::home-folder&quot; signal</title>
	<programlisting>
          void user_function (GtkFileChooserDefault *chooser,
                              <link linkend="gpointer">gpointer</link> user_data);
	</programlisting>
	<para>
	  This is used to make the file chooser show the user's home
	  folder in the file list.  By default this is bound to
	  <keycombo><keycap>Alt</keycap><keycap>Home</keycap></keycombo>
	  (the Home key in the numeric keypad also works).
	</para>
	<variablelist role="params">
	  <varlistentry>
	    <term><parameter>chooser</parameter>&nbsp;:</term>
	    <listitem>
	      <simpara>
		the object which received the signal.
	      </simpara>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <term><parameter>user_data</parameter>&nbsp;:</term>
	    <listitem>
	      <simpara>
		user data set when the signal handler was connected.
	      </simpara>
	    </listitem>
	  </varlistentry>
	</variablelist>
      </refsect3>
      <refsect3 id="GtkFileChooserDefault-desktop-folder">
	<title>The &quot;GtkFileChooserDefault::desktop-folder&quot; signal</title>
	<programlisting>
          void user_function (GtkFileChooserDefault *chooser,
                              <link linkend="gpointer">gpointer</link> user_data);
	</programlisting>
	<para>
	  This is used to make the file chooser show the user's Desktop
	  folder in the file list.  By default this is bound to
	  <keycombo><keycap>Alt</keycap><keycap>D</keycap></keycombo>.
	</para>
	<variablelist role="params">
	  <varlistentry>
	    <term><parameter>chooser</parameter>&nbsp;:</term>
	    <listitem>
	      <simpara>
		the object which received the signal.
	      </simpara>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <term><parameter>user_data</parameter>&nbsp;:</term>
	    <listitem>
	      <simpara>
		user data set when the signal handler was connected.
	      </simpara>
	    </listitem>
	  </varlistentry>
	</variablelist>
      </refsect3>
      <refsect3 id="GtkFileChooserDefault-quick-bookmark">
	<title>The &quot;GtkFileChooserDefault::quick-bookmark&quot; signal</title>
	<programlisting>
          void user_function (GtkFileChooserDefault *chooser,
                              gint bookmark_index,
                              <link linkend="gpointer">gpointer</link> user_data);
	</programlisting>
	<para>
	  This is used to make the file chooser switch to the bookmark
	  specified in the <parameter>bookmark_index</parameter> parameter.
	  For example, if you have three bookmarks, you can pass 0, 1, 2 to
	  this signal to switch to each of them, respectively.  By default this is bound to
	  <keycombo><keycap>Alt</keycap><keycap>1</keycap></keycombo>,
	  <keycombo><keycap>Alt</keycap><keycap>2</keycap></keycombo>,
	  etc. until
	  <keycombo><keycap>Alt</keycap><keycap>0</keycap></keycombo>.  Note
	  that in the default binding,
	  that <keycombo><keycap>Alt</keycap><keycap>1</keycap></keycombo> is
	  actually defined to switch to the bookmark at index 0, and so on
	  successively;
	  <keycombo><keycap>Alt</keycap><keycap>0</keycap></keycombo> is
	  defined to switch to the bookmark at index 10.
	</para>
	<variablelist role="params">
	  <varlistentry>
	    <term><parameter>chooser</parameter>&nbsp;:</term>
	    <listitem>
	      <simpara>
		the object which received the signal.
	      </simpara>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <term><parameter>bookmark_indes</parameter>&nbsp;:</term>
	    <listitem>
	      <simpara>
		index of the bookmark to switch to; the indices start at 0.
	      </simpara>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <term><parameter>user_data</parameter>&nbsp;:</term>
	    <listitem>
	      <simpara>
		user data set when the signal handler was connected.
	      </simpara>
	    </listitem>
	  </varlistentry>
	</variablelist>
      </refsect3>
    </refsect2>
</refsect1>

<refsect1 id="GtkFileChooser.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GtkFileChooser-struct" role="struct">
<title>GtkFileChooser</title>
<indexterm zone="GtkFileChooser-struct"><primary sortas="FileChooser">GtkFileChooser</primary></indexterm><programlisting>typedef struct _GtkFileChooser GtkFileChooser;</programlisting>
<para>
</para></refsect2>
<refsect2 id="GtkFileChooserAction" role="enum">
<title>enum GtkFileChooserAction</title>
<indexterm zone="GtkFileChooserAction"><primary sortas="FileChooserAction">GtkFileChooserAction</primary></indexterm><programlisting>typedef enum
{
  GTK_FILE_CHOOSER_ACTION_OPEN,
  GTK_FILE_CHOOSER_ACTION_SAVE,
  GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
  GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER
} GtkFileChooserAction;
</programlisting>
    <para>
      Describes whether a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link> is being used to open
      existing files or to save to a possibly new file.
    </para><variablelist role="enum">
<varlistentry id="GTK-FILE-CHOOSER-ACTION-OPEN--CAPS" role="constant">
<term><literal>GTK_FILE_CHOOSER_ACTION_OPEN</literal></term>
<listitem><simpara>Indicates open mode.  The file chooser
    will only let the user pick an existing file.
</simpara></listitem>
</varlistentry>
<varlistentry id="GTK-FILE-CHOOSER-ACTION-SAVE--CAPS" role="constant">
<term><literal>GTK_FILE_CHOOSER_ACTION_SAVE</literal></term>
<listitem><simpara>Indicates save mode.  The file chooser
    will let the user pick an existing file, or type in a new
    filename.
</simpara></listitem>
</varlistentry>
<varlistentry id="GTK-FILE-CHOOSER-ACTION-SELECT-FOLDER--CAPS" role="constant">
<term><literal>GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</literal></term>
<listitem><simpara>Indicates an Open mode for
    selecting folders.  The file chooser will let the user pick an
    existing folder.
</simpara></listitem>
</varlistentry>
<varlistentry id="GTK-FILE-CHOOSER-ACTION-CREATE-FOLDER--CAPS" role="constant">
<term><literal>GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER</literal></term>
<listitem><simpara>Indicates a mode for creating a
    new folder.  The file chooser will let the user name an existing or
    new folder.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="GtkFileChooserConfirmation" role="enum">
<title>enum GtkFileChooserConfirmation</title>
<indexterm zone="GtkFileChooserConfirmation"><primary sortas="FileChooserConfirmation">GtkFileChooserConfirmation</primary></indexterm><programlisting>typedef enum
{
  GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM,
  GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME,
  GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN
} GtkFileChooserConfirmation;
</programlisting>
    <para>
      Used as a return value of handlers for the <link
      linkend="GtkFileChooser-confirm-overwrite">confirm-overwrite</link>
      signal of a <classname>GtkFileChooser</classname>.  This value
      determines whether the file chooser will present the stock
      confirmation dialog, accept the user's choice of a filename, or
      let the user choose another filename.
    </para><variablelist role="enum">
<varlistentry id="GTK-FILE-CHOOSER-CONFIRMATION-CONFIRM--CAPS" role="constant">
<term><literal>GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM</literal></term>
<listitem><simpara>The file chooser will present
    its stock dialog to confirm about overwriting an existing file.
</simpara></listitem>
</varlistentry>
<varlistentry id="GTK-FILE-CHOOSER-CONFIRMATION-ACCEPT-FILENAME--CAPS" role="constant">
<term><literal>GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME</literal></term>
<listitem><simpara>The file chooser will
    terminate and accept the user's choice of a file name.
</simpara></listitem>
</varlistentry>
<varlistentry id="GTK-FILE-CHOOSER-CONFIRMATION-SELECT-AGAIN--CAPS" role="constant">
<term><literal>GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN</literal></term>
<listitem><simpara>The file chooser will
    continue running, so as to let the user select another file name.
    <para>
      Since 2.8
    </para>
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="GTK-FILE-CHOOSER-ERROR--CAPS" role="macro">
<title>GTK_FILE_CHOOSER_ERROR</title>
<indexterm zone="GTK-FILE-CHOOSER-ERROR--CAPS"><primary sortas="FILE_CHOOSER_ERROR">GTK_FILE_CHOOSER_ERROR</primary></indexterm><programlisting>#define GTK_FILE_CHOOSER_ERROR (gtk_file_chooser_error_quark ())
</programlisting>
    <para>
      Used to get the <link linkend="GError"><type>GError</type></link> quark for <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link> errors.
    </para></refsect2>
<refsect2 id="GtkFileChooserError" role="enum">
<title>enum GtkFileChooserError</title>
<indexterm zone="GtkFileChooserError"><primary sortas="FileChooserError">GtkFileChooserError</primary></indexterm><programlisting>typedef enum {
  GTK_FILE_CHOOSER_ERROR_NONEXISTENT,
  GTK_FILE_CHOOSER_ERROR_BAD_FILENAME,
  GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS,
  GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME
} GtkFileChooserError;
</programlisting>
    <para>
      These identify the various errors that can occur while calling
      <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link> functions.
    </para><variablelist role="enum">
<varlistentry id="GTK-FILE-CHOOSER-ERROR-NONEXISTENT--CAPS" role="constant">
<term><literal>GTK_FILE_CHOOSER_ERROR_NONEXISTENT</literal></term>
<listitem><simpara>Indicates that a file does not exist.
</simpara></listitem>
</varlistentry>
<varlistentry id="GTK-FILE-CHOOSER-ERROR-BAD-FILENAME--CAPS" role="constant">
<term><literal>GTK_FILE_CHOOSER_ERROR_BAD_FILENAME</literal></term>
<listitem><simpara>Indicates a malformed filename.
</simpara></listitem>
</varlistentry>
<varlistentry id="GTK-FILE-CHOOSER-ERROR-ALREADY-EXISTS--CAPS" role="constant">
<term><literal>GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS</literal></term>
<listitem><simpara>Indicates a duplicate path (e.g. when
   adding a bookmark).
</simpara></listitem>
</varlistentry>
<varlistentry id="GTK-FILE-CHOOSER-ERROR-INCOMPLETE-HOSTNAME--CAPS" role="constant">
<term><literal>GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME</literal></term>
<listitem><simpara>
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-file-chooser-set-action" role="function" condition="since:2.4">
<title>gtk_file_chooser_set_action ()</title>
<indexterm zone="gtk-file-chooser-set-action" role="2.4"><primary sortas="file_chooser_set_action">gtk_file_chooser_set_action</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_file_chooser_set_action         (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="GtkFileChooserAction">GtkFileChooserAction</link> action);</programlisting>
<para>
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
<link linkend="GTK-FILE-CHOOSER-ACTION-SAVE--CAPS"><literal>GTK_FILE_CHOOSER_ACTION_SAVE</literal></link> but not if the action is
<link linkend="GTK-FILE-CHOOSER-ACTION-OPEN--CAPS"><literal>GTK_FILE_CHOOSER_ACTION_OPEN</literal></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>action</parameter>&#160;:</term>
<listitem><simpara> the action that the file selector is performing
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-get-action" role="function" condition="since:2.4">
<title>gtk_file_chooser_get_action ()</title>
<indexterm zone="gtk-file-chooser-get-action" role="2.4"><primary sortas="file_chooser_get_action">gtk_file_chooser_get_action</primary></indexterm><programlisting><link linkend="GtkFileChooserAction">GtkFileChooserAction</link>  gtk_file_chooser_get_action       (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
<para>
Gets the type of operation that the file chooser is performing; see
<link linkend="gtk-file-chooser-set-action"><function>gtk_file_chooser_set_action()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the action that the file selector is performing

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-set-local-only" role="function" condition="since:2.4">
<title>gtk_file_chooser_set_local_only ()</title>
<indexterm zone="gtk-file-chooser-set-local-only" role="2.4"><primary sortas="file_chooser_set_local_only">gtk_file_chooser_set_local_only</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_file_chooser_set_local_only     (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="gboolean">gboolean</link> local_only);</programlisting>
<para>
Sets whether only local files can be selected in the
file selector. If <parameter>local_only</parameter> is <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> (the default),
then the selected file are files are guaranteed to be
accessible through the operating systems native file
file system and therefore the application only
needs to worry about the filename functions in
<link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>, like <link linkend="gtk-file-chooser-get-filename"><function>gtk_file_chooser_get_filename()</function></link>,
rather than the URI functions like
<link linkend="gtk-file-chooser-get-uri"><function>gtk_file_chooser_get_uri()</function></link>,</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>local_only</parameter>&#160;:</term>
<listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if only local files can be selected
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-get-local-only" role="function" condition="since:2.4">
<title>gtk_file_chooser_get_local_only ()</title>
<indexterm zone="gtk-file-chooser-get-local-only" role="2.4"><primary sortas="file_chooser_get_local_only">gtk_file_chooser_get_local_only</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_file_chooser_get_local_only     (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
<para>
Gets whether only local files can be selected in the
file selector. See <link linkend="gtk-file-chooser-set-local-only"><function>gtk_file_chooser_set_local_only()</function></link></para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChoosre"><type>GtkFileChoosre</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if only local files can be selected.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-set-select-multiple" role="function" condition="since:2.4">
<title>gtk_file_chooser_set_select_multiple ()</title>
<indexterm zone="gtk-file-chooser-set-select-multiple" role="2.4"><primary sortas="file_chooser_set_select_multiple">gtk_file_chooser_set_select_multiple</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_file_chooser_set_select_multiple
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="gboolean">gboolean</link> select_multiple);</programlisting>
<para>
Sets whether multiple files can be selected in the file selector.  This is
only relevant if the action is set to be GTK_FILE_CHOOSER_ACTION_OPEN or
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>select_multiple</parameter>&#160;:</term>
<listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if multiple files can be selected.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-get-select-multiple" role="function" condition="since:2.4">
<title>gtk_file_chooser_get_select_multiple ()</title>
<indexterm zone="gtk-file-chooser-get-select-multiple" role="2.4"><primary sortas="file_chooser_get_select_multiple">gtk_file_chooser_get_select_multiple</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_file_chooser_get_select_multiple
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
<para>
Gets whether multiple files can be selected in the file
selector. See <link linkend="gtk-file-chooser-set-select-multiple"><function>gtk_file_chooser_set_select_multiple()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if multiple files can be selected.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-set-show-hidden" role="function" condition="since:2.6">
<title>gtk_file_chooser_set_show_hidden ()</title>
<indexterm zone="gtk-file-chooser-set-show-hidden" role="2.6"><primary sortas="file_chooser_set_show_hidden">gtk_file_chooser_set_show_hidden</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_file_chooser_set_show_hidden    (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="gboolean">gboolean</link> show_hidden);</programlisting>
<para>
Sets whether hidden files and folders are displayed in the file selector.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>show_hidden</parameter>&#160;:</term>
<listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if hidden files and folders should be displayed.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.6</para></refsect2>
<refsect2 id="gtk-file-chooser-get-show-hidden" role="function" condition="since:2.6">
<title>gtk_file_chooser_get_show_hidden ()</title>
<indexterm zone="gtk-file-chooser-get-show-hidden" role="2.6"><primary sortas="file_chooser_get_show_hidden">gtk_file_chooser_get_show_hidden</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_file_chooser_get_show_hidden    (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
<para>
Gets whether hidden files and folders are displayed in the file selector.   
See <link linkend="gtk-file-chooser-set-show-hidden"><function>gtk_file_chooser_set_show_hidden()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if hidden files and folders are displayed.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.6</para></refsect2>
<refsect2 id="gtk-file-chooser-set-do-overwrite-confirmation" role="function" condition="since:2.8">
<title>gtk_file_chooser_set_do_overwrite_confirmation ()</title>
<indexterm zone="gtk-file-chooser-set-do-overwrite-confirmation" role="2.8"><primary sortas="file_chooser_set_do_overwrite_confirmation">gtk_file_chooser_set_do_overwrite_confirmation</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_file_chooser_set_do_overwrite_confirmation
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="gboolean">gboolean</link> do_overwrite_confirmation);</programlisting>
<para>
Sets whether a file chooser in GTK_FILE_CHOOSER_ACTION_SAVE mode will present
a confirmation dialog if the user types a file name that already exists.  This
is <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> by default.
</para>
<para>
Regardless of this setting, the <parameter>chooser</parameter> will emit the "confirm-overwrite"
signal when appropriate.
</para>
<para>
If all you need is the stock confirmation dialog, set this property to <link linkend="TRUE--CAPS"><literal>TRUE</literal></link>.
You can override the way confirmation is done by actually handling the
"confirm-overwrite" signal; please refer to its documentation for the
details.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>do_overwrite_confirmation</parameter>&#160;:</term>
<listitem><simpara> whether to confirm overwriting in save mode
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.8</para></refsect2>
<refsect2 id="gtk-file-chooser-get-do-overwrite-confirmation" role="function" condition="since:2.8">
<title>gtk_file_chooser_get_do_overwrite_confirmation ()</title>
<indexterm zone="gtk-file-chooser-get-do-overwrite-confirmation" role="2.8"><primary sortas="file_chooser_get_do_overwrite_confirmation">gtk_file_chooser_get_do_overwrite_confirmation</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_file_chooser_get_do_overwrite_confirmation
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
<para>
Queries whether a file chooser is set to confirm for overwriting when the user
types a file name that already exists.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the file chooser will present a confirmation dialog;
<link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.8</para></refsect2>
<refsect2 id="gtk-file-chooser-set-create-folders" role="function" condition="since:2.18">
<title>gtk_file_chooser_set_create_folders ()</title>
<indexterm zone="gtk-file-chooser-set-create-folders" role="2.18"><primary sortas="file_chooser_set_create_folders">gtk_file_chooser_set_create_folders</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_file_chooser_set_create_folders (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="gboolean">gboolean</link> create_folders);</programlisting>
<para>
Sets whether file choser will offer to create new folders.
This is only relevant if the action is not set to be 
GTK_FILE_CHOOSER_ACTION_OPEN.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>create_folders</parameter>&#160;:</term>
<listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the New Folder button should be displayed
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.18</para></refsect2>
<refsect2 id="gtk-file-chooser-get-create-folders" role="function" condition="since:2.18">
<title>gtk_file_chooser_get_create_folders ()</title>
<indexterm zone="gtk-file-chooser-get-create-folders" role="2.18"><primary sortas="file_chooser_get_create_folders">gtk_file_chooser_get_create_folders</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_file_chooser_get_create_folders (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
<para>
Gets whether file choser will offer to create new folders.
See <link linkend="gtk-file-chooser-set-create-folders"><function>gtk_file_chooser_set_create_folders()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the New Folder button should be displayed.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.18</para></refsect2>
<refsect2 id="gtk-file-chooser-set-current-name" role="function" condition="since:2.4">
<title>gtk_file_chooser_set_current_name ()</title>
<indexterm zone="gtk-file-chooser-set-current-name" role="2.4"><primary sortas="file_chooser_set_current_name">gtk_file_chooser_set_current_name</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_file_chooser_set_current_name   (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         const <link linkend="gchar">gchar</link> *name);</programlisting>
<para>
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.
</para>
<para>
If you want to preselect a particular existing file, you should use
<link linkend="gtk-file-chooser-set-filename"><function>gtk_file_chooser_set_filename()</function></link> or <link linkend="gtk-file-chooser-set-uri"><function>gtk_file_chooser_set_uri()</function></link> instead.
Please see the documentation for those functions for an example of using
<link linkend="gtk-file-chooser-set-current-name"><function>gtk_file_chooser_set_current_name()</function></link> as well.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter>&#160;:</term>
<listitem><simpara> the filename to use, as a UTF-8 string
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-get-filename" role="function" condition="since:2.4">
<title>gtk_file_chooser_get_filename ()</title>
<indexterm zone="gtk-file-chooser-get-filename" role="2.4"><primary sortas="file_chooser_get_filename">gtk_file_chooser_get_filename</primary></indexterm><programlisting><link linkend="gchar">gchar</link> *             gtk_file_chooser_get_filename       (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
<para>
Gets the filename for the currently selected file in
the file selector. If multiple files are selected,
one of the filenames will be returned at random.
</para>
<para>
If the file chooser is in folder mode, this function returns the selected
folder.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> The currently selected filename, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
 if no file is selected, or the selected file can't
 be represented with a local filename. Free with <link linkend="g-free"><function>g_free()</function></link>.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-set-filename" role="function" condition="since:2.4">
<title>gtk_file_chooser_set_filename ()</title>
<indexterm zone="gtk-file-chooser-set-filename" role="2.4"><primary sortas="file_chooser_set_filename">gtk_file_chooser_set_filename</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_file_chooser_set_filename       (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         const <link linkend="char">char</link> *filename);</programlisting>
<para>
Sets <parameter>filename</parameter> 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 <parameter>chooser</parameter> is in <link linkend="GTK-FILE-CHOOSER-ACTION-SAVE--CAPS"><type>GTK_FILE_CHOOSER_ACTION_SAVE</type></link> mode, the file's base name
will also appear in the dialog's file name entry.
</para>
<para>
If the file name isn't in the current folder of <parameter>chooser</parameter>, then the current
folder of <parameter>chooser</parameter> will be changed to the folder containing <parameter>filename</parameter>. This
is equivalent to a sequence of <link linkend="gtk-file-chooser-unselect-all"><function>gtk_file_chooser_unselect_all()</function></link> followed by
<link linkend="gtk-file-chooser-select-filename"><function>gtk_file_chooser_select_filename()</function></link>.
</para>
<para>
Note that the file must exist, or nothing will be done except
for the directory change.
</para>
<para>
If you are implementing a <guimenuitem>File/Save As...</guimenuitem> 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 <guimenuitem>File/Save As...</guimenuitem> on it.  If you don't have 
a file name already &mdash; 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:
<informalexample><programlisting>
if (document_is_new)
  {
    /&ast; the user just created a new document &ast;/
    gtk_file_chooser_set_current_folder (chooser, default_folder_for_saving);
    gtk_file_chooser_set_current_name (chooser, "Untitled document");
  }
else
  {
    /&ast; the user edited an existing document &ast;/ 
    gtk_file_chooser_set_filename (chooser, existing_filename);
  }
</programlisting></informalexample></para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>filename</parameter>&#160;:</term>
<listitem><simpara> the filename to set as current
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if both the folder could be changed and the file was
selected successfully, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-select-filename" role="function" condition="since:2.4">
<title>gtk_file_chooser_select_filename ()</title>
<indexterm zone="gtk-file-chooser-select-filename" role="2.4"><primary sortas="file_chooser_select_filename">gtk_file_chooser_select_filename</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_file_chooser_select_filename    (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         const <link linkend="char">char</link> *filename);</programlisting>
<para>
Selects a filename. If the file name isn't in the current
folder of <parameter>chooser</parameter>, then the current folder of <parameter>chooser</parameter> will
be changed to the folder containing <parameter>filename</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>filename</parameter>&#160;:</term>
<listitem><simpara> the filename to select
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if both the folder could be changed and the file was
selected successfully, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-unselect-filename" role="function" condition="since:2.4">
<title>gtk_file_chooser_unselect_filename ()</title>
<indexterm zone="gtk-file-chooser-unselect-filename" role="2.4"><primary sortas="file_chooser_unselect_filename">gtk_file_chooser_unselect_filename</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_file_chooser_unselect_filename  (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         const <link linkend="char">char</link> *filename);</programlisting>
<para>
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.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>filename</parameter>&#160;:</term>
<listitem><simpara> the filename to unselect
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-select-all" role="function" condition="since:2.4">
<title>gtk_file_chooser_select_all ()</title>
<indexterm zone="gtk-file-chooser-select-all" role="2.4"><primary sortas="file_chooser_select_all">gtk_file_chooser_select_all</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_file_chooser_select_all         (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
<para>
Selects all the files in the current folder of a file chooser.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-unselect-all" role="function" condition="since:2.4">
<title>gtk_file_chooser_unselect_all ()</title>
<indexterm zone="gtk-file-chooser-unselect-all" role="2.4"><primary sortas="file_chooser_unselect_all">gtk_file_chooser_unselect_all</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_file_chooser_unselect_all       (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
<para>
Unselects all the files in the current folder of a file chooser.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-get-filenames" role="function" condition="since:2.4">
<title>gtk_file_chooser_get_filenames ()</title>
<indexterm zone="gtk-file-chooser-get-filenames" role="2.4"><primary sortas="file_chooser_get_filenames">gtk_file_chooser_get_filenames</primary></indexterm><programlisting><link linkend="GSList">GSList</link> *            gtk_file_chooser_get_filenames      (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
<para>
Lists all the selected files and subfolders in the current folder of
<parameter>chooser</parameter>. The returned names are full absolute paths. If files in the current
folder cannot be represented as local filenames they will be ignored. (See
<link linkend="gtk-file-chooser-get-uris"><function>gtk_file_chooser_get_uris()</function></link>)</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="GSList"><type>GSList</type></link> containing the filenames of all selected
  files and subfolders in the current folder. Free the returned list
  with <link linkend="g-slist-free"><function>g_slist_free()</function></link>, and the filenames with <link linkend="g-free"><function>g_free()</function></link>.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-set-current-folder" role="function" condition="since:2.4">
<title>gtk_file_chooser_set_current_folder ()</title>
<indexterm zone="gtk-file-chooser-set-current-folder" role="2.4"><primary sortas="file_chooser_set_current_folder">gtk_file_chooser_set_current_folder</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_file_chooser_set_current_folder (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         const <link linkend="gchar">gchar</link> *filename);</programlisting>
<para>
Sets the current folder for <parameter>chooser</parameter> 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.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>filename</parameter>&#160;:</term>
<listitem><simpara> the full path of the new current folder
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the folder could be changed successfully, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link>
otherwise.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-get-current-folder" role="function" condition="since:2.4">
<title>gtk_file_chooser_get_current_folder ()</title>
<indexterm zone="gtk-file-chooser-get-current-folder" role="2.4"><primary sortas="file_chooser_get_current_folder">gtk_file_chooser_get_current_folder</primary></indexterm><programlisting><link linkend="gchar">gchar</link> *             gtk_file_chooser_get_current_folder (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
<para>
Gets the current folder of <parameter>chooser</parameter> as a local filename.
See <link linkend="gtk-file-chooser-set-current-folder"><function>gtk_file_chooser_set_current_folder()</function></link>.
</para>
<para>
Note that this is the folder that the file chooser is currently displaying
(e.g. "/home/username/Documents"), which is <emphasis>not the same</emphasis>
as the currently-selected folder if the chooser is in
<link linkend="GTK-FILE-CHOOSER-SELECT-FOLDER--CAPS"><type>GTK_FILE_CHOOSER_SELECT_FOLDER</type></link> mode
(e.g. "/home/username/Documents/selected-folder/".  To get the
currently-selected folder in that mode, use <link linkend="gtk-file-chooser-get-uri"><function>gtk_file_chooser_get_uri()</function></link> as the
usual way to get the selection.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the full path of the current folder, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if the current
path cannot be represented as a local filename.  Free with <link linkend="g-free"><function>g_free()</function></link>.  This
function will also return <link linkend="NULL--CAPS"><literal>NULL</literal></link> if the file chooser was unable to load the
last folder that was requested from it; for example, as would be for calling
<link linkend="gtk-file-chooser-set-current-folder"><function>gtk_file_chooser_set_current_folder()</function></link> on a nonexistent folder.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-get-uri" role="function" condition="since:2.4">
<title>gtk_file_chooser_get_uri ()</title>
<indexterm zone="gtk-file-chooser-get-uri" role="2.4"><primary sortas="file_chooser_get_uri">gtk_file_chooser_get_uri</primary></indexterm><programlisting><link linkend="gchar">gchar</link> *             gtk_file_chooser_get_uri            (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
<para>
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.
</para>
<para>
If the file chooser is in folder mode, this function returns the selected
folder.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> The currently selected URI, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
 if no file is selected. Free with <link linkend="g-free"><function>g_free()</function></link>

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-set-uri" role="function" condition="since:2.4">
<title>gtk_file_chooser_set_uri ()</title>
<indexterm zone="gtk-file-chooser-set-uri" role="2.4"><primary sortas="file_chooser_set_uri">gtk_file_chooser_set_uri</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_file_chooser_set_uri            (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         const <link linkend="char">char</link> *uri);</programlisting>
<para>
Sets the file referred to by <parameter>uri</parameter> 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 <parameter>chooser</parameter> is <link linkend="GTK-FILE-CHOOSER-ACTION-SAVE--CAPS"><type>GTK_FILE_CHOOSER_ACTION_SAVE</type></link> mode, the URI's base
name will also appear in the dialog's file name entry.
</para>
<para>
If the URI isn't in the current folder of <parameter>chooser</parameter>, then the current folder
of <parameter>chooser</parameter> will be changed to the folder containing <parameter>uri</parameter>. This is equivalent
to a sequence of <link linkend="gtk-file-chooser-unselect-all"><function>gtk_file_chooser_unselect_all()</function></link> followed by
<link linkend="gtk-file-chooser-select-uri"><function>gtk_file_chooser_select_uri()</function></link>.
</para>
<para>
Note that the URI must exist, or nothing will be done except for the 
directory change.
If you are implementing a <guimenuitem>File/Save As...</guimenuitem> 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 <guimenuitem>File/Save As...</guimenuitem> on it.  If you don't have 
a file name already &mdash; 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:
<informalexample><programlisting>
if (document_is_new)
  {
    /&ast; the user just created a new document &ast;/
    gtk_file_chooser_set_current_folder_uri (chooser, default_folder_for_saving);
    gtk_file_chooser_set_current_name (chooser, "Untitled document");
  }
else
  {
    /&ast; the user edited an existing document &ast;/ 
    gtk_file_chooser_set_uri (chooser, existing_uri);
  }
</programlisting></informalexample></para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uri</parameter>&#160;:</term>
<listitem><simpara> the URI to set as current
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if both the folder could be changed and the URI was
selected successfully, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-select-uri" role="function" condition="since:2.4">
<title>gtk_file_chooser_select_uri ()</title>
<indexterm zone="gtk-file-chooser-select-uri" role="2.4"><primary sortas="file_chooser_select_uri">gtk_file_chooser_select_uri</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_file_chooser_select_uri         (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         const <link linkend="char">char</link> *uri);</programlisting>
<para>
Selects the file to by <parameter>uri</parameter>. If the URI doesn't refer to a
file in the current folder of <parameter>chooser</parameter>, then the current folder of
<parameter>chooser</parameter> will be changed to the folder containing <parameter>filename</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uri</parameter>&#160;:</term>
<listitem><simpara> the URI to select
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if both the folder could be changed and the URI was
selected successfully, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-unselect-uri" role="function" condition="since:2.4">
<title>gtk_file_chooser_unselect_uri ()</title>
<indexterm zone="gtk-file-chooser-unselect-uri" role="2.4"><primary sortas="file_chooser_unselect_uri">gtk_file_chooser_unselect_uri</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_file_chooser_unselect_uri       (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         const <link linkend="char">char</link> *uri);</programlisting>
<para>
Unselects the file referred to by <parameter>uri</parameter>. If the file
is not in the current directory, does not exist, or
is otherwise not currently selected, does nothing.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uri</parameter>&#160;:</term>
<listitem><simpara> the URI to unselect
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-get-uris" role="function" condition="since:2.4">
<title>gtk_file_chooser_get_uris ()</title>
<indexterm zone="gtk-file-chooser-get-uris" role="2.4"><primary sortas="file_chooser_get_uris">gtk_file_chooser_get_uris</primary></indexterm><programlisting><link linkend="GSList">GSList</link> *            gtk_file_chooser_get_uris           (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
<para>
Lists all the selected files and subfolders in the current folder of
<parameter>chooser</parameter>. The returned names are full absolute URIs.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="GSList"><type>GSList</type></link> containing the URIs of all selected
  files and subfolders in the current folder. Free the returned list
  with <link linkend="g-slist-free"><function>g_slist_free()</function></link>, and the filenames with <link linkend="g-free"><function>g_free()</function></link>.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-set-current-folder-uri" role="function" condition="since:2.4">
<title>gtk_file_chooser_set_current_folder_uri ()</title>
<indexterm zone="gtk-file-chooser-set-current-folder-uri" role="2.4"><primary sortas="file_chooser_set_current_folder_uri">gtk_file_chooser_set_current_folder_uri</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_file_chooser_set_current_folder_uri
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         const <link linkend="gchar">gchar</link> *uri);</programlisting>
<para>
Sets the current folder for <parameter>chooser</parameter> from an URI.
The user will be shown the full contents of the current folder,
plus user interface elements for navigating to other folders.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uri</parameter>&#160;:</term>
<listitem><simpara> the URI for the new current folder
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the folder could be changed successfully, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link>
otherwise.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-get-current-folder-uri" role="function" condition="since:2.4">
<title>gtk_file_chooser_get_current_folder_uri ()</title>
<indexterm zone="gtk-file-chooser-get-current-folder-uri" role="2.4"><primary sortas="file_chooser_get_current_folder_uri">gtk_file_chooser_get_current_folder_uri</primary></indexterm><programlisting><link linkend="gchar">gchar</link> *             gtk_file_chooser_get_current_folder_uri
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
<para>
Gets the current folder of <parameter>chooser</parameter> as an URI.
See <link linkend="gtk-file-chooser-set-current-folder-uri"><function>gtk_file_chooser_set_current_folder_uri()</function></link>.
</para>
<para>
Note that this is the folder that the file chooser is currently displaying
(e.g. "file:///home/username/Documents"), which is <emphasis>not the same</emphasis>
as the currently-selected folder if the chooser is in
<link linkend="GTK-FILE-CHOOSER-SELECT-FOLDER--CAPS"><type>GTK_FILE_CHOOSER_SELECT_FOLDER</type></link> mode
(e.g. "file:///home/username/Documents/selected-folder/".  To get the
currently-selected folder in that mode, use <link linkend="gtk-file-chooser-get-uri"><function>gtk_file_chooser_get_uri()</function></link> as the
usual way to get the selection.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the URI for the current folder.  Free with <link linkend="g-free"><function>g_free()</function></link>.  This
function will also return <link linkend="NULL--CAPS"><literal>NULL</literal></link> if the file chooser was unable to load the
last folder that was requested from it; for example, as would be for calling
<link linkend="gtk-file-chooser-set-current-folder-uri"><function>gtk_file_chooser_set_current_folder_uri()</function></link> on a nonexistent folder.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-set-preview-widget" role="function" condition="since:2.4">
<title>gtk_file_chooser_set_preview_widget ()</title>
<indexterm zone="gtk-file-chooser-set-preview-widget" role="2.4"><primary sortas="file_chooser_set_preview_widget">gtk_file_chooser_set_preview_widget</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_file_chooser_set_preview_widget (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="GtkWidget">GtkWidget</link> *preview_widget);</programlisting>
<para>
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 ::update-preview
signal, and call <link linkend="gtk-file-chooser-get-preview-filename"><function>gtk_file_chooser_get_preview_filename()</function></link> or
<link linkend="gtk-file-chooser-get-preview-uri"><function>gtk_file_chooser_get_preview_uri()</function></link> on each change. If you can
display a preview of the new file, update your widget and
set the preview active using <link linkend="gtk-file-chooser-set-preview-widget-active"><function>gtk_file_chooser_set_preview_widget_active()</function></link>.
Otherwise, set the preview inactive.
</para>
<para>
When there is no application-supplied preview widget, or the
application-supplied preview widget is not active, the file chooser
may display an internally generated preview of the current file or
it may display no preview at all.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>preview_widget</parameter>&#160;:</term>
<listitem><simpara> widget for displaying preview.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-get-preview-widget" role="function" condition="since:2.4">
<title>gtk_file_chooser_get_preview_widget ()</title>
<indexterm zone="gtk-file-chooser-get-preview-widget" role="2.4"><primary sortas="file_chooser_get_preview_widget">gtk_file_chooser_get_preview_widget</primary></indexterm><programlisting><link linkend="GtkWidget">GtkWidget</link> *         gtk_file_chooser_get_preview_widget (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
<para>
Gets the current preview widget; see
<link linkend="gtk-file-chooser-set-preview-widget"><function>gtk_file_chooser_set_preview_widget()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the current preview widget, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-set-preview-widget-active" role="function" condition="since:2.4">
<title>gtk_file_chooser_set_preview_widget_active ()</title>
<indexterm zone="gtk-file-chooser-set-preview-widget-active" role="2.4"><primary sortas="file_chooser_set_preview_widget_active">gtk_file_chooser_set_preview_widget_active</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_file_chooser_set_preview_widget_active
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="gboolean">gboolean</link> active);</programlisting>
<para>
Sets whether the preview widget set by
<link linkend="gtk-file-chooser-set-preview-widget"><function>gtk_file_chooser_set_preview_widget()</function></link> should be shown for the
current filename. When <parameter>active</parameter> 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
<link linkend="gtk-file-chooser-set-preview-widget"><function>gtk_file_chooser_set_preview_widget()</function></link> for more details.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>active</parameter>&#160;:</term>
<listitem><simpara> whether to display the user-specified preview widget
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-get-preview-widget-active" role="function" condition="since:2.4">
<title>gtk_file_chooser_get_preview_widget_active ()</title>
<indexterm zone="gtk-file-chooser-get-preview-widget-active" role="2.4"><primary sortas="file_chooser_get_preview_widget_active">gtk_file_chooser_get_preview_widget_active</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_file_chooser_get_preview_widget_active
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
<para>
Gets whether the preview widget set by <link linkend="gtk-file-chooser-set-preview-widget"><function>gtk_file_chooser_set_preview_widget()</function></link>
should be shown for the current filename. See
<link linkend="gtk-file-chooser-set-preview-widget-active"><function>gtk_file_chooser_set_preview_widget_active()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the preview widget is active for the current filename.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-set-use-preview-label" role="function" condition="since:2.4">
<title>gtk_file_chooser_set_use_preview_label ()</title>
<indexterm zone="gtk-file-chooser-set-use-preview-label" role="2.4"><primary sortas="file_chooser_set_use_preview_label">gtk_file_chooser_set_use_preview_label</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_file_chooser_set_use_preview_label
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="gboolean">gboolean</link> use_label);</programlisting>
<para>
Sets whether the file chooser should display a stock label with the name of
the file that is being previewed; the default is <link linkend="TRUE--CAPS"><literal>TRUE</literal></link>.  Applications that
want to draw the whole preview area themselves should set this to <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> and
display the name themselves in their preview widget.
</para>
<para>
See also: <link linkend="gtk-file-chooser-set-preview-widget"><function>gtk_file_chooser_set_preview_widget()</function></link></para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>use_label</parameter>&#160;:</term>
<listitem><simpara> whether to display a stock label with the name of the previewed file
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-get-use-preview-label" role="function">
<title>gtk_file_chooser_get_use_preview_label ()</title>
<indexterm zone="gtk-file-chooser-get-use-preview-label"><primary sortas="file_chooser_get_use_preview_label">gtk_file_chooser_get_use_preview_label</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_file_chooser_get_use_preview_label
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
<para>
Gets whether a stock label should be drawn with the name of the previewed
file.  See <link linkend="gtk-file-chooser-set-use-preview-label"><function>gtk_file_chooser_set_use_preview_label()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the file chooser is set to display a label with the
name of the previewed file, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-file-chooser-get-preview-filename" role="function" condition="since:2.4">
<title>gtk_file_chooser_get_preview_filename ()</title>
<indexterm zone="gtk-file-chooser-get-preview-filename" role="2.4"><primary sortas="file_chooser_get_preview_filename">gtk_file_chooser_get_preview_filename</primary></indexterm><programlisting><link linkend="char">char</link> *              gtk_file_chooser_get_preview_filename
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
<para>
Gets the filename that should be previewed in a custom preview
widget. See <link linkend="gtk-file-chooser-set-preview-widget"><function>gtk_file_chooser_set_preview_widget()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the filename to preview, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if no file
 is selected, or if the selected file cannot be represented
 as a local filename. Free with <link linkend="g-free"><function>g_free()</function></link>

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-get-preview-uri" role="function" condition="since:2.4">
<title>gtk_file_chooser_get_preview_uri ()</title>
<indexterm zone="gtk-file-chooser-get-preview-uri" role="2.4"><primary sortas="file_chooser_get_preview_uri">gtk_file_chooser_get_preview_uri</primary></indexterm><programlisting><link linkend="char">char</link> *              gtk_file_chooser_get_preview_uri    (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
<para>
Gets the URI that should be previewed in a custom preview
widget. See <link linkend="gtk-file-chooser-set-preview-widget"><function>gtk_file_chooser_set_preview_widget()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the URI for the file to preview, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if no file is
selected. Free with <link linkend="g-free"><function>g_free()</function></link>.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-set-extra-widget" role="function" condition="since:2.4">
<title>gtk_file_chooser_set_extra_widget ()</title>
<indexterm zone="gtk-file-chooser-set-extra-widget" role="2.4"><primary sortas="file_chooser_set_extra_widget">gtk_file_chooser_set_extra_widget</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_file_chooser_set_extra_widget   (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="GtkWidget">GtkWidget</link> *extra_widget);</programlisting>
<para>
Sets an application-supplied widget to provide extra options to the user.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>extra_widget</parameter>&#160;:</term>
<listitem><simpara> widget for extra options
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-get-extra-widget" role="function" condition="since:2.4">
<title>gtk_file_chooser_get_extra_widget ()</title>
<indexterm zone="gtk-file-chooser-get-extra-widget" role="2.4"><primary sortas="file_chooser_get_extra_widget">gtk_file_chooser_get_extra_widget</primary></indexterm><programlisting><link linkend="GtkWidget">GtkWidget</link> *         gtk_file_chooser_get_extra_widget   (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
<para>
Gets the current preview widget; see
<link linkend="gtk-file-chooser-set-extra-widget"><function>gtk_file_chooser_set_extra_widget()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the current extra widget, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-add-filter" role="function" condition="since:2.4">
<title>gtk_file_chooser_add_filter ()</title>
<indexterm zone="gtk-file-chooser-add-filter" role="2.4"><primary sortas="file_chooser_add_filter">gtk_file_chooser_add_filter</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_file_chooser_add_filter         (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="GtkFileFilter">GtkFileFilter</link> *filter);</programlisting>
<para>
Adds <parameter>filter</parameter> 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. 
</para>
<para>
Note that the <parameter>chooser</parameter> takes ownership of the filter, so you have to 
ref and sink it if you want to keep a reference.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>filter</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileFilter"><type>GtkFileFilter</type></link>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-remove-filter" role="function" condition="since:2.4">
<title>gtk_file_chooser_remove_filter ()</title>
<indexterm zone="gtk-file-chooser-remove-filter" role="2.4"><primary sortas="file_chooser_remove_filter">gtk_file_chooser_remove_filter</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_file_chooser_remove_filter      (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="GtkFileFilter">GtkFileFilter</link> *filter);</programlisting>
<para>
Removes <parameter>filter</parameter> from the list of filters that the user can select between.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>filter</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileFilter"><type>GtkFileFilter</type></link>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-list-filters" role="function" condition="since:2.4">
<title>gtk_file_chooser_list_filters ()</title>
<indexterm zone="gtk-file-chooser-list-filters" role="2.4"><primary sortas="file_chooser_list_filters">gtk_file_chooser_list_filters</primary></indexterm><programlisting><link linkend="GSList">GSList</link> *            gtk_file_chooser_list_filters       (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
<para>
Lists the current set of user-selectable filters; see
<link linkend="gtk-file-chooser-add-filter"><function>gtk_file_chooser_add_filter()</function></link>, <link linkend="gtk-file-chooser-remove-filter"><function>gtk_file_chooser_remove_filter()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="GSList"><type>GSList</type></link> 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
 <link linkend="g-slist-free"><function>g_slist_free()</function></link> when you are done with it.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-set-filter" role="function" condition="since:2.4">
<title>gtk_file_chooser_set_filter ()</title>
<indexterm zone="gtk-file-chooser-set-filter" role="2.4"><primary sortas="file_chooser_set_filter">gtk_file_chooser_set_filter</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_file_chooser_set_filter         (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="GtkFileFilter">GtkFileFilter</link> *filter);</programlisting>
<para>
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.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>filter</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileFilter"><type>GtkFileFilter</type></link>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-get-filter" role="function" condition="since:2.4">
<title>gtk_file_chooser_get_filter ()</title>
<indexterm zone="gtk-file-chooser-get-filter" role="2.4"><primary sortas="file_chooser_get_filter">gtk_file_chooser_get_filter</primary></indexterm><programlisting><link linkend="GtkFileFilter">GtkFileFilter</link> *     gtk_file_chooser_get_filter         (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
<para>
Gets the current filter; see <link linkend="gtk-file-chooser-set-filter"><function>gtk_file_chooser_set_filter()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the current filter, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-add-shortcut-folder" role="function" condition="since:2.4">
<title>gtk_file_chooser_add_shortcut_folder ()</title>
<indexterm zone="gtk-file-chooser-add-shortcut-folder" role="2.4"><primary sortas="file_chooser_add_shortcut_folder">gtk_file_chooser_add_shortcut_folder</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_file_chooser_add_shortcut_folder
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         const <link linkend="char">char</link> *folder,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
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.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>folder</parameter>&#160;:</term>
<listitem><simpara> filename of the folder to add
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> location to store error, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the folder could be added successfully, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link>
otherwise.  In the latter case, the <parameter>error</parameter> will be set as appropriate.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-remove-shortcut-folder" role="function" condition="since:2.4">
<title>gtk_file_chooser_remove_shortcut_folder ()</title>
<indexterm zone="gtk-file-chooser-remove-shortcut-folder" role="2.4"><primary sortas="file_chooser_remove_shortcut_folder">gtk_file_chooser_remove_shortcut_folder</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_file_chooser_remove_shortcut_folder
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         const <link linkend="char">char</link> *folder,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Removes a folder from a file chooser's list of shortcut folders.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>folder</parameter>&#160;:</term>
<listitem><simpara> filename of the folder to remove
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> location to store error, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the operation succeeds, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.  
In the latter case, the <parameter>error</parameter> will be set as appropriate.

See also: <link linkend="gtk-file-chooser-add-shortcut-folder"><function>gtk_file_chooser_add_shortcut_folder()</function></link>

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-list-shortcut-folders" role="function" condition="since:2.4">
<title>gtk_file_chooser_list_shortcut_folders ()</title>
<indexterm zone="gtk-file-chooser-list-shortcut-folders" role="2.4"><primary sortas="file_chooser_list_shortcut_folders">gtk_file_chooser_list_shortcut_folders</primary></indexterm><programlisting><link linkend="GSList">GSList</link> *            gtk_file_chooser_list_shortcut_folders
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
<para>
Queries the list of shortcut folders in the file chooser, as set by
<link linkend="gtk-file-chooser-add-shortcut-folder"><function>gtk_file_chooser_add_shortcut_folder()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> A list of folder filenames, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if there are no shortcut
folders.  Free the returned list with <link linkend="g-slist-free"><function>g_slist_free()</function></link>, and the filenames with
<link linkend="g-free"><function>g_free()</function></link>.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-add-shortcut-folder-uri" role="function" condition="since:2.4">
<title>gtk_file_chooser_add_shortcut_folder_uri ()</title>
<indexterm zone="gtk-file-chooser-add-shortcut-folder-uri" role="2.4"><primary sortas="file_chooser_add_shortcut_folder_uri">gtk_file_chooser_add_shortcut_folder_uri</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_file_chooser_add_shortcut_folder_uri
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         const <link linkend="char">char</link> *uri,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
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.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uri</parameter>&#160;:</term>
<listitem><simpara> URI of the folder to add
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> location to store error, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the folder could be added successfully, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link>
otherwise.  In the latter case, the <parameter>error</parameter> will be set as appropriate.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-remove-shortcut-folder-uri" role="function" condition="since:2.4">
<title>gtk_file_chooser_remove_shortcut_folder_uri ()</title>
<indexterm zone="gtk-file-chooser-remove-shortcut-folder-uri" role="2.4"><primary sortas="file_chooser_remove_shortcut_folder_uri">gtk_file_chooser_remove_shortcut_folder_uri</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_file_chooser_remove_shortcut_folder_uri
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         const <link linkend="char">char</link> *uri,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Removes a folder URI from a file chooser's list of shortcut folders.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uri</parameter>&#160;:</term>
<listitem><simpara> URI of the folder to remove
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> location to store error, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the operation succeeds, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.  
In the latter case, the <parameter>error</parameter> will be set as appropriate.

See also: <link linkend="gtk-file-chooser-add-shortcut-folder-uri"><function>gtk_file_chooser_add_shortcut_folder_uri()</function></link>

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-list-shortcut-folder-uris" role="function" condition="since:2.4">
<title>gtk_file_chooser_list_shortcut_folder_uris ()</title>
<indexterm zone="gtk-file-chooser-list-shortcut-folder-uris" role="2.4"><primary sortas="file_chooser_list_shortcut_folder_uris">gtk_file_chooser_list_shortcut_folder_uris</primary></indexterm><programlisting><link linkend="GSList">GSList</link> *            gtk_file_chooser_list_shortcut_folder_uris
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
<para>
Queries the list of shortcut folders in the file chooser, as set by
<link linkend="gtk-file-chooser-add-shortcut-folder-uri"><function>gtk_file_chooser_add_shortcut_folder_uri()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> A list of folder URIs, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if there are no shortcut
folders.  Free the returned list with <link linkend="g-slist-free"><function>g_slist_free()</function></link>, and the URIs with
<link linkend="g-free"><function>g_free()</function></link>.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-file-chooser-get-current-folder-file" role="function" condition="since:2.14">
<title>gtk_file_chooser_get_current_folder_file ()</title>
<indexterm zone="gtk-file-chooser-get-current-folder-file" role="2.14"><primary sortas="file_chooser_get_current_folder_file">gtk_file_chooser_get_current_folder_file</primary></indexterm><programlisting><link linkend="GFile">GFile</link> *             gtk_file_chooser_get_current_folder_file
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
<para>
Gets the current folder of <parameter>chooser</parameter> as <link linkend="GFile"><type>GFile</type></link>.
See <link linkend="gtk-file-chooser-get-current-folder-uri"><function>gtk_file_chooser_get_current_folder_uri()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the <link linkend="GFile"><type>GFile</type></link> for the current folder.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.14</para></refsect2>
<refsect2 id="gtk-file-chooser-get-file" role="function" condition="since:2.14">
<title>gtk_file_chooser_get_file ()</title>
<indexterm zone="gtk-file-chooser-get-file" role="2.14"><primary sortas="file_chooser_get_file">gtk_file_chooser_get_file</primary></indexterm><programlisting><link linkend="GFile">GFile</link> *             gtk_file_chooser_get_file           (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
<para>
Gets the <link linkend="GFile"><type>GFile</type></link> for the currently selected file in
the file selector. If multiple files are selected,
one of the files will be returned at random.
</para>
<para>
If the file chooser is in folder mode, this function returns the selected
folder.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a selected <link linkend="GFile"><type>GFile</type></link>

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.14</para></refsect2>
<refsect2 id="gtk-file-chooser-get-files" role="function" condition="since:2.14">
<title>gtk_file_chooser_get_files ()</title>
<indexterm zone="gtk-file-chooser-get-files" role="2.14"><primary sortas="file_chooser_get_files">gtk_file_chooser_get_files</primary></indexterm><programlisting><link linkend="GSList">GSList</link> *            gtk_file_chooser_get_files          (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
<para>
Lists all the selected files and subfolders in the current folder of <parameter>chooser</parameter>
as <link linkend="GFile"><type>GFile</type></link>. An internal function, see <link linkend="gtk-file-chooser-get-uris"><function>gtk_file_chooser_get_uris()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="GSList"><type>GSList</type></link> containing a <link linkend="GFile"><type>GFile</type></link> for each selected
  file and subfolder in the current folder.  Free the returned list
  with <link linkend="g-slist-free"><function>g_slist_free()</function></link>, and the files with <link linkend="g-object-unref"><function>g_object_unref()</function></link>.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.14</para></refsect2>
<refsect2 id="gtk-file-chooser-get-preview-file" role="function" condition="since:2.14">
<title>gtk_file_chooser_get_preview_file ()</title>
<indexterm zone="gtk-file-chooser-get-preview-file" role="2.14"><primary sortas="file_chooser_get_preview_file">gtk_file_chooser_get_preview_file</primary></indexterm><programlisting><link linkend="GFile">GFile</link> *             gtk_file_chooser_get_preview_file   (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
<para>
Gets the <link linkend="GFile"><type>GFile</type></link> that should be previewed in a custom preview
Internal function, see <link linkend="gtk-file-chooser-get-preview-uri"><function>gtk_file_chooser_get_preview_uri()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the <link linkend="GFile"><type>GFile</type></link> for the file to preview, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if no file
 is selected. Free with <link linkend="g-object-unref"><function>g_object_unref()</function></link>.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.14</para></refsect2>
<refsect2 id="gtk-file-chooser-select-file" role="function" condition="since:2.14">
<title>gtk_file_chooser_select_file ()</title>
<indexterm zone="gtk-file-chooser-select-file" role="2.14"><primary sortas="file_chooser_select_file">gtk_file_chooser_select_file</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_file_chooser_select_file        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="GFile">GFile</link> *file,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Selects the file referred to by <parameter>file</parameter>. An internal function. See
<link linkend="gtk-file-chooser-select-uri"><function>_gtk_file_chooser_select_uri()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>file</parameter>&#160;:</term>
<listitem><simpara> the file to select
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> location to store error, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if both the folder could be changed and the path was
selected successfully, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.14</para></refsect2>
<refsect2 id="gtk-file-chooser-set-current-folder-file" role="function" condition="since:2.14">
<title>gtk_file_chooser_set_current_folder_file ()</title>
<indexterm zone="gtk-file-chooser-set-current-folder-file" role="2.14"><primary sortas="file_chooser_set_current_folder_file">gtk_file_chooser_set_current_folder_file</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_file_chooser_set_current_folder_file
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="GFile">GFile</link> *file,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Sets the current folder for <parameter>chooser</parameter> from a <link linkend="GFile"><type>GFile</type></link>.
Internal function, see <link linkend="gtk-file-chooser-set-current-folder-uri"><function>gtk_file_chooser_set_current_folder_uri()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>file</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GFile"><type>GFile</type></link> for the new folder
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> location to store error, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the folder could be changed successfully, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link>
otherwise.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.14</para></refsect2>
<refsect2 id="gtk-file-chooser-set-file" role="function" condition="since:2.14">
<title>gtk_file_chooser_set_file ()</title>
<indexterm zone="gtk-file-chooser-set-file" role="2.14"><primary sortas="file_chooser_set_file">gtk_file_chooser_set_file</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_file_chooser_set_file           (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="GFile">GFile</link> *file,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Sets <parameter>file</parameter> 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 <parameter>chooser</parameter> is in <link linkend="GTK-FILE-CHOOSER-ACTION-SAVE--CAPS"><type>GTK_FILE_CHOOSER_ACTION_SAVE</type></link> mode, the file's base name
will also appear in the dialog's file name entry.
</para>
<para>
If the file name isn't in the current folder of <parameter>chooser</parameter>, then the current
folder of <parameter>chooser</parameter> will be changed to the folder containing <parameter>filename</parameter>. This
is equivalent to a sequence of <link linkend="gtk-file-chooser-unselect-all"><function>gtk_file_chooser_unselect_all()</function></link> followed by
<link linkend="gtk-file-chooser-select-filename"><function>gtk_file_chooser_select_filename()</function></link>.
</para>
<para>
Note that the file must exist, or nothing will be done except
for the directory change.
</para>
<para>
If you are implementing a <guimenuitem>File/Save As...</guimenuitem> 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 <guimenuitem>File/Save As...</guimenuitem> on it.  If you don't have
a file name already &mdash; 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:
<informalexample><programlisting>
if (document_is_new)
  {
    /&ast; the user just created a new document &ast;/
    gtk_file_chooser_set_current_folder_file (chooser, default_file_for_saving);
    gtk_file_chooser_set_current_name (chooser, "Untitled document");
  }
else
  {
    /&ast; the user edited an existing document &ast;/
    gtk_file_chooser_set_file (chooser, existing_file);
  }
</programlisting></informalexample></para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>file</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GFile"><type>GFile</type></link> to set as current
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> location to store the error, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> to ignore errors.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if both the folder could be changed and the file was
selected successfully, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.14</para></refsect2>
<refsect2 id="gtk-file-chooser-unselect-file" role="function" condition="since:2.14">
<title>gtk_file_chooser_unselect_file ()</title>
<indexterm zone="gtk-file-chooser-unselect-file" role="2.14"><primary sortas="file_chooser_unselect_file">gtk_file_chooser_unselect_file</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_file_chooser_unselect_file      (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                         <link linkend="GFile">GFile</link> *file);</programlisting>
<para>
Unselects the file referred to by <parameter>file</parameter>. If the file is not in the current
directory, does not exist, or is otherwise not currently selected, does nothing.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>file</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GFile"><type>GFile</type></link>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.14</para></refsect2>

</refsect1>
<refsect1 id="GtkFileChooser.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkFileChooser--action" role="property"><title>The <literal>&quot;action&quot;</literal> property</title>
<indexterm zone="GtkFileChooser--action"><primary sortas="FileChooser:action">GtkFileChooser:action</primary></indexterm><programlisting>  &quot;action&quot;                   <link linkend="GtkFileChooserAction">GtkFileChooserAction</link>  : Read / Write</programlisting>
<para>The type of operation that the file selector is performing.</para><para>Default value: GTK_FILE_CHOOSER_ACTION_OPEN</para>
</refsect2>
<refsect2 id="GtkFileChooser--create-folders" role="property"><title>The <literal>&quot;create-folders&quot;</literal> property</title>
<indexterm zone="GtkFileChooser--create-folders" role="2.18"><primary sortas="FileChooser:create-folders">GtkFileChooser:create-folders</primary></indexterm><programlisting>  &quot;create-folders&quot;           <link linkend="gboolean">gboolean</link>              : Read / Write</programlisting>
<para>
Whether a file chooser not in <link linkend="GTK-FILE-CHOOSER-ACTION-OPEN--CAPS"><literal>GTK_FILE_CHOOSER_ACTION_OPEN</literal></link> mode
will offer the user to create new folders.</para>
<para>
</para><para>Default value: TRUE</para>
<para>Since 2.18</para>
</refsect2>
<refsect2 id="GtkFileChooser--do-overwrite-confirmation" role="property"><title>The <literal>&quot;do-overwrite-confirmation&quot;</literal> property</title>
<indexterm zone="GtkFileChooser--do-overwrite-confirmation" role="2.8"><primary sortas="FileChooser:do-overwrite-confirmation">GtkFileChooser:do-overwrite-confirmation</primary></indexterm><programlisting>  &quot;do-overwrite-confirmation&quot; <link linkend="gboolean">gboolean</link>              : Read / Write</programlisting>
<para>
Whether a file chooser in <link linkend="GTK-FILE-CHOOSER-ACTION-SAVE--CAPS"><literal>GTK_FILE_CHOOSER_ACTION_SAVE</literal></link> mode
will present an overwrite confirmation dialog if the user
selects a file name that already exists.</para>
<para>
</para><para>Default value: FALSE</para>
<para>Since 2.8</para>
</refsect2>
<refsect2 id="GtkFileChooser--extra-widget" role="property"><title>The <literal>&quot;extra-widget&quot;</literal> property</title>
<indexterm zone="GtkFileChooser--extra-widget"><primary sortas="FileChooser:extra-widget">GtkFileChooser:extra-widget</primary></indexterm><programlisting>  &quot;extra-widget&quot;             <link linkend="GtkWidget">GtkWidget</link>*            : Read / Write</programlisting>
<para>Application supplied widget for extra options.</para></refsect2>
<refsect2 id="GtkFileChooser--file-system-backend" role="property"><title>The <literal>&quot;file-system-backend&quot;</literal> property</title>
<indexterm zone="GtkFileChooser--file-system-backend"><primary sortas="FileChooser:file-system-backend">GtkFileChooser:file-system-backend</primary></indexterm><programlisting>  &quot;file-system-backend&quot;      <link linkend="gchar">gchar</link>*                : Write / Construct Only</programlisting>
<para>Name of file system backend to use.</para><para>Default value: NULL</para>
</refsect2>
<refsect2 id="GtkFileChooser--filter" role="property"><title>The <literal>&quot;filter&quot;</literal> property</title>
<indexterm zone="GtkFileChooser--filter"><primary sortas="FileChooser:filter">GtkFileChooser:filter</primary></indexterm><programlisting>  &quot;filter&quot;                   <link linkend="GtkFileFilter">GtkFileFilter</link>*        : Read / Write</programlisting>
<para>The current filter for selecting which files are displayed.</para></refsect2>
<refsect2 id="GtkFileChooser--local-only" role="property"><title>The <literal>&quot;local-only&quot;</literal> property</title>
<indexterm zone="GtkFileChooser--local-only"><primary sortas="FileChooser:local-only">GtkFileChooser:local-only</primary></indexterm><programlisting>  &quot;local-only&quot;               <link linkend="gboolean">gboolean</link>              : Read / Write</programlisting>
<para>Whether the selected file(s) should be limited to local file: URLs.</para><para>Default value: TRUE</para>
</refsect2>
<refsect2 id="GtkFileChooser--preview-widget" role="property"><title>The <literal>&quot;preview-widget&quot;</literal> property</title>
<indexterm zone="GtkFileChooser--preview-widget"><primary sortas="FileChooser:preview-widget">GtkFileChooser:preview-widget</primary></indexterm><programlisting>  &quot;preview-widget&quot;           <link linkend="GtkWidget">GtkWidget</link>*            : Read / Write</programlisting>
<para>Application supplied widget for custom previews.</para></refsect2>
<refsect2 id="GtkFileChooser--preview-widget-active" role="property"><title>The <literal>&quot;preview-widget-active&quot;</literal> property</title>
<indexterm zone="GtkFileChooser--preview-widget-active"><primary sortas="FileChooser:preview-widget-active">GtkFileChooser:preview-widget-active</primary></indexterm><programlisting>  &quot;preview-widget-active&quot;    <link linkend="gboolean">gboolean</link>              : Read / Write</programlisting>
<para>Whether the application supplied widget for custom previews should be shown.</para><para>Default value: TRUE</para>
</refsect2>
<refsect2 id="GtkFileChooser--select-multiple" role="property"><title>The <literal>&quot;select-multiple&quot;</literal> property</title>
<indexterm zone="GtkFileChooser--select-multiple"><primary sortas="FileChooser:select-multiple">GtkFileChooser:select-multiple</primary></indexterm><programlisting>  &quot;select-multiple&quot;          <link linkend="gboolean">gboolean</link>              : Read / Write</programlisting>
<para>Whether to allow multiple files to be selected.</para><para>Default value: FALSE</para>
</refsect2>
<refsect2 id="GtkFileChooser--show-hidden" role="property"><title>The <literal>&quot;show-hidden&quot;</literal> property</title>
<indexterm zone="GtkFileChooser--show-hidden"><primary sortas="FileChooser:show-hidden">GtkFileChooser:show-hidden</primary></indexterm><programlisting>  &quot;show-hidden&quot;              <link linkend="gboolean">gboolean</link>              : Read / Write</programlisting>
<para>Whether the hidden files and folders should be displayed.</para><para>Default value: FALSE</para>
</refsect2>
<refsect2 id="GtkFileChooser--use-preview-label" role="property"><title>The <literal>&quot;use-preview-label&quot;</literal> property</title>
<indexterm zone="GtkFileChooser--use-preview-label"><primary sortas="FileChooser:use-preview-label">GtkFileChooser:use-preview-label</primary></indexterm><programlisting>  &quot;use-preview-label&quot;        <link linkend="gboolean">gboolean</link>              : Read / Write</programlisting>
<para>Whether to display a stock label with the name of the previewed file.</para><para>Default value: TRUE</para>
</refsect2>
</refsect1>

<refsect1 id="GtkFileChooser.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GtkFileChooser-confirm-overwrite" role="signal"><title>The <literal>&quot;confirm-overwrite&quot;</literal> signal</title>
<indexterm zone="GtkFileChooser-confirm-overwrite"><primary sortas="FileChooser::confirm-overwrite">GtkFileChooser::confirm-overwrite</primary></indexterm><programlisting><link linkend="GtkFileChooserConfirmation">GtkFileChooserConfirmation</link>user_function                      (<link linkend="GtkFileChooser">GtkFileChooser</link> *filechooser,
                                                        <link linkend="gpointer">gpointer</link>        user_data)        : Run Last</programlisting>
    <para>
      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 <link linkend="GTK-FILE-CHOOSER-ACTION-SAVE--CAPS"><type>GTK_FILE_CHOOSER_ACTION_SAVE</type></link> mode.
    </para>
    <para>
      Most applications just need to turn on the <link
      linkend="GtkFileChooser--do-overwrite-confirmation">do-overwrite-confirmation</link>
      property (or call the
      <link linkend="gtk-file-chooser-set-do-overwrite-confirmation"><function>gtk_file_chooser_set_do_overwrite_confirmation()</function></link> 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 <symbol>confirm-overwrite</symbol>
      signal.
    </para>
    <para>
      A signal handler for this signal must return a
      <link linkend="GtkFileChooserConfirmation"><type>GtkFileChooserConfirmation</type></link> value, which indicates the action to
      take.  If the handler determines that the user wants to select a
      different filename, it should return
      <link linkend="GTK-FILE-CHOOSER-CONFIRMATION-SELECT-AGAIN--CAPS"><type>GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN</type></link>.  If it determines
      that the user is satisfied with his choice of file name, it
      should return <link linkend="GTK-FILE-CHOOSER-CONFIRMATION-ACCEPT-FILENAME--CAPS"><type>GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME</type></link>.
      On the other hand, if it determines that the stock confirmation
      dialog should be used, it should return
      <link linkend="GTK-FILE-CHOOSER-CONFIRMATION-CONFIRM--CAPS"><type>GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM</type></link>.  The following example
      illustrates this.
    </para>
    <example id="gtkfilechooser-confirmation">
      <title>Custom confirmation</title>
      <programlisting>
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);
      </programlisting>
    </example><variablelist role="params">
<varlistentry><term><parameter>filechooser</parameter>&#160;:</term>
<listitem><simpara>the object which received the signal.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>#GtkFileChooserConfirmation value that indicates which
    action to take after emitting the signal.
    <para>
      Since 2.8
    </para>
</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="GtkFileChooser-current-folder-changed" role="signal"><title>The <literal>&quot;current-folder-changed&quot;</literal> signal</title>
<indexterm zone="GtkFileChooser-current-folder-changed"><primary sortas="FileChooser::current-folder-changed">GtkFileChooser::current-folder-changed</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                        <link linkend="gpointer">gpointer</link>        user_data)      : Run Last</programlisting>
<para>
This signal is emitted when the current folder in a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
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.
</para>
<para>
Normally you do not need to connect to this signal, unless you need to keep
track of which folder a file chooser is showing.
</para>
<para>
See also:  <link linkend="gtk-file-chooser-set-current-folder"><function>gtk_file_chooser_set_current_folder()</function></link>,
<link linkend="gtk-file-chooser-get-current-folder"><function>gtk_file_chooser_get_current_folder()</function></link>,
<link linkend="gtk-file-chooser-set-current-folder-uri"><function>gtk_file_chooser_set_current_folder_uri()</function></link>,
<link linkend="gtk-file-chooser-get-current-folder-uri"><function>gtk_file_chooser_get_current_folder_uri()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> the object which received the signal.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="GtkFileChooser-file-activated" role="signal"><title>The <literal>&quot;file-activated&quot;</literal> signal</title>
<indexterm zone="GtkFileChooser-file-activated"><primary sortas="FileChooser::file-activated">GtkFileChooser::file-activated</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                        <link linkend="gpointer">gpointer</link>        user_data)      : Run Last</programlisting>
<para>
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 <keycap>Enter</keycap>.
</para>
<para>
Normally you do not need to connect to this signal.  It is used internally
by <link linkend="GtkFileChooserDialog"><type>GtkFileChooserDialog</type></link> to know when to activate the default button in the
dialog.
</para>
<para>
See also: <link linkend="gtk-file-chooser-get-filename"><function>gtk_file_chooser_get_filename()</function></link>,
<link linkend="gtk-file-chooser-get-filenames"><function>gtk_file_chooser_get_filenames()</function></link>, <link linkend="gtk-file-chooser-get-uri"><function>gtk_file_chooser_get_uri()</function></link>,
<link linkend="gtk-file-chooser-get-uris"><function>gtk_file_chooser_get_uris()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> the object which received the signal.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="GtkFileChooser-selection-changed" role="signal"><title>The <literal>&quot;selection-changed&quot;</literal> signal</title>
<indexterm zone="GtkFileChooser-selection-changed"><primary sortas="FileChooser::selection-changed">GtkFileChooser::selection-changed</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                        <link linkend="gpointer">gpointer</link>        user_data)      : Run Last</programlisting>
<para>
This signal is emitted when there is a change in the set of selected files
in a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>.  This can happen when the user modifies the selection
with the mouse or the keyboard, or when explicitly calling functions to
change the selection.
</para>
<para>
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.
</para>
<para>
See also: <link linkend="gtk-file-chooser-select-filename"><function>gtk_file_chooser_select_filename()</function></link>,
<link linkend="gtk-file-chooser-unselect-filename"><function>gtk_file_chooser_unselect_filename()</function></link>, <link linkend="gtk-file-chooser-get-filename"><function>gtk_file_chooser_get_filename()</function></link>,
<link linkend="gtk-file-chooser-get-filenames"><function>gtk_file_chooser_get_filenames()</function></link>, <link linkend="gtk-file-chooser-select-uri"><function>gtk_file_chooser_select_uri()</function></link>,
<link linkend="gtk-file-chooser-unselect-uri"><function>gtk_file_chooser_unselect_uri()</function></link>, <link linkend="gtk-file-chooser-get-uri"><function>gtk_file_chooser_get_uri()</function></link>,
<link linkend="gtk-file-chooser-get-uris"><function>gtk_file_chooser_get_uris()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> the object which received the signal.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="GtkFileChooser-update-preview" role="signal"><title>The <literal>&quot;update-preview&quot;</literal> signal</title>
<indexterm zone="GtkFileChooser-update-preview"><primary sortas="FileChooser::update-preview">GtkFileChooser::update-preview</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
                                                        <link linkend="gpointer">gpointer</link>        user_data)      : Run Last</programlisting>
<para>
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.
</para>
<para>
Once you have installed a preview widget with
<link linkend="gtk-file-chooser-set-preview-widget"><function>gtk_file_chooser_set_preview_widget()</function></link>, you should update it when this
signal is emitted.  You can use the functions
<link linkend="gtk-file-chooser-get-preview-filename"><function>gtk_file_chooser_get_preview_filename()</function></link> or
<link linkend="gtk-file-chooser-get-preview-uri"><function>gtk_file_chooser_get_preview_uri()</function></link> 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 <link linkend="gtk-file-chooser-set-preview-widget-active"><function>gtk_file_chooser_set_preview_widget_active()</function></link> to inform the file
chooser about whether the preview was generated successfully or not.
</para>
<para>
Please see the example code in <xref linkend="gtkfilechooser-preview"/>.
</para>
<para>
See also: <link linkend="gtk-file-chooser-set-preview-widget"><function>gtk_file_chooser_set_preview_widget()</function></link>,
<link linkend="gtk-file-chooser-set-preview-widget-active"><function>gtk_file_chooser_set_preview_widget_active()</function></link>,
<link linkend="gtk-file-chooser-set-use-preview-label"><function>gtk_file_chooser_set_use_preview_label()</function></link>,
<link linkend="gtk-file-chooser-get-preview-filename"><function>gtk_file_chooser_get_preview_filename()</function></link>,
<link linkend="gtk-file-chooser-get-preview-uri"><function>gtk_file_chooser_get_preview_uri()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>chooser</parameter>&#160;:</term>
<listitem><simpara> the object which received the signal.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2>
</refsect1>


<refsect1 id="GtkFileChooser.see-also">
<title>See Also</title>
    <para>
      <link linkend="GtkFileChooserDialog"><type>GtkFileChooserDialog</type></link>, <link linkend="GtkFileChooserWidget"><type>GtkFileChooserWidget</type></link>, <link linkend="GtkFileChooserButton"><type>GtkFileChooserButton</type></link>
    </para>
</refsect1>

</refentry>
