1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gtk.FileChooserT;
26 
27 public  import gio.FileIF;
28 public  import glib.ErrorG;
29 public  import glib.GException;
30 public  import glib.ListSG;
31 public  import glib.Str;
32 public  import gobject.ObjectG;
33 public  import gobject.Signals;
34 public  import gtk.FileFilter;
35 public  import gtk.Widget;
36 public  import gtk.c.functions;
37 public  import gtk.c.types;
38 public  import gtkc.gtktypes;
39 public  import std.algorithm;
40 
41 
42 /**
43  * #GtkFileChooser is an interface that can be implemented by file
44  * selection widgets.  In GTK+, the main objects that implement this
45  * interface are #GtkFileChooserWidget, #GtkFileChooserDialog, and
46  * #GtkFileChooserButton.  You do not need to write an object that
47  * implements the #GtkFileChooser interface unless you are trying to
48  * adapt an existing file selector to expose a standard programming
49  * interface.
50  * 
51  * #GtkFileChooser allows for shortcuts to various places in the filesystem.
52  * In the default implementation these are displayed in the left pane. It
53  * may be a bit confusing at first that these shortcuts come from various
54  * sources and in various flavours, so lets explain the terminology here:
55  * 
56  * - Bookmarks: are created by the user, by dragging folders from the
57  * right pane to the left pane, or by using the “Add”. Bookmarks
58  * can be renamed and deleted by the user.
59  * 
60  * - Shortcuts: can be provided by the application. For example, a Paint
61  * program may want to add a shortcut for a Clipart folder. Shortcuts
62  * cannot be modified by the user.
63  * 
64  * - Volumes: are provided by the underlying filesystem abstraction. They are
65  * the “roots” of the filesystem.
66  * 
67  * # File Names and Encodings
68  * 
69  * When the user is finished selecting files in a
70  * #GtkFileChooser, your program can get the selected names
71  * either as filenames or as URIs.  For URIs, the normal escaping
72  * rules are applied if the URI contains non-ASCII characters.
73  * However, filenames are always returned in
74  * the character set specified by the
75  * `G_FILENAME_ENCODING` environment variable.
76  * Please see the GLib documentation for more details about this
77  * variable.
78  * 
79  * This means that while you can pass the result of
80  * gtk_file_chooser_get_filename() to open() or fopen(),
81  * you may not be able to directly set it as the text of a
82  * #GtkLabel widget unless you convert it first to UTF-8,
83  * which all GTK+ widgets expect. You should use g_filename_to_utf8()
84  * to convert filenames into strings that can be passed to GTK+
85  * widgets.
86  * 
87  * # Adding a Preview Widget
88  * 
89  * You can add a custom preview widget to a file chooser and then
90  * get notification about when the preview needs to be updated.
91  * To install a preview widget, use
92  * gtk_file_chooser_set_preview_widget().  Then, connect to the
93  * #GtkFileChooser::update-preview signal to get notified when
94  * you need to update the contents of the preview.
95  * 
96  * Your callback should use
97  * gtk_file_chooser_get_preview_filename() to see what needs
98  * previewing.  Once you have generated the preview for the
99  * corresponding file, you must call
100  * gtk_file_chooser_set_preview_widget_active() with a boolean
101  * flag that indicates whether your callback could successfully
102  * generate a preview.
103  * 
104  * ## Example: Using a Preview Widget ## {#gtkfilechooser-preview}
105  * |[<!-- language="C" -->
106  * {
107  * GtkImage *preview;
108  * 
109  * ...
110  * 
111  * preview = gtk_image_new ();
112  * 
113  * gtk_file_chooser_set_preview_widget (my_file_chooser, preview);
114  * g_signal_connect (my_file_chooser, "update-preview",
115  * G_CALLBACK (update_preview_cb), preview);
116  * }
117  * 
118  * static void
119  * update_preview_cb (GtkFileChooser *file_chooser, gpointer data)
120  * {
121  * GtkWidget *preview;
122  * char *filename;
123  * GdkPixbuf *pixbuf;
124  * gboolean have_preview;
125  * 
126  * preview = GTK_WIDGET (data);
127  * filename = gtk_file_chooser_get_preview_filename (file_chooser);
128  * 
129  * pixbuf = gdk_pixbuf_new_from_file_at_size (filename, 128, 128, NULL);
130  * have_preview = (pixbuf != NULL);
131  * g_free (filename);
132  * 
133  * gtk_image_set_from_pixbuf (GTK_IMAGE (preview), pixbuf);
134  * if (pixbuf)
135  * g_object_unref (pixbuf);
136  * 
137  * gtk_file_chooser_set_preview_widget_active (file_chooser, have_preview);
138  * }
139  * ]|
140  * 
141  * # Adding Extra Widgets
142  * 
143  * You can add extra widgets to a file chooser to provide options
144  * that are not present in the default design.  For example, you
145  * can add a toggle button to give the user the option to open a
146  * file in read-only mode.  You can use
147  * gtk_file_chooser_set_extra_widget() to insert additional
148  * widgets in a file chooser.
149  * 
150  * An example for adding extra widgets:
151  * |[<!-- language="C" -->
152  * 
153  * GtkWidget *toggle;
154  * 
155  * ...
156  * 
157  * toggle = gtk_check_button_new_with_label ("Open file read-only");
158  * gtk_widget_show (toggle);
159  * gtk_file_chooser_set_extra_widget (my_file_chooser, toggle);
160  * }
161  * ]|
162  * 
163  * If you want to set more than one extra widget in the file
164  * chooser, you can a container such as a #GtkBox or a #GtkGrid
165  * and include your widgets in it.  Then, set the container as
166  * the whole extra widget.
167  */
168 public template FileChooserT(TStruct)
169 {
170 	/** Get the main Gtk struct */
171 	public GtkFileChooser* getFileChooserStruct(bool transferOwnership = false)
172 	{
173 		if (transferOwnership)
174 			ownedRef = false;
175 		return cast(GtkFileChooser*)getStruct();
176 	}
177 
178 
179 	/**
180 	 * Adds a 'choice' to the file chooser. This is typically implemented
181 	 * as a combobox or, for boolean choices, as a checkbutton. You can select
182 	 * a value using gtk_file_chooser_set_choice() before the dialog is shown,
183 	 * and you can obtain the user-selected value in the ::response signal handler
184 	 * using gtk_file_chooser_get_choice().
185 	 *
186 	 * Compare gtk_file_chooser_set_extra_widget().
187 	 *
188 	 * Params:
189 	 *     id = id for the added choice
190 	 *     label = user-visible label for the added choice
191 	 *     options = ids for the options of the choice, or %NULL for a boolean choice
192 	 *     optionLabels = user-visible labels for the options, must be the same length as @options
193 	 *
194 	 * Since: 3.22
195 	 */
196 	public void addChoice(string id, string label, string[] options, string[] optionLabels)
197 	{
198 		gtk_file_chooser_add_choice(getFileChooserStruct(), Str.toStringz(id), Str.toStringz(label), Str.toStringzArray(options), Str.toStringzArray(optionLabels));
199 	}
200 
201 	/**
202 	 * Adds @filter to the list of filters that the user can select between.
203 	 * When a filter is selected, only files that are passed by that
204 	 * filter are displayed.
205 	 *
206 	 * Note that the @chooser takes ownership of the filter, so you have to
207 	 * ref and sink it if you want to keep a reference.
208 	 *
209 	 * Params:
210 	 *     filter = a #GtkFileFilter
211 	 *
212 	 * Since: 2.4
213 	 */
214 	public void addFilter(FileFilter filter)
215 	{
216 		gtk_file_chooser_add_filter(getFileChooserStruct(), (filter is null) ? null : filter.getFileFilterStruct());
217 	}
218 
219 	/**
220 	 * Adds a folder to be displayed with the shortcut folders in a file chooser.
221 	 * Note that shortcut folders do not get saved, as they are provided by the
222 	 * application.  For example, you can use this to add a
223 	 * “/usr/share/mydrawprogram/Clipart” folder to the volume list.
224 	 *
225 	 * Params:
226 	 *     folder = filename of the folder to add
227 	 *
228 	 * Returns: %TRUE if the folder could be added successfully, %FALSE
229 	 *     otherwise.  In the latter case, the @error will be set as appropriate.
230 	 *
231 	 * Since: 2.4
232 	 *
233 	 * Throws: GException on failure.
234 	 */
235 	public bool addShortcutFolder(string folder)
236 	{
237 		GError* err = null;
238 
239 		auto p = gtk_file_chooser_add_shortcut_folder(getFileChooserStruct(), Str.toStringz(folder), &err) != 0;
240 
241 		if (err !is null)
242 		{
243 			throw new GException( new ErrorG(err) );
244 		}
245 
246 		return p;
247 	}
248 
249 	/**
250 	 * Adds a folder URI to be displayed with the shortcut folders in a file
251 	 * chooser.  Note that shortcut folders do not get saved, as they are provided
252 	 * by the application.  For example, you can use this to add a
253 	 * “file:///usr/share/mydrawprogram/Clipart” folder to the volume list.
254 	 *
255 	 * Params:
256 	 *     uri = URI of the folder to add
257 	 *
258 	 * Returns: %TRUE if the folder could be added successfully, %FALSE
259 	 *     otherwise.  In the latter case, the @error will be set as appropriate.
260 	 *
261 	 * Since: 2.4
262 	 *
263 	 * Throws: GException on failure.
264 	 */
265 	public bool addShortcutFolderUri(string uri)
266 	{
267 		GError* err = null;
268 
269 		auto p = gtk_file_chooser_add_shortcut_folder_uri(getFileChooserStruct(), Str.toStringz(uri), &err) != 0;
270 
271 		if (err !is null)
272 		{
273 			throw new GException( new ErrorG(err) );
274 		}
275 
276 		return p;
277 	}
278 
279 	/**
280 	 * Gets the type of operation that the file chooser is performing; see
281 	 * gtk_file_chooser_set_action().
282 	 *
283 	 * Returns: the action that the file selector is performing
284 	 *
285 	 * Since: 2.4
286 	 */
287 	public GtkFileChooserAction getFileChooserAction()
288 	{
289 		return gtk_file_chooser_get_action(getFileChooserStruct());
290 	}
291 
292 	/**
293 	 * Gets the currently selected option in the 'choice' with the given ID.
294 	 *
295 	 * Params:
296 	 *     id = the ID of the choice to get
297 	 *
298 	 * Returns: the ID of the currenly selected option
299 	 *
300 	 * Since: 3.22
301 	 */
302 	public string getChoice(string id)
303 	{
304 		return Str.toString(gtk_file_chooser_get_choice(getFileChooserStruct(), Str.toStringz(id)));
305 	}
306 
307 	/**
308 	 * Gets whether file choser will offer to create new folders.
309 	 * See gtk_file_chooser_set_create_folders().
310 	 *
311 	 * Returns: %TRUE if the Create Folder button should be displayed.
312 	 *
313 	 * Since: 2.18
314 	 */
315 	public bool getCreateFolders()
316 	{
317 		return gtk_file_chooser_get_create_folders(getFileChooserStruct()) != 0;
318 	}
319 
320 	/**
321 	 * Gets the current folder of @chooser as a local filename.
322 	 * See gtk_file_chooser_set_current_folder().
323 	 *
324 	 * Note that this is the folder that the file chooser is currently displaying
325 	 * (e.g. "/home/username/Documents"), which is not the same
326 	 * as the currently-selected folder if the chooser is in
327 	 * %GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER mode
328 	 * (e.g. "/home/username/Documents/selected-folder/".  To get the
329 	 * currently-selected folder in that mode, use gtk_file_chooser_get_uri() as the
330 	 * usual way to get the selection.
331 	 *
332 	 * Returns: the full path of the current
333 	 *     folder, or %NULL if the current path cannot be represented as a local
334 	 *     filename.  Free with g_free().  This function will also return
335 	 *     %NULL if the file chooser was unable to load the last folder that
336 	 *     was requested from it; for example, as would be for calling
337 	 *     gtk_file_chooser_set_current_folder() on a nonexistent folder.
338 	 *
339 	 * Since: 2.4
340 	 */
341 	public string getCurrentFolder()
342 	{
343 		auto retStr = gtk_file_chooser_get_current_folder(getFileChooserStruct());
344 
345 		scope(exit) Str.freeString(retStr);
346 		return Str.toString(retStr);
347 	}
348 
349 	/**
350 	 * Gets the current folder of @chooser as #GFile.
351 	 * See gtk_file_chooser_get_current_folder_uri().
352 	 *
353 	 * Returns: the #GFile for the current folder.
354 	 *
355 	 * Since: 2.14
356 	 */
357 	public FileIF getCurrentFolderFile()
358 	{
359 		auto p = gtk_file_chooser_get_current_folder_file(getFileChooserStruct());
360 
361 		if(p is null)
362 		{
363 			return null;
364 		}
365 
366 		return ObjectG.getDObject!(FileIF)(cast(GFile*) p, true);
367 	}
368 
369 	/**
370 	 * Gets the current folder of @chooser as an URI.
371 	 * See gtk_file_chooser_set_current_folder_uri().
372 	 *
373 	 * Note that this is the folder that the file chooser is currently displaying
374 	 * (e.g. "file:///home/username/Documents"), which is not the same
375 	 * as the currently-selected folder if the chooser is in
376 	 * %GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER mode
377 	 * (e.g. "file:///home/username/Documents/selected-folder/".  To get the
378 	 * currently-selected folder in that mode, use gtk_file_chooser_get_uri() as the
379 	 * usual way to get the selection.
380 	 *
381 	 * Returns: the URI for the current folder.
382 	 *     Free with g_free().  This function will also return %NULL if the file chooser
383 	 *     was unable to load the last folder that was requested from it; for example,
384 	 *     as would be for calling gtk_file_chooser_set_current_folder_uri() on a
385 	 *     nonexistent folder.
386 	 *
387 	 * Since: 2.4
388 	 */
389 	public string getCurrentFolderUri()
390 	{
391 		auto retStr = gtk_file_chooser_get_current_folder_uri(getFileChooserStruct());
392 
393 		scope(exit) Str.freeString(retStr);
394 		return Str.toString(retStr);
395 	}
396 
397 	/**
398 	 * Gets the current name in the file selector, as entered by the user in the
399 	 * text entry for “Name”.
400 	 *
401 	 * This is meant to be used in save dialogs, to get the currently typed filename
402 	 * when the file itself does not exist yet.  For example, an application that
403 	 * adds a custom extra widget to the file chooser for “file format” may want to
404 	 * change the extension of the typed filename based on the chosen format, say,
405 	 * from “.jpg” to “.png”.
406 	 *
407 	 * Returns: The raw text from the file chooser’s “Name” entry.  Free this with
408 	 *     g_free().  Note that this string is not a full pathname or URI; it is
409 	 *     whatever the contents of the entry are.  Note also that this string is in
410 	 *     UTF-8 encoding, which is not necessarily the system’s encoding for filenames.
411 	 *
412 	 * Since: 3.10
413 	 */
414 	public string getCurrentName()
415 	{
416 		auto retStr = gtk_file_chooser_get_current_name(getFileChooserStruct());
417 
418 		scope(exit) Str.freeString(retStr);
419 		return Str.toString(retStr);
420 	}
421 
422 	/**
423 	 * Queries whether a file chooser is set to confirm for overwriting when the user
424 	 * types a file name that already exists.
425 	 *
426 	 * Returns: %TRUE if the file chooser will present a confirmation dialog;
427 	 *     %FALSE otherwise.
428 	 *
429 	 * Since: 2.8
430 	 */
431 	public bool getDoOverwriteConfirmation()
432 	{
433 		return gtk_file_chooser_get_do_overwrite_confirmation(getFileChooserStruct()) != 0;
434 	}
435 
436 	/**
437 	 * Gets the current extra widget; see
438 	 * gtk_file_chooser_set_extra_widget().
439 	 *
440 	 * Returns: the current extra widget, or %NULL
441 	 *
442 	 * Since: 2.4
443 	 */
444 	public Widget getExtraWidget()
445 	{
446 		auto p = gtk_file_chooser_get_extra_widget(getFileChooserStruct());
447 
448 		if(p is null)
449 		{
450 			return null;
451 		}
452 
453 		return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p);
454 	}
455 
456 	/**
457 	 * Gets the #GFile for the currently selected file in
458 	 * the file selector. If multiple files are selected,
459 	 * one of the files will be returned at random.
460 	 *
461 	 * If the file chooser is in folder mode, this function returns the selected
462 	 * folder.
463 	 *
464 	 * Returns: a selected #GFile. You own the returned file;
465 	 *     use g_object_unref() to release it.
466 	 *
467 	 * Since: 2.14
468 	 */
469 	public FileIF getFile()
470 	{
471 		auto p = gtk_file_chooser_get_file(getFileChooserStruct());
472 
473 		if(p is null)
474 		{
475 			return null;
476 		}
477 
478 		return ObjectG.getDObject!(FileIF)(cast(GFile*) p, true);
479 	}
480 
481 	/**
482 	 * Gets the filename for the currently selected file in
483 	 * the file selector. The filename is returned as an absolute path. If
484 	 * multiple files are selected, one of the filenames will be returned at
485 	 * random.
486 	 *
487 	 * If the file chooser is in folder mode, this function returns the selected
488 	 * folder.
489 	 *
490 	 * Returns: The currently selected filename,
491 	 *     or %NULL if no file is selected, or the selected file can't
492 	 *     be represented with a local filename. Free with g_free().
493 	 *
494 	 * Since: 2.4
495 	 */
496 	public string getFilename()
497 	{
498 		auto retStr = gtk_file_chooser_get_filename(getFileChooserStruct());
499 
500 		scope(exit) Str.freeString(retStr);
501 		return Str.toString(retStr);
502 	}
503 
504 	/**
505 	 * Lists all the selected files and subfolders in the current folder of
506 	 * @chooser. The returned names are full absolute paths. If files in the current
507 	 * folder cannot be represented as local filenames they will be ignored. (See
508 	 * gtk_file_chooser_get_uris())
509 	 *
510 	 * Returns: a #GSList
511 	 *     containing the filenames of all selected files and subfolders in
512 	 *     the current folder. Free the returned list with g_slist_free(),
513 	 *     and the filenames with g_free().
514 	 *
515 	 * Since: 2.4
516 	 */
517 	public ListSG getFilenames()
518 	{
519 		auto p = gtk_file_chooser_get_filenames(getFileChooserStruct());
520 
521 		if(p is null)
522 		{
523 			return null;
524 		}
525 
526 		return new ListSG(cast(GSList*) p, true);
527 	}
528 
529 	/**
530 	 * Lists all the selected files and subfolders in the current folder of @chooser
531 	 * as #GFile. An internal function, see gtk_file_chooser_get_uris().
532 	 *
533 	 * Returns: a #GSList
534 	 *     containing a #GFile for each selected file and subfolder in the
535 	 *     current folder.  Free the returned list with g_slist_free(), and
536 	 *     the files with g_object_unref().
537 	 *
538 	 * Since: 2.14
539 	 */
540 	public ListSG getFiles()
541 	{
542 		auto p = gtk_file_chooser_get_files(getFileChooserStruct());
543 
544 		if(p is null)
545 		{
546 			return null;
547 		}
548 
549 		return new ListSG(cast(GSList*) p, true);
550 	}
551 
552 	/**
553 	 * Gets the current filter; see gtk_file_chooser_set_filter().
554 	 *
555 	 * Returns: the current filter, or %NULL
556 	 *
557 	 * Since: 2.4
558 	 */
559 	public FileFilter getFilter()
560 	{
561 		auto p = gtk_file_chooser_get_filter(getFileChooserStruct());
562 
563 		if(p is null)
564 		{
565 			return null;
566 		}
567 
568 		return ObjectG.getDObject!(FileFilter)(cast(GtkFileFilter*) p);
569 	}
570 
571 	/**
572 	 * Gets whether only local files can be selected in the
573 	 * file selector. See gtk_file_chooser_set_local_only()
574 	 *
575 	 * Returns: %TRUE if only local files can be selected.
576 	 *
577 	 * Since: 2.4
578 	 */
579 	public bool getLocalOnly()
580 	{
581 		return gtk_file_chooser_get_local_only(getFileChooserStruct()) != 0;
582 	}
583 
584 	/**
585 	 * Gets the #GFile that should be previewed in a custom preview
586 	 * Internal function, see gtk_file_chooser_get_preview_uri().
587 	 *
588 	 * Returns: the #GFile for the file to preview,
589 	 *     or %NULL if no file is selected. Free with g_object_unref().
590 	 *
591 	 * Since: 2.14
592 	 */
593 	public FileIF getPreviewFile()
594 	{
595 		auto p = gtk_file_chooser_get_preview_file(getFileChooserStruct());
596 
597 		if(p is null)
598 		{
599 			return null;
600 		}
601 
602 		return ObjectG.getDObject!(FileIF)(cast(GFile*) p, true);
603 	}
604 
605 	/**
606 	 * Gets the filename that should be previewed in a custom preview
607 	 * widget. See gtk_file_chooser_set_preview_widget().
608 	 *
609 	 * Returns: the filename to preview, or %NULL if
610 	 *     no file is selected, or if the selected file cannot be represented
611 	 *     as a local filename. Free with g_free()
612 	 *
613 	 * Since: 2.4
614 	 */
615 	public string getPreviewFilename()
616 	{
617 		auto retStr = gtk_file_chooser_get_preview_filename(getFileChooserStruct());
618 
619 		scope(exit) Str.freeString(retStr);
620 		return Str.toString(retStr);
621 	}
622 
623 	/**
624 	 * Gets the URI that should be previewed in a custom preview
625 	 * widget. See gtk_file_chooser_set_preview_widget().
626 	 *
627 	 * Returns: the URI for the file to preview,
628 	 *     or %NULL if no file is selected. Free with g_free().
629 	 *
630 	 * Since: 2.4
631 	 */
632 	public string getPreviewUri()
633 	{
634 		auto retStr = gtk_file_chooser_get_preview_uri(getFileChooserStruct());
635 
636 		scope(exit) Str.freeString(retStr);
637 		return Str.toString(retStr);
638 	}
639 
640 	/**
641 	 * Gets the current preview widget; see
642 	 * gtk_file_chooser_set_preview_widget().
643 	 *
644 	 * Returns: the current preview widget, or %NULL
645 	 *
646 	 * Since: 2.4
647 	 */
648 	public Widget getPreviewWidget()
649 	{
650 		auto p = gtk_file_chooser_get_preview_widget(getFileChooserStruct());
651 
652 		if(p is null)
653 		{
654 			return null;
655 		}
656 
657 		return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p);
658 	}
659 
660 	/**
661 	 * Gets whether the preview widget set by gtk_file_chooser_set_preview_widget()
662 	 * should be shown for the current filename. See
663 	 * gtk_file_chooser_set_preview_widget_active().
664 	 *
665 	 * Returns: %TRUE if the preview widget is active for the current filename.
666 	 *
667 	 * Since: 2.4
668 	 */
669 	public bool getPreviewWidgetActive()
670 	{
671 		return gtk_file_chooser_get_preview_widget_active(getFileChooserStruct()) != 0;
672 	}
673 
674 	/**
675 	 * Gets whether multiple files can be selected in the file
676 	 * selector. See gtk_file_chooser_set_select_multiple().
677 	 *
678 	 * Returns: %TRUE if multiple files can be selected.
679 	 *
680 	 * Since: 2.4
681 	 */
682 	public bool getSelectMultiple()
683 	{
684 		return gtk_file_chooser_get_select_multiple(getFileChooserStruct()) != 0;
685 	}
686 
687 	/**
688 	 * Gets whether hidden files and folders are displayed in the file selector.
689 	 * See gtk_file_chooser_set_show_hidden().
690 	 *
691 	 * Returns: %TRUE if hidden files and folders are displayed.
692 	 *
693 	 * Since: 2.6
694 	 */
695 	public bool getShowHidden()
696 	{
697 		return gtk_file_chooser_get_show_hidden(getFileChooserStruct()) != 0;
698 	}
699 
700 	/**
701 	 * Gets the URI for the currently selected file in
702 	 * the file selector. If multiple files are selected,
703 	 * one of the filenames will be returned at random.
704 	 *
705 	 * If the file chooser is in folder mode, this function returns the selected
706 	 * folder.
707 	 *
708 	 * Returns: The currently selected URI, or %NULL
709 	 *     if no file is selected. If gtk_file_chooser_set_local_only() is set to
710 	 *     %TRUE (the default) a local URI will be returned for any FUSE locations.
711 	 *     Free with g_free()
712 	 *
713 	 * Since: 2.4
714 	 */
715 	public string getUri()
716 	{
717 		auto retStr = gtk_file_chooser_get_uri(getFileChooserStruct());
718 
719 		scope(exit) Str.freeString(retStr);
720 		return Str.toString(retStr);
721 	}
722 
723 	/**
724 	 * Lists all the selected files and subfolders in the current folder of
725 	 * @chooser. The returned names are full absolute URIs.
726 	 *
727 	 * Returns: a #GSList containing the URIs of all selected
728 	 *     files and subfolders in the current folder. Free the returned list
729 	 *     with g_slist_free(), and the filenames with g_free().
730 	 *
731 	 * Since: 2.4
732 	 */
733 	public ListSG getUris()
734 	{
735 		auto p = gtk_file_chooser_get_uris(getFileChooserStruct());
736 
737 		if(p is null)
738 		{
739 			return null;
740 		}
741 
742 		return new ListSG(cast(GSList*) p, true);
743 	}
744 
745 	/**
746 	 * Gets whether a stock label should be drawn with the name of the previewed
747 	 * file.  See gtk_file_chooser_set_use_preview_label().
748 	 *
749 	 * Returns: %TRUE if the file chooser is set to display a label with the
750 	 *     name of the previewed file, %FALSE otherwise.
751 	 */
752 	public bool getUsePreviewLabel()
753 	{
754 		return gtk_file_chooser_get_use_preview_label(getFileChooserStruct()) != 0;
755 	}
756 
757 	/**
758 	 * Lists the current set of user-selectable filters; see
759 	 * gtk_file_chooser_add_filter(), gtk_file_chooser_remove_filter().
760 	 *
761 	 * Returns: a
762 	 *     #GSList containing the current set of user selectable filters. The
763 	 *     contents of the list are owned by GTK+, but you must free the list
764 	 *     itself with g_slist_free() when you are done with it.
765 	 *
766 	 * Since: 2.4
767 	 */
768 	public ListSG listFilters()
769 	{
770 		auto p = gtk_file_chooser_list_filters(getFileChooserStruct());
771 
772 		if(p is null)
773 		{
774 			return null;
775 		}
776 
777 		return new ListSG(cast(GSList*) p);
778 	}
779 
780 	/**
781 	 * Queries the list of shortcut folders in the file chooser, as set by
782 	 * gtk_file_chooser_add_shortcut_folder_uri().
783 	 *
784 	 * Returns: A list of
785 	 *     folder URIs, or %NULL if there are no shortcut folders.  Free the
786 	 *     returned list with g_slist_free(), and the URIs with g_free().
787 	 *
788 	 * Since: 2.4
789 	 */
790 	public ListSG listShortcutFolderUris()
791 	{
792 		auto p = gtk_file_chooser_list_shortcut_folder_uris(getFileChooserStruct());
793 
794 		if(p is null)
795 		{
796 			return null;
797 		}
798 
799 		return new ListSG(cast(GSList*) p, true);
800 	}
801 
802 	/**
803 	 * Queries the list of shortcut folders in the file chooser, as set by
804 	 * gtk_file_chooser_add_shortcut_folder().
805 	 *
806 	 * Returns: A list
807 	 *     of folder filenames, or %NULL if there are no shortcut folders.
808 	 *     Free the returned list with g_slist_free(), and the filenames with
809 	 *     g_free().
810 	 *
811 	 * Since: 2.4
812 	 */
813 	public ListSG listShortcutFolders()
814 	{
815 		auto p = gtk_file_chooser_list_shortcut_folders(getFileChooserStruct());
816 
817 		if(p is null)
818 		{
819 			return null;
820 		}
821 
822 		return new ListSG(cast(GSList*) p, true);
823 	}
824 
825 	/**
826 	 * Removes a 'choice' that has been added with gtk_file_chooser_add_choice().
827 	 *
828 	 * Params:
829 	 *     id = the ID of the choice to remove
830 	 *
831 	 * Since: 3.22
832 	 */
833 	public void removeChoice(string id)
834 	{
835 		gtk_file_chooser_remove_choice(getFileChooserStruct(), Str.toStringz(id));
836 	}
837 
838 	/**
839 	 * Removes @filter from the list of filters that the user can select between.
840 	 *
841 	 * Params:
842 	 *     filter = a #GtkFileFilter
843 	 *
844 	 * Since: 2.4
845 	 */
846 	public void removeFilter(FileFilter filter)
847 	{
848 		gtk_file_chooser_remove_filter(getFileChooserStruct(), (filter is null) ? null : filter.getFileFilterStruct());
849 	}
850 
851 	/**
852 	 * Removes a folder from a file chooser’s list of shortcut folders.
853 	 *
854 	 * Params:
855 	 *     folder = filename of the folder to remove
856 	 *
857 	 * Returns: %TRUE if the operation succeeds, %FALSE otherwise.
858 	 *     In the latter case, the @error will be set as appropriate.
859 	 *
860 	 *     See also: gtk_file_chooser_add_shortcut_folder()
861 	 *
862 	 * Since: 2.4
863 	 *
864 	 * Throws: GException on failure.
865 	 */
866 	public bool removeShortcutFolder(string folder)
867 	{
868 		GError* err = null;
869 
870 		auto p = gtk_file_chooser_remove_shortcut_folder(getFileChooserStruct(), Str.toStringz(folder), &err) != 0;
871 
872 		if (err !is null)
873 		{
874 			throw new GException( new ErrorG(err) );
875 		}
876 
877 		return p;
878 	}
879 
880 	/**
881 	 * Removes a folder URI from a file chooser’s list of shortcut folders.
882 	 *
883 	 * Params:
884 	 *     uri = URI of the folder to remove
885 	 *
886 	 * Returns: %TRUE if the operation succeeds, %FALSE otherwise.
887 	 *     In the latter case, the @error will be set as appropriate.
888 	 *
889 	 *     See also: gtk_file_chooser_add_shortcut_folder_uri()
890 	 *
891 	 * Since: 2.4
892 	 *
893 	 * Throws: GException on failure.
894 	 */
895 	public bool removeShortcutFolderUri(string uri)
896 	{
897 		GError* err = null;
898 
899 		auto p = gtk_file_chooser_remove_shortcut_folder_uri(getFileChooserStruct(), Str.toStringz(uri), &err) != 0;
900 
901 		if (err !is null)
902 		{
903 			throw new GException( new ErrorG(err) );
904 		}
905 
906 		return p;
907 	}
908 
909 	/**
910 	 * Selects all the files in the current folder of a file chooser.
911 	 *
912 	 * Since: 2.4
913 	 */
914 	public void selectAll()
915 	{
916 		gtk_file_chooser_select_all(getFileChooserStruct());
917 	}
918 
919 	/**
920 	 * Selects the file referred to by @file. An internal function. See
921 	 * _gtk_file_chooser_select_uri().
922 	 *
923 	 * Params:
924 	 *     file = the file to select
925 	 *
926 	 * Returns: Not useful.
927 	 *
928 	 * Since: 2.14
929 	 *
930 	 * Throws: GException on failure.
931 	 */
932 	public bool selectFile(FileIF file)
933 	{
934 		GError* err = null;
935 
936 		auto p = gtk_file_chooser_select_file(getFileChooserStruct(), (file is null) ? null : file.getFileStruct(), &err) != 0;
937 
938 		if (err !is null)
939 		{
940 			throw new GException( new ErrorG(err) );
941 		}
942 
943 		return p;
944 	}
945 
946 	/**
947 	 * Selects a filename. If the file name isn’t in the current
948 	 * folder of @chooser, then the current folder of @chooser will
949 	 * be changed to the folder containing @filename.
950 	 *
951 	 * Params:
952 	 *     filename = the filename to select
953 	 *
954 	 * Returns: Not useful.
955 	 *
956 	 *     See also: gtk_file_chooser_set_filename()
957 	 *
958 	 * Since: 2.4
959 	 */
960 	public bool selectFilename(string filename)
961 	{
962 		return gtk_file_chooser_select_filename(getFileChooserStruct(), Str.toStringz(filename)) != 0;
963 	}
964 
965 	/**
966 	 * Selects the file to by @uri. If the URI doesn’t refer to a
967 	 * file in the current folder of @chooser, then the current folder of
968 	 * @chooser will be changed to the folder containing @filename.
969 	 *
970 	 * Params:
971 	 *     uri = the URI to select
972 	 *
973 	 * Returns: Not useful.
974 	 *
975 	 * Since: 2.4
976 	 */
977 	public bool selectUri(string uri)
978 	{
979 		return gtk_file_chooser_select_uri(getFileChooserStruct(), Str.toStringz(uri)) != 0;
980 	}
981 
982 	/**
983 	 * Sets the type of operation that the chooser is performing; the
984 	 * user interface is adapted to suit the selected action. For example,
985 	 * an option to create a new folder might be shown if the action is
986 	 * %GTK_FILE_CHOOSER_ACTION_SAVE but not if the action is
987 	 * %GTK_FILE_CHOOSER_ACTION_OPEN.
988 	 *
989 	 * Params:
990 	 *     action = the action that the file selector is performing
991 	 *
992 	 * Since: 2.4
993 	 */
994 	public void setFileChooserAction(GtkFileChooserAction action)
995 	{
996 		gtk_file_chooser_set_action(getFileChooserStruct(), action);
997 	}
998 
999 	/**
1000 	 * Selects an option in a 'choice' that has been added with
1001 	 * gtk_file_chooser_add_choice(). For a boolean choice, the
1002 	 * possible options are "true" and "false".
1003 	 *
1004 	 * Params:
1005 	 *     id = the ID of the choice to set
1006 	 *     option = the ID of the option to select
1007 	 *
1008 	 * Since: 3.22
1009 	 */
1010 	public void setChoice(string id, string option)
1011 	{
1012 		gtk_file_chooser_set_choice(getFileChooserStruct(), Str.toStringz(id), Str.toStringz(option));
1013 	}
1014 
1015 	/**
1016 	 * Sets whether file choser will offer to create new folders.
1017 	 * This is only relevant if the action is not set to be
1018 	 * %GTK_FILE_CHOOSER_ACTION_OPEN.
1019 	 *
1020 	 * Params:
1021 	 *     createFolders = %TRUE if the Create Folder button should be displayed
1022 	 *
1023 	 * Since: 2.18
1024 	 */
1025 	public void setCreateFolders(bool createFolders)
1026 	{
1027 		gtk_file_chooser_set_create_folders(getFileChooserStruct(), createFolders);
1028 	}
1029 
1030 	/**
1031 	 * Sets the current folder for @chooser from a local filename.
1032 	 * The user will be shown the full contents of the current folder,
1033 	 * plus user interface elements for navigating to other folders.
1034 	 *
1035 	 * In general, you should not use this function.  See the
1036 	 * [section on setting up a file chooser dialog][gtkfilechooserdialog-setting-up]
1037 	 * for the rationale behind this.
1038 	 *
1039 	 * Params:
1040 	 *     filename = the full path of the new current folder
1041 	 *
1042 	 * Returns: Not useful.
1043 	 *
1044 	 * Since: 2.4
1045 	 */
1046 	public bool setCurrentFolder(string filename)
1047 	{
1048 		return gtk_file_chooser_set_current_folder(getFileChooserStruct(), Str.toStringz(filename)) != 0;
1049 	}
1050 
1051 	/**
1052 	 * Sets the current folder for @chooser from a #GFile.
1053 	 * Internal function, see gtk_file_chooser_set_current_folder_uri().
1054 	 *
1055 	 * Params:
1056 	 *     file = the #GFile for the new folder
1057 	 *
1058 	 * Returns: %TRUE if the folder could be changed successfully, %FALSE
1059 	 *     otherwise.
1060 	 *
1061 	 * Since: 2.14
1062 	 *
1063 	 * Throws: GException on failure.
1064 	 */
1065 	public bool setCurrentFolderFile(FileIF file)
1066 	{
1067 		GError* err = null;
1068 
1069 		auto p = gtk_file_chooser_set_current_folder_file(getFileChooserStruct(), (file is null) ? null : file.getFileStruct(), &err) != 0;
1070 
1071 		if (err !is null)
1072 		{
1073 			throw new GException( new ErrorG(err) );
1074 		}
1075 
1076 		return p;
1077 	}
1078 
1079 	/**
1080 	 * Sets the current folder for @chooser from an URI.
1081 	 * The user will be shown the full contents of the current folder,
1082 	 * plus user interface elements for navigating to other folders.
1083 	 *
1084 	 * In general, you should not use this function.  See the
1085 	 * [section on setting up a file chooser dialog][gtkfilechooserdialog-setting-up]
1086 	 * for the rationale behind this.
1087 	 *
1088 	 * Params:
1089 	 *     uri = the URI for the new current folder
1090 	 *
1091 	 * Returns: %TRUE if the folder could be changed successfully, %FALSE
1092 	 *     otherwise.
1093 	 *
1094 	 * Since: 2.4
1095 	 */
1096 	public bool setCurrentFolderUri(string uri)
1097 	{
1098 		return gtk_file_chooser_set_current_folder_uri(getFileChooserStruct(), Str.toStringz(uri)) != 0;
1099 	}
1100 
1101 	/**
1102 	 * Sets the current name in the file selector, as if entered
1103 	 * by the user. Note that the name passed in here is a UTF-8
1104 	 * string rather than a filename. This function is meant for
1105 	 * such uses as a suggested name in a “Save As...” dialog.  You can
1106 	 * pass “Untitled.doc” or a similarly suitable suggestion for the @name.
1107 	 *
1108 	 * If you want to preselect a particular existing file, you should use
1109 	 * gtk_file_chooser_set_filename() or gtk_file_chooser_set_uri() instead.
1110 	 * Please see the documentation for those functions for an example of using
1111 	 * gtk_file_chooser_set_current_name() as well.
1112 	 *
1113 	 * Params:
1114 	 *     name = the filename to use, as a UTF-8 string
1115 	 *
1116 	 * Since: 2.4
1117 	 */
1118 	public void setCurrentName(string name)
1119 	{
1120 		gtk_file_chooser_set_current_name(getFileChooserStruct(), Str.toStringz(name));
1121 	}
1122 
1123 	/**
1124 	 * Sets whether a file chooser in %GTK_FILE_CHOOSER_ACTION_SAVE mode will present
1125 	 * a confirmation dialog if the user types a file name that already exists.  This
1126 	 * is %FALSE by default.
1127 	 *
1128 	 * If set to %TRUE, the @chooser will emit the
1129 	 * #GtkFileChooser::confirm-overwrite signal when appropriate.
1130 	 *
1131 	 * If all you need is the stock confirmation dialog, set this property to %TRUE.
1132 	 * You can override the way confirmation is done by actually handling the
1133 	 * #GtkFileChooser::confirm-overwrite signal; please refer to its documentation
1134 	 * for the details.
1135 	 *
1136 	 * Params:
1137 	 *     doOverwriteConfirmation = whether to confirm overwriting in save mode
1138 	 *
1139 	 * Since: 2.8
1140 	 */
1141 	public void setDoOverwriteConfirmation(bool doOverwriteConfirmation)
1142 	{
1143 		gtk_file_chooser_set_do_overwrite_confirmation(getFileChooserStruct(), doOverwriteConfirmation);
1144 	}
1145 
1146 	/**
1147 	 * Sets an application-supplied widget to provide extra options to the user.
1148 	 *
1149 	 * Params:
1150 	 *     extraWidget = widget for extra options
1151 	 *
1152 	 * Since: 2.4
1153 	 */
1154 	public void setExtraWidget(Widget extraWidget)
1155 	{
1156 		gtk_file_chooser_set_extra_widget(getFileChooserStruct(), (extraWidget is null) ? null : extraWidget.getWidgetStruct());
1157 	}
1158 
1159 	/**
1160 	 * Sets @file as the current filename for the file chooser, by changing
1161 	 * to the file’s parent folder and actually selecting the file in list.  If
1162 	 * the @chooser is in %GTK_FILE_CHOOSER_ACTION_SAVE mode, the file’s base name
1163 	 * will also appear in the dialog’s file name entry.
1164 	 *
1165 	 * If the file name isn’t in the current folder of @chooser, then the current
1166 	 * folder of @chooser will be changed to the folder containing @filename. This
1167 	 * is equivalent to a sequence of gtk_file_chooser_unselect_all() followed by
1168 	 * gtk_file_chooser_select_filename().
1169 	 *
1170 	 * Note that the file must exist, or nothing will be done except
1171 	 * for the directory change.
1172 	 *
1173 	 * If you are implementing a save dialog,
1174 	 * you should use this function if you already have a file name to which the
1175 	 * user may save; for example, when the user opens an existing file and then
1176 	 * does Save As...  If you don’t have
1177 	 * a file name already — for example, if the user just created a new
1178 	 * file and is saving it for the first time, do not call this function.
1179 	 * Instead, use something similar to this:
1180 	 * |[<!-- language="C" -->
1181 	 * if (document_is_new)
1182 	 * {
1183 	 * // the user just created a new document
1184 	 * gtk_file_chooser_set_current_folder_file (chooser, default_file_for_saving);
1185 	 * gtk_file_chooser_set_current_name (chooser, "Untitled document");
1186 	 * }
1187 	 * else
1188 	 * {
1189 	 * // the user edited an existing document
1190 	 * gtk_file_chooser_set_file (chooser, existing_file);
1191 	 * }
1192 	 * ]|
1193 	 *
1194 	 * Params:
1195 	 *     file = the #GFile to set as current
1196 	 *
1197 	 * Returns: Not useful.
1198 	 *
1199 	 * Since: 2.14
1200 	 *
1201 	 * Throws: GException on failure.
1202 	 */
1203 	public bool setFile(FileIF file)
1204 	{
1205 		GError* err = null;
1206 
1207 		auto p = gtk_file_chooser_set_file(getFileChooserStruct(), (file is null) ? null : file.getFileStruct(), &err) != 0;
1208 
1209 		if (err !is null)
1210 		{
1211 			throw new GException( new ErrorG(err) );
1212 		}
1213 
1214 		return p;
1215 	}
1216 
1217 	/**
1218 	 * Sets @filename as the current filename for the file chooser, by changing to
1219 	 * the file’s parent folder and actually selecting the file in list; all other
1220 	 * files will be unselected.  If the @chooser is in
1221 	 * %GTK_FILE_CHOOSER_ACTION_SAVE mode, the file’s base name will also appear in
1222 	 * the dialog’s file name entry.
1223 	 *
1224 	 * Note that the file must exist, or nothing will be done except
1225 	 * for the directory change.
1226 	 *
1227 	 * You should use this function only when implementing a save
1228 	 * dialog for which you already have a file name to which
1229 	 * the user may save.  For example, when the user opens an existing file and
1230 	 * then does Save As... to save a copy or
1231 	 * a modified version.  If you don’t have a file name already — for
1232 	 * example, if the user just created a new file and is saving it for the first
1233 	 * time, do not call this function.  Instead, use something similar to this:
1234 	 * |[<!-- language="C" -->
1235 	 * if (document_is_new)
1236 	 * {
1237 	 * // the user just created a new document
1238 	 * gtk_file_chooser_set_current_name (chooser, "Untitled document");
1239 	 * }
1240 	 * else
1241 	 * {
1242 	 * // the user edited an existing document
1243 	 * gtk_file_chooser_set_filename (chooser, existing_filename);
1244 	 * }
1245 	 * ]|
1246 	 *
1247 	 * In the first case, the file chooser will present the user with useful suggestions
1248 	 * as to where to save his new file.  In the second case, the file’s existing location
1249 	 * is already known, so the file chooser will use it.
1250 	 *
1251 	 * Params:
1252 	 *     filename = the filename to set as current
1253 	 *
1254 	 * Returns: Not useful.
1255 	 *
1256 	 * Since: 2.4
1257 	 */
1258 	public bool setFilename(string filename)
1259 	{
1260 		return gtk_file_chooser_set_filename(getFileChooserStruct(), Str.toStringz(filename)) != 0;
1261 	}
1262 
1263 	/**
1264 	 * Sets the current filter; only the files that pass the
1265 	 * filter will be displayed. If the user-selectable list of filters
1266 	 * is non-empty, then the filter should be one of the filters
1267 	 * in that list. Setting the current filter when the list of
1268 	 * filters is empty is useful if you want to restrict the displayed
1269 	 * set of files without letting the user change it.
1270 	 *
1271 	 * Params:
1272 	 *     filter = a #GtkFileFilter
1273 	 *
1274 	 * Since: 2.4
1275 	 */
1276 	public void setFilter(FileFilter filter)
1277 	{
1278 		gtk_file_chooser_set_filter(getFileChooserStruct(), (filter is null) ? null : filter.getFileFilterStruct());
1279 	}
1280 
1281 	/**
1282 	 * Sets whether only local files can be selected in the
1283 	 * file selector. If @local_only is %TRUE (the default),
1284 	 * then the selected file or files are guaranteed to be
1285 	 * accessible through the operating systems native file
1286 	 * system and therefore the application only
1287 	 * needs to worry about the filename functions in
1288 	 * #GtkFileChooser, like gtk_file_chooser_get_filename(),
1289 	 * rather than the URI functions like
1290 	 * gtk_file_chooser_get_uri(),
1291 	 *
1292 	 * On some systems non-native files may still be
1293 	 * available using the native filesystem via a userspace
1294 	 * filesystem (FUSE).
1295 	 *
1296 	 * Params:
1297 	 *     localOnly = %TRUE if only local files can be selected
1298 	 *
1299 	 * Since: 2.4
1300 	 */
1301 	public void setLocalOnly(bool localOnly)
1302 	{
1303 		gtk_file_chooser_set_local_only(getFileChooserStruct(), localOnly);
1304 	}
1305 
1306 	/**
1307 	 * Sets an application-supplied widget to use to display a custom preview
1308 	 * of the currently selected file. To implement a preview, after setting the
1309 	 * preview widget, you connect to the #GtkFileChooser::update-preview
1310 	 * signal, and call gtk_file_chooser_get_preview_filename() or
1311 	 * gtk_file_chooser_get_preview_uri() on each change. If you can
1312 	 * display a preview of the new file, update your widget and
1313 	 * set the preview active using gtk_file_chooser_set_preview_widget_active().
1314 	 * Otherwise, set the preview inactive.
1315 	 *
1316 	 * When there is no application-supplied preview widget, or the
1317 	 * application-supplied preview widget is not active, the file chooser
1318 	 * will display no preview at all.
1319 	 *
1320 	 * Params:
1321 	 *     previewWidget = widget for displaying preview.
1322 	 *
1323 	 * Since: 2.4
1324 	 */
1325 	public void setPreviewWidget(Widget previewWidget)
1326 	{
1327 		gtk_file_chooser_set_preview_widget(getFileChooserStruct(), (previewWidget is null) ? null : previewWidget.getWidgetStruct());
1328 	}
1329 
1330 	/**
1331 	 * Sets whether the preview widget set by
1332 	 * gtk_file_chooser_set_preview_widget() should be shown for the
1333 	 * current filename. When @active is set to false, the file chooser
1334 	 * may display an internally generated preview of the current file
1335 	 * or it may display no preview at all. See
1336 	 * gtk_file_chooser_set_preview_widget() for more details.
1337 	 *
1338 	 * Params:
1339 	 *     active = whether to display the user-specified preview widget
1340 	 *
1341 	 * Since: 2.4
1342 	 */
1343 	public void setPreviewWidgetActive(bool active)
1344 	{
1345 		gtk_file_chooser_set_preview_widget_active(getFileChooserStruct(), active);
1346 	}
1347 
1348 	/**
1349 	 * Sets whether multiple files can be selected in the file selector.  This is
1350 	 * only relevant if the action is set to be %GTK_FILE_CHOOSER_ACTION_OPEN or
1351 	 * %GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER.
1352 	 *
1353 	 * Params:
1354 	 *     selectMultiple = %TRUE if multiple files can be selected.
1355 	 *
1356 	 * Since: 2.4
1357 	 */
1358 	public void setSelectMultiple(bool selectMultiple)
1359 	{
1360 		gtk_file_chooser_set_select_multiple(getFileChooserStruct(), selectMultiple);
1361 	}
1362 
1363 	/**
1364 	 * Sets whether hidden files and folders are displayed in the file selector.
1365 	 *
1366 	 * Params:
1367 	 *     showHidden = %TRUE if hidden files and folders should be displayed.
1368 	 *
1369 	 * Since: 2.6
1370 	 */
1371 	public void setShowHidden(bool showHidden)
1372 	{
1373 		gtk_file_chooser_set_show_hidden(getFileChooserStruct(), showHidden);
1374 	}
1375 
1376 	/**
1377 	 * Sets the file referred to by @uri as the current file for the file chooser,
1378 	 * by changing to the URI’s parent folder and actually selecting the URI in the
1379 	 * list.  If the @chooser is %GTK_FILE_CHOOSER_ACTION_SAVE mode, the URI’s base
1380 	 * name will also appear in the dialog’s file name entry.
1381 	 *
1382 	 * Note that the URI must exist, or nothing will be done except for the
1383 	 * directory change.
1384 	 *
1385 	 * You should use this function only when implementing a save
1386 	 * dialog for which you already have a file name to which
1387 	 * the user may save.  For example, when the user opens an existing file and then
1388 	 * does Save As... to save a copy or a
1389 	 * modified version.  If you don’t have a file name already — for example,
1390 	 * if the user just created a new file and is saving it for the first time, do
1391 	 * not call this function.  Instead, use something similar to this:
1392 	 * |[<!-- language="C" -->
1393 	 * if (document_is_new)
1394 	 * {
1395 	 * // the user just created a new document
1396 	 * gtk_file_chooser_set_current_name (chooser, "Untitled document");
1397 	 * }
1398 	 * else
1399 	 * {
1400 	 * // the user edited an existing document
1401 	 * gtk_file_chooser_set_uri (chooser, existing_uri);
1402 	 * }
1403 	 * ]|
1404 	 *
1405 	 *
1406 	 * In the first case, the file chooser will present the user with useful suggestions
1407 	 * as to where to save his new file.  In the second case, the file’s existing location
1408 	 * is already known, so the file chooser will use it.
1409 	 *
1410 	 * Params:
1411 	 *     uri = the URI to set as current
1412 	 *
1413 	 * Returns: Not useful.
1414 	 *
1415 	 * Since: 2.4
1416 	 */
1417 	public bool setUri(string uri)
1418 	{
1419 		return gtk_file_chooser_set_uri(getFileChooserStruct(), Str.toStringz(uri)) != 0;
1420 	}
1421 
1422 	/**
1423 	 * Sets whether the file chooser should display a stock label with the name of
1424 	 * the file that is being previewed; the default is %TRUE.  Applications that
1425 	 * want to draw the whole preview area themselves should set this to %FALSE and
1426 	 * display the name themselves in their preview widget.
1427 	 *
1428 	 * See also: gtk_file_chooser_set_preview_widget()
1429 	 *
1430 	 * Params:
1431 	 *     useLabel = whether to display a stock label with the name of the previewed file
1432 	 *
1433 	 * Since: 2.4
1434 	 */
1435 	public void setUsePreviewLabel(bool useLabel)
1436 	{
1437 		gtk_file_chooser_set_use_preview_label(getFileChooserStruct(), useLabel);
1438 	}
1439 
1440 	/**
1441 	 * Unselects all the files in the current folder of a file chooser.
1442 	 *
1443 	 * Since: 2.4
1444 	 */
1445 	public void unselectAll()
1446 	{
1447 		gtk_file_chooser_unselect_all(getFileChooserStruct());
1448 	}
1449 
1450 	/**
1451 	 * Unselects the file referred to by @file. If the file is not in the current
1452 	 * directory, does not exist, or is otherwise not currently selected, does nothing.
1453 	 *
1454 	 * Params:
1455 	 *     file = a #GFile
1456 	 *
1457 	 * Since: 2.14
1458 	 */
1459 	public void unselectFile(FileIF file)
1460 	{
1461 		gtk_file_chooser_unselect_file(getFileChooserStruct(), (file is null) ? null : file.getFileStruct());
1462 	}
1463 
1464 	/**
1465 	 * Unselects a currently selected filename. If the filename
1466 	 * is not in the current directory, does not exist, or
1467 	 * is otherwise not currently selected, does nothing.
1468 	 *
1469 	 * Params:
1470 	 *     filename = the filename to unselect
1471 	 *
1472 	 * Since: 2.4
1473 	 */
1474 	public void unselectFilename(string filename)
1475 	{
1476 		gtk_file_chooser_unselect_filename(getFileChooserStruct(), Str.toStringz(filename));
1477 	}
1478 
1479 	/**
1480 	 * Unselects the file referred to by @uri. If the file
1481 	 * is not in the current directory, does not exist, or
1482 	 * is otherwise not currently selected, does nothing.
1483 	 *
1484 	 * Params:
1485 	 *     uri = the URI to unselect
1486 	 *
1487 	 * Since: 2.4
1488 	 */
1489 	public void unselectUri(string uri)
1490 	{
1491 		gtk_file_chooser_unselect_uri(getFileChooserStruct(), Str.toStringz(uri));
1492 	}
1493 
1494 	protected class OnConfirmOverwriteDelegateWrapper
1495 	{
1496 		GtkFileChooserConfirmation delegate(FileChooserIF) dlg;
1497 		gulong handlerId;
1498 
1499 		this(GtkFileChooserConfirmation delegate(FileChooserIF) dlg)
1500 		{
1501 			this.dlg = dlg;
1502 			onConfirmOverwriteListeners ~= this;
1503 		}
1504 
1505 		void remove(OnConfirmOverwriteDelegateWrapper source)
1506 		{
1507 			foreach(index, wrapper; onConfirmOverwriteListeners)
1508 			{
1509 				if (wrapper.handlerId == source.handlerId)
1510 				{
1511 					onConfirmOverwriteListeners[index] = null;
1512 					onConfirmOverwriteListeners = std.algorithm.remove(onConfirmOverwriteListeners, index);
1513 					break;
1514 				}
1515 			}
1516 		}
1517 	}
1518 	OnConfirmOverwriteDelegateWrapper[] onConfirmOverwriteListeners;
1519 
1520 	/**
1521 	 * This signal gets emitted whenever it is appropriate to present a
1522 	 * confirmation dialog when the user has selected a file name that
1523 	 * already exists.  The signal only gets emitted when the file
1524 	 * chooser is in %GTK_FILE_CHOOSER_ACTION_SAVE mode.
1525 	 *
1526 	 * Most applications just need to turn on the
1527 	 * #GtkFileChooser:do-overwrite-confirmation property (or call the
1528 	 * gtk_file_chooser_set_do_overwrite_confirmation() function), and
1529 	 * they will automatically get a stock confirmation dialog.
1530 	 * Applications which need to customize this behavior should do
1531 	 * that, and also connect to the #GtkFileChooser::confirm-overwrite
1532 	 * signal.
1533 	 *
1534 	 * A signal handler for this signal must return a
1535 	 * #GtkFileChooserConfirmation value, which indicates the action to
1536 	 * take.  If the handler determines that the user wants to select a
1537 	 * different filename, it should return
1538 	 * %GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN.  If it determines
1539 	 * that the user is satisfied with his choice of file name, it
1540 	 * should return %GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME.
1541 	 * On the other hand, if it determines that the stock confirmation
1542 	 * dialog should be used, it should return
1543 	 * %GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM. The following example
1544 	 * illustrates this.
1545 	 *
1546 	 * ## Custom confirmation ## {#gtkfilechooser-confirmation}
1547 	 *
1548 	 * |[<!-- language="C" -->
1549 	 * static GtkFileChooserConfirmation
1550 	 * confirm_overwrite_callback (GtkFileChooser *chooser, gpointer data)
1551 	 * {
1552 	 * char *uri;
1553 	 *
1554 	 * uri = gtk_file_chooser_get_uri (chooser);
1555 	 *
1556 	 * if (is_uri_read_only (uri))
1557 	 * {
1558 	 * if (user_wants_to_replace_read_only_file (uri))
1559 	 * return GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME;
1560 	 * else
1561 	 * return GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN;
1562 	 * } else
1563 	 * return GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM; // fall back to the default dialog
1564 	 * }
1565 	 *
1566 	 * ...
1567 	 *
1568 	 * chooser = gtk_file_chooser_dialog_new (...);
1569 	 *
1570 	 * gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE);
1571 	 * g_signal_connect (chooser, "confirm-overwrite",
1572 	 * G_CALLBACK (confirm_overwrite_callback), NULL);
1573 	 *
1574 	 * if (gtk_dialog_run (chooser) == GTK_RESPONSE_ACCEPT)
1575 	 * save_to_file (gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser));
1576 	 *
1577 	 * gtk_widget_destroy (chooser);
1578 	 * ]|
1579 	 *
1580 	 * Returns: a #GtkFileChooserConfirmation value that indicates which
1581 	 *     action to take after emitting the signal.
1582 	 *
1583 	 * Since: 2.8
1584 	 */
1585 	gulong addOnConfirmOverwrite(GtkFileChooserConfirmation delegate(FileChooserIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
1586 	{
1587 		auto wrapper = new OnConfirmOverwriteDelegateWrapper(dlg);
1588 		wrapper.handlerId = Signals.connectData(
1589 			this,
1590 			"confirm-overwrite",
1591 			cast(GCallback)&callBackConfirmOverwrite,
1592 			cast(void*)wrapper,
1593 			cast(GClosureNotify)&callBackConfirmOverwriteDestroy,
1594 			connectFlags);
1595 		return wrapper.handlerId;
1596 	}
1597 
1598 	extern(C) static GtkFileChooserConfirmation callBackConfirmOverwrite(GtkFileChooser* filechooserStruct, OnConfirmOverwriteDelegateWrapper wrapper)
1599 	{
1600 		return wrapper.dlg(wrapper.outer);
1601 	}
1602 
1603 	extern(C) static void callBackConfirmOverwriteDestroy(OnConfirmOverwriteDelegateWrapper wrapper, GClosure* closure)
1604 	{
1605 		wrapper.remove(wrapper);
1606 	}
1607 
1608 	protected class OnCurrentFolderChangedDelegateWrapper
1609 	{
1610 		void delegate(FileChooserIF) dlg;
1611 		gulong handlerId;
1612 
1613 		this(void delegate(FileChooserIF) dlg)
1614 		{
1615 			this.dlg = dlg;
1616 			onCurrentFolderChangedListeners ~= this;
1617 		}
1618 
1619 		void remove(OnCurrentFolderChangedDelegateWrapper source)
1620 		{
1621 			foreach(index, wrapper; onCurrentFolderChangedListeners)
1622 			{
1623 				if (wrapper.handlerId == source.handlerId)
1624 				{
1625 					onCurrentFolderChangedListeners[index] = null;
1626 					onCurrentFolderChangedListeners = std.algorithm.remove(onCurrentFolderChangedListeners, index);
1627 					break;
1628 				}
1629 			}
1630 		}
1631 	}
1632 	OnCurrentFolderChangedDelegateWrapper[] onCurrentFolderChangedListeners;
1633 
1634 	/**
1635 	 * This signal is emitted when the current folder in a #GtkFileChooser
1636 	 * changes.  This can happen due to the user performing some action that
1637 	 * changes folders, such as selecting a bookmark or visiting a folder on the
1638 	 * file list.  It can also happen as a result of calling a function to
1639 	 * explicitly change the current folder in a file chooser.
1640 	 *
1641 	 * Normally you do not need to connect to this signal, unless you need to keep
1642 	 * track of which folder a file chooser is showing.
1643 	 *
1644 	 * See also:  gtk_file_chooser_set_current_folder(),
1645 	 * gtk_file_chooser_get_current_folder(),
1646 	 * gtk_file_chooser_set_current_folder_uri(),
1647 	 * gtk_file_chooser_get_current_folder_uri().
1648 	 */
1649 	gulong addOnCurrentFolderChanged(void delegate(FileChooserIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
1650 	{
1651 		auto wrapper = new OnCurrentFolderChangedDelegateWrapper(dlg);
1652 		wrapper.handlerId = Signals.connectData(
1653 			this,
1654 			"current-folder-changed",
1655 			cast(GCallback)&callBackCurrentFolderChanged,
1656 			cast(void*)wrapper,
1657 			cast(GClosureNotify)&callBackCurrentFolderChangedDestroy,
1658 			connectFlags);
1659 		return wrapper.handlerId;
1660 	}
1661 
1662 	extern(C) static void callBackCurrentFolderChanged(GtkFileChooser* filechooserStruct, OnCurrentFolderChangedDelegateWrapper wrapper)
1663 	{
1664 		wrapper.dlg(wrapper.outer);
1665 	}
1666 
1667 	extern(C) static void callBackCurrentFolderChangedDestroy(OnCurrentFolderChangedDelegateWrapper wrapper, GClosure* closure)
1668 	{
1669 		wrapper.remove(wrapper);
1670 	}
1671 
1672 	protected class OnFileActivatedDelegateWrapper
1673 	{
1674 		void delegate(FileChooserIF) dlg;
1675 		gulong handlerId;
1676 
1677 		this(void delegate(FileChooserIF) dlg)
1678 		{
1679 			this.dlg = dlg;
1680 			onFileActivatedListeners ~= this;
1681 		}
1682 
1683 		void remove(OnFileActivatedDelegateWrapper source)
1684 		{
1685 			foreach(index, wrapper; onFileActivatedListeners)
1686 			{
1687 				if (wrapper.handlerId == source.handlerId)
1688 				{
1689 					onFileActivatedListeners[index] = null;
1690 					onFileActivatedListeners = std.algorithm.remove(onFileActivatedListeners, index);
1691 					break;
1692 				}
1693 			}
1694 		}
1695 	}
1696 	OnFileActivatedDelegateWrapper[] onFileActivatedListeners;
1697 
1698 	/**
1699 	 * This signal is emitted when the user "activates" a file in the file
1700 	 * chooser.  This can happen by double-clicking on a file in the file list, or
1701 	 * by pressing `Enter`.
1702 	 *
1703 	 * Normally you do not need to connect to this signal.  It is used internally
1704 	 * by #GtkFileChooserDialog to know when to activate the default button in the
1705 	 * dialog.
1706 	 *
1707 	 * See also: gtk_file_chooser_get_filename(),
1708 	 * gtk_file_chooser_get_filenames(), gtk_file_chooser_get_uri(),
1709 	 * gtk_file_chooser_get_uris().
1710 	 */
1711 	gulong addOnFileActivated(void delegate(FileChooserIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
1712 	{
1713 		auto wrapper = new OnFileActivatedDelegateWrapper(dlg);
1714 		wrapper.handlerId = Signals.connectData(
1715 			this,
1716 			"file-activated",
1717 			cast(GCallback)&callBackFileActivated,
1718 			cast(void*)wrapper,
1719 			cast(GClosureNotify)&callBackFileActivatedDestroy,
1720 			connectFlags);
1721 		return wrapper.handlerId;
1722 	}
1723 
1724 	extern(C) static void callBackFileActivated(GtkFileChooser* filechooserStruct, OnFileActivatedDelegateWrapper wrapper)
1725 	{
1726 		wrapper.dlg(wrapper.outer);
1727 	}
1728 
1729 	extern(C) static void callBackFileActivatedDestroy(OnFileActivatedDelegateWrapper wrapper, GClosure* closure)
1730 	{
1731 		wrapper.remove(wrapper);
1732 	}
1733 
1734 	protected class OnSelectionChangedDelegateWrapper
1735 	{
1736 		void delegate(FileChooserIF) dlg;
1737 		gulong handlerId;
1738 
1739 		this(void delegate(FileChooserIF) dlg)
1740 		{
1741 			this.dlg = dlg;
1742 			onSelectionChangedListeners ~= this;
1743 		}
1744 
1745 		void remove(OnSelectionChangedDelegateWrapper source)
1746 		{
1747 			foreach(index, wrapper; onSelectionChangedListeners)
1748 			{
1749 				if (wrapper.handlerId == source.handlerId)
1750 				{
1751 					onSelectionChangedListeners[index] = null;
1752 					onSelectionChangedListeners = std.algorithm.remove(onSelectionChangedListeners, index);
1753 					break;
1754 				}
1755 			}
1756 		}
1757 	}
1758 	OnSelectionChangedDelegateWrapper[] onSelectionChangedListeners;
1759 
1760 	/**
1761 	 * This signal is emitted when there is a change in the set of selected files
1762 	 * in a #GtkFileChooser.  This can happen when the user modifies the selection
1763 	 * with the mouse or the keyboard, or when explicitly calling functions to
1764 	 * change the selection.
1765 	 *
1766 	 * Normally you do not need to connect to this signal, as it is easier to wait
1767 	 * for the file chooser to finish running, and then to get the list of
1768 	 * selected files using the functions mentioned below.
1769 	 *
1770 	 * See also: gtk_file_chooser_select_filename(),
1771 	 * gtk_file_chooser_unselect_filename(), gtk_file_chooser_get_filename(),
1772 	 * gtk_file_chooser_get_filenames(), gtk_file_chooser_select_uri(),
1773 	 * gtk_file_chooser_unselect_uri(), gtk_file_chooser_get_uri(),
1774 	 * gtk_file_chooser_get_uris().
1775 	 */
1776 	gulong addOnSelectionChanged(void delegate(FileChooserIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
1777 	{
1778 		auto wrapper = new OnSelectionChangedDelegateWrapper(dlg);
1779 		wrapper.handlerId = Signals.connectData(
1780 			this,
1781 			"selection-changed",
1782 			cast(GCallback)&callBackSelectionChanged,
1783 			cast(void*)wrapper,
1784 			cast(GClosureNotify)&callBackSelectionChangedDestroy,
1785 			connectFlags);
1786 		return wrapper.handlerId;
1787 	}
1788 
1789 	extern(C) static void callBackSelectionChanged(GtkFileChooser* filechooserStruct, OnSelectionChangedDelegateWrapper wrapper)
1790 	{
1791 		wrapper.dlg(wrapper.outer);
1792 	}
1793 
1794 	extern(C) static void callBackSelectionChangedDestroy(OnSelectionChangedDelegateWrapper wrapper, GClosure* closure)
1795 	{
1796 		wrapper.remove(wrapper);
1797 	}
1798 
1799 	protected class OnUpdatePreviewDelegateWrapper
1800 	{
1801 		void delegate(FileChooserIF) dlg;
1802 		gulong handlerId;
1803 
1804 		this(void delegate(FileChooserIF) dlg)
1805 		{
1806 			this.dlg = dlg;
1807 			onUpdatePreviewListeners ~= this;
1808 		}
1809 
1810 		void remove(OnUpdatePreviewDelegateWrapper source)
1811 		{
1812 			foreach(index, wrapper; onUpdatePreviewListeners)
1813 			{
1814 				if (wrapper.handlerId == source.handlerId)
1815 				{
1816 					onUpdatePreviewListeners[index] = null;
1817 					onUpdatePreviewListeners = std.algorithm.remove(onUpdatePreviewListeners, index);
1818 					break;
1819 				}
1820 			}
1821 		}
1822 	}
1823 	OnUpdatePreviewDelegateWrapper[] onUpdatePreviewListeners;
1824 
1825 	/**
1826 	 * This signal is emitted when the preview in a file chooser should be
1827 	 * regenerated.  For example, this can happen when the currently selected file
1828 	 * changes.  You should use this signal if you want your file chooser to have
1829 	 * a preview widget.
1830 	 *
1831 	 * Once you have installed a preview widget with
1832 	 * gtk_file_chooser_set_preview_widget(), you should update it when this
1833 	 * signal is emitted.  You can use the functions
1834 	 * gtk_file_chooser_get_preview_filename() or
1835 	 * gtk_file_chooser_get_preview_uri() to get the name of the file to preview.
1836 	 * Your widget may not be able to preview all kinds of files; your callback
1837 	 * must call gtk_file_chooser_set_preview_widget_active() to inform the file
1838 	 * chooser about whether the preview was generated successfully or not.
1839 	 *
1840 	 * Please see the example code in
1841 	 * [Using a Preview Widget][gtkfilechooser-preview].
1842 	 *
1843 	 * See also: gtk_file_chooser_set_preview_widget(),
1844 	 * gtk_file_chooser_set_preview_widget_active(),
1845 	 * gtk_file_chooser_set_use_preview_label(),
1846 	 * gtk_file_chooser_get_preview_filename(),
1847 	 * gtk_file_chooser_get_preview_uri().
1848 	 */
1849 	gulong addOnUpdatePreview(void delegate(FileChooserIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
1850 	{
1851 		auto wrapper = new OnUpdatePreviewDelegateWrapper(dlg);
1852 		wrapper.handlerId = Signals.connectData(
1853 			this,
1854 			"update-preview",
1855 			cast(GCallback)&callBackUpdatePreview,
1856 			cast(void*)wrapper,
1857 			cast(GClosureNotify)&callBackUpdatePreviewDestroy,
1858 			connectFlags);
1859 		return wrapper.handlerId;
1860 	}
1861 
1862 	extern(C) static void callBackUpdatePreview(GtkFileChooser* filechooserStruct, OnUpdatePreviewDelegateWrapper wrapper)
1863 	{
1864 		wrapper.dlg(wrapper.outer);
1865 	}
1866 
1867 	extern(C) static void callBackUpdatePreviewDestroy(OnUpdatePreviewDelegateWrapper wrapper, GClosure* closure)
1868 	{
1869 		wrapper.remove(wrapper);
1870 	}
1871 }