~canonical-dx-team/ubuntu/maverick/gtk+2.0/menuproxy

« back to all changes in this revision

Viewing changes to docs/reference/gtk/xml/gtkfilechooser.xml

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-05-04 12:24:25 UTC
  • mfrom: (1.1.21 upstream)
  • Revision ID: james.westby@ubuntu.com-20070504122425-0m8midgzrp40y8w2
Tags: 2.10.12-1ubuntu1
* Sync with Debian
* New upstream version:
  Fixed bugs:
  - 379414 file chooser warnings when changing path in the entry
  - 418585 GtkFileChooserDefault sizing code is not DPI independent
  - 419568 Crash in search if start with special letter
  - 435062 build dies with icon cache validation
  - 379399 Segfault to call gtk_print_operation_run twice.
  - 387889 cups backend has problems when there are too many printers
  - 418531 invalid read to gtkicontheme.c gtk_icon_theme_lookup_icon...
  - 423916 crash in color scheme code
  - 424042 Segmentation fault while quickly pressing Alt+arrows
  - 415260 Protect against negative indices when setting values in G...
  - 419171 XGetVisualInfo() may not set nxvisuals
  - 128852 Gdk cursors don't look good on win32
  - 344657 Ctrl-H doesn't toggle "Show Hidden Files" setting
  - 345345 PrintOperation::paginate is not emitted for class handler
  - 347567 GtkPrintOperation::end-print is not emitted if it's cance...
  - 369112 gtk_ui_manager_add_ui should accept unnamed separator
  - 392015 Selected menu item invisible on Windows Vista
  - 399253 MS-Windows Theme Bottom Tab placement rendering glitches
  - 399425 gtk_input_dialog_fill_axes() adds child to gtkscrolledwin...
  - 403251 [patch] little memory leak in GtkPrintJob
  - 403267 [patch] memory leak in GtkPageSetupUnixDialog
  - 403470 MS-Windows Theme tab placement other than on top leaks a ...
  - 404506 Windows system fonts that have multi-byte font names cann...
  - 405089 Incorrect window placement for GtkEventBox private window
  - 405515 Minor leak in gtkfilesystemmodel.c
  - 405539 gdk_pixbuf_save() for PNG saver can return FALSE without ...
  - 415681 gdk_window_clear_area includes an extra line and column o...
  - 418219 GtkRecentChooser should apply filter before sorting and c...
  - 418403 Scroll to printer after selecting it from settings
  - 421985 _gtk_print_operation_platform_backend_launch_preview
  - 421990 gtk_print_job_get_surface
  - 421993 gtk_print_operation_init
  - 423064 Conditional jump or move depends on uninitialised value(s...
  - 423722 Fix printing header in gtk-demo
  - 424168 gtk_print_operation_run on async preview
  - 425655 Don't install gtk+-unix-print-2.0.pc on non-UNIX platforms
  - 425786 GDK segfaults if XineramaQueryScreens fails
  - 428665 Lpr Backend gets stuck in infinite loop during gtk_enumer...
  - 429902 GtkPrintOperation leaks cairo contextes
  - 431997 First delay of GdkPixbufAnimationIter is wrong
  - 433242 Inconsistent scroll arrow position calculations
  - 433972 Placing gtk.Expander inside a gtk.TextView() changes gtk....
  - 434261 _gtk_toolbar_elide_underscores incorrectly handles some s...
  - 383354 ctrl-L should make 'Location' entry disappear
  - 418673 gtk_recent_manager_add_item
  - 429732 gtk_accel_group_finalize accesses invalid memory
  - 435028 WM_CLIENT_LEADER is wrong on the leader_window
  - 431067 Background of the header window is not updated
  - 338843 add recent files support inside the ui manager
  - 148535 add drop shadow to menus, tooltips, etc. under Windows XP
* debian/control.in:
  - Conflicts on ubuntulooks (<= 0.9.11-1)
* debian/patches/15_default-fallback-icon-theme.patch:
  - patch from Debian, fallback on gnome icon theme

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<refentry id="GtkFileChooser">
 
2
<refmeta>
 
3
<refentrytitle role="top_of_page">GtkFileChooser</refentrytitle>
 
4
<manvolnum>3</manvolnum>
 
5
<refmiscinfo>GTK Library</refmiscinfo>
 
6
</refmeta>
 
7
 
 
8
<refnamediv>
 
9
<refname>GtkFileChooser</refname>
 
10
<refpurpose>File chooser interface used by GtkFileChooserWidget and GtkFileChooserDialog</refpurpose>
 
11
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
 
12
</refnamediv>
 
13
 
 
14
<refsynopsisdiv role="synopsis">
 
15
<title role="synopsis.title">Synopsis</title>
 
16
 
 
17
<synopsis>
 
18
 
 
19
#include &lt;gtk/gtk.h&gt;
 
20
 
 
21
 
 
22
                    <link linkend="GtkFileChooser-struct">GtkFileChooser</link>;
 
23
enum                <link linkend="GtkFileChooserAction">GtkFileChooserAction</link>;
 
24
enum                <link linkend="GtkFileChooserConfirmation">GtkFileChooserConfirmation</link>;
 
25
#define             <link linkend="GTK-FILE-CHOOSER-ERROR:CAPS">GTK_FILE_CHOOSER_ERROR</link>
 
26
enum                <link linkend="GtkFileChooserError">GtkFileChooserError</link>;
 
27
<link linkend="void">void</link>                <link linkend="gtk-file-chooser-set-action">gtk_file_chooser_set_action</link>         (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
28
                                                         <link linkend="GtkFileChooserAction">GtkFileChooserAction</link> action);
 
29
<link linkend="GtkFileChooserAction">GtkFileChooserAction</link> <link linkend="gtk-file-chooser-get-action">gtk_file_chooser_get_action</link>        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
 
30
<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,
 
31
                                                         <link linkend="gboolean">gboolean</link> local_only);
 
32
<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);
 
33
<link linkend="void">void</link>                <link linkend="gtk-file-chooser-set-select-multiple">gtk_file_chooser_set_select_multiple</link>
 
34
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
35
                                                         <link linkend="gboolean">gboolean</link> select_multiple);
 
36
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-file-chooser-get-select-multiple">gtk_file_chooser_get_select_multiple</link>
 
37
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
 
38
<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,
 
39
                                                         <link linkend="gboolean">gboolean</link> show_hidden);
 
40
<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);
 
41
<link linkend="void">void</link>                <link linkend="gtk-file-chooser-set-do-overwrite-confirmation">gtk_file_chooser_set_do_overwrite_confirmation</link>
 
42
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
43
                                                         <link linkend="gboolean">gboolean</link> do_overwrite_confirmation);
 
44
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-file-chooser-get-do-overwrite-confirmation">gtk_file_chooser_get_do_overwrite_confirmation</link>
 
45
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
 
46
<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,
 
47
                                                         const <link linkend="gchar">gchar</link> *name);
 
48
<link linkend="gchar">gchar</link>*              <link linkend="gtk-file-chooser-get-filename">gtk_file_chooser_get_filename</link>       (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
 
49
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-file-chooser-set-filename">gtk_file_chooser_set_filename</link>       (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
50
                                                         const <link linkend="char">char</link> *filename);
 
51
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-file-chooser-select-filename">gtk_file_chooser_select_filename</link>    (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
52
                                                         const <link linkend="char">char</link> *filename);
 
53
<link linkend="void">void</link>                <link linkend="gtk-file-chooser-unselect-filename">gtk_file_chooser_unselect_filename</link>  (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
54
                                                         const <link linkend="char">char</link> *filename);
 
55
<link linkend="void">void</link>                <link linkend="gtk-file-chooser-select-all">gtk_file_chooser_select_all</link>         (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
 
56
<link linkend="void">void</link>                <link linkend="gtk-file-chooser-unselect-all">gtk_file_chooser_unselect_all</link>       (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
 
57
<link linkend="GSList">GSList</link>*             <link linkend="gtk-file-chooser-get-filenames">gtk_file_chooser_get_filenames</link>      (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
 
58
<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,
 
59
                                                         const <link linkend="gchar">gchar</link> *filename);
 
60
<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);
 
61
<link linkend="gchar">gchar</link>*              <link linkend="gtk-file-chooser-get-uri">gtk_file_chooser_get_uri</link>            (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
 
62
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-file-chooser-set-uri">gtk_file_chooser_set_uri</link>            (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
63
                                                         const <link linkend="char">char</link> *uri);
 
64
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-file-chooser-select-uri">gtk_file_chooser_select_uri</link>         (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
65
                                                         const <link linkend="char">char</link> *uri);
 
66
<link linkend="void">void</link>                <link linkend="gtk-file-chooser-unselect-uri">gtk_file_chooser_unselect_uri</link>       (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
67
                                                         const <link linkend="char">char</link> *uri);
 
68
<link linkend="GSList">GSList</link>*             <link linkend="gtk-file-chooser-get-uris">gtk_file_chooser_get_uris</link>           (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
 
69
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-file-chooser-set-current-folder-uri">gtk_file_chooser_set_current_folder_uri</link>
 
70
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
71
                                                         const <link linkend="gchar">gchar</link> *uri);
 
72
<link linkend="gchar">gchar</link>*              <link linkend="gtk-file-chooser-get-current-folder-uri">gtk_file_chooser_get_current_folder_uri</link>
 
73
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
 
74
<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,
 
75
                                                         <link linkend="GtkWidget">GtkWidget</link> *preview_widget);
 
76
<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);
 
77
<link linkend="void">void</link>                <link linkend="gtk-file-chooser-set-preview-widget-active">gtk_file_chooser_set_preview_widget_active</link>
 
78
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
79
                                                         <link linkend="gboolean">gboolean</link> active);
 
80
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-file-chooser-get-preview-widget-active">gtk_file_chooser_get_preview_widget_active</link>
 
81
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
 
82
<link linkend="void">void</link>                <link linkend="gtk-file-chooser-set-use-preview-label">gtk_file_chooser_set_use_preview_label</link>
 
83
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
84
                                                         <link linkend="gboolean">gboolean</link> use_label);
 
85
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-file-chooser-get-use-preview-label">gtk_file_chooser_get_use_preview_label</link>
 
86
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
 
87
<link linkend="char">char</link>*               <link linkend="gtk-file-chooser-get-preview-filename">gtk_file_chooser_get_preview_filename</link>
 
88
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
 
89
<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);
 
90
<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,
 
91
                                                         <link linkend="GtkWidget">GtkWidget</link> *extra_widget);
 
92
<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);
 
93
<link linkend="void">void</link>                <link linkend="gtk-file-chooser-add-filter">gtk_file_chooser_add_filter</link>         (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
94
                                                         <link linkend="GtkFileFilter">GtkFileFilter</link> *filter);
 
95
<link linkend="void">void</link>                <link linkend="gtk-file-chooser-remove-filter">gtk_file_chooser_remove_filter</link>      (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
96
                                                         <link linkend="GtkFileFilter">GtkFileFilter</link> *filter);
 
97
<link linkend="GSList">GSList</link>*             <link linkend="gtk-file-chooser-list-filters">gtk_file_chooser_list_filters</link>       (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
 
98
<link linkend="void">void</link>                <link linkend="gtk-file-chooser-set-filter">gtk_file_chooser_set_filter</link>         (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
99
                                                         <link linkend="GtkFileFilter">GtkFileFilter</link> *filter);
 
100
<link linkend="GtkFileFilter">GtkFileFilter</link>*      <link linkend="gtk-file-chooser-get-filter">gtk_file_chooser_get_filter</link>         (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
 
101
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-file-chooser-add-shortcut-folder">gtk_file_chooser_add_shortcut_folder</link>
 
102
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
103
                                                         const <link linkend="char">char</link> *folder,
 
104
                                                         <link linkend="GError">GError</link> **error);
 
105
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-file-chooser-remove-shortcut-folder">gtk_file_chooser_remove_shortcut_folder</link>
 
106
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
107
                                                         const <link linkend="char">char</link> *folder,
 
108
                                                         <link linkend="GError">GError</link> **error);
 
109
<link linkend="GSList">GSList</link>*             <link linkend="gtk-file-chooser-list-shortcut-folders">gtk_file_chooser_list_shortcut_folders</link>
 
110
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
 
111
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-file-chooser-add-shortcut-folder-uri">gtk_file_chooser_add_shortcut_folder_uri</link>
 
112
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
113
                                                         const <link linkend="char">char</link> *uri,
 
114
                                                         <link linkend="GError">GError</link> **error);
 
115
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-file-chooser-remove-shortcut-folder-uri">gtk_file_chooser_remove_shortcut_folder_uri</link>
 
116
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
117
                                                         const <link linkend="char">char</link> *uri,
 
118
                                                         <link linkend="GError">GError</link> **error);
 
119
<link linkend="GSList">GSList</link>*             <link linkend="gtk-file-chooser-list-shortcut-folder-uris">gtk_file_chooser_list_shortcut_folder_uris</link>
 
120
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);
 
121
 
 
122
 
 
123
</synopsis>
 
124
</refsynopsisdiv>
 
125
 
 
126
<refsect1 role="object_hierarchy">
 
127
<title role="object_hierarchy.title">Object Hierarchy</title>
 
128
<synopsis>
 
129
 
 
130
  <link linkend="GInterface">GInterface</link>
 
131
   +----GtkFileChooser
 
132
</synopsis>
 
133
 
 
134
</refsect1>
 
135
 
 
136
<refsect1 role="prerequisites">
 
137
<title role="prerequisites.title">Prerequisites</title>
 
138
<para>
 
139
GtkFileChooser requires
 
140
 <link linkend="GtkWidget">GtkWidget</link>.</para>
 
141
 
 
142
</refsect1>
 
143
 
 
144
 
 
145
 
 
146
<refsect1 role="implementations">
 
147
<title role="implementations.title">Known Implementations</title>
 
148
<para>
 
149
GtkFileChooser is implemented by
 
150
 <link linkend="GtkFileChooserWidget">GtkFileChooserWidget</link>,  <link linkend="GtkFileChooserButton">GtkFileChooserButton</link> and  <link linkend="GtkFileChooserDialog">GtkFileChooserDialog</link>.</para>
 
151
 
 
152
</refsect1>
 
153
 
 
154
 
 
155
<refsect1 role="signal_proto">
 
156
<title role="signal_proto.title">Signals</title>
 
157
<synopsis>
 
158
 
 
159
  &quot;<link linkend="GtkFileChooser-confirm-overwrite">confirm-overwrite</link>&quot;                              : Run Last
 
160
  &quot;<link linkend="GtkFileChooser-current-folder-changed">current-folder-changed</link>&quot;                         : Run Last
 
161
  &quot;<link linkend="GtkFileChooser-file-activated">file-activated</link>&quot;                                 : Run Last
 
162
  &quot;<link linkend="GtkFileChooser-selection-changed">selection-changed</link>&quot;                              : Run Last
 
163
  &quot;<link linkend="GtkFileChooser-update-preview">update-preview</link>&quot;                                 : Run Last
 
