Simplify vflist_get_formatted()
[geeqie.git] / src / utilops.h
1 /*
2  * Copyright (C) 2006 John Ellis
3  * Copyright (C) 2008 - 2016 The Geeqie Team
4  *
5  * Author: John Ellis
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21
22 #ifndef UTILOPS_H
23 #define UTILOPS_H
24
25
26 #include "ui_utildlg.h"
27
28 void file_maint_renamed(FileData *fd);
29 void file_maint_moved(FileData *fd, GList *ignore_list);
30 void file_maint_copied(FileData *fd);
31
32 GenericDialog *file_util_gen_dlg(const gchar *title,
33                                  const gchar *role,
34                                  GtkWidget *parent, gint auto_close,
35                                  void (*cancel_cb)(GenericDialog *, gpointer), gpointer data);
36 FileDialog *file_util_file_dlg(const gchar *title,
37                                const gchar *role,
38                                GtkWidget *parent,
39                                void (*cancel_cb)(FileDialog *, gpointer), gpointer data);
40 GenericDialog *file_util_warning_dialog(const gchar *heading, const gchar *message,
41                                         const gchar *icon_stock_id, GtkWidget *parent);
42
43 /* all functions takes over the filelist and frees it when done */
44
45 void file_util_delete(FileData *source_fd, GList *source_list, GtkWidget *parent);
46 void file_util_delete_notify_done(FileData *source_fd, GList *source_list, GtkWidget *parent, FileUtilDoneFunc done_func, gpointer done_data);
47 void file_util_move(FileData *source_fd, GList *source_list, const gchar *dest_path, GtkWidget *parent);
48 void file_util_copy(FileData *source_fd, GList *source_list, const gchar *dest_path, GtkWidget *parent);
49 void file_util_rename(FileData *source_fd, GList *source_list, GtkWidget *parent);
50 void file_util_write_metadata(FileData *source_fd, GList *source_list, GtkWidget *parent, gboolean force_dialog, FileUtilDoneFunc done_func, gpointer done_data);
51
52 void file_util_create_dir(FileData *dir_fd, GtkWidget *parent, FileUtilDoneFunc done_func, gpointer done_data);
53
54 void file_util_rename_dir(FileData *source_fd, const gchar *new_path, GtkWidget *parent, FileUtilDoneFunc done_func, gpointer done_data);
55
56 /* these avoid the location entry dialog, list must be files only and
57  * dest_path must be a valid directory path
58 */
59 void file_util_move_simple(GList *list, const gchar *dest_path, GtkWidget *parent);
60 void file_util_copy_simple(GList *list, const gchar *dest_path, GtkWidget *parent);
61 void file_util_rename_simple(FileData *fd, const gchar *dest_path, GtkWidget *parent);
62
63 void file_util_start_editor_from_file(const gchar *key, FileData *fd, GtkWidget *parent);
64
65 /* working directory is used only as a fallback when the filelist is empty */
66 void file_util_start_editor_from_filelist(const gchar *key, GList *list, const gchar *working_directory, GtkWidget *parent);
67 void file_util_start_filter_from_file(const gchar *key, FileData *fd, const gchar *dest_path, GtkWidget *parent);
68 void file_util_start_filter_from_filelist(const gchar *key, GList *list, const gchar *dest_path, GtkWidget *parent);
69
70 void file_util_delete_dir(FileData *source_fd, GtkWidget *parent);
71
72 void file_util_copy_path_to_clipboard(FileData *fd, gboolean quoted);
73 void file_util_copy_path_list_to_clipboard(GList *list, gboolean quoted);
74
75 gchar *new_folder(GtkWindow *window, gchar *path);
76 #endif
77 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */