1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
2 
3 /* caja-file-operations: execute file operations.
4 
5    Copyright (C) 1999, 2000 Free Software Foundation
6    Copyright (C) 2000, 2001 Eazel, Inc.
7 
8    This program is free software; you can redistribute it and/or
9    modify it under the terms of the GNU General Public License as
10    published by the Free Software Foundation; either version 2 of the
11    License, or (at your option) any later version.
12 
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16    General Public License for more details.
17 
18    You should have received a copy of the GNU General Public
19    License along with this program; if not, write to the
20    Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
21    Boston, MA 02110-1301, USA.
22 
23    Authors: Ettore Perazzoli <ettore@gnu.org>,
24             Pavel Cisler <pavel@eazel.com>
25 */
26 
27 #ifndef CAJA_FILE_OPERATIONS_H
28 #define CAJA_FILE_OPERATIONS_H
29 
30 #include <gtk/gtk.h>
31 #include <gio/gio.h>
32 
33 typedef void (* CajaCopyCallback)      (GHashTable *debuting_uris,
34                                         gpointer    callback_data);
35 typedef void (* CajaCreateCallback)    (GFile      *new_file,
36                                         gpointer    callback_data);
37 typedef void (* CajaOpCallback)        (gpointer    callback_data);
38 typedef void (* CajaDeleteCallback)    (GHashTable *debuting_uris,
39                                         gboolean    user_cancel,
40                                         gpointer    callback_data);
41 typedef void (* CajaMountCallback)     (GVolume    *volume,
42                                         GObject    *callback_data_object);
43 typedef void (* CajaUnmountCallback)   (gpointer    callback_data);
44 
45 /* FIXME: int copy_action should be an enum */
46 
47 void caja_file_operations_copy_move   (const GList               *item_uris,
48                                        GArray                    *relative_item_points,
49                                        const char                *target_dir_uri,
50                                        GdkDragAction              copy_action,
51                                        GtkWidget                 *parent_view,
52                                        CajaCopyCallback       done_callback,
53                                        gpointer                   done_callback_data);
54 void caja_file_operations_empty_trash (GtkWidget                 *parent_view);
55 void caja_file_operations_new_folder  (GtkWidget                 *parent_view,
56                                        GdkPoint                  *target_point,
57                                        const char                *parent_dir_uri,
58                                        CajaCreateCallback     done_callback,
59                                        gpointer                   done_callback_data);
60 void caja_file_operations_new_file    (GtkWidget                 *parent_view,
61                                        GdkPoint                  *target_point,
62                                        const char                *parent_dir,
63                                        const char                *target_filename,
64                                        const char                *initial_contents,
65                                        int                        length,
66                                        CajaCreateCallback     done_callback,
67                                        gpointer                   data);
68 void caja_file_operations_new_file_from_template (GtkWidget               *parent_view,
69         GdkPoint                *target_point,
70         const char              *parent_dir,
71         const char              *target_filename,
72         const char              *template_uri,
73         CajaCreateCallback   done_callback,
74         gpointer                 data);
75 
76 void caja_file_operations_delete          (GList                  *files,
77         GtkWindow              *parent_window,
78         CajaDeleteCallback  done_callback,
79         gpointer                done_callback_data);
80 void caja_file_operations_trash_or_delete (GList                  *files,
81         GtkWindow              *parent_window,
82         CajaDeleteCallback  done_callback,
83         gpointer                done_callback_data);
84 
85 void caja_file_set_permissions_recursive (const char                     *directory,
86         guint32                         file_permissions,
87         guint32                         file_mask,
88         guint32                         folder_permissions,
89         guint32                         folder_mask,
90         CajaOpCallback              callback,
91         gpointer                        callback_data);
92 
93 void caja_file_operations_unmount_mount (GtkWindow                      *parent_window,
94         GMount                         *mount,
95         gboolean                        eject,
96         gboolean                        check_trash);
97 void caja_file_operations_unmount_mount_full (GtkWindow                 *parent_window,
98         GMount                    *mount,
99         gboolean                   eject,
100         gboolean                   check_trash,
101         CajaUnmountCallback    callback,
102         gpointer                   callback_data);
103 void caja_file_operations_mount_volume  (GtkWindow                      *parent_window,
104         GVolume                        *volume,
105         gboolean                        allow_autorun);
106 void caja_file_operations_mount_volume_full (GtkWindow                      *parent_window,
107         GVolume                        *volume,
108         gboolean                        allow_autorun,
109         CajaMountCallback           mount_callback,
110         GObject                        *mount_callback_data_object);
111 
112 void caja_file_operations_copy      (GList                *files,
113                                      GArray               *relative_item_points,
114                                      GFile                *target_dir,
115                                      GtkWindow            *parent_window,
116                                      CajaCopyCallback  done_callback,
117                                      gpointer              done_callback_data);
118 void caja_file_operations_move      (GList                *files,
119                                      GArray               *relative_item_points,
120                                      GFile                *target_dir,
121                                      GtkWindow            *parent_window,
122                                      CajaCopyCallback  done_callback,
123                                      gpointer              done_callback_data);
124 void caja_file_operations_duplicate (GList                *files,
125                                      GArray               *relative_item_points,
126                                      GtkWindow            *parent_window,
127                                      CajaCopyCallback  done_callback,
128                                      gpointer              done_callback_data);
129 void caja_file_operations_link      (GList                *files,
130                                      GArray               *relative_item_points,
131                                      GFile                *target_dir,
132                                      GtkWindow            *parent_window,
133                                      CajaCopyCallback  done_callback,
134                                      gpointer              done_callback_data);
135 void caja_file_mark_desktop_file_trusted (GFile           *file,
136         GtkWindow        *parent_window,
137         gboolean          interactive,
138         CajaOpCallback done_callback,
139         gpointer          done_callback_data);
140 
141 void caja_application_notify_unmount_show (const gchar *message);
142 
143 #endif /* CAJA_FILE_OPERATIONS_H */
144