1 | /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ |
---|
2 | |
---|
3 | /* gnome-vfs-async-ops.h - Asynchronous operations in the GNOME Virtual File |
---|
4 | System. |
---|
5 | |
---|
6 | Copyright (C) 1999 Free Software Foundation |
---|
7 | |
---|
8 | The Gnome Library is free software; you can redistribute it and/or |
---|
9 | modify it under the terms of the GNU Library 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 | The Gnome Library 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 | Library General Public License for more details. |
---|
17 | |
---|
18 | You should have received a copy of the GNU Library General Public |
---|
19 | License along with the Gnome Library; see the file COPYING.LIB. If not, |
---|
20 | write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
---|
21 | Boston, MA 02111-1307, USA. |
---|
22 | |
---|
23 | Author: Ettore Perazzoli <ettore@comm2000.it> */ |
---|
24 | |
---|
25 | #ifndef GNOME_VFS_ASYNC_OPS_H |
---|
26 | #define GNOME_VFS_ASYNC_OPS_H |
---|
27 | |
---|
28 | #include <libgnomevfs/gnome-vfs-directory-filter.h> |
---|
29 | #include <libgnomevfs/gnome-vfs-file-info.h> |
---|
30 | #include <libgnomevfs/gnome-vfs-find-directory.h> |
---|
31 | #include <libgnomevfs/gnome-vfs-handle.h> |
---|
32 | #include <libgnomevfs/gnome-vfs-xfer.h> |
---|
33 | |
---|
34 | typedef struct GnomeVFSAsyncHandle GnomeVFSAsyncHandle; |
---|
35 | |
---|
36 | typedef void (* GnomeVFSAsyncCallback) (GnomeVFSAsyncHandle *handle, |
---|
37 | GnomeVFSResult result, |
---|
38 | gpointer callback_data); |
---|
39 | |
---|
40 | typedef GnomeVFSAsyncCallback GnomeVFSAsyncOpenCallback; |
---|
41 | typedef GnomeVFSAsyncCallback GnomeVFSAsyncCreateCallback; |
---|
42 | |
---|
43 | typedef void (* GnomeVFSAsyncOpenAsChannelCallback) |
---|
44 | (GnomeVFSAsyncHandle *handle, |
---|
45 | GIOChannel *channel, |
---|
46 | GnomeVFSResult result, |
---|
47 | gpointer callback_data); |
---|
48 | |
---|
49 | typedef GnomeVFSAsyncOpenAsChannelCallback GnomeVFSAsyncCreateAsChannelCallback; |
---|
50 | |
---|
51 | #define GnomeVFSAsyncCloseCallback GnomeVFSAsyncCallback |
---|
52 | |
---|
53 | typedef void (* GnomeVFSAsyncReadCallback) (GnomeVFSAsyncHandle *handle, |
---|
54 | GnomeVFSResult result, |
---|
55 | gpointer buffer, |
---|
56 | GnomeVFSFileSize bytes_requested, |
---|
57 | GnomeVFSFileSize bytes_read, |
---|
58 | gpointer callback_data); |
---|
59 | |
---|
60 | typedef void (* GnomeVFSAsyncWriteCallback) (GnomeVFSAsyncHandle *handle, |
---|
61 | GnomeVFSResult result, |
---|
62 | gconstpointer buffer, |
---|
63 | GnomeVFSFileSize bytes_requested, |
---|
64 | GnomeVFSFileSize bytes_written, |
---|
65 | gpointer callback_data); |
---|
66 | |
---|
67 | |
---|
68 | typedef void (* GnomeVFSAsyncGetFileInfoCallback) |
---|
69 | (GnomeVFSAsyncHandle *handle, |
---|
70 | GList *results, /* GnomeVFSGetFileInfoResult* items */ |
---|
71 | gpointer callback_data); |
---|
72 | |
---|
73 | typedef void (* GnomeVFSAsyncSetFileInfoCallback) |
---|
74 | (GnomeVFSAsyncHandle *handle, |
---|
75 | GnomeVFSResult result, |
---|
76 | GnomeVFSFileInfo *file_info, |
---|
77 | gpointer callback_data); |
---|
78 | |
---|
79 | |
---|
80 | typedef void (* GnomeVFSAsyncDirectoryLoadCallback) |
---|
81 | (GnomeVFSAsyncHandle *handle, |
---|
82 | GnomeVFSResult result, |
---|
83 | GList *list, |
---|
84 | guint entries_read, |
---|
85 | gpointer callback_data); |
---|
86 | |
---|
87 | typedef gint (* GnomeVFSAsyncXferProgressCallback) |
---|
88 | (GnomeVFSAsyncHandle *handle, |
---|
89 | GnomeVFSXferProgressInfo *info, |
---|
90 | gpointer data); |
---|
91 | |
---|
92 | typedef struct { |
---|
93 | GnomeVFSURI *uri; |
---|
94 | GnomeVFSResult result; |
---|
95 | } GnomeVFSFindDirectoryResult; |
---|
96 | |
---|
97 | typedef void (* GnomeVFSAsyncFindDirectoryCallback) |
---|
98 | (GnomeVFSAsyncHandle *handle, |
---|
99 | GList *results /* GnomeVFSFindDirectoryResult */, |
---|
100 | gpointer data); |
---|
101 | |
---|
102 | |
---|
103 | void gnome_vfs_async_cancel (GnomeVFSAsyncHandle *handle); |
---|
104 | |
---|
105 | void gnome_vfs_async_open (GnomeVFSAsyncHandle **handle_return, |
---|
106 | const gchar *text_uri, |
---|
107 | GnomeVFSOpenMode open_mode, |
---|
108 | GnomeVFSAsyncOpenCallback callback, |
---|
109 | gpointer callback_data); |
---|
110 | void gnome_vfs_async_open_uri (GnomeVFSAsyncHandle **handle_return, |
---|
111 | GnomeVFSURI *uri, |
---|
112 | GnomeVFSOpenMode open_mode, |
---|
113 | GnomeVFSAsyncOpenCallback callback, |
---|
114 | gpointer callback_data); |
---|
115 | void gnome_vfs_async_open_as_channel (GnomeVFSAsyncHandle **handle_return, |
---|
116 | const gchar *text_uri, |
---|
117 | GnomeVFSOpenMode open_mode, |
---|
118 | guint advised_block_size, |
---|
119 | GnomeVFSAsyncOpenAsChannelCallback callback, |
---|
120 | gpointer callback_data); |
---|
121 | void gnome_vfs_async_open_uri_as_channel (GnomeVFSAsyncHandle **handle_return, |
---|
122 | GnomeVFSURI *uri, |
---|
123 | GnomeVFSOpenMode open_mode, |
---|
124 | guint advised_block_size, |
---|
125 | GnomeVFSAsyncOpenAsChannelCallback callback, |
---|
126 | gpointer callback_data); |
---|
127 | void gnome_vfs_async_create (GnomeVFSAsyncHandle **handle_return, |
---|
128 | const gchar *text_uri, |
---|
129 | GnomeVFSOpenMode open_mode, |
---|
130 | gboolean exclusive, |
---|
131 | guint perm, |
---|
132 | GnomeVFSAsyncOpenCallback callback, |
---|
133 | gpointer callback_data); |
---|
134 | void gnome_vfs_async_create_uri (GnomeVFSAsyncHandle **handle_return, |
---|
135 | GnomeVFSURI *uri, |
---|
136 | GnomeVFSOpenMode open_mode, |
---|
137 | gboolean exclusive, |
---|
138 | guint perm, |
---|
139 | GnomeVFSAsyncOpenCallback callback, |
---|
140 | gpointer callback_data); |
---|
141 | void gnome_vfs_async_create_symbolic_link (GnomeVFSAsyncHandle **handle_return, |
---|
142 | GnomeVFSURI *uri, |
---|
143 | const gchar *uri_reference, |
---|
144 | GnomeVFSAsyncOpenCallback callback, |
---|
145 | gpointer callback_data); |
---|
146 | void gnome_vfs_async_create_as_channel (GnomeVFSAsyncHandle **handle_return, |
---|
147 | const gchar *text_uri, |
---|
148 | GnomeVFSOpenMode open_mode, |
---|
149 | gboolean exclusive, |
---|
150 | guint perm, |
---|
151 | GnomeVFSAsyncCreateAsChannelCallback callback, |
---|
152 | gpointer callback_data); |
---|
153 | void gnome_vfs_async_create_uri_as_channel (GnomeVFSAsyncHandle **handle_return, |
---|
154 | GnomeVFSURI *uri, |
---|
155 | GnomeVFSOpenMode open_mode, |
---|
156 | gboolean exclusive, |
---|
157 | guint perm, |
---|
158 | GnomeVFSAsyncCreateAsChannelCallback callback, |
---|
159 | gpointer callback_data); |
---|
160 | void gnome_vfs_async_close (GnomeVFSAsyncHandle *handle, |
---|
161 | GnomeVFSAsyncCloseCallback callback, |
---|
162 | gpointer callback_data); |
---|
163 | void gnome_vfs_async_read (GnomeVFSAsyncHandle *handle, |
---|
164 | gpointer buffer, |
---|
165 | guint bytes, |
---|
166 | GnomeVFSAsyncReadCallback callback, |
---|
167 | gpointer callback_data); |
---|
168 | void gnome_vfs_async_write (GnomeVFSAsyncHandle *handle, |
---|
169 | gconstpointer buffer, |
---|
170 | guint bytes, |
---|
171 | GnomeVFSAsyncWriteCallback callback, |
---|
172 | gpointer callback_data); |
---|
173 | void gnome_vfs_async_get_file_info (GnomeVFSAsyncHandle **handle_return, |
---|
174 | GList *uri_list, |
---|
175 | GnomeVFSFileInfoOptions options, |
---|
176 | GnomeVFSAsyncGetFileInfoCallback callback, |
---|
177 | gpointer callback_data); |
---|
178 | |
---|
179 | /* Setting the file info sometimes changes more info than the |
---|
180 | * caller specified; for example, if the name changes the MIME type might |
---|
181 | * change, and if the owner changes the SUID & SGID bits might change. |
---|
182 | * Therefore the callback returns the new file info for the caller's |
---|
183 | * convenience. The GnomeVFSFileInfoOptions passed here are those used |
---|
184 | * for the returned file info; they are not used when setting. |
---|
185 | */ |
---|
186 | void gnome_vfs_async_set_file_info (GnomeVFSAsyncHandle **handle_return, |
---|
187 | GnomeVFSURI *uri, |
---|
188 | GnomeVFSFileInfo *info, |
---|
189 | GnomeVFSSetFileInfoMask mask, |
---|
190 | GnomeVFSFileInfoOptions options, |
---|
191 | GnomeVFSAsyncSetFileInfoCallback callback, |
---|
192 | gpointer callback_data); |
---|
193 | void gnome_vfs_async_load_directory (GnomeVFSAsyncHandle **handle_return, |
---|
194 | const gchar *text_uri, |
---|
195 | GnomeVFSFileInfoOptions options, |
---|
196 | GnomeVFSDirectoryFilterType filter_type, |
---|
197 | GnomeVFSDirectoryFilterOptions filter_options, |
---|
198 | const gchar *filter_pattern, |
---|
199 | guint items_per_notification, |
---|
200 | GnomeVFSAsyncDirectoryLoadCallback callback, |
---|
201 | gpointer callback_data); |
---|
202 | void gnome_vfs_async_load_directory_uri (GnomeVFSAsyncHandle **handle_return, |
---|
203 | GnomeVFSURI *uri, |
---|
204 | GnomeVFSFileInfoOptions options, |
---|
205 | GnomeVFSDirectoryFilterType filter_type, |
---|
206 | GnomeVFSDirectoryFilterOptions filter_options, |
---|
207 | const gchar *filter_pattern, |
---|
208 | guint items_per_notification, |
---|
209 | GnomeVFSAsyncDirectoryLoadCallback callback, |
---|
210 | gpointer callback_data); |
---|
211 | GnomeVFSResult gnome_vfs_async_xfer (GnomeVFSAsyncHandle **handle_return, |
---|
212 | const GList *source_uri_list, |
---|
213 | const GList *target_uri_list, |
---|
214 | GnomeVFSXferOptions xfer_options, |
---|
215 | GnomeVFSXferErrorMode error_mode, |
---|
216 | GnomeVFSXferOverwriteMode overwrite_mode, |
---|
217 | GnomeVFSAsyncXferProgressCallback progress_update_callback, |
---|
218 | gpointer update_callback_data, |
---|
219 | GnomeVFSXferProgressCallback progress_sync_callback, |
---|
220 | gpointer sync_callback_data); |
---|
221 | void gnome_vfs_async_find_directory (GnomeVFSAsyncHandle **handle_return, |
---|
222 | GList *near_uri_list, |
---|
223 | GnomeVFSFindDirectoryKind kind, |
---|
224 | gboolean create_if_needed, |
---|
225 | gboolean find_if_needed, |
---|
226 | guint permissions, |
---|
227 | GnomeVFSAsyncFindDirectoryCallback callback, |
---|
228 | gpointer user_data); |
---|
229 | |
---|
230 | #endif /* GNOME_VFS_ASYNC_OPS_H */ |
---|