### ----------------------------------------------------
### -- Gnome::Gtk3
### -- Licenses: Artistic-2.0
### -- Authors: Marcel Timmerman
### -- File: lib/Gnome/Gtk3/FileChooser.rakumod
### ----------------------------------------------------
### -- Chunk 2 of 4
is

Queries the list of shortcut folders in the file chooser, as set by C<add_shortcut_folder_uri()>.

Returns:  (element-type utf8) : A list of folder URIs, or C<undefined> if there are no shortcut folders. Free the returned list with C<g_slist_free()>, and the URIs with C<g_free()>.

  method list-shortcut-folder-uris ( --> N-GSList )

=end pod

method list-shortcut-folder-uris ( --> N-GSList ) {
  gtk_file_chooser_list_shortcut_folder_uris( self._f('GtkFileChooser'))
}

sub gtk_file_chooser_list_shortcut_folder_uris (
  N-GObject $chooser --> N-GSList
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:list-shortcut-folders:
=begin pod
=head2 list-shortcut-folders

Queries the list of shortcut folders in the file chooser, as set by C<add_shortcut_folder()>.

Returns:  (element-type filename) : A list of folder filenames, or C<undefined> if there are no shortcut folders. Free the returned list with C<g_slist_free()>, and the filenames with C<g_free()>.

  method list-shortcut-folders ( --> N-GSList )

=end pod

method list-shortcut-folders ( --> N-GSList ) {
  gtk_file_chooser_list_shortcut_folders( self._f('GtkFileChooser'))
}

sub gtk_file_chooser_list_shortcut_folders (
  N-GObject $chooser --> N-GSList
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:remove-choice:
=begin pod
=head2 remove-choice

Removes a 'choice' that has been added with C<add_choice()>.

  method remove-choice ( Str $id )

=item $id; the ID of the choice to remove
=end pod

method remove-choice ( Str $id ) {
  gtk_file_chooser_remove_choice( self._f('GtkFileChooser'), $id);
}

sub gtk_file_chooser_remove_choice (
  N-GObject $chooser, gchar-ptr $id
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:remove-filter:
=begin pod
=head2 remove-filter

Removes I<filter> from the list of filters that the user can select between.

  method remove-filter ( N-GObject() $filter )

=item $filter; a B<Gnome::Gtk3::FileFilter>
=end pod

method remove-filter ( N-GObject() $filter ) {
  gtk_file_chooser_remove_filter( self._f('GtkFileChooser'), $filter);
}

sub gtk_file_chooser_remove_filter (
  N-GObject $chooser, N-GObject $filter
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:remove-shortcut-folder:
=begin pod
=head2 remove-shortcut-folder

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

Returns: C<True> if the operation succeeds, C<False> otherwise. In the latter case, the I<error> will be set as appropriate.

See also: C<add_shortcut_folder()>

  method remove-shortcut-folder ( Str $folder, N-GError $error --> Bool )

=item $folder; (type filename): filename of the folder to remove
=item $error; location to store error, or C<undefined>
=end pod

method remove-shortcut-folder ( Str $folder, $error is copy --> Bool ) {
  $error .= _get-native-object-no-reffing unless $error ~~ N-GError;
  gtk_file_chooser_remove_shortcut_folder( self._f('GtkFileChooser'), $folder, $error).Bool
}

sub gtk_file_chooser_remove_shortcut_folder (
  N-GObject $chooser, gchar-ptr $folder, N-GError $error --> gboolean
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:remove-shortcut-folder-uri:
=begin pod
=head2 remove-shortcut-folder-uri

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

Returns: C<True> if the operation succeeds, C<False> otherwise. In the latter case, the I<error> will be set as appropriate.

See also: C<add_shortcut_folder_uri()>

  method remove-shortcut-folder-uri ( Str $uri, N-GError $error --> Bool )

=item $uri; URI of the folder to remove
=item $error; location to store error, or C<undefined>
=end pod

method remove-shortcut-folder-uri ( Str $uri, $error is copy --> Bool ) {
  $error .= _get-native-object-no-reffing unless $error ~~ N-GError;
  gtk_file_chooser_remove_shortcut_folder_uri( self._f('GtkFileChooser'), $uri, $error).Bool
}

sub gtk_file_chooser_remove_shortcut_folder_uri (
  N-GObject $chooser, gchar-ptr $uri, N-GError $error --> gboolean
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:select-all:
=begin pod
=head2 select-all

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

  method select-all ( )

=end pod

method select-all ( ) {
  gtk_file_chooser_select_all( self._f('GtkFileChooser'));
}

sub gtk_file_chooser_select_all (
  N-GObject $chooser
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:select-file:
=begin pod
=head2 select-file

Selects the file referred to by I<file>. An internal function. See C<_select_uri()>.

Returns: Not useful.

  method select-file ( N-GObject() $file, N-GError $error --> Bool )

=item $file; the file to select
=item $error; location to store error, or C<undefined>
=end pod

method select-file ( N-GObject() $file, $error is copy --> Bool ) {
  $error .= _get-native-object-no-reffing unless $error ~~ N-GError;
  gtk_file_chooser_select_file( self._f('GtkFileChooser'), $file, $error).Bool
}

sub gtk_file_chooser_select_file (
  N-GObject $chooser, N-GObject $file, N-GError $error --> gboolean
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:select-filename:
=begin pod
=head2 select-filename

Selects a filename. If the file name isn’t in the current folder of I<chooser>, then the current folder of I<chooser> will be changed to the folder containing I<filename>.

Returns: Not useful.

See also: C<set_filename()>

  method select-filename ( Str $filename --> Bool )

=item $filename; (type filename): the filename to select
=end pod

method select-filename ( Str $filename --> Bool ) {
  gtk_file_chooser_select_filename( self._f('GtkFileChooser'), $filename).Bool
}

sub gtk_file_chooser_select_filename (
  N-GObject $chooser, gchar-ptr $filename --> gboolean
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:select-uri:
=begin pod
=head2 select-uri

Selects the file to by I<uri>. If the URI doesn’t refer to a file in the current folder of I<chooser>, then the current folder of I<chooser> will be changed to the folder containing I<filename>.

Returns: Not useful.

  method select-uri ( Str $uri --> Bool )

=item $uri; the URI to select
=end pod

method select-uri ( Str $uri --> Bool ) {
  gtk_file_chooser_select_uri( self._f('GtkFileChooser'), $uri).Bool
}

sub gtk_file_chooser_select_uri (
  N-GObject $chooser, gchar-ptr $uri --> gboolean
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-action:
=begin pod
=head2 set-action

Sets the type of operation that the chooser is performing; the user interface is adapted to suit the selected action. For example, an option to create a new folder might be shown if the action is C<GTK_FILE_CHOOSER_ACTION_SAVE> but not if the action is C<GTK_FILE_CHOOSER_ACTION_OPEN>.

  method set-action ( GtkFileChooserAction $action )

=item $action; the action that the file selector is performing
=end pod

method set-action ( GtkFileChooserAction $action ) {
  gtk_file_chooser_set_action( self._f('GtkFileChooser'), $action);
}

sub gtk_file_chooser_set_action (
  N-GObject $chooser, GEnum $action
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-choice:
=begin pod
=head2 set-choice

Selects an option in a 'choice' that has been added with C<add_choice()>. For a boolean choice, the possible options are "true" and "false".

  method set-choice ( Str $id, Str $option )

=item $id; the ID of the choice to set
=item $option; the ID of the option to select
=end pod

method set-choice ( Str $id, Str $option ) {
  gtk_file_chooser_set_choice( self._f('GtkFileChooser'), $id, $option);
}

sub gtk_file_chooser_set_choice (
  N-GObject $chooser, gchar-ptr $id, gchar-ptr $option
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-create-folders:
=begin pod
=head2 set-create-folders

Sets whether file choser will offer to create new folders. This is only relevant if the action is not set to be C<GTK_FILE_CHOOSER_ACTION_OPEN>.

  method set-create-folders ( Bool $create_folders )

=item $create_folders; C<True> if the Create Folder button should be displayed
=end pod

method set-create-folders ( Bool $create_folders ) {
  gtk_file_chooser_set_create_folders( self._f('GtkFileChooser'), $create_folders);
}

sub gtk_file_chooser_set_create_folders (
  N-GObject $chooser, gboolean $create_folders
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-current-folder:
=begin pod
=head2 set-current-folder

Sets the current folder for I<chooser> from a local filename. The user will be shown the full contents of the current folder, plus user interface elements for navigating to other folders.

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

Returns: Not useful.

  method set-current-folder ( Str $filename --> Bool )

=item $filename; (type filename): the full path of the new current folder
=end pod

method set-current-folder ( Str $filename --> Bool ) {
  gtk_file_chooser_set_current_folder( self._f('GtkFileChooser'), $filename).Bool
}

sub gtk_file_chooser_set_current_folder (
  N-GObject $chooser, gchar-ptr $filename --> gboolean
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-current-folder-file:
=begin pod
=head2 set-current-folder-file

Sets the current folder for I<chooser> from a B<Gnome::Gio::File>. Internal function, see C<set_current_folder_uri()>.

Returns: C<True> if the folder could be changed successfully, C<False> otherwise.

  method set-current-folder-file ( N-GObject() $file, N-GError $error --> Bool )

=item $file; the B<Gnome::Gio::File> for the new folder
=item $error; location to store error, or C<undefined>.
=end pod

method set-current-folder-file ( N-GObject() $file, $error is copy --> Bool ) {
  $error .= _get-native-object-no-reffing unless $error ~~ N-GError;
  gtk_file_chooser_set_current_folder_file( self._f('GtkFileChooser'), $file, $error).Bool
}

sub gtk_file_chooser_set_current_folder_file (
  N-GObject $chooser, N-GObject $file, N-GError $error --> gboolean
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-current-folder-uri:
=begin pod
=head2 set-current-folder-uri

Sets the current folder for I<chooser> from an URI. The user will be shown the full contents of the current folder, plus user interface elements for navigating to other folders.

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

Returns: C<True> if the folder could be changed successfully, C<False> otherwise.

  method set-current-folder-uri ( Str $uri --> Bool )

=item $uri; the URI for the new current folder
=end pod

method set-current-folder-uri ( Str $uri --> Bool ) {
  gtk_file_chooser_set_current_folder_uri( self._f('GtkFileChooser'), $uri).Bool
}

sub gtk_file_chooser_set_current_folder_uri (
  N-GObject $chooser, gchar-ptr $uri --> gboolean
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-current-name:
=begin pod
=head2 set-current-name

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

If you want to preselect a particular existing file, you should use C<set_filename()> or C<set_uri()> instead. Please see the documentation for those functions for an example of using C<set_current_name()> as well.

  method set-current-name ( Str $name )

=item $name; (type utf8): the filename to use, as a UTF-8 string
=end pod

method set-current-name ( Str $name ) {
  gtk_file_chooser_set_current_name( self._f('GtkFileChooser'), $name);
}

sub gtk_file_chooser_set_current_name (
  N-GObject $chooser, gchar-ptr $name
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-do-overwrite-confirmation:
=begin pod
=head2 set-do-overwrite-confirmation

Sets whether a file chooser in C<GTK_FILE_CHOOSER_ACTION_SAVE> mode will present a confirmation dialog if the user types a file name that already exists. This is C<False> by default.

If set to C<True>, the I<chooser> will emit the I<confirm-overwrite> signal when appropriate.

If all you need is the stock confirmation dialog, set this property to C<True>. You can override the way confirmation is done by actually handling the I<confirm-overwrite> signal; please refer to its documentation for the details.

  method set-do-overwrite-confirmation ( Bool $do_overwrite_confirmation )

=item $do_overwrite_confirmation; whether to confirm overwriting in save mode
=end pod

method set-do-overwrite-confirmation ( Bool $do_overwrite_confirmation ) {
  gtk_file_chooser_set_do_overwrite_confirmation( self._f('GtkFileChooser'), $do_overwrite_confirmation);
}

sub gtk_file_chooser_set_do_overwrite_confirmation (
  N-GObject $chooser, gboolean $do_overwrite_confirmation
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-extra-widget:
=begin pod
=head2 set-extra-widget

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

  method set-extra-widget ( N-GObject() $extra_widget )

=item $extra_widget; widget for extra options
=end pod

method set-extra-widget ( N-GObject() $extra_widget ) {
  gtk_file_chooser_set_extra_widget( self._f('GtkFileChooser'), $extra_widget);
}

sub gtk_file_chooser_set_extra_widget (
  N-GObject $chooser, N-GObject $extra_widget
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-file:
=begin pod
=head2 set-file

Sets I<file> as the current filename for the file chooser, by changing to the file’s parent folder and actually selecting the file in list. If the I<chooser> is in C<GTK_FILE_CHOOSER_ACTION_SAVE> mode, the file’s base name will also appear in the dialog’s file name entry.

If the file name isn’t in the current folder of I<chooser>, then the current folder of I<chooser> will be changed to the folder containing I<filename>. This is equivalent to a sequence of C<unselect_all()> followed by C<select_filename()>.

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

If you are implementing a save dialog, you should use this function if you already have a file name to which the user may save; for example, when the user opens an existing file and then does Save As...

=begin comment
If you don’t have a file name already for example, if the user just created a new file and is saving it for the first time, do not call this function. Instead, use something similar to this:
|[<!-- language="C" -->
if (document_is_new) {
  // the user just created a new document
  set_current_folder_file (chooser, default_file_for_saving);
  set_current_name (chooser, "Untitled document");
}
else {
  // the user edited an existing document
  set_file (chooser, existing_file);
}
]|
=end comment

Returns: An error object. It is valid when the call fails.

  method set-file ( N-GObject() $file --> N-GError )

=item $file; the B<Gnome::Gio::File> to set as the current file.
=end pod

method set-file ( N-GObject() $file --> N-GError ) {
  my $error = CArray[N-GError].new(N-GError.new);
  gtk_file_chooser_set_file(
    self._f('GtkFileChooser'), $file, $error
  ).Bool;

  $error[0];
}

sub gtk_file_chooser_set_file (
  N-GObject $chooser, N-GObject $file, CArray[N-GError] $error --> gboolean
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-filename:
=begin pod
=head2 set-filename

Sets I<filename> as the current filename for the file chooser, by changing to the file’s parent folder and actually selecting the file in list; all other files will be unselected. If the I<chooser> is in C<GTK_FILE_CHOOSER_ACTION_SAVE> mode, the file’s base name will also appear in the dialog’s file name entry.

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

You should use this function only when implementing a save dialog for which you already have a file name to which the user may save. For example, when the user opens an existing file and then does Save As... to save a copy or a modified version. If you don’t have a file name already — for example, if the user just created a new file and is saving it for the first time, do not call this function. Instead, use something similar to this: |[<!-- language="C" --> if (document_is_new) { // the user just created a new document set_current_name (chooser, "Untitled document"); } else { // the user edited an existing document set_filename (chooser, existing_filename); } ]|

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

Returns: Not useful.

  method set-filename ( Str $filename --> Bool )

=item $filename; (type filename): the filename to set as current
=end pod

method set-filename ( Str $filename --> Bool ) {
  gtk_file_chooser_set_filename( self._f('GtkFileChooser'), $filename).Bool
}

sub gtk_file_chooser_set_filename (
  N-GObject $chooser, gchar-ptr $filename --> gboolean
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-filter:
=begin pod
=head2 set-filter

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

  method set-filter ( N-GObject() $filter )

=item $filter; a B<Gnome::Gtk3::FileFilter>
=end pod

method set-filter ( N-GObject() $filter ) {
  gtk_file_chooser_set_filter( self._f('GtkFileChooser'), $filter);
}

sub gtk_file_chooser_set_filter (
  N-GObject $chooser, N-GObject $filter
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-local-only:
=begin pod
=head2 set-local-only

Sets whether only local files can be selected in the file selector. If I<local_only> is C<True> (the default), then the selected file or files are guaranteed to be accessible through the operating systems native file system and therefore the application only needs to worry about the filename functions in B<Gnome::Gtk3::FileChooser>, like C<get_filename()>, rather than the URI functions like C<get_uri()>,

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

  method set-local-only ( Bool $local_only )

=item $local_only; C<True> if only local files can be selected
=end pod

method set-local-only ( Bool $local_only ) {
  gtk_file_chooser_set_local_only( self._f('GtkFileChooser'), $local_only);
}

sub gtk_file_chooser_set_local_only (
  N-GObject $chooser, gboolean $local_only
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-preview-widget:
=begin pod
=head2 set-preview-widget

Sets an application-supplied widget to use to display a custom preview of the currently selected file. To implement a preview, after setting the preview widget, you connect to the I<update-preview> signal, and call C<get_preview_filename()> or C<get_preview_uri()> on each change. If you can display a preview of the new file, update your widget and set the preview active using C<set_preview_widget_active()>. Otherwise, set the preview inactive.

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

  method set-preview-widget ( N-GObject() $preview_widget )

=item $preview_widget; widget for displaying preview.
=end pod

method set-preview-widget ( N-GObject() $preview_widget ) {
  gtk_file_chooser_set_preview_widget( self._f('GtkFileChooser'), $preview_widget);
}

sub gtk_file_chooser_set_preview_widget (
  N-GObject $chooser, N-GObject $preview_widget
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-preview-widget-active:
=begin pod
=head2 set-preview-widget-active

Sets whether the preview widget set by C<set_preview_widget()> should be shown for the current filename. When I<active> is set to false, the file chooser may display an internally generated preview of the current file or it may display no preview at all. See C<set_preview_widget()> for more details.

  method set-preview-widget-active ( Bool $active )

=item $active; whether to display the user-specified preview widget
=end pod

method set-preview-widget-active ( Bool $active ) {
  gtk_file_chooser_set_preview_widget_active( self._f('GtkFileChooser'), $active);
}

sub gtk_file_chooser_set_preview_widget_active (
  N-GObject $chooser, gboolean $active
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-select-multiple:
=begin pod
=head2 set-select-multiple

Sets whether multiple files can be selected in the file selector. This is only relevant if the action is set to be C<GTK_FILE_CHOOSER_ACTION_OPEN> or C<GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER>.

  method set-select-multiple ( Bool $select_multiple )

=item $select_multiple; C<True> if multiple files can be selected.
=end pod

method set-select-multiple ( Bool $select_multiple ) {
  gtk_file_chooser_set_select_multiple( self._f('GtkFileChooser'), $select_multiple);
}

sub gtk_file_chooser_set_select_multiple (
  N-GObject $chooser, gboolean $select_multiple
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-show-hidden:
=begin pod
=head2 set-show-hidden

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

  method set-show-hidden ( Bool $show_hidden )

=item $show_hidden; C<True> if hidden files and folders should be displayed.
=end pod

method set-show-hidden ( Bool $show_hidden ) {
  gtk_file_chooser_set_show_hidden( self._f('GtkFileChooser'), $show_hidden);
}

sub gtk_file_chooser_set_show_hidden (
  N-GObject $chooser, gboolean $show_hidden
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-uri:
=begin pod
=head2 set-uri

Sets the file referred to by I<uri> as the current file for the file chooser, by changing to the URI’s parent folder and actually selecting the URI in the list. If the I<chooser> is C<GTK_FILE_CHOOSER_ACTION_SAVE> mode, the URI’s base name will also appear in the dialog’s file name entry.

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

You should use this function only when implementing a save dialog for which you already have a file name to which the user may save. For example, when the user opens an existing file and then does Save As... to save a copy or a modified version. If you don’t have a file name already — for example, if the user just created a new file and is saving it for the first time, do not call this function. Instead, use something similar to this: |[<!-- language="C" --> if (document_is_new) { // the user just created a new document set_current_name (chooser, "Untitled document"); } else { // the user edited an existing document set_uri (chooser, existing_uri); } ]|

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

Returns: Not useful.

  method set-uri ( Str $uri --> Bool )

=item $uri; the URI to set as current
=end pod

method set-uri ( Str $uri --> Bool ) {
  gtk_file_chooser_set_uri( self._f('GtkFileChooser'), $uri).Bool
}

sub gtk_file_chooser_set_uri (
  N-GObject $chooser, gchar-ptr $uri --> gboolean
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-use-preview-label:
=begin pod
=head2 set-use-preview-label

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

See also: C<set_preview_widget()>

  method set-use-preview-label ( Bool $use_label )

=item $use_label; whether to display a stock label with the name of the previewed file
=end pod

method set-use-preview-label ( Bool $use_label ) {
  gtk_file_chooser_set_use_preview_label( self._f('GtkFileChooser'), $use_label);
}

sub gtk_file_chooser_set_use_preview_label (
  N-GObject $chooser, gboolean $use_label
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:unselect-all:
=begin pod
=head2 unselect-all

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

  method unselect-all ( )

=end pod

method unselect-all ( ) {
  gtk_file_chooser_unselect_all( self._f('GtkFileChooser'));
}

sub gtk_file_chooser_unselect_all (
  N-GObject $chooser
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:unselect-file:
=begin pod
=head2 unselect-file

Unselects the file referred to by I<file>. If the file is not in the current directory, does not exist, or is otherwise not currently selected, does nothing.

  method unselect-file ( N-GObject() $file )

=item $file; a B<Gnome::Gio::File>
=end pod

method unselect-file ( N-GObject() $file ) {
  gtk_file_chooser_unselect_file( self._f('GtkFileChooser'), $file);
}

sub gtk_file_chooser_unselect_file (
  N-GObject $chooser, N-GObject $file
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:unselect-filename:
=begin pod
=head2 unselect-filename

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

  method unselect-filename ( Str $filename )

=item $filename; (type filename): the filename to unselect
=end pod

method unselect-filename ( Str $filename ) {
  gtk_file_chooser_unselect_filename( self._f('GtkFileChooser'), $filename);
}

sub gtk_file_chooser_unselect_filename (
  N-GObject $chooser, gchar-ptr $filename
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:unselect-uri:
=begin pod
=head2 unselect-uri

Unselects the file referred to by I<uri>. If the file is not in the current directory, does not exist, or is otherwise not currently selected, does nothing.

  method unselect-uri ( Str $uri )

=item $uri; the URI to unselect
=end pod

method unselect-uri ( Str $uri ) {
  gtk_file_chooser_unselect_uri( self._f('GtkFileChooser'), $uri);
}

sub gtk_file_chooser_unselect_uri (
  N-GObject $chooser, gchar-ptr $uri
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
=begin pod
=head1 Signals


=comment -----------------------------------------------------------------------
=comment #TS:0:confirm-overwrite:
=head2 confirm-overwrite

This signal gets emitted whenever it is appropriate to present a
confirmation dialog when the user has selected a file name that
already exists.  The signal only gets emitted when the file
chooser is in C<GTK_FILE_CHOOSER_ACTION_SAVE> mode.

Most applications just need to turn on the
I<do-overwrite-confirmation> property (or call the
C<set_do_overwrite_confirmation()> function), and
they will automatically get a stock confirmation dialog.
Applications which need to customize this behavior should do
that, and also connect to the I<confirm-overwrite>
signal.

A signal handler for this signal must return a
B<Gnome::Gtk3::FileChooserConfirmation> value, which indicates the action to
take.  If the handler determines that the user wants to select a
different filename, it should return
C<GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN>.  If it determines
that the user is satisfied with his choice of file name, it
should return C<GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME>.
On the other hand, if it determines that the stock confirmation
dialog should be used, it should return
C<GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM>. The following example
illustrates this.

## Custom confirmation ## {B<gtkfilechooser>-confirmation}

|[<!-- language="C" -->
static GtkFileChooserConfirmation
confirm_overwrite_callback (GtkFileChooser *chooser, gpointer data)
{
char *uri;

uri = get_uri (chooser);

if (is_uri_read_only (uri))
{
if (user_wants_to_replace_read_only_file (uri))
return GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME;
else
return GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN;
} else
return GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM; // fall back to the default dialog
}

...

chooser = dialog_new (...);

set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE);
g_signal_connect (chooser, "confirm-overwrite",
G_CALLBACK (confirm_overwrite_callback), NULL);

if (gtk_dialog_run (chooser) == GTK_RESPONSE_ACCEPT)
save_to_file (get_filename (GTK_FILE_CHOOSER (chooser));

gtk_widget_destroy (chooser);
]|

Returns: a B<Gnome::Gtk3::FileChooserConfirmation> value that indicates which
action to take after emitting the signal.

  method handler (
    Int :$_handler-id,
    N-GObject :$_native-object,
    *%user-options

    --> Unknown type: GTK_TYPE_FILE_CHOOSER_CONFIRMATION
  )

=item $_handler-id; The handler id which is returned from the registration
=item $_native-object; The native object provided by the caller wrapped in the Raku object which registered the signal.
=item %user-options; A list of named arguments provided at the C<register-signal()> method

=comment -----------------------------------------------------------------------
=comment #TS:0:current-folder-changed:
=head2 current-folder-changed

This signal is emitted when the current folder in a B<Gnome::Gtk3::FileChooser>
changes.  This can happen due to the user performing some action that
changes folders, such as selecting a bookmark or visiting a folder on the
file list.  It can also happen as a result of calling a function to
explicitly change the current folder in a file chooser.

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

See also:  C<set_current_folder()>,
C<get_current_folder()>,
C<set_current_folder_uri()>,
C<get_current_folder_uri()>.

  method handler (
    Int :$_handler-id,
    N-GObject :$_native-object,
    *%user-options
  )

=item $_handler-id; The handler id which is returned from the registration
=item $_native-object; The native object provided by the caller wrapped in the Raku object which registered the signal.
=item %user-options; A list of named arguments provided at the C<register-signal()> method

=comment -----------------------------------------------------------------------
=comment #TS:0:file-activated:
=head2 file-activated

This signal is emitted when the user "activates" a file in the file
chooser.  This can happen by double-clicking on a file in the file list, or
by pressing `Enter`.

Normally you do not need to connect to this signal.  It is used internally
by B<Gnome::Gtk3::FileChooserDialog> to know when to activate the default button in the
dialog.

See also: C<get_filename()>,
C<get_filenames()>, C<get_uri()>,
C<get_uris()>.

  method handler (
    Int :$_handler-id,
    N-GObject :$_native-object,
    *%user-options
  )

=item $_handler-id; The handler id which is returned from the registration
=item $_native-object; The native object provided by the caller wrapped in the Raku object which registered the signal.
=item %user-options; A list of named arguments provided at the C<register-signal()> method

=comment -----------------------------------------------------------------------
=comment #TS:0:selection-changed:
=head2 selection-changed

This signal is emitted when there is a change in the set of selected files
in a B<Gnome::Gtk3::FileChooser>.  This can happen when the user modifies the selection
with the mouse or the keyboard, or when explicitly calling functions to
change the selection.

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

See also: C<select_filename()>,
C<unselect_filename()>, C<get_filename()>,
C<get_filenames()>, C<select_uri()>,
C<unselect_uri()>, C<get_uri()>,
C<get_uris()>.

  method handler (
    Int :$_handler-id,
    N-GObject :$_native-object,
    *%user-options
  )

=item $_handler-id; The handler id which is returned from the registration
=item $_native-object; The native object provided by the caller wrapped in the Raku object which registered the signal.
=item %user-options; A list of named arguments provided at the C<register-signal()> method

=comment -----------------------------------------------------------------------
=comment #TS:0:update-preview:
=head2 update-preview

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

Once you have installed a preview widget with
C<set_preview_widget()>, you should update it when this
signal is emitted.  You can use the functions
C<get_preview_filename()> or
C<get_preview_uri()> to get the name of the file to preview.
Your widget may not be able to preview all kinds of files; your callback
must call C<set_preview_widget_active()> to inform the file
chooser about whether the preview was generated successfully or not.

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

See also: C<set_preview_widget()>,