164
</synopsis>
 
165
</refsect1>
 
166
 
 
167
 
 
168
<refsect1 role="desc">
 
169
<title role="desc.title">Description</title>
 
170
    <para>
 
171
      <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link> is an interface that can be implemented by file
 
172
      selection widgets.  In GTK+, the main objects that implement this
 
173
      interface are <link linkend="GtkFileChooserWidget"><type>GtkFileChooserWidget</type></link>, <link linkend="GtkFileChooserDialog"><type>GtkFileChooserDialog</type></link>, and
 
174
      <link linkend="GtkFileChooserButton"><type>GtkFileChooserButton</type></link>.  You do not need to write an object that
 
175
      implements the <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link> interface unless you are trying to
 
176
      adapt an existing file selector to expose a standard programming
 
177
      interface.
 
178
    </para>
 
179
 
 
180
    <para>
 
181
      <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link> allows for shortcuts to various places in the filesystem.
 
182
      In the default implementation these are displayed in the left pane. It
 
183
      may be a bit confusing at first taht these shortcuts come from various 
 
184
      sources and in various flavours, so lets explain the terminology here:
 
185
    </para>
 
186
      <variablelist>
 
187
         <varlistentry>
 
188
           <term>Bookmarks</term>
 
189
           <listitem><para>
 
190
             are created by the user, by dragging folders from the 
 
191
             right pane to the left pane, or by using the "Add". Bookmarks
 
192
             can be renamed and deleted by the user.
 
193
           </para></listitem>
 
194
         </varlistentry>
 
195
         <varlistentry>
 
196
           <term>Shortcuts</term>
 
197
           <listitem><para> 
 
198
             can be provided by the application or by the underlying filesystem
 
199
             abstraction (e.g. both the gnome-vfs and the Windows filesystems 
 
200
             provide "Desktop" shortcuts). Shortcuts cannot be modified by the 
 
201
             user.
 
202
           </para></listitem>
 
203
         </varlistentry>
 
204
         <varlistentry> 
 
205
           <term>Volumes</term>
 
206
           <listitem><para>
 
207
             are provided by the underlying filesystem abstraction. They are
 
208
             the "roots" of the filesystem. 
 
209
           </para></listitem>
 
210
         </varlistentry>
 
211
      </variablelist>
 
212
 
 
213
    <refsect2 id="gtkfilechooser-encodings">
 
214
      <title>File Names and Encodings</title>
 
215
 
 
216
      <para>
 
217
        When the user is finished selecting files in a
 
218
        <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>, your program can get the selected names
 
219
        either as filenames or as URIs.  For URIs, the normal escaping
 
220
        rules are applied if the URI contains non-ASCII characters.
 
221
        However, filenames are <emphasis>always</emphasis> returned in
 
222
        the character set specified by the
 
223
        <envar>G_FILENAME_ENCODING</envar> environment variable.
 
224
        Please see the Glib documentation for more details about this
 
225
        variable.
 
226
      </para>
 
227
 
 
228
      <important>
 
229
        <para>
 
230
          This means that while you can pass the result of
 
231
          <link linkend="gtk-file-chooser-get-filename"><function>gtk_file_chooser_get_filename()</function></link> to
 
232
          <function>open(2)</function> or
 
233
          <function>fopen(3)</function>, you may not be able to
 
234
          directly set it as the text of a <link linkend="GtkLabel"><type>GtkLabel</type></link> widget unless you
 
235
          convert it first to UTF-8, which all GTK+ widgets expect.
 
236
          You should use <link linkend="g-filename-to-utf8"><function>g_filename_to_utf8()</function></link> to convert filenames
 
237
          into strings that can be passed to GTK+ widgets.
 
238
        </para>
 
239
      </important>
 
240
    </refsect2>
 
241
 
 
242
    <refsect2 id="gtkfilechooser-preview">
 
243
      <title>Adding a Preview Widget</title>
 
244
 
 
245
      <para>
 
246
        You can add a custom preview widget to a file chooser and then
 
247
        get notification about when the preview needs to be updated.
 
248
        To install a preview widget, use
 
249
        <link linkend="gtk-file-chooser-set-preview-widget"><function>gtk_file_chooser_set_preview_widget()</function></link>.  Then, connect to the
 
250
        <link linkend="GtkFileChooser-update-preview"><type>GtkFileChooser::update-preview</type></link> signal to get notified when
 
251
        you need to update the contents of the preview.
 
252
      </para>
 
253
 
 
254
      <para>
 
255
        Your callback should use
 
256
        <link linkend="gtk-file-chooser-get-preview-filename"><function>gtk_file_chooser_get_preview_filename()</function></link> to see what needs
 
257
        previewing.  Once you have generated the preview for the
 
258
        corresponding file, you must call
 
259
        <link linkend="gtk-file-chooser-set-preview-widget-active"><function>gtk_file_chooser_set_preview_widget_active()</function></link> with a boolean
 
260
        flag that indicates whether your callback could successfully
 
261
        generate a preview.
 
262
      </para>
 
263
 
 
264
      <example id="example-gtkfilechooser-preview">
 
265
        <title>Sample Usage</title>
 
266
 
 
267
        <programlisting>
 
268
{
 
269
  GtkImage *preview;
 
270
 
 
271
  ...
 
272
 
 
273
  preview = gtk_image_new (<!-- -->);
 
274
 
 
275
  gtk_file_chooser_set_preview_widget (my_file_chooser, preview);
 
276
  g_signal_connect (my_file_chooser, "update-preview",
 
277
                    G_CALLBACK (update_preview_cb), preview);
 
278
}
 
279
 
 
280
static void
 
281
update_preview_cb (GtkFileChooser *file_chooser, gpointer data)
 
282
{
 
283
  GtkWidget *preview;
 
284
  char *filename;
 
285
  GdkPixbuf *pixbuf;
 
286
  gboolean have_preview;
 
287
 
 
288
  preview = GTK_WIDGET (data);
 
289
  filename = gtk_file_chooser_get_preview_filename (file_chooser);
 
290
 
 
291
  pixbuf = gdk_pixbuf_new_from_file_at_size (filename, 128, 128, NULL);
 
292
  have_preview = (pixbuf != NULL);
 
293
  g_free (filename);
 
294
 
 
295
  gtk_image_set_from_pixbuf (GTK_IMAGE (preview), pixbuf);
 
296
  if (pixbuf)
 
297
    gobject_unref (pixbuf);
 
298
 
 
299
  gtk_file_chooser_set_preview_widget_active (file_chooser, have_preview);
 
300
}
 
301
        </programlisting>
 
302
      </example>
 
303
    </refsect2>
 
304
 
 
305
    <refsect2 id="gtkfilechooser-extra">
 
306
      <title>Adding Extra Widgets</title>
 
307
 
 
308
      <para>
 
309
        You can add extra widgets to a file chooser to provide options
 
310
        that are not present in the default design.  For example, you
 
311
        can add a toggle button to give the user the option to open a
 
312
        file in read-only mode.  You can use
 
313
        <link linkend="gtk-file-chooser-set-extra-widget"><function>gtk_file_chooser_set_extra_widget()</function></link> to insert additional
 
314
        widgets in a file chooser.
 
315
      </para>
 
316
 
 
317
      <example id="example-gtkfilechooser-extra">
 
318
        <title>Sample Usage</title>
 
319
 
 
320
        <programlisting>
 
321
{
 
322
  GtkWidget *toggle;
 
323
 
 
324
  ...
 
325
 
 
326
  toggle = gtk_check_button_new_with_label ("Open file read-only");
 
327
  gtk_widget_show (toggle);
 
328
  gtk_file_chooser_set_extra_widget (my_file_chooser, toggle);
 
329
}
 
330
        </programlisting>
 
331
      </example>
 
332
 
 
333
      <note>
 
334
        <para>
 
335
          If you want to set more than one extra widget in the file
 
336
          chooser, you can a container such as a GtkVBox or a GtkTable
 
337
          and include your widgets in it.  Then, set the container as
 
338
          the whole extra widget.
 
339
        </para>
 
340
      </note>
 
341
    </refsect2>
 
342
 
 
343
    <refsect2 id="gtkfilechooser-key-bindings">
 
344
      <title>Key Bindings</title>
 
345
 
 
346
      <para>
 
347
        Internally, GTK+ implements a file chooser's graphical user
 
348
        interface with the private
 
349
        <classname>GtkFileChooserDefaultClass</classname>.  This
 
350
        widget has several <link linkend="gtk-Bindings">key
 
351
        bindings</link> and their associated signals.  This section
 
352
        describes the available key binding signals.
 
353
      </para>
 
354
 
 
355
      <example id="gtkfilechooser-key-binding-example">
 
356
        <title>GtkFileChooser key binding example</title>
 
357
 
 
358
        <para>
 
359
          The default keys that activate the key-binding signals in
 
360
          <classname>GtkFileChooserDefaultClass</classname> are as
 
361
          follows:
 
362
        </para>
 
363
 
 
364
        <informaltable>
 
365
          <tgroup cols="2">
 
366
            <tbody>
 
367
              <row>
 
368
                <entry>Signal name</entry>
 
369
                <entry>Default key combinations</entry>
 
370
              </row>
 
371
              <row>
 
372
                <entry>location-popup</entry>
 
373
                <entry>
 
374
                  <keycombo><keycap>Control</keycap><keycap>L</keycap></keycombo> (empty path);
 
375
                  <keycap>/</keycap> (path of "/")<footnote>
 
376
                    <para>
 
377
                      Both the individual <keycap>/</keycap> key and the
 
378
                      numeric keypad's "divide" key are supported.
 
379
                    </para>
 
380
                  </footnote>;
 
381
                  <keycap>~</keycap> (path of "~")
 
382
                </entry>
 
383
              </row>
 
384
              <row>
 
385
                <entry>up-folder</entry>
 
386
                <entry>
 
387
                  <keycombo><keycap>Alt</keycap><keycap>Up</keycap></keycombo><footnote>
 
388
                    <para>
 
389
                      Both the individual Up key and the numeric
 
390
                      keypad's Up key are supported.
 
391
                    </para>
 
392
                  </footnote>
 
393
                  ;
 
394
                  <keycap>Backspace</keycap>
 
395
                </entry>
 
396
              </row>
 
397
              <row>
 
398
                <entry>down-folder</entry>
 
399
                <entry><keycombo><keycap>Alt</keycap><keycap>Down</keycap></keycombo></entry>
 
400
              </row>
 
401
              <row>
 
402
                <entry>home-folder</entry>
 
403
                <entry><keycombo><keycap>Alt</keycap><keycap>Home</keycap></keycombo></entry>
 
404
              </row>
 
405
              <row>
 
406
                <entry>desktop-folder</entry>
 
407
                <entry><keycombo><keycap>Alt</keycap><keycap>D</keycap></keycombo></entry>
 
408
              </row>
 
409
              <row>
 
410
                <entry>quick-bookmark</entry>
 
411
                <entry><keycombo><keycap>Alt</keycap><keycap>1</keycap></keycombo> through <keycombo><keycap>Alt</keycap><keycap>0</keycap></keycombo></entry>
 
412
              </row>
 
413
            </tbody>
 
414
          </tgroup>
 
415
        </informaltable>
 
416
 
 
417
        <para>
 
418
          You can change these defaults to something else.  For
 
419
          example, to add a <keycap>Shift</keycap> modifier to a few
 
420
          of the default bindings, you can include the following
 
421
          fragment in your <filename>.gtkrc-2.0</filename> file:
 
422
        </para>
 
423
 
 
424
        <programlisting>
 
425
binding "my-own-gtkfilechooser-bindings" {
 
426
        bind "&lt;Alt&gt;&lt;Shift&gt;Up" {
 
427
                "up-folder" ()
 
428
        }
 
429
        bind "&lt;Alt&gt;&lt;Shift&gt;Down" {
 
430
                "down-folder" ()
 
431
        }
 
432
        bind "&lt;Alt&gt;&lt;Shift&gt;Home" {
 
433
                "home-folder" ()
 
434
        }
 
435
}
 
436
 
 
437
class "GtkFileChooserDefault" binding "my-own-gtkfilechooser-bindings"
 
438
        </programlisting>
 
439
      </example>
 
440
 
 
441
      <refsect3 id="GtkFileChooserDefault-location-popup">
 
442
        <title>The &quot;GtkFileChooserDefault::location-popup&quot; signal</title>
 
443
 
 
444
        <programlisting>
 
445
          void user_function (GtkFileChooserDefault *chooser,
 
446
                              const char            *path,
 
447
                              <link linkend="gpointer">gpointer</link> user_data);
 
448
        </programlisting>
 
449
 
 
450
        <para>
 
451
          This is used to make the file chooser show a "Location"
 
452
          dialog which the user can use to manually type the name of
 
453
          the file he wishes to select.  The
 
454
          <parameter>path</parameter> argument is a string that gets
 
455
          put in the text entry for the file name.  By default this is bound to
 
456
          <keycombo><keycap>Control</keycap><keycap>L</keycap></keycombo>
 
457
          with a <parameter>path</parameter> string of "" (the empty
 
458
          string).  It is also bound to <keycap>/</keycap> with a
 
459
          <parameter>path</parameter> string of "<literal>/</literal>"
 
460
          (a slash):  this lets you type <keycap>/</keycap> and
 
461
          immediately type a path name.  On Unix systems, this is bound to
 
462
          <keycap>~</keycap> (tilde) with a <parameter>path</parameter> string
 
463
          of "~" itself for access to home directories.
 
464
        </para>
 
465
 
 
466
        <variablelist role="params">
 
467
          <varlistentry>
 
468
            <term><parameter>chooser</parameter>&nbsp;:</term>
 
469
            <listitem>
 
470
              <simpara>
 
471
                the object which received the signal.
 
472
              </simpara>
 
473
            </listitem>
 
474
          </varlistentry>
 
475
          <varlistentry>
 
476
            <term><parameter>path</parameter>&nbsp;:</term>
 
477
            <listitem>
 
478
              <simpara>
 
479
                default contents for the text entry for the file name
 
480
              </simpara>
 
481
            </listitem>
 
482
          </varlistentry>
 
483
          <varlistentry>
 
484
            <term><parameter>user_data</parameter>&nbsp;:</term>
 
485
            <listitem>
 
486
              <simpara>
 
487
                user data set when the signal handler was connected.
 
488
              </simpara>
 
489
            </listitem>
 
490
          </varlistentry>
 
491
        </variablelist>
 
492
 
 
493
        <tip>
 
494
          <para>
 
495
            You can create your own bindings for the
 
496
            <symbol>location-popup</symbol> signal with custom
 
497
            <parameter>path</parameter> strings, and have a crude form
 
498
            of easily-to-type bookmarks.  For example, say you access
 
499
            the path <filename>/home/username/misc</filename> very
 
500
            frequently.  You could then create an <keycombo>
 
501
            <keycap>Alt</keycap> <keycap>M</keycap> </keycombo>
 
502
            shortcut by including the following in your
 
503
            <filename>.gtkrc-2.0</filename>:
 
504
          </para>
 
505
 
 
506
          <programlisting>
 
507
binding "misc-shortcut" {
 
508
        bind "&lt;Alt&gt;M" {
 
509
                "location-popup" ("/home/username/misc")
 
510
        }
 
511
}
 
512
 
 
513
class "GtkFileChooserDefault" binding "misc-shortcut"
 
514
          </programlisting>
 
515
        </tip>
 
516
      </refsect3>
 
517
 
 
518
      <refsect3 id="GtkFileChooserDefault-up-folder">
 
519
        <title>The &quot;GtkFileChooserDefault::up-folder&quot; signal</title>
 
520
 
 
521
        <programlisting>
 
522
          void user_function (GtkFileChooserDefault *chooser,
 
523
                              <link linkend="gpointer">gpointer</link> user_data);
 
524
        </programlisting>
 
525
 
 
526
        <para>
 
527
          This is used to make the file chooser go to the parent of
 
528
          the current folder in the file hierarchy.  By default this
 
529
          is bound to <keycap>Backspace</keycap> and
 
530
          <keycombo><keycap>Alt</keycap><keycap>Up</keycap></keycombo>
 
531
          (the Up key in the numeric keypad also works).
 
532
        </para>
 
533
 
 
534
        <variablelist role="params">
 
535
          <varlistentry>
 
536
            <term><parameter>chooser</parameter>&nbsp;:</term>
 
537
            <listitem>
 
538
              <simpara>
 
539
                the object which received the signal.
 
540
              </simpara>
 
541
            </listitem>
 
542
          </varlistentry>
 
543
          <varlistentry>
 
544
            <term><parameter>user_data</parameter>&nbsp;:</term>
 
545
            <listitem>
 
546
              <simpara>
 
547
                user data set when the signal handler was connected.
 
548
              </simpara>
 
549
            </listitem>
 
550
          </varlistentry>
 
551
        </variablelist>
 
552
      </refsect3>
 
553
 
 
554
      <refsect3 id="GtkFileChooserDefault-down-folder">
 
555
        <title>The &quot;GtkFileChooserDefault::down-folder&quot; signal</title>
 
556
 
 
557
        <programlisting>
 
558
          void user_function (GtkFileChooserDefault *chooser,
 
559
                              <link linkend="gpointer">gpointer</link> user_data);
 
560
        </programlisting>
 
561
 
 
562
        <para>
 
563
          This is used to make the file chooser go to a child of the
 
564
          current folder in the file hierarchy.  The subfolder that
 
565
          will be used is displayed in the path bar widget of the file
 
566
          chooser.  For example, if the path bar is showing
 
567
          "/foo/<emphasis>bar/</emphasis>baz", then this will cause
 
568
          the file chooser to switch to the "baz" subfolder.  By
 
569
          default this is bound to
 
570
          <keycombo><keycap>Alt</keycap><keycap>Down</keycap></keycombo>
 
571
          (the Down key in the numeric keypad also works).
 
572
        </para>
 
573
 
 
574
        <variablelist role="params">
 
575
          <varlistentry>
 
576
            <term><parameter>chooser</parameter>&nbsp;:</term>
 
577
            <listitem>
 
578
              <simpara>
 
579
                the object which received the signal.
 
580
              </simpara>
 
581
            </listitem>
 
582
          </varlistentry>
 
583
          <varlistentry>
 
584
            <term><parameter>user_data</parameter>&nbsp;:</term>
 
585
            <listitem>
 
586
              <simpara>
 
587
                user data set when the signal handler was connected.
 
588
              </simpara>
 
589
            </listitem>
 
590
          </varlistentry>
 
591
        </variablelist>
 
592
      </refsect3>
 
593
 
 
594
      <refsect3 id="GtkFileChooserDefault-home-folder">
 
595
        <title>The &quot;GtkFileChooserDefault::home-folder&quot; signal</title>
 
596
 
 
597
        <programlisting>
 
598
          void user_function (GtkFileChooserDefault *chooser,
 
599
                              <link linkend="gpointer">gpointer</link> user_data);
 
600
        </programlisting>
 
601
 
 
602
        <para>
 
603
          This is used to make the file chooser show the user's home
 
604
          folder in the file list.  By default this is bound to
 
605
          <keycombo><keycap>Alt</keycap><keycap>Home</keycap></keycombo>
 
606
          (the Home key in the numeric keypad also works).
 
607
        </para>
 
608
 
 
609
        <variablelist role="params">
 
610
          <varlistentry>
 
611
            <term><parameter>chooser</parameter>&nbsp;:</term>
 
612
            <listitem>
 
613
              <simpara>
 
614
                the object which received the signal.
 
615
              </simpara>
 
616
            </listitem>
 
617
          </varlistentry>
 
618
          <varlistentry>
 
619
            <term><parameter>user_data</parameter>&nbsp;:</term>
 
620
            <listitem>
 
621
              <simpara>
 
622
                user data set when the signal handler was connected.
 
623
              </simpara>
 
624
            </listitem>
 
625
          </varlistentry>
 
626
        </variablelist>
 
627
      </refsect3>
 
628
 
 
629
      <refsect3 id="GtkFileChooserDefault-desktop-folder">
 
630
        <title>The &quot;GtkFileChooserDefault::desktop-folder&quot; signal</title>
 
631
 
 
632
        <programlisting>
 
633
          void user_function (GtkFileChooserDefault *chooser,
 
634
                              <link linkend="gpointer">gpointer</link> user_data);
 
635
        </programlisting>
 
636
 
 
637
        <para>
 
638
          This is used to make the file chooser show the user's Desktop
 
639
          folder in the file list.  By default this is bound to
 
640
          <keycombo><keycap>Alt</keycap><keycap>D</keycap></keycombo>.
 
641
        </para>
 
642
 
 
643
        <variablelist role="params">
 
644
          <varlistentry>
 
645
            <term><parameter>chooser</parameter>&nbsp;:</term>
 
646
            <listitem>
 
647
              <simpara>
 
648
                the object which received the signal.
 
649
              </simpara>
 
650
            </listitem>
 
651
          </varlistentry>
 
652
          <varlistentry>
 
653
            <term><parameter>user_data</parameter>&nbsp;:</term>
 
654
            <listitem>
 
655
              <simpara>
 
656
                user data set when the signal handler was connected.
 
657
              </simpara>
 
658
            </listitem>
 
659
          </varlistentry>
 
660
        </variablelist>
 
661
      </refsect3>
 
662
 
 
663
      <refsect3 id="GtkFileChooserDefault-quick-bookmark">
 
664
        <title>The &quot;GtkFileChooserDefault::quick-bookmark&quot; signal</title>
 
665
 
 
666
        <programlisting>
 
667
          void user_function (GtkFileChooserDefault *chooser,
 
668
                              gint bookmark_index,
 
669
                              <link linkend="gpointer">gpointer</link> user_data);
 
670
        </programlisting>
 
671
 
 
672
        <para>
 
673
          This is used to make the file chooser switch to the bookmark
 
674
          specified in the <parameter>bookmark_index</parameter> parameter.
 
675
          For example, if you have three bookmarks, you can pass 0, 1, 2 to
 
676
          this signal to switch to each of them, respectively.  By default this is bound to
 
677
          <keycombo><keycap>Alt</keycap><keycap>1</keycap></keycombo>,
 
678
          <keycombo><keycap>Alt</keycap><keycap>2</keycap></keycombo>, 
 
679
          etc. until
 
680
          <keycombo><keycap>Alt</keycap><keycap>0</keycap></keycombo>.  Note
 
681
          that in the default binding,
 
682
          that <keycombo><keycap>Alt</keycap><keycap>1</keycap></keycombo> is
 
683
          actually defined to switch to the bookmark at index 0, and so on
 
684
          successively;
 
685
          <keycombo><keycap>Alt</keycap><keycap>0</keycap></keycombo> is
 
686
          defined to switch to the bookmark at index 10.
 
687
        </para>
 
688
 
 
689
        <variablelist role="params">
 
690
          <varlistentry>
 
691
            <term><parameter>chooser</parameter>&nbsp;:</term>
 
692
            <listitem>
 
693
              <simpara>
 
694
                the object which received the signal.
 
695
              </simpara>
 
696
            </listitem>
 
697
          </varlistentry>
 
698
          <varlistentry>
 
699
            <term><parameter>bookmark_indes</parameter>&nbsp;:</term>
 
700
            <listitem>
 
701
              <simpara>
 
702
                index of the bookmark to switch to; the indices start at 0.
 
703
              </simpara>
 
704
            </listitem>
 
705
          </varlistentry>
 
706
          <varlistentry>
 
707
            <term><parameter>user_data</parameter>&nbsp;:</term>
 
708
            <listitem>
 
709
              <simpara>
 
710
                user data set when the signal handler was connected.
 
711
              </simpara>
 
712
            </listitem>
 
713
          </varlistentry>
 
714
        </variablelist>
 
715
      </refsect3>
 
716
    </refsect2>
 
717
</refsect1>
 
718
 
 
719
<refsect1 role="details">
 
720
<title role="details.title">Details</title>
 
721
<refsect2>
 
722
<title><anchor id="GtkFileChooser-struct" role="struct"/>GtkFileChooser</title>
 
723
<indexterm><primary>GtkFileChooser</primary></indexterm><programlisting>typedef struct _GtkFileChooser GtkFileChooser;</programlisting>
 
724
<para>
 
725
 
 
726
</para></refsect2>
 
727
<refsect2>
 
728
<title><anchor id="GtkFileChooserAction" role="enum"/>enum GtkFileChooserAction</title>
 
729
<indexterm><primary>GtkFileChooserAction</primary></indexterm><programlisting>typedef enum
 
730
{
 
731
  GTK_FILE_CHOOSER_ACTION_OPEN,
 
732
  GTK_FILE_CHOOSER_ACTION_SAVE,
 
733
  GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
 
734
  GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER
 
735
} GtkFileChooserAction;
 
736
</programlisting>
 
737
    <para>
 
738
      Describes whether a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link> is being used to open
 
739
      existing files or to save to a possibly new file.
 
740
    </para><variablelist role="enum">
 
741
<varlistentry>
 
742
<term><anchor id="GTK-FILE-CHOOSER-ACTION-OPEN:CAPS" role="constant"/><literal>GTK_FILE_CHOOSER_ACTION_OPEN</literal></term>
 
743
<listitem><simpara>Indicates open mode.  The file chooser
 
744
    will only let the user pick an existing file.
 
745
</simpara></listitem>
 
746
</varlistentry>
 
747
<varlistentry>
 
748
<term><anchor id="GTK-FILE-CHOOSER-ACTION-SAVE:CAPS" role="constant"/><literal>GTK_FILE_CHOOSER_ACTION_SAVE</literal></term>
 
749
<listitem><simpara>Indicates save mode.  The file chooser
 
750
    will let the user pick an existing file, or type in a new
 
751
    filename.
 
752
</simpara></listitem>
 
753
</varlistentry>
 
754
<varlistentry>
 
755
<term><anchor id="GTK-FILE-CHOOSER-ACTION-SELECT-FOLDER:CAPS" role="constant"/><literal>GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</literal></term>
 
756
<listitem><simpara>Indicates an Open mode for
 
757
    selecting folders.  The file chooser will let the user pick an
 
758
    existing folder.
 
759
</simpara></listitem>
 
760
</varlistentry>
 
761
<varlistentry>
 
762
<term><anchor id="GTK-FILE-CHOOSER-ACTION-CREATE-FOLDER:CAPS" role="constant"/><literal>GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER</literal></term>
 
763
<listitem><simpara>Indicates a mode for creating a
 
764
    new folder.  The file chooser will let the user name an existing or
 
765
    new folder.
 
766
 
 
767
</simpara></listitem>
 
768
</varlistentry>
 
769
</variablelist></refsect2>
 
770
<refsect2>
 
771
<title><anchor id="GtkFileChooserConfirmation" role="enum"/>enum GtkFileChooserConfirmation</title>
 
772
<indexterm><primary>GtkFileChooserConfirmation</primary></indexterm><programlisting>typedef enum
 
773
{
 
774
  GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM,
 
775
  GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME,
 
776
  GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN
 
777
} GtkFileChooserConfirmation;
 
778
</programlisting>
 
779
    <para>
 
780
      Used as a return value of handlers for the <link
 
781
      linkend="GtkFileChooser-confirm-overwrite">confirm-overwrite</link>
 
782
      signal of a <classname>GtkFileChooser</classname>.  This value
 
783
      determines whether the file chooser will present the stock
 
784
      confirmation dialog, accept the user's choice of a filename, or
 
785
      let the user choose another filename.
 
786
    </para><variablelist role="enum">
 
787
<varlistentry>
 
788
<term><anchor id="GTK-FILE-CHOOSER-CONFIRMATION-CONFIRM:CAPS" role="constant"/><literal>GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM</literal></term>
 
789
<listitem><simpara>The file chooser will present
 
790
    its stock dialog to confirm about overwriting an existing file.
 
791
</simpara></listitem>
 
792
</varlistentry>
 
793
<varlistentry>
 
794
<term><anchor id="GTK-FILE-CHOOSER-CONFIRMATION-ACCEPT-FILENAME:CAPS" role="constant"/><literal>GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME</literal></term>
 
795
<listitem><simpara>The file chooser will
 
796
    terminate and accept the user's choice of a file name.
 
797
</simpara></listitem>
 
798
</varlistentry>
 
799
<varlistentry>
 
800
<term><anchor id="GTK-FILE-CHOOSER-CONFIRMATION-SELECT-AGAIN:CAPS" role="constant"/><literal>GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN</literal></term>
 
801
<listitem><simpara>The file chooser will
 
802
    continue running, so as to let the user select another file name.
 
803
 
 
804
    <para>
 
805
      Since 2.8
 
806
    </para>
 
807
 
 
808
</simpara></listitem>
 
809
</varlistentry>
 
810
</variablelist></refsect2>
 
811
<refsect2>
 
812
<title><anchor id="GTK-FILE-CHOOSER-ERROR:CAPS" role="macro"/>GTK_FILE_CHOOSER_ERROR</title>
 
813
<indexterm><primary>GTK_FILE_CHOOSER_ERROR</primary></indexterm><programlisting>#define GTK_FILE_CHOOSER_ERROR (gtk_file_chooser_error_quark ())
 
814
</programlisting>
 
815
    <para>
 
816
      Used to get the <link linkend="GError"><type>GError</type></link> quark for <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link> errors.
 
817
    </para></refsect2>
 
818
<refsect2>
 
819
<title><anchor id="GtkFileChooserError" role="enum"/>enum GtkFileChooserError</title>
 
820
<indexterm><primary>GtkFileChooserError</primary></indexterm><programlisting>typedef enum {
 
821
  GTK_FILE_CHOOSER_ERROR_NONEXISTENT,
 
822
  GTK_FILE_CHOOSER_ERROR_BAD_FILENAME,
 
823
  GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS
 
824
} GtkFileChooserError;
 
825
</programlisting>
 
826
    <para>
 
827
      These identify the various errors that can occur while calling
 
828
      <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link> functions.
 
829
    </para><variablelist role="enum">
 
830
<varlistentry>
 
831
<term><anchor id="GTK-FILE-CHOOSER-ERROR-NONEXISTENT:CAPS" role="constant"/><literal>GTK_FILE_CHOOSER_ERROR_NONEXISTENT</literal></term>
 
832
<listitem><simpara>Indicates that a file does not exist.
 
833
</simpara></listitem>
 
834
</varlistentry>
 
835
<varlistentry>
 
836
<term><anchor id="GTK-FILE-CHOOSER-ERROR-BAD-FILENAME:CAPS" role="constant"/><literal>GTK_FILE_CHOOSER_ERROR_BAD_FILENAME</literal></term>
 
837
<listitem><simpara>Indicates a malformed filename.
 
838
</simpara></listitem>
 
839
</varlistentry>
 
840
<varlistentry>
 
841
<term><anchor id="GTK-FILE-CHOOSER-ERROR-ALREADY-EXISTS:CAPS" role="constant"/><literal>GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS</literal></term>
 
842
<listitem><simpara>
 
843
 
 
844
</simpara></listitem>
 
845
</varlistentry>
 
846
</variablelist></refsect2>
 
847
<refsect2>
 
848
<title><anchor id="gtk-file-chooser-set-action" role="function" condition="since:2.4"/>gtk_file_chooser_set_action ()</title>
 
849
<indexterm role="2.4"><primary>gtk_file_chooser_set_action</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_file_chooser_set_action         (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
850
                                                         <link linkend="GtkFileChooserAction">GtkFileChooserAction</link> action);</programlisting>
 
851
<para>
 
852
Sets the type of operation that the chooser is performing; the
 
853
user interface is adapted to suit the selected action. For example,
 
854
an option to create a new folder might be shown if the action is
 
855
<link linkend="GTK-FILE-CHOOSER-ACTION-SAVE:CAPS"><literal>GTK_FILE_CHOOSER_ACTION_SAVE</literal></link> but not if the action is
 
856
<link linkend="GTK-FILE-CHOOSER-ACTION-OPEN:CAPS"><literal>GTK_FILE_CHOOSER_ACTION_OPEN</literal></link>.</para>
 
857
<para>
 
858
 
 
859
</para><variablelist role="params">
 
860
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
861
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
862
</simpara></listitem></varlistentry>
 
863
<varlistentry><term><parameter>action</parameter>&nbsp;:</term>
 
864
<listitem><simpara> the action that the file selector is performing
 
865
</simpara></listitem></varlistentry>
 
866
</variablelist><para role="since">Since  2.4
 
867
</para></refsect2>
 
868
<refsect2>
 
869
<title><anchor id="gtk-file-chooser-get-action" role="function" condition="since:2.4"/>gtk_file_chooser_get_action ()</title>
 
870
<indexterm role="2.4"><primary>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>
 
871
<para>
 
872
Gets the type of operation that the file chooser is performing; see
 
873
<link linkend="gtk-file-chooser-set-action"><function>gtk_file_chooser_set_action()</function></link>.</para>
 
874
<para>
 
875
 
 
876
</para><variablelist role="params">
 
877
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
878
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
879
</simpara></listitem></varlistentry>
 
880
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the action that the file selector is performing
 
881
 
 
882
</simpara></listitem></varlistentry>
 
883
</variablelist><para role="since">Since  2.4
 
884
</para></refsect2>
 
885
<refsect2>
 
886
<title><anchor id="gtk-file-chooser-set-local-only" role="function" condition="since:2.4"/>gtk_file_chooser_set_local_only ()</title>
 
887
<indexterm role="2.4"><primary>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,
 
888
                                                         <link linkend="gboolean">gboolean</link> local_only);</programlisting>
 
889
<para>
 
890
Sets whether only local files can be selected in the
 
891
file selector. If <parameter>local_only</parameter> is <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> (the default),
 
892
then the selected file are files are guaranteed to be
 
893
accessible through the operating systems native file
 
894
file system and therefore the application only
 
895
needs to worry about the filename functions in
 
896
<link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>, like <link linkend="gtk-file-chooser-get-filename"><function>gtk_file_chooser_get_filename()</function></link>,
 
897
rather than the URI functions like
 
898
<link linkend="gtk-file-chooser-get-uri"><function>gtk_file_chooser_get_uri()</function></link>,</para>
 
899
<para>
 
900
 
 
901
</para><variablelist role="params">
 
902
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
903
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
904
</simpara></listitem></varlistentry>
 
905
<varlistentry><term><parameter>local_only</parameter>&nbsp;:</term>
 
906
<listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if only local files can be selected
 
907
</simpara></listitem></varlistentry>
 
908
</variablelist><para role="since">Since  2.4
 
909
</para></refsect2>
 
910
<refsect2>
 
911
<title><anchor id="gtk-file-chooser-get-local-only" role="function" condition="since:2.4"/>gtk_file_chooser_get_local_only ()</title>
 
912
<indexterm role="2.4"><primary>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>
 
913
<para>
 
914
Gets whether only local files can be selected in the
 
915
file selector. See <link linkend="gtk-file-chooser-set-local-only"><function>gtk_file_chooser_set_local_only()</function></link></para>
 
916
<para>
 
917
 
 
918
</para><variablelist role="params">
 
919
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
920
<listitem><simpara> a <link linkend="GtkFileChoosre"><type>GtkFileChoosre</type></link>
 
921
</simpara></listitem></varlistentry>
 
922
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if only local files can be selected.
 
923
 
 
924
</simpara></listitem></varlistentry>
 
925
</variablelist><para role="since">Since  2.4
 
926
</para></refsect2>
 
927
<refsect2>
 
928
<title><anchor id="gtk-file-chooser-set-select-multiple" role="function" condition="since:2.4"/>gtk_file_chooser_set_select_multiple ()</title>
 
929
<indexterm role="2.4"><primary>gtk_file_chooser_set_select_multiple</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_file_chooser_set_select_multiple
 
930
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
931
                                                         <link linkend="gboolean">gboolean</link> select_multiple);</programlisting>
 
932
<para>
 
933
Sets whether multiple files can be selected in the file selector.  This is
 
934
only relevant if the action is set to be GTK_FILE_CHOOSER_ACTION_OPEN or
 
935
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER.</para>
 
936
<para>
 
937
 
 
938
</para><variablelist role="params">
 
939
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
940
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
941
</simpara></listitem></varlistentry>
 
942
<varlistentry><term><parameter>select_multiple</parameter>&nbsp;:</term>
 
943
<listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if multiple files can be selected.
 
944
</simpara></listitem></varlistentry>
 
945
</variablelist><para role="since">Since  2.4
 
946
</para></refsect2>
 
947
<refsect2>
 
948
<title><anchor id="gtk-file-chooser-get-select-multiple" role="function" condition="since:2.4"/>gtk_file_chooser_get_select_multiple ()</title>
 
949
<indexterm role="2.4"><primary>gtk_file_chooser_get_select_multiple</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_file_chooser_get_select_multiple
 
950
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
 
951
<para>
 
952
Gets whether multiple files can be selected in the file
 
953
selector. See <link linkend="gtk-file-chooser-set-select-multiple"><function>gtk_file_chooser_set_select_multiple()</function></link>.</para>
 
954
<para>
 
955
 
 
956
</para><variablelist role="params">
 
957
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
958
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
959
</simpara></listitem></varlistentry>
 
960
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if multiple files can be selected.
 
961
 
 
962
</simpara></listitem></varlistentry>
 
963
</variablelist><para role="since">Since  2.4
 
964
</para></refsect2>
 
965
<refsect2>
 
966
<title><anchor id="gtk-file-chooser-set-show-hidden" role="function" condition="since:2.6"/>gtk_file_chooser_set_show_hidden ()</title>
 
967
<indexterm role="2.6"><primary>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,
 
968
                                                         <link linkend="gboolean">gboolean</link> show_hidden);</programlisting>
 
969
<para>
 
970
Sets whether hidden files and folders are displayed in the file selector.</para>
 
971
<para>
 
972
 
 
973
</para><variablelist role="params">
 
974
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
975
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
976
</simpara></listitem></varlistentry>
 
977
<varlistentry><term><parameter>show_hidden</parameter>&nbsp;:</term>
 
978
<listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if hidden files and folders should be displayed.
 
979
</simpara></listitem></varlistentry>
 
980
</variablelist><para role="since">Since  2.6
 
981
</para></refsect2>
 
982
<refsect2>
 
983
<title><anchor id="gtk-file-chooser-get-show-hidden" role="function" condition="since:2.6"/>gtk_file_chooser_get_show_hidden ()</title>
 
984
<indexterm role="2.6"><primary>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>
 
985
<para>
 
986
Gets whether hidden files and folders are displayed in the file selector.   
 
987
See <link linkend="gtk-file-chooser-set-show-hidden"><function>gtk_file_chooser_set_show_hidden()</function></link>.</para>
 
988
<para>
 
989
 
 
990
</para><variablelist role="params">
 
991
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
992
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
993
</simpara></listitem></varlistentry>
 
994
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if hidden files and folders are displayed.
 
995
 
 
996
</simpara></listitem></varlistentry>
 
997
</variablelist><para role="since">Since  2.6
 
998
</para></refsect2>
 
999
<refsect2>
 
1000
<title><anchor id="gtk-file-chooser-set-do-overwrite-confirmation" role="function" condition="since:2.8"/>gtk_file_chooser_set_do_overwrite_confirmation ()</title>
 
1001
<indexterm role="2.8"><primary>gtk_file_chooser_set_do_overwrite_confirmation</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_file_chooser_set_do_overwrite_confirmation
 
1002
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
1003
                                                         <link linkend="gboolean">gboolean</link> do_overwrite_confirmation);</programlisting>
 
1004
<para>
 
1005
Sets whether a file chooser in GTK_FILE_CHOOSER_ACTION_SAVE mode will present
 
1006
a confirmation dialog if the user types a file name that already exists.  This
 
1007
is <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> by default.
 
1008
</para>
 
1009
<para>
 
1010
Regardless of this setting, the <parameter>chooser</parameter> will emit the "confirm-overwrite"
 
1011
signal when appropriate.
 
1012
</para>
 
1013
<para>
 
1014
If all you need is the stock confirmation dialog, set this property to <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>.
 
1015
You can override the way confirmation is done by actually handling the
 
1016
"confirm-overwrite" signal; please refer to its documentation for the
 
1017
details.</para>
 
1018
<para>
 
1019
 
 
1020
</para><variablelist role="params">
 
1021
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1022
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1023
</simpara></listitem></varlistentry>
 
1024
<varlistentry><term><parameter>do_overwrite_confirmation</parameter>&nbsp;:</term>
 
1025
<listitem><simpara> whether to confirm overwriting in save mode
 
1026
</simpara></listitem></varlistentry>
 
1027
</variablelist><para role="since">Since  2.8
 
1028
</para></refsect2>
 
1029
<refsect2>
 
1030
<title><anchor id="gtk-file-chooser-get-do-overwrite-confirmation" role="function" condition="since:2.8"/>gtk_file_chooser_get_do_overwrite_confirmation ()</title>
 
1031
<indexterm role="2.8"><primary>gtk_file_chooser_get_do_overwrite_confirmation</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_file_chooser_get_do_overwrite_confirmation
 
1032
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
 
1033
<para>
 
1034
Queries whether a file chooser is set to confirm for overwriting when the user
 
1035
types a file name that already exists.</para>
 
1036
<para>
 
1037
 
 
1038
</para><variablelist role="params">
 
1039
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1040
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1041
</simpara></listitem></varlistentry>
 
1042
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the file chooser will present a confirmation dialog;
 
1043
<link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise.
 
1044
 
 
1045
</simpara></listitem></varlistentry>
 
1046
</variablelist><para role="since">Since  2.8
 
1047
</para></refsect2>
 
1048
<refsect2>
 
1049
<title><anchor id="gtk-file-chooser-set-current-name" role="function" condition="since:2.4"/>gtk_file_chooser_set_current_name ()</title>
 
1050
<indexterm role="2.4"><primary>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,
 
1051
                                                         const <link linkend="gchar">gchar</link> *name);</programlisting>
 
1052
<para>
 
1053
Sets the current name in the file selector, as if entered
 
1054
by the user. Note that the name passed in here is a UTF-8
 
1055
string rather than a filename. This function is meant for
 
1056
such uses as a suggested name in a "Save As..." dialog.
 
1057
</para>
 
1058
<para>
 
1059
If you want to preselect a particular existing file, you should use
 
1060
<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.
 
1061
Please see the documentation for those functions for an example of using
 
1062
<link linkend="gtk-file-chooser-set-current-name"><function>gtk_file_chooser_set_current_name()</function></link> as well.</para>
 
1063
<para>
 
1064
 
 
1065
</para><variablelist role="params">
 
1066
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1067
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1068
</simpara></listitem></varlistentry>
 
1069
<varlistentry><term><parameter>name</parameter>&nbsp;:</term>
 
1070
<listitem><simpara> the filename to use, as a UTF-8 string
 
1071
</simpara></listitem></varlistentry>
 
1072
</variablelist><para role="since">Since  2.4
 
1073
</para></refsect2>
 
1074
<refsect2>
 
1075
<title><anchor id="gtk-file-chooser-get-filename" role="function" condition="since:2.4"/>gtk_file_chooser_get_filename ()</title>
 
1076
<indexterm role="2.4"><primary>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>
 
1077
<para>
 
1078
Gets the filename for the currently selected file in
 
1079
the file selector. If multiple files are selected,
 
1080
one of the filenames will be returned at random.
 
1081
</para>
 
1082
<para>
 
1083
If the file chooser is in folder mode, this function returns the selected
 
1084
folder.</para>
 
1085
<para>
 
1086
 
 
1087
</para><variablelist role="params">
 
1088
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1089
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1090
</simpara></listitem></varlistentry>
 
1091
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> The currently selected filename, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
 
1092
 if no file is selected, or the selected file can't
 
1093
 be represented with a local filename. Free with <link linkend="g-free"><function>g_free()</function></link>.
 
1094
 
 
1095
</simpara></listitem></varlistentry>
 
1096
</variablelist><para role="since">Since  2.4
 
1097
</para></refsect2>
 
1098
<refsect2>
 
1099
<title><anchor id="gtk-file-chooser-set-filename" role="function" condition="since:2.4"/>gtk_file_chooser_set_filename ()</title>
 
1100
<indexterm role="2.4"><primary>gtk_file_chooser_set_filename</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_file_chooser_set_filename       (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
1101
                                                         const <link linkend="char">char</link> *filename);</programlisting>
 
1102
<para>
 
1103
Sets <parameter>filename</parameter> as the current filename for the file chooser, by changing
 
1104
to the file's parent folder and actually selecting the file in list.  If
 
1105
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
 
1106
will also appear in the dialog's file name entry.
 
1107
</para>
 
1108
<para>
 
1109
If the file name isn't in the current folder of <parameter>chooser</parameter>, then the current
 
1110
folder of <parameter>chooser</parameter> will be changed to the folder containing <parameter>filename</parameter>. This
 
1111
is equivalent to a sequence of <link linkend="gtk-file-chooser-unselect-all"><function>gtk_file_chooser_unselect_all()</function></link> followed by
 
1112
<link linkend="gtk-file-chooser-select-filename"><function>gtk_file_chooser_select_filename()</function></link>.
 
1113
</para>
 
1114
<para>
 
1115
Note that the file must exist, or nothing will be done except
 
1116
for the directory change.
 
1117
</para>
 
1118
<para>
 
1119
If you are implementing a <guimenuitem>File/Save As...</guimenuitem> dialog, you
 
1120
should use this function if you already have a file name to which the user may save; for example,
 
1121
when the user opens an existing file and then does <guimenuitem>File/Save As...</guimenuitem>
 
1122
on it.  If you don't have a file name already &mdash; for example, if the user just created
 
1123
a new file and is saving it for the first time, do not call this function.  Instead, use
 
1124
something similar to this:
 
1125
</para>
 
1126
<para>
 
1127
<programlisting>
 
1128
if (document_is_new)
 
1129
  {
 
1130
    /<!-- -->* the user just created a new document *<!-- -->/
 
1131
    gtk_file_chooser_set_current_folder (chooser, default_folder_for_saving);
 
1132
    gtk_file_chooser_set_current_name (chooser, "Untitled document");
 
1133
  }
 
1134
else
 
1135
  {
 
1136
    /<!-- -->* the user edited an existing document *<!-- -->/ 
 
1137
    gtk_file_chooser_set_filename (chooser, existing_filename);
 
1138
  }
 
1139
</programlisting></para>
 
1140
<para>
 
1141
 
 
1142
</para><variablelist role="params">
 
1143
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1144
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1145
</simpara></listitem></varlistentry>
 
1146
<varlistentry><term><parameter>filename</parameter>&nbsp;:</term>
 
1147
<listitem><simpara> the filename to set as current
 
1148
</simpara></listitem></varlistentry>
 
1149
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if both the folder could be changed and the file was
 
1150
selected successfully, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise.
 
1151
 
 
1152
</simpara></listitem></varlistentry>
 
1153
</variablelist><para role="since">Since  2.4
 
1154
</para></refsect2>
 
1155
<refsect2>
 
1156
<title><anchor id="gtk-file-chooser-select-filename" role="function" condition="since:2.4"/>gtk_file_chooser_select_filename ()</title>
 
1157
<indexterm role="2.4"><primary>gtk_file_chooser_select_filename</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_file_chooser_select_filename    (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
1158
                                                         const <link linkend="char">char</link> *filename);</programlisting>
 
1159
<para>
 
1160
Selects a filename. If the file name isn't in the current
 
1161
folder of <parameter>chooser</parameter>, then the current folder of <parameter>chooser</parameter> will
 
1162
be changed to the folder containing <parameter>filename</parameter>.</para>
 
1163
<para>
 
1164
 
 
1165
</para><variablelist role="params">
 
1166
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1167
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1168
</simpara></listitem></varlistentry>
 
1169
<varlistentry><term><parameter>filename</parameter>&nbsp;:</term>
 
1170
<listitem><simpara> the filename to select
 
1171
</simpara></listitem></varlistentry>
 
1172
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if both the folder could be changed and the file was
 
1173
selected successfully, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise.
 
1174
 
 
1175
</simpara></listitem></varlistentry>
 
1176
</variablelist><para role="since">Since  2.4
 
1177
</para></refsect2>
 
1178
<refsect2>
 
1179
<title><anchor id="gtk-file-chooser-unselect-filename" role="function" condition="since:2.4"/>gtk_file_chooser_unselect_filename ()</title>
 
1180
<indexterm role="2.4"><primary>gtk_file_chooser_unselect_filename</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_file_chooser_unselect_filename  (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
1181
                                                         const <link linkend="char">char</link> *filename);</programlisting>
 
1182
<para>
 
1183
Unselects a currently selected filename. If the filename
 
1184
is not in the current directory, does not exist, or
 
1185
is otherwise not currently selected, does nothing.</para>
 
1186
<para>
 
1187
 
 
1188
</para><variablelist role="params">
 
1189
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1190
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1191
</simpara></listitem></varlistentry>
 
1192
<varlistentry><term><parameter>filename</parameter>&nbsp;:</term>
 
1193
<listitem><simpara> the filename to unselect
 
1194
</simpara></listitem></varlistentry>
 
1195
</variablelist><para role="since">Since  2.4
 
1196
</para></refsect2>
 
1197
<refsect2>
 
1198
<title><anchor id="gtk-file-chooser-select-all" role="function" condition="since:2.4"/>gtk_file_chooser_select_all ()</title>
 
1199
<indexterm role="2.4"><primary>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>
 
1200
<para>
 
1201
Selects all the files in the current folder of a file chooser.</para>
 
1202
<para>
 
1203
 
 
1204
</para><variablelist role="params">
 
1205
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1206
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1207
</simpara></listitem></varlistentry>
 
1208
</variablelist><para role="since">Since  2.4
 
1209
</para></refsect2>
 
1210
<refsect2>
 
1211
<title><anchor id="gtk-file-chooser-unselect-all" role="function" condition="since:2.4"/>gtk_file_chooser_unselect_all ()</title>
 
1212
<indexterm role="2.4"><primary>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>
 
1213
<para>
 
1214
Unselects all the files in the current folder of a file chooser.</para>
 
1215
<para>
 
1216
 
 
1217
</para><variablelist role="params">
 
1218
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1219
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1220
</simpara></listitem></varlistentry>
 
1221
</variablelist><para role="since">Since  2.4
 
1222
</para></refsect2>
 
1223
<refsect2>
 
1224
<title><anchor id="gtk-file-chooser-get-filenames" role="function" condition="since:2.4"/>gtk_file_chooser_get_filenames ()</title>
 
1225
<indexterm role="2.4"><primary>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>
 
1226
<para>
 
1227
Lists all the selected files and subfolders in the current folder of
 
1228
<parameter>chooser</parameter>. The returned names are full absolute paths. If files in the current
 
1229
folder cannot be represented as local filenames they will be ignored. (See
 
1230
<link linkend="gtk-file-chooser-get-uris"><function>gtk_file_chooser_get_uris()</function></link>)</para>
 
1231
<para>
 
1232
 
 
1233
</para><variablelist role="params">
 
1234
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1235
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1236
</simpara></listitem></varlistentry>
 
1237
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a <link linkend="GSList"><type>GSList</type></link> containing the filenames of all selected
 
1238
  files and subfolders in the current folder. Free the returned list
 
1239
  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>.
 
1240
 
 
1241
</simpara></listitem></varlistentry>
 
1242
</variablelist><para role="since">Since  2.4
 
1243
</para></refsect2>
 
1244
<refsect2>
 
1245
<title><anchor id="gtk-file-chooser-set-current-folder" role="function" condition="since:2.4"/>gtk_file_chooser_set_current_folder ()</title>
 
1246
<indexterm role="2.4"><primary>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,
 
1247
                                                         const <link linkend="gchar">gchar</link> *filename);</programlisting>
 
1248
<para>
 
1249
Sets the current folder for <parameter>chooser</parameter> from a local filename.
 
1250
The user will be shown the full contents of the current folder,
 
1251
plus user interface elements for navigating to other folders.</para>
 
1252
<para>
 
1253
 
 
1254
</para><variablelist role="params">
 
1255
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1256
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1257
</simpara></listitem></varlistentry>
 
1258
<varlistentry><term><parameter>filename</parameter>&nbsp;:</term>
 
1259
<listitem><simpara> the full path of the new current folder
 
1260
</simpara></listitem></varlistentry>
 
1261
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</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>
 
1262
otherwise.
 
1263
 
 
1264
</simpara></listitem></varlistentry>
 
1265
</variablelist><para role="since">Since  2.4
 
1266
</para></refsect2>
 
1267
<refsect2>
 
1268
<title><anchor id="gtk-file-chooser-get-current-folder" role="function" condition="since:2.4"/>gtk_file_chooser_get_current_folder ()</title>
 
1269
<indexterm role="2.4"><primary>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>
 
1270
<para>
 
1271
Gets the current folder of <parameter>chooser</parameter> as a local filename.
 
1272
See <link linkend="gtk-file-chooser-set-current-folder"><function>gtk_file_chooser_set_current_folder()</function></link>.
 
1273
</para>
 
1274
<para>
 
1275
Note that this is the folder that the file chooser is currently displaying
 
1276
(e.g. "/home/username/Documents"), which is <emphasis>not the same</emphasis>
 
1277
as the currently-selected folder if the chooser is in
 
1278
<link linkend="GTK-FILE-CHOOSER-SELECT-FOLDER:CAPS"><type>GTK_FILE_CHOOSER_SELECT_FOLDER</type></link> mode
 
1279
(e.g. "/home/username/Documents/selected-folder/".  To get the
 
1280
currently-selected folder in that mode, use <link linkend="gtk-file-chooser-get-uri"><function>gtk_file_chooser_get_uri()</function></link> as the
 
1281
usual way to get the selection.</para>
 
1282
<para>
 
1283
 
 
1284
</para><variablelist role="params">
 
1285
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1286
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1287
</simpara></listitem></varlistentry>
 
1288
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the full path of the current folder, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if the current
 
1289
path cannot be represented as a local filename.  Free with <link linkend="g-free"><function>g_free()</function></link>.  This
 
1290
function will also return <link linkend="NULL:CAPS"><literal>NULL</literal></link> if the file chooser was unable to load the
 
1291
last folder that was requested from it; for example, as would be for calling
 
1292
<link linkend="gtk-file-chooser-set-current-folder"><function>gtk_file_chooser_set_current_folder()</function></link> on a nonexistent folder.
 
1293
 
 
1294
</simpara></listitem></varlistentry>
 
1295
</variablelist><para role="since">Since  2.4
 
1296
</para></refsect2>
 
1297
<refsect2>
 
1298
<title><anchor id="gtk-file-chooser-get-uri" role="function" condition="since:2.4"/>gtk_file_chooser_get_uri ()</title>
 
1299
<indexterm role="2.4"><primary>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>
 
1300
<para>
 
1301
Gets the URI for the currently selected file in
 
1302
the file selector. If multiple files are selected,
 
1303
one of the filenames will be returned at random.
 
1304
</para>
 
1305
<para>
 
1306
If the file chooser is in folder mode, this function returns the selected
 
1307
folder.</para>
 
1308
<para>
 
1309
 
 
1310
</para><variablelist role="params">
 
1311
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1312
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1313
</simpara></listitem></varlistentry>
 
1314
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> The currently selected URI, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
 
1315
 if no file is selected. Free with <link linkend="g-free"><function>g_free()</function></link>
 
1316
 
 
1317
</simpara></listitem></varlistentry>
 
1318
</variablelist><para role="since">Since  2.4
 
1319
</para></refsect2>
 
1320
<refsect2>
 
1321
<title><anchor id="gtk-file-chooser-set-uri" role="function" condition="since:2.4"/>gtk_file_chooser_set_uri ()</title>
 
1322
<indexterm role="2.4"><primary>gtk_file_chooser_set_uri</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_file_chooser_set_uri            (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
1323
                                                         const <link linkend="char">char</link> *uri);</programlisting>
 
1324
<para>
 
1325
Sets the file referred to by <parameter>uri</parameter> as the current file for the file chooser,
 
1326
by changing to the URI's parent folder and actually selecting the URI in the
 
1327
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
 
1328
name will also appear in the dialog's file name entry.
 
1329
</para>
 
1330
<para>
 
1331
If the URI isn't in the current folder of <parameter>chooser</parameter>, then the current folder
 
1332
of <parameter>chooser</parameter> will be changed to the folder containing <parameter>uri</parameter>. This is equivalent
 
1333
to a sequence of <link linkend="gtk-file-chooser-unselect-all"><function>gtk_file_chooser_unselect_all()</function></link> followed by
 
1334
<link linkend="gtk-file-chooser-select-uri"><function>gtk_file_chooser_select_uri()</function></link>.
 
1335
</para>
 
1336
<para>
 
1337
Note that the URI must exist, or nothing will be done except
 
1338
for the directory change.
 
1339
If you are implementing a <guimenuitem>File/Save As...</guimenuitem> dialog, you
 
1340
should use this function if you already have a file name to which the user may save; for example,
 
1341
when the user opens an existing file and then does <guimenuitem>File/Save As...</guimenuitem>
 
1342
on it.  If you don't have a file name already &mdash; for example, if the user just created
 
1343
a new file and is saving it for the first time, do not call this function.  Instead, use
 
1344
something similar to this:
 
1345
</para>
 
1346
<para>
 
1347
<programlisting>
 
1348
if (document_is_new)
 
1349
  {
 
1350
    /<!-- -->* the user just created a new document *<!-- -->/
 
1351
    gtk_file_chooser_set_current_folder_uri (chooser, default_folder_for_saving);
 
1352
    gtk_file_chooser_set_current_name (chooser, "Untitled document");
 
1353
  }
 
1354
else
 
1355
  {
 
1356
    /<!-- -->* the user edited an existing document *<!-- -->/ 
 
1357
    gtk_file_chooser_set_uri (chooser, existing_uri);
 
1358
  }
 
1359
</programlisting></para>
 
1360
<para>
 
1361
 
 
1362
</para><variablelist role="params">
 
1363
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1364
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1365
</simpara></listitem></varlistentry>
 
1366
<varlistentry><term><parameter>uri</parameter>&nbsp;:</term>
 
1367
<listitem><simpara> the URI to set as current
 
1368
</simpara></listitem></varlistentry>
 
1369
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if both the folder could be changed and the URI was
 
1370
selected successfully, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise.
 
1371
 
 
1372
</simpara></listitem></varlistentry>
 
1373
</variablelist><para role="since">Since  2.4
 
1374
</para></refsect2>
 
1375
<refsect2>
 
1376
<title><anchor id="gtk-file-chooser-select-uri" role="function" condition="since:2.4"/>gtk_file_chooser_select_uri ()</title>
 
1377
<indexterm role="2.4"><primary>gtk_file_chooser_select_uri</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_file_chooser_select_uri         (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
1378
                                                         const <link linkend="char">char</link> *uri);</programlisting>
 
1379
<para>
 
1380
Selects the file to by <parameter>uri</parameter>. If the URI doesn't refer to a
 
1381
file in the current folder of <parameter>chooser</parameter>, then the current folder of
 
1382
<parameter>chooser</parameter> will be changed to the folder containing <parameter>filename</parameter>.</para>
 
1383
<para>
 
1384
 
 
1385
</para><variablelist role="params">
 
1386
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1387
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1388
</simpara></listitem></varlistentry>
 
1389
<varlistentry><term><parameter>uri</parameter>&nbsp;:</term>
 
1390
<listitem><simpara> the URI to select
 
1391
</simpara></listitem></varlistentry>
 
1392
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if both the folder could be changed and the URI was
 
1393
selected successfully, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise.
 
1394
 
 
1395
</simpara></listitem></varlistentry>
 
1396
</variablelist><para role="since">Since  2.4
 
1397
</para></refsect2>
 
1398
<refsect2>
 
1399
<title><anchor id="gtk-file-chooser-unselect-uri" role="function" condition="since:2.4"/>gtk_file_chooser_unselect_uri ()</title>
 
1400
<indexterm role="2.4"><primary>gtk_file_chooser_unselect_uri</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_file_chooser_unselect_uri       (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
1401
                                                         const <link linkend="char">char</link> *uri);</programlisting>
 
1402
<para>
 
1403
Unselects the file referred to by <parameter>uri</parameter>. If the file
 
1404
is not in the current directory, does not exist, or
 
1405
is otherwise not currently selected, does nothing.</para>
 
1406
<para>
 
1407
 
 
1408
</para><variablelist role="params">
 
1409
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1410
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1411
</simpara></listitem></varlistentry>
 
1412
<varlistentry><term><parameter>uri</parameter>&nbsp;:</term>
 
1413
<listitem><simpara> the URI to unselect
 
1414
</simpara></listitem></varlistentry>
 
1415
</variablelist><para role="since">Since  2.4
 
1416
</para></refsect2>
 
1417
<refsect2>
 
1418
<title><anchor id="gtk-file-chooser-get-uris" role="function" condition="since:2.4"/>gtk_file_chooser_get_uris ()</title>
 
1419
<indexterm role="2.4"><primary>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>
 
1420
<para>
 
1421
Lists all the selected files and subfolders in the current folder of
 
1422
<parameter>chooser</parameter>. The returned names are full absolute URIs.</para>
 
1423
<para>
 
1424
 
 
1425
</para><variablelist role="params">
 
1426
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1427
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1428
</simpara></listitem></varlistentry>
 
1429
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a <link linkend="GSList"><type>GSList</type></link> containing the URIs of all selected
 
1430
  files and subfolders in the current folder. Free the returned list
 
1431
  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>.
 
1432
 
 
1433
</simpara></listitem></varlistentry>
 
1434
</variablelist><para role="since">Since  2.4
 
1435
</para></refsect2>
 
1436
<refsect2>
 
1437
<title><anchor id="gtk-file-chooser-set-current-folder-uri" role="function" condition="since:2.4"/>gtk_file_chooser_set_current_folder_uri ()</title>
 
1438
<indexterm role="2.4"><primary>gtk_file_chooser_set_current_folder_uri</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_file_chooser_set_current_folder_uri
 
1439
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
1440
                                                         const <link linkend="gchar">gchar</link> *uri);</programlisting>
 
1441
<para>
 
1442
Sets the current folder for <parameter>chooser</parameter> from an URI.
 
1443
The user will be shown the full contents of the current folder,
 
1444
plus user interface elements for navigating to other folders.</para>
 
1445
<para>
 
1446
 
 
1447
</para><variablelist role="params">
 
1448
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1449
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1450
</simpara></listitem></varlistentry>
 
1451
<varlistentry><term><parameter>uri</parameter>&nbsp;:</term>
 
1452
<listitem><simpara> the URI for the new current folder
 
1453
</simpara></listitem></varlistentry>
 
1454
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</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>
 
1455
otherwise.
 
1456
 
 
1457
</simpara></listitem></varlistentry>
 
1458
</variablelist><para role="since">Since  2.4
 
1459
</para></refsect2>
 
1460
<refsect2>
 
1461
<title><anchor id="gtk-file-chooser-get-current-folder-uri" role="function" condition="since:2.4"/>gtk_file_chooser_get_current_folder_uri ()</title>
 
1462
<indexterm role="2.4"><primary>gtk_file_chooser_get_current_folder_uri</primary></indexterm><programlisting><link linkend="gchar">gchar</link>*              gtk_file_chooser_get_current_folder_uri
 
1463
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
 
1464
<para>
 
1465
Gets the current folder of <parameter>chooser</parameter> as an URI.
 
1466
See <link linkend="gtk-file-chooser-set-current-folder-uri"><function>gtk_file_chooser_set_current_folder_uri()</function></link>.
 
1467
</para>
 
1468
<para>
 
1469
Note that this is the folder that the file chooser is currently displaying
 
1470
(e.g. "file:///home/username/Documents"), which is <emphasis>not the same</emphasis>
 
1471
as the currently-selected folder if the chooser is in
 
1472
<link linkend="GTK-FILE-CHOOSER-SELECT-FOLDER:CAPS"><type>GTK_FILE_CHOOSER_SELECT_FOLDER</type></link> mode
 
1473
(e.g. "file:///home/username/Documents/selected-folder/".  To get the
 
1474
currently-selected folder in that mode, use <link linkend="gtk-file-chooser-get-uri"><function>gtk_file_chooser_get_uri()</function></link> as the
 
1475
usual way to get the selection.</para>
 
1476
<para>
 
1477
 
 
1478
</para><variablelist role="params">
 
1479
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1480
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1481
</simpara></listitem></varlistentry>
 
1482
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the URI for the current folder.  Free with <link linkend="g-free"><function>g_free()</function></link>.  This
 
1483
function will also return <link linkend="NULL:CAPS"><literal>NULL</literal></link> if the file chooser was unable to load the
 
1484
last folder that was requested from it; for example, as would be for calling
 
1485
<link linkend="gtk-file-chooser-set-current-folder-uri"><function>gtk_file_chooser_set_current_folder_uri()</function></link> on a nonexistent folder.
 
1486
 
 
1487
</simpara></listitem></varlistentry>
 
1488
</variablelist><para role="since">Since  2.4
 
1489
</para></refsect2>
 
1490
<refsect2>
 
1491
<title><anchor id="gtk-file-chooser-set-preview-widget" role="function" condition="since:2.4"/>gtk_file_chooser_set_preview_widget ()</title>
 
1492
<indexterm role="2.4"><primary>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,
 
1493
                                                         <link linkend="GtkWidget">GtkWidget</link> *preview_widget);</programlisting>
 
1494
<para>
 
1495
Sets an application-supplied widget to use to display a custom preview
 
1496
of the currently selected file. To implement a preview, after setting the
 
1497
preview widget, you connect to the ::update-preview
 
1498
signal, and call <link linkend="gtk-file-chooser-get-preview-filename"><function>gtk_file_chooser_get_preview_filename()</function></link> or
 
1499
<link linkend="gtk-file-chooser-get-preview-uri"><function>gtk_file_chooser_get_preview_uri()</function></link> on each change. If you can
 
1500
display a preview of the new file, update your widget and
 
1501
set the preview active using <link linkend="gtk-file-chooser-set-preview-widget-active"><function>gtk_file_chooser_set_preview_widget_active()</function></link>.
 
1502
Otherwise, set the preview inactive.
 
1503
</para>
 
1504
<para>
 
1505
When there is no application-supplied preview widget, or the
 
1506
application-supplied preview widget is not active, the file chooser
 
1507
may display an internally generated preview of the current file or
 
1508
it may display no preview at all.</para>
 
1509
<para>
 
1510
 
 
1511
</para><variablelist role="params">
 
1512
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1513
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1514
</simpara></listitem></varlistentry>
 
1515
<varlistentry><term><parameter>preview_widget</parameter>&nbsp;:</term>
 
1516
<listitem><simpara> widget for displaying preview.
 
1517
</simpara></listitem></varlistentry>
 
1518
</variablelist><para role="since">Since  2.4
 
1519
</para></refsect2>
 
1520
<refsect2>
 
1521
<title><anchor id="gtk-file-chooser-get-preview-widget" role="function" condition="since:2.4"/>gtk_file_chooser_get_preview_widget ()</title>
 
1522
<indexterm role="2.4"><primary>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>
 
1523
<para>
 
1524
Gets the current preview widget; see
 
1525
<link linkend="gtk-file-chooser-set-preview-widget"><function>gtk_file_chooser_set_preview_widget()</function></link>.</para>
 
1526
<para>
 
1527
 
 
1528
</para><variablelist role="params">
 
1529
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1530
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1531
</simpara></listitem></varlistentry>
 
1532
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the current preview widget, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
 
1533
 
 
1534
</simpara></listitem></varlistentry>
 
1535
</variablelist><para role="since">Since  2.4
 
1536
</para></refsect2>
 
1537
<refsect2>
 
1538
<title><anchor id="gtk-file-chooser-set-preview-widget-active" role="function" condition="since:2.4"/>gtk_file_chooser_set_preview_widget_active ()</title>
 
1539
<indexterm role="2.4"><primary>gtk_file_chooser_set_preview_widget_active</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_file_chooser_set_preview_widget_active
 
1540
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
1541
                                                         <link linkend="gboolean">gboolean</link> active);</programlisting>
 
1542
<para>
 
1543
Sets whether the preview widget set by
 
1544
<link linkend="gtk-file-chooser-set-preview-widget"><function>gtk_file_chooser_set_preview_widget()</function></link> should be shown for the
 
1545
current filename. When <parameter>active</parameter> is set to false, the file chooser
 
1546
may display an internally generated preview of the current file
 
1547
or it may display no preview at all. See
 
1548
<link linkend="gtk-file-chooser-set-preview-widget"><function>gtk_file_chooser_set_preview_widget()</function></link> for more details.</para>
 
1549
<para>
 
1550
 
 
1551
</para><variablelist role="params">
 
1552
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1553
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1554
</simpara></listitem></varlistentry>
 
1555
<varlistentry><term><parameter>active</parameter>&nbsp;:</term>
 
1556
<listitem><simpara> whether to display the user-specified preview widget
 
1557
</simpara></listitem></varlistentry>
 
1558
</variablelist><para role="since">Since  2.4
 
1559
</para></refsect2>
 
1560
<refsect2>
 
1561
<title><anchor id="gtk-file-chooser-get-preview-widget-active" role="function" condition="since:2.4"/>gtk_file_chooser_get_preview_widget_active ()</title>
 
1562
<indexterm role="2.4"><primary>gtk_file_chooser_get_preview_widget_active</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_file_chooser_get_preview_widget_active
 
1563
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
 
1564
<para>
 
1565
Gets whether the preview widget set by <link linkend="gtk-file-chooser-set-preview-widget"><function>gtk_file_chooser_set_preview_widget()</function></link>
 
1566
should be shown for the current filename. See
 
1567
<link linkend="gtk-file-chooser-set-preview-widget-active"><function>gtk_file_chooser_set_preview_widget_active()</function></link>.</para>
 
1568
<para>
 
1569
 
 
1570
</para><variablelist role="params">
 
1571
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1572
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1573
</simpara></listitem></varlistentry>
 
1574
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the preview widget is active for the current filename.
 
1575
 
 
1576
</simpara></listitem></varlistentry>
 
1577
</variablelist><para role="since">Since  2.4
 
1578
</para></refsect2>
 
1579
<refsect2>
 
1580
<title><anchor id="gtk-file-chooser-set-use-preview-label" role="function" condition="since:2.4"/>gtk_file_chooser_set_use_preview_label ()</title>
 
1581
<indexterm role="2.4"><primary>gtk_file_chooser_set_use_preview_label</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_file_chooser_set_use_preview_label
 
1582
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
1583
                                                         <link linkend="gboolean">gboolean</link> use_label);</programlisting>
 
1584
<para>
 
1585
Sets whether the file chooser should display a stock label with the name of
 
1586
the file that is being previewed; the default is <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>.  Applications that
 
1587
want to draw the whole preview area themselves should set this to <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> and
 
1588
display the name themselves in their preview widget.
 
1589
</para>
 
1590
<para>
 
1591
See also: <link linkend="gtk-file-chooser-set-preview-widget"><function>gtk_file_chooser_set_preview_widget()</function></link></para>
 
1592
<para>
 
1593
 
 
1594
</para><variablelist role="params">
 
1595
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1596
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1597
</simpara></listitem></varlistentry>
 
1598
<varlistentry><term><parameter>use_label</parameter>&nbsp;:</term>
 
1599
<listitem><simpara> whether to display a stock label with the name of the previewed file
 
1600
</simpara></listitem></varlistentry>
 
1601
</variablelist><para role="since">Since  2.4
 
1602
</para></refsect2>
 
1603
<refsect2>
 
1604
<title><anchor id="gtk-file-chooser-get-use-preview-label" role="function"/>gtk_file_chooser_get_use_preview_label ()</title>
 
1605
<indexterm><primary>gtk_file_chooser_get_use_preview_label</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_file_chooser_get_use_preview_label
 
1606
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
 
1607
<para>
 
1608
Gets whether a stock label should be drawn with the name of the previewed
 
1609
file.  See <link linkend="gtk-file-chooser-set-use-preview-label"><function>gtk_file_chooser_set_use_preview_label()</function></link>.</para>
 
1610
<para>
 
1611
 
 
1612
</para><variablelist role="params">
 
1613
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1614
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1615
</simpara></listitem></varlistentry>
 
1616
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the file chooser is set to display a label with the
 
1617
name of the previewed file, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise.
 
1618
</simpara></listitem></varlistentry>
 
1619
</variablelist></refsect2>
 
1620
<refsect2>
 
1621
<title><anchor id="gtk-file-chooser-get-preview-filename" role="function" condition="since:2.4"/>gtk_file_chooser_get_preview_filename ()</title>
 
1622
<indexterm role="2.4"><primary>gtk_file_chooser_get_preview_filename</primary></indexterm><programlisting><link linkend="char">char</link>*               gtk_file_chooser_get_preview_filename
 
1623
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
 
1624
<para>
 
1625
Gets the filename that should be previewed in a custom preview
 
1626
widget. See <link linkend="gtk-file-chooser-set-preview-widget"><function>gtk_file_chooser_set_preview_widget()</function></link>.</para>
 
1627
<para>
 
1628
 
 
1629
</para><variablelist role="params">
 
1630
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1631
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1632
</simpara></listitem></varlistentry>
 
1633
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the filename to preview, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if no file
 
1634
 is selected, or if the selected file cannot be represented
 
1635
 as a local filename. Free with <link linkend="g-free"><function>g_free()</function></link>
 
1636
 
 
1637
</simpara></listitem></varlistentry>
 
1638
</variablelist><para role="since">Since  2.4
 
1639
</para></refsect2>
 
1640
<refsect2>
 
1641
<title><anchor id="gtk-file-chooser-get-preview-uri" role="function" condition="since:2.4"/>gtk_file_chooser_get_preview_uri ()</title>
 
1642
<indexterm role="2.4"><primary>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>
 
1643
<para>
 
1644
Gets the URI that should be previewed in a custom preview
 
1645
widget. See <link linkend="gtk-file-chooser-set-preview-widget"><function>gtk_file_chooser_set_preview_widget()</function></link>.</para>
 
1646
<para>
 
1647
 
 
1648
</para><variablelist role="params">
 
1649
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1650
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1651
</simpara></listitem></varlistentry>
 
1652
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the URI for the file to preview, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if no file is
 
1653
selected. Free with <link linkend="g-free"><function>g_free()</function></link>.
 
1654
 
 
1655
</simpara></listitem></varlistentry>
 
1656
</variablelist><para role="since">Since  2.4
 
1657
</para></refsect2>
 
1658
<refsect2>
 
1659
<title><anchor id="gtk-file-chooser-set-extra-widget" role="function" condition="since:2.4"/>gtk_file_chooser_set_extra_widget ()</title>
 
1660
<indexterm role="2.4"><primary>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,
 
1661
                                                         <link linkend="GtkWidget">GtkWidget</link> *extra_widget);</programlisting>
 
1662
<para>
 
1663
Sets an application-supplied widget to provide extra options to the user.</para>
 
1664
<para>
 
1665
 
 
1666
</para><variablelist role="params">
 
1667
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1668
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1669
</simpara></listitem></varlistentry>
 
1670
<varlistentry><term><parameter>extra_widget</parameter>&nbsp;:</term>
 
1671
<listitem><simpara> widget for extra options
 
1672
</simpara></listitem></varlistentry>
 
1673
</variablelist><para role="since">Since  2.4
 
1674
</para></refsect2>
 
1675
<refsect2>
 
1676
<title><anchor id="gtk-file-chooser-get-extra-widget" role="function" condition="since:2.4"/>gtk_file_chooser_get_extra_widget ()</title>
 
1677
<indexterm role="2.4"><primary>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>
 
1678
<para>
 
1679
Gets the current preview widget; see
 
1680
<link linkend="gtk-file-chooser-set-extra-widget"><function>gtk_file_chooser_set_extra_widget()</function></link>.</para>
 
1681
<para>
 
1682
 
 
1683
</para><variablelist role="params">
 
1684
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1685
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1686
</simpara></listitem></varlistentry>
 
1687
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the current extra widget, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
 
1688
 
 
1689
</simpara></listitem></varlistentry>
 
1690
</variablelist><para role="since">Since  2.4
 
1691
</para></refsect2>
 
1692
<refsect2>
 
1693
<title><anchor id="gtk-file-chooser-add-filter" role="function" condition="since:2.4"/>gtk_file_chooser_add_filter ()</title>
 
1694
<indexterm role="2.4"><primary>gtk_file_chooser_add_filter</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_file_chooser_add_filter         (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
1695
                                                         <link linkend="GtkFileFilter">GtkFileFilter</link> *filter);</programlisting>
 
1696
<para>
 
1697
Adds <parameter>filter</parameter> to the list of filters that the user can select between.
 
1698
When a filter is selected, only files that are passed by that
 
1699
filter are displayed. 
 
1700
</para>
 
1701
<para>
 
1702
Note that the <parameter>chooser</parameter> takes ownership of the filter, so you have to 
 
1703
ref and sink it if you want to keep a reference.</para>
 
1704
<para>
 
1705
 
 
1706
</para><variablelist role="params">
 
1707
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1708
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1709
</simpara></listitem></varlistentry>
 
1710
<varlistentry><term><parameter>filter</parameter>&nbsp;:</term>
 
1711
<listitem><simpara> a <link linkend="GtkFileFilter"><type>GtkFileFilter</type></link>
 
1712
</simpara></listitem></varlistentry>
 
1713
</variablelist><para role="since">Since  2.4
 
1714
</para></refsect2>
 
1715
<refsect2>
 
1716
<title><anchor id="gtk-file-chooser-remove-filter" role="function" condition="since:2.4"/>gtk_file_chooser_remove_filter ()</title>
 
1717
<indexterm role="2.4"><primary>gtk_file_chooser_remove_filter</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_file_chooser_remove_filter      (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
1718
                                                         <link linkend="GtkFileFilter">GtkFileFilter</link> *filter);</programlisting>
 
1719
<para>
 
1720
Removes <parameter>filter</parameter> from the list of filters that the user can select between.</para>
 
1721
<para>
 
1722
 
 
1723
</para><variablelist role="params">
 
1724
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1725
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1726
</simpara></listitem></varlistentry>
 
1727
<varlistentry><term><parameter>filter</parameter>&nbsp;:</term>
 
1728
<listitem><simpara> a <link linkend="GtkFileFilter"><type>GtkFileFilter</type></link>
 
1729
</simpara></listitem></varlistentry>
 
1730
</variablelist><para role="since">Since  2.4
 
1731
</para></refsect2>
 
1732
<refsect2>
 
1733
<title><anchor id="gtk-file-chooser-list-filters" role="function" condition="since:2.4"/>gtk_file_chooser_list_filters ()</title>
 
1734
<indexterm role="2.4"><primary>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>
 
1735
<para>
 
1736
Lists the current set of user-selectable filters; see
 
1737
<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>
 
1738
<para>
 
1739
 
 
1740
</para><variablelist role="params">
 
1741
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1742
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1743
</simpara></listitem></varlistentry>
 
1744
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a <link linkend="GSList"><type>GSList</type></link> containing the current set of
 
1745
 user selectable filters. The contents of the list are
 
1746
 owned by GTK+, but you must free the list itself with
 
1747
 <link linkend="g-slist-free"><function>g_slist_free()</function></link> when you are done with it.
 
1748
 
 
1749
</simpara></listitem></varlistentry>
 
1750
</variablelist><para role="since">Since  2.4
 
1751
</para></refsect2>
 
1752
<refsect2>
 
1753
<title><anchor id="gtk-file-chooser-set-filter" role="function" condition="since:2.4"/>gtk_file_chooser_set_filter ()</title>
 
1754
<indexterm role="2.4"><primary>gtk_file_chooser_set_filter</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_file_chooser_set_filter         (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
1755
                                                         <link linkend="GtkFileFilter">GtkFileFilter</link> *filter);</programlisting>
 
1756
<para>
 
1757
Sets the current filter; only the files that pass the
 
1758
filter will be displayed. If the user-selectable list of filters
 
1759
is non-empty, then the filter should be one of the filters
 
1760
in that list. Setting the current filter when the list of
 
1761
filters is empty is useful if you want to restrict the displayed
 
1762
set of files without letting the user change it.</para>
 
1763
<para>
 
1764
 
 
1765
</para><variablelist role="params">
 
1766
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1767
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1768
</simpara></listitem></varlistentry>
 
1769
<varlistentry><term><parameter>filter</parameter>&nbsp;:</term>
 
1770
<listitem><simpara> a <link linkend="GtkFileFilter"><type>GtkFileFilter</type></link>
 
1771
</simpara></listitem></varlistentry>
 
1772
</variablelist><para role="since">Since  2.4
 
1773
</para></refsect2>
 
1774
<refsect2>
 
1775
<title><anchor id="gtk-file-chooser-get-filter" role="function" condition="since:2.4"/>gtk_file_chooser_get_filter ()</title>
 
1776
<indexterm role="2.4"><primary>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>
 
1777
<para>
 
1778
Gets the current filter; see <link linkend="gtk-file-chooser-set-filter"><function>gtk_file_chooser_set_filter()</function></link>.</para>
 
1779
<para>
 
1780
 
 
1781
</para><variablelist role="params">
 
1782
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1783
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1784
</simpara></listitem></varlistentry>
 
1785
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the current filter, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
 
1786
 
 
1787
</simpara></listitem></varlistentry>
 
1788
</variablelist><para role="since">Since  2.4
 
1789
</para></refsect2>
 
1790
<refsect2>
 
1791
<title><anchor id="gtk-file-chooser-add-shortcut-folder" role="function" condition="since:2.4"/>gtk_file_chooser_add_shortcut_folder ()</title>
 
1792
<indexterm role="2.4"><primary>gtk_file_chooser_add_shortcut_folder</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_file_chooser_add_shortcut_folder
 
1793
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
1794
                                                         const <link linkend="char">char</link> *folder,
 
1795
                                                         <link linkend="GError">GError</link> **error);</programlisting>
 
1796
<para>
 
1797
Adds a folder to be displayed with the shortcut folders in a file chooser.
 
1798
Note that shortcut folders do not get saved, as they are provided by the
 
1799
application.  For example, you can use this to add a
 
1800
"/usr/share/mydrawprogram/Clipart" folder to the volume list.</para>
 
1801
<para>
 
1802
 
 
1803
</para><variablelist role="params">
 
1804
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1805
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1806
</simpara></listitem></varlistentry>
 
1807
<varlistentry><term><parameter>folder</parameter>&nbsp;:</term>
 
1808
<listitem><simpara> filename of the folder to add
 
1809
</simpara></listitem></varlistentry>
 
1810
<varlistentry><term><parameter>error</parameter>&nbsp;:</term>
 
1811
<listitem><simpara> location to store error, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
 
1812
</simpara></listitem></varlistentry>
 
1813
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</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>
 
1814
otherwise.  In the latter case, the <parameter>error</parameter> will be set as appropriate.
 
1815
 
 
1816
</simpara></listitem></varlistentry>
 
1817
</variablelist><para role="since">Since  2.4
 
1818
</para></refsect2>
 
1819
<refsect2>
 
1820
<title><anchor id="gtk-file-chooser-remove-shortcut-folder" role="function" condition="since:2.4"/>gtk_file_chooser_remove_shortcut_folder ()</title>
 
1821
<indexterm role="2.4"><primary>gtk_file_chooser_remove_shortcut_folder</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_file_chooser_remove_shortcut_folder
 
1822
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
1823
                                                         const <link linkend="char">char</link> *folder,
 
1824
                                                         <link linkend="GError">GError</link> **error);</programlisting>
 
1825
<para>
 
1826
Removes a folder from a file chooser's list of shortcut folders.</para>
 
1827
<para>
 
1828
 
 
1829
</para><variablelist role="params">
 
1830
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1831
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1832
</simpara></listitem></varlistentry>
 
1833
<varlistentry><term><parameter>folder</parameter>&nbsp;:</term>
 
1834
<listitem><simpara> filename of the folder to remove
 
1835
</simpara></listitem></varlistentry>
 
1836
<varlistentry><term><parameter>error</parameter>&nbsp;:</term>
 
1837
<listitem><simpara> location to store error, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
 
1838
</simpara></listitem></varlistentry>
 
1839
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the operation succeeds, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise.  
 
1840
In the latter case, the <parameter>error</parameter> will be set as appropriate.
 
1841
 
 
1842
See also: <link linkend="gtk-file-chooser-add-shortcut-folder"><function>gtk_file_chooser_add_shortcut_folder()</function></link>
 
1843
 
 
1844
</simpara></listitem></varlistentry>
 
1845
</variablelist><para role="since">Since  2.4
 
1846
</para></refsect2>
 
1847
<refsect2>
 
1848
<title><anchor id="gtk-file-chooser-list-shortcut-folders" role="function" condition="since:2.4"/>gtk_file_chooser_list_shortcut_folders ()</title>
 
1849
<indexterm role="2.4"><primary>gtk_file_chooser_list_shortcut_folders</primary></indexterm><programlisting><link linkend="GSList">GSList</link>*             gtk_file_chooser_list_shortcut_folders
 
1850
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
 
1851
<para>
 
1852
Queries the list of shortcut folders in the file chooser, as set by
 
1853
<link linkend="gtk-file-chooser-add-shortcut-folder"><function>gtk_file_chooser_add_shortcut_folder()</function></link>.</para>
 
1854
<para>
 
1855
 
 
1856
</para><variablelist role="params">
 
1857
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1858
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1859
</simpara></listitem></varlistentry>
 
1860
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> A list of folder filenames, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if there are no shortcut
 
1861
folders.  Free the returned list with <link linkend="g-slist-free"><function>g_slist_free()</function></link>, and the filenames with
 
1862
<link linkend="g-free"><function>g_free()</function></link>.
 
1863
 
 
1864
</simpara></listitem></varlistentry>
 
1865
</variablelist><para role="since">Since  2.4
 
1866
</para></refsect2>
 
1867
<refsect2>
 
1868
<title><anchor id="gtk-file-chooser-add-shortcut-folder-uri" role="function" condition="since:2.4"/>gtk_file_chooser_add_shortcut_folder_uri ()</title>
 
1869
<indexterm role="2.4"><primary>gtk_file_chooser_add_shortcut_folder_uri</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_file_chooser_add_shortcut_folder_uri
 
1870
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
1871
                                                         const <link linkend="char">char</link> *uri,
 
1872
                                                         <link linkend="GError">GError</link> **error);</programlisting>
 
1873
<para>
 
1874
Adds a folder URI to be displayed with the shortcut folders in a file
 
1875
chooser.  Note that shortcut folders do not get saved, as they are provided
 
1876
by the application.  For example, you can use this to add a
 
1877
"file:///usr/share/mydrawprogram/Clipart" folder to the volume list.</para>
 
1878
<para>
 
1879
 
 
1880
</para><variablelist role="params">
 
1881
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1882
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1883
</simpara></listitem></varlistentry>
 
1884
<varlistentry><term><parameter>uri</parameter>&nbsp;:</term>
 
1885
<listitem><simpara> URI of the folder to add
 
1886
</simpara></listitem></varlistentry>
 
1887
<varlistentry><term><parameter>error</parameter>&nbsp;:</term>
 
1888
<listitem><simpara> location to store error, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
 
1889
</simpara></listitem></varlistentry>
 
1890
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</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>
 
1891
otherwise.  In the latter case, the <parameter>error</parameter> will be set as appropriate.
 
1892
 
 
1893
</simpara></listitem></varlistentry>
 
1894
</variablelist><para role="since">Since  2.4
 
1895
</para></refsect2>
 
1896
<refsect2>
 
1897
<title><anchor id="gtk-file-chooser-remove-shortcut-folder-uri" role="function" condition="since:2.4"/>gtk_file_chooser_remove_shortcut_folder_uri ()</title>
 
1898
<indexterm role="2.4"><primary>gtk_file_chooser_remove_shortcut_folder_uri</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_file_chooser_remove_shortcut_folder_uri
 
1899
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
1900
                                                         const <link linkend="char">char</link> *uri,
 
1901
                                                         <link linkend="GError">GError</link> **error);</programlisting>
 
1902
<para>
 
1903
Removes a folder URI from a file chooser's list of shortcut folders.</para>
 
1904
<para>
 
1905
 
 
1906
</para><variablelist role="params">
 
1907
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1908
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1909
</simpara></listitem></varlistentry>
 
1910
<varlistentry><term><parameter>uri</parameter>&nbsp;:</term>
 
1911
<listitem><simpara> URI of the folder to remove
 
1912
</simpara></listitem></varlistentry>
 
1913
<varlistentry><term><parameter>error</parameter>&nbsp;:</term>
 
1914
<listitem><simpara> location to store error, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
 
1915
</simpara></listitem></varlistentry>
 
1916
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the operation succeeds, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise.  
 
1917
In the latter case, the <parameter>error</parameter> will be set as appropriate.
 
1918
 
 
1919
See also: <link linkend="gtk-file-chooser-add-shortcut-folder-uri"><function>gtk_file_chooser_add_shortcut_folder_uri()</function></link>
 
1920
 
 
1921
</simpara></listitem></varlistentry>
 
1922
</variablelist><para role="since">Since  2.4
 
1923
</para></refsect2>
 
1924
<refsect2>
 
1925
<title><anchor id="gtk-file-chooser-list-shortcut-folder-uris" role="function" condition="since:2.4"/>gtk_file_chooser_list_shortcut_folder_uris ()</title>
 
1926
<indexterm role="2.4"><primary>gtk_file_chooser_list_shortcut_folder_uris</primary></indexterm><programlisting><link linkend="GSList">GSList</link>*             gtk_file_chooser_list_shortcut_folder_uris
 
1927
                                                        (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser);</programlisting>
 
1928
<para>
 
1929
Queries the list of shortcut folders in the file chooser, as set by
 
1930
<link linkend="gtk-file-chooser-add-shortcut-folder-uri"><function>gtk_file_chooser_add_shortcut_folder_uri()</function></link>.</para>
 
1931
<para>
 
1932
 
 
1933
</para><variablelist role="params">
 
1934
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
1935
<listitem><simpara> a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
1936
</simpara></listitem></varlistentry>
 
1937
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> A list of folder URIs, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if there are no shortcut
 
1938
folders.  Free the returned list with <link linkend="g-slist-free"><function>g_slist_free()</function></link>, and the URIs with
 
1939
<link linkend="g-free"><function>g_free()</function></link>.
 
1940
 
 
1941
</simpara></listitem></varlistentry>
 
1942
</variablelist><para role="since">Since  2.4
 
1943
</para></refsect2>
 
1944
 
 
1945
</refsect1>
 
1946
 
 
1947
<refsect1 role="signals">
 
1948
<title role="signals.title">Signal Details</title>
 
1949
<refsect2><title><anchor id="GtkFileChooser-confirm-overwrite"/>The &quot;confirm-overwrite&quot; signal</title>
 
1950
<indexterm><primary>GtkFileChooser::confirm-overwrite</primary></indexterm><programlisting><link linkend="GtkFileChooserConfirmation">GtkFileChooserConfirmation</link>user_function                      (<link linkend="GtkFileChooser">GtkFileChooser</link> *filechooser,
 
1951
                                                        <link linkend="gpointer">gpointer</link>        user_data)        : Run Last</programlisting>
 
1952
    <para>
 
1953
      This signal gets emitted whenever it is appropriate to present a
 
1954
      confirmation dialog when the user has selected a file name that
 
1955
      already exists.  The signal only gets emitted when the file
 
1956
      chooser is in <link linkend="GTK-FILE-CHOOSER-ACTION-SAVE:CAPS"><type>GTK_FILE_CHOOSER_ACTION_SAVE</type></link> mode.
 
1957
    </para>
 
1958
 
 
1959
    <para>
 
1960
      Most applications just need to turn on the <link
 
1961
      linkend="GtkFileChooser--do-overwrite-confirmation">do-overwrite-confirmation</link>
 
1962
      property (or call the
 
1963
      <link linkend="gtk-file-chooser-set-do-overwrite-confirmation"><function>gtk_file_chooser_set_do_overwrite_confirmation()</function></link> function), and
 
1964
      they will automatically get a stock confirmation dialog.
 
1965
      Applications which need to customize this behavior should do
 
1966
      that, and also connect to the <symbol>confirm-overwrite</symbol>
 
1967
      signal.
 
1968
    </para>
 
1969
 
 
1970
    <para>
 
1971
      A signal handler for this signal must return a
 
1972
      <link linkend="GtkFileChooserConfirmation"><type>GtkFileChooserConfirmation</type></link> value, which indicates the action to
 
1973
      take.  If the handler determines that the user wants to select a
 
1974
      different filename, it should return
 
1975
      <link linkend="GTK-FILE-CHOOSER-CONFIRMATION-SELECT-AGAIN:CAPS"><type>GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN</type></link>.  If it determines
 
1976
      that the user is satisfied with his choice of file name, it
 
1977
      should return <link linkend="GTK-FILE-CHOOSER-CONFIRMATION-ACCEPT-FILENAME:CAPS"><type>GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME</type></link>.
 
1978
      On the other hand, if it determines that the stock confirmation
 
1979
      dialog should be used, it should return
 
1980
      <link linkend="GTK-FILE-CHOOSER-CONFIRMATION-CONFIRM:CAPS"><type>GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM</type></link>.  The following example
 
1981
      illustrates this.
 
1982
    </para>
 
1983
 
 
1984
    <example id="gtkfilechooser-confirmation">
 
1985
      <title>Custom confirmation</title>
 
1986
 
 
1987
      <programlisting>
 
1988
static GtkFileChooserConfirmation
 
1989
confirm_overwrite_callback (GtkFileChooser *chooser, gpointer data)
 
1990
{
 
1991
  char *uri;
 
1992
 
 
1993
  uri = gtk_file_chooser_get_uri (chooser);
 
1994
 
 
1995
  if (is_uri_read_only (uri))
 
1996
    {
 
1997
      if (user_wants_to_replace_read_only_file (uri))
 
1998
        return GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME;
 
1999
      else
 
2000
        return GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN;
 
2001
    } else
 
2002
      return GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM; /* fall back to the default dialog */
 
2003
}
 
2004
 
 
2005
...
 
2006
 
 
2007
chooser = gtk_file_chooser_dialog_new (...);
 
2008
 
 
2009
gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE);
 
2010
g_signal_connect (chooser, "confirm-overwrite",
 
2011
                  G_CALLBACK (confirm_overwrite_callback), NULL);
 
2012
 
 
2013
if (gtk_dialog_run (chooser) == GTK_RESPONSE_ACCEPT)
 
2014
        save_to_file (gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser));
 
2015
 
 
2016
gtk_widget_destroy (chooser);
 
2017
      </programlisting>
 
2018
    </example><variablelist role="params">
 
2019
<varlistentry><term><parameter>filechooser</parameter>&nbsp;:</term>
 
2020
<listitem><simpara>the object which received the signal.
 
2021
</simpara></listitem></varlistentry>
 
2022
<varlistentry><term><parameter>user_data</parameter>&nbsp;:</term>
 
2023
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
 
2024
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara><link linkend="GtkFileChooserConfirmation"><type>GtkFileChooserConfirmation</type></link> value that indicates which
 
2025
    action to take after emitting the signal.
 
2026
 
 
2027
    <para>
 
2028
      Since 2.8
 
2029
    </para>
 
2030
 
 
2031
</simpara></listitem></varlistentry>
 
2032
</variablelist></refsect2><refsect2><title><anchor id="GtkFileChooser-current-folder-changed"/>The &quot;current-folder-changed&quot; signal</title>
 
2033
<indexterm><primary>GtkFileChooser::current-folder-changed</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
2034
                                                        <link linkend="gpointer">gpointer</link>        user_data)      : Run Last</programlisting>
 
2035
<para>
 
2036
This signal is emitted when the current folder in a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>
 
2037
changes.  This can happen due to the user performing some action that
 
2038
changes folders, such as selecting a bookmark or visiting a folder on the
 
2039
file list.  It can also happen as a result of calling a function to
 
2040
explicitly change the current folder in a file chooser.
 
2041
</para>
 
2042
<para>
 
2043
Normally you do not need to connect to this signal, unless you need to keep
 
2044
track of which folder a file chooser is showing.
 
2045
</para>
 
2046
<para>
 
2047
See also:  <link linkend="gtk-file-chooser-set-current-folder"><function>gtk_file_chooser_set_current_folder()</function></link>,
 
2048
<link linkend="gtk-file-chooser-get-current-folder"><function>gtk_file_chooser_get_current_folder()</function></link>,
 
2049
<link linkend="gtk-file-chooser-set-current-folder-uri"><function>gtk_file_chooser_set_current_folder_uri()</function></link>,
 
2050
<link linkend="gtk-file-chooser-get-current-folder-uri"><function>gtk_file_chooser_get_current_folder_uri()</function></link>.</para>
 
2051
<para>
 
2052
 
 
2053
</para><variablelist role="params">
 
2054
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
2055
<listitem><simpara> the object which received the signal.
 
2056
</simpara></listitem></varlistentry>
 
2057
<varlistentry><term><parameter>user_data</parameter>&nbsp;:</term>
 
2058
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
 
2059
</variablelist></refsect2><refsect2><title><anchor id="GtkFileChooser-file-activated"/>The &quot;file-activated&quot; signal</title>
 
2060
<indexterm><primary>GtkFileChooser::file-activated</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
2061
                                                        <link linkend="gpointer">gpointer</link>        user_data)      : Run Last</programlisting>
 
2062
<para>
 
2063
This signal is emitted when the user "activates" a file in the file
 
2064
chooser.  This can happen by double-clicking on a file in the file list, or
 
2065
by pressing <keycap>Enter</keycap>.
 
2066
</para>
 
2067
<para>
 
2068
Normally you do not need to connect to this signal.  It is used internally
 
2069
by <link linkend="GtkFileChooserDialog"><type>GtkFileChooserDialog</type></link> to know when to activate the default button in the
 
2070
dialog.
 
2071
</para>
 
2072
<para>
 
2073
See also: <link linkend="gtk-file-chooser-get-filename"><function>gtk_file_chooser_get_filename()</function></link>,
 
2074
<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>,
 
2075
<link linkend="gtk-file-chooser-get-uris"><function>gtk_file_chooser_get_uris()</function></link>.</para>
 
2076
<para>
 
2077
 
 
2078
</para><variablelist role="params">
 
2079
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
2080
<listitem><simpara> the object which received the signal.
 
2081
</simpara></listitem></varlistentry>
 
2082
<varlistentry><term><parameter>user_data</parameter>&nbsp;:</term>
 
2083
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
 
2084
</variablelist></refsect2><refsect2><title><anchor id="GtkFileChooser-selection-changed"/>The &quot;selection-changed&quot; signal</title>
 
2085
<indexterm><primary>GtkFileChooser::selection-changed</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
2086
                                                        <link linkend="gpointer">gpointer</link>        user_data)      : Run Last</programlisting>
 
2087
<para>
 
2088
This signal is emitted when there is a change in the set of selected files
 
2089
in a <link linkend="GtkFileChooser"><type>GtkFileChooser</type></link>.  This can happen when the user modifies the selection
 
2090
with the mouse or the keyboard, or when explicitly calling functions to
 
2091
change the selection.
 
2092
</para>
 
2093
<para>
 
2094
Normally you do not need to connect to this signal, as it is easier to wait
 
2095
for the file chooser to finish running, and then to get the list of
 
2096
selected files using the functions mentioned below.
 
2097
</para>
 
2098
<para>
 
2099
See also: <link linkend="gtk-file-chooser-select-filename"><function>gtk_file_chooser_select_filename()</function></link>,
 
2100
<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>,
 
2101
<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>,
 
2102
<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>,
 
2103
<link linkend="gtk-file-chooser-get-uris"><function>gtk_file_chooser_get_uris()</function></link>.</para>
 
2104
<para>
 
2105
 
 
2106
</para><variablelist role="params">
 
2107
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
2108
<listitem><simpara> the object which received the signal.
 
2109
</simpara></listitem></varlistentry>
 
2110
<varlistentry><term><parameter>user_data</parameter>&nbsp;:</term>
 
2111
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
 
2112
</variablelist></refsect2><refsect2><title><anchor id="GtkFileChooser-update-preview"/>The &quot;update-preview&quot; signal</title>
 
2113
<indexterm><primary>GtkFileChooser::update-preview</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkFileChooser">GtkFileChooser</link> *chooser,
 
2114
                                                        <link linkend="gpointer">gpointer</link>        user_data)      : Run Last</programlisting>
 
2115
<para>
 
2116
This signal is emitted when the preview in a file chooser should be
 
2117
regenerated.  For example, this can happen when the currently selected file
 
2118
changes.  You should use this signal if you want your file chooser to have
 
2119
a preview widget.
 
2120
</para>
 
2121
<para>
 
2122
Once you have installed a preview widget with
 
2123
<link linkend="gtk-file-chooser-set-preview-widget"><function>gtk_file_chooser_set_preview_widget()</function></link>, you should update it when this
 
2124
signal is emitted.  You can use the functions
 
2125
<link linkend="gtk-file-chooser-get-preview-filename"><function>gtk_file_chooser_get_preview_filename()</function></link> or
 
2126
<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.
 
2127
Your widget may not be able to preview all kinds of files; your callback
 
2128
must call <link linkend="gtk-file-chooser-set-preview-wiget-active"><function>gtk_file_chooser_set_preview_wiget_active()</function></link> to inform the file
 
2129
chooser about whether the preview was generated successfully or not.
 
2130
</para>
 
2131
<para>
 
2132
Please see the example code in <xref linkend="gtkfilechooser-preview"/>.
 
2133
</para>
 
2134
<para>
 
2135
See also: <link linkend="gtk-file-chooser-set-preview-widget"><function>gtk_file_chooser_set_preview_widget()</function></link>,
 
2136
<link linkend="gtk-file-chooser-set-preview-widget-active"><function>gtk_file_chooser_set_preview_widget_active()</function></link>,
 
2137
<link linkend="gtk-file-chooser-set-use-preview-label"><function>gtk_file_chooser_set_use_preview_label()</function></link>,
 
2138
<link linkend="gtk-file-chooser-get-preview-filename"><function>gtk_file_chooser_get_preview_filename()</function></link>,
 
2139
<link linkend="gtk-file-chooser-get-preview-uri"><function>gtk_file_chooser_get_preview_uri()</function></link>.</para>
 
2140
<para>
 
2141
 
 
2142
</para><variablelist role="params">
 
2143
<varlistentry><term><parameter>chooser</parameter>&nbsp;:</term>
 
2144
<listitem><simpara> the object which received the signal.
 
2145
</simpara></listitem></varlistentry>
 
2146
<varlistentry><term><parameter>user_data</parameter>&nbsp;:</term>
 
2147
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
 
2148
</variablelist></refsect2>
 
2149
</refsect1>
 
2150
 
 
2151
 
 
2152
<refsect1>
 
2153
<title>See Also</title>
 
2154
    <para>
 
2155
      <link linkend="GtkFileChooserDialog"><type>GtkFileChooserDialog</type></link>, <link linkend="GtkFileChooserWidget"><type>GtkFileChooserWidget</type></link>, <link linkend="GtkFileChooserButton"><type>GtkFileChooserButton</type></link>
 
2156
    </para>
 
2157
</refsect1>
 
2158
 
 
2159
</refentry>