Add async version of g_file_trash()
[platform/upstream/glib.git] / gio / gfile.h
1 /* GIO - GLib Input, Output and Streaming Library
2  *
3  * Copyright (C) 2006-2007 Red Hat, Inc.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library 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 GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General
16  * Public License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18  * Boston, MA 02111-1307, USA.
19  *
20  * Author: Alexander Larsson <alexl@redhat.com>
21  */
22
23 #ifndef __G_FILE_H__
24 #define __G_FILE_H__
25
26 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
27 #error "Only <gio/gio.h> can be included directly."
28 #endif
29
30 #include <gio/giotypes.h>
31
32 G_BEGIN_DECLS
33
34 #define G_TYPE_FILE            (g_file_get_type ())
35 #define G_FILE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_FILE, GFile))
36 #define G_IS_FILE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_FILE))
37 #define G_FILE_GET_IFACE(obj)  (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_FILE, GFileIface))
38
39 #if 0
40 /**
41  * GFile:
42  *
43  * A handle to an object implementing the #GFileIface interface.
44  * Generally stores a location within the file system. Handles do not
45  * necessarily represent files or directories that currently exist.
46  **/
47 typedef struct _GFile                   GFile; /* Dummy typedef */
48 #endif
49 typedef struct _GFileIface              GFileIface;
50
51
52 /**
53  * GFileIface:
54  * @g_iface: The parent interface.
55  * @dup: Duplicates a #GFile.
56  * @hash: Creates a hash of a #GFile.
57  * @equal: Checks equality of two given #GFile<!-- -->s.
58  * @is_native: Checks to see if a file is native to the system.
59  * @has_uri_scheme: Checks to see if a #GFile has a given URI scheme.
60  * @get_uri_scheme: Gets the URI scheme for a #GFile.
61  * @get_basename: Gets the basename for a given #GFile.
62  * @get_path: Gets the current path within a #GFile.
63  * @get_uri: Gets a URI for the path within a #GFile.
64  * @get_parse_name: Gets the parsed name for the #GFile.
65  * @get_parent: Gets the parent directory for the #GFile.
66  * @prefix_matches: Checks whether a #GFile contains a specified file.
67  * @get_relative_path: Gets the path for a #GFile relative to a given path.
68  * @resolve_relative_path: Resolves a relative path for a #GFile to an absolute path.
69  * @get_child_for_display_name: Gets the child #GFile for a given display name.
70  * @enumerate_children: Gets a #GFileEnumerator with the children of a #GFile.
71  * @enumerate_children_async: Asynchronously gets a #GFileEnumerator with the children of a #GFile.
72  * @enumerate_children_finish: Finishes asynchronously enumerating the children.
73  * @query_info: Gets the #GFileInfo for a #GFile.
74  * @query_info_async: Asynchronously gets the #GFileInfo for a #GFile.
75  * @query_info_finish: Finishes an asynchronous query info operation.
76  * @query_filesystem_info: Gets a #GFileInfo for the file system #GFile is on.
77  * @query_filesystem_info_async: Asynchronously gets a #GFileInfo for the file system #GFile is on.
78  * @query_filesystem_info_finish: Finishes asynchronously getting the file system info.
79  * @find_enclosing_mount: Gets a #GMount for the #GFile.
80  * @find_enclosing_mount_async: Asynchronously gets the #GMount for a #GFile.
81  * @find_enclosing_mount_finish: Finishes asynchronously getting the volume.
82  * @set_display_name: Sets the display name for a #GFile.
83  * @set_display_name_async: Asynchronously sets a #GFile's display name.
84  * @set_display_name_finish: Finishes asynchronously setting a #GFile's display name.
85  * @query_settable_attributes: Returns a list of #GFileAttribute<!-- -->s that can be set.
86  * @_query_settable_attributes_async: Asynchronously gets a list of #GFileAttribute<!-- -->s that can be set.
87  * @_query_settable_attributes_finish: Finishes asynchronously querying settable attributes.
88  * @query_writable_namespaces: Returns a list of #GFileAttribute namespaces that are writable.
89  * @_query_writable_namespaces_async: Asynchronously gets a list of #GFileAttribute namespaces that are writable.
90  * @_query_writable_namespaces_finish: Finishes asynchronously querying the writable namespaces.
91  * @set_attribute: Sets a #GFileAttribute.
92  * @set_attributes_from_info: Sets a #GFileAttribute with information from a #GFileInfo.
93  * @set_attributes_async: Asynchronously sets a file's attributes.
94  * @set_attributes_finish: Finishes setting a file's attributes asynchronously.
95  * @read_fn: Reads a file asynchronously.
96  * @read_async: Asynchronously reads a file.
97  * @read_finish: Finishes asynchronously reading a file.
98  * @append_to: Writes to the end of a file.
99  * @append_to_async: Asynchronously writes to the end of a file.
100  * @append_to_finish: Finishes an asynchronous file append operation.
101  * @create: Creates a new file.
102  * @create_async: Asynchronously creates a file.
103  * @create_finish: Finishes asynchronously creating a file.
104  * @replace: Replaces the contents of a file.
105  * @replace_async: Asynchronously replaces the contents of a file.
106  * @replace_finish: Finishes asynchronously replacing a file.
107  * @delete_file: Deletes a file.
108  * @delete_file_async: Asynchronously deletes a file.
109  * @delete_file_finish: Finishes an asynchronous delete.
110  * @trash: Sends a #GFile to the Trash location.
111  * @trash_async: Asynchronously sends a #GFile to the Trash location.
112  * @trash_finish: Finishes an asynchronous file trashing operation.
113  * @make_directory: Makes a directory.
114  * @_make_directory_async: Asynchronously makes a directory.
115  * @_make_directory_finish: Finishes making a directory asynchronously.
116  * @make_symbolic_link: Makes a symbolic link.
117  * @_make_symbolic_link_async: Asynchronously makes a symbolic link
118  * @_make_symbolic_link_finish: Finishes making a symbolic link asynchronously.
119  * @copy: Copies a file.
120  * @copy_async: Asynchronously copies a file.
121  * @copy_finish: Finishes an asynchronous copy operation.
122  * @move: Moves a file.
123  * @_move_async: Asynchronously moves a file.
124  * @_move_finish: Finishes an asynchronous move operation.
125  * @mount_mountable: Mounts a mountable object.
126  * @mount_mountable_finish: Finishes a mounting operation.
127  * @unmount_mountable: Unmounts a mountable object.
128  * @unmount_mountable_finish: Finishes an unmount operation.
129  * @eject_mountable: Ejects a mountable.
130  * @eject_mountable_finish: Finishes an eject operation.
131  * @mount_enclosing_volume: Mounts a specified location.
132  * @mount_enclosing_volume_finish: Finishes mounting a specified location.
133  * @monitor_dir: Creates a #GFileMonitor for the location.
134  * @monitor_file: Creates a #GFileMonitor for the location.
135  * @open_readwrite: Open file read/write. Since 2.22.
136  * @open_readwrite_async: Asynchronously opens file read/write. Since 2.22.
137  * @open_readwrite_finish: Finishes an asynchronous open read/write. Since 2.22.
138  * @create_readwrite: Creates file read/write. Since 2.22.
139  * @create_readwrite_async: Asynchronously creates file read/write. Since 2.22.
140  * @create_readwrite_finish: Finishes an asynchronous creates read/write. Since 2.22.
141  * @replace_readwrite: Replaces file read/write. Since 2.22.
142  * @replace_readwrite_async: Asynchronously replaces file read/write. Since 2.22.
143  * @replace_readwrite_finish: Finishes an asynchronous replace read/write. Since 2.22.
144  * @start_mountable: Starts a mountable object. Since 2.22.
145  * @start_mountable_finish: Finishes an start operation. Since 2.22.
146  * @stop_mountable: Stops a mountable. Since 2.22.
147  * @stop_mountable_finish: Finishes an stop operation. Since 2.22.
148  * @supports_thread_contexts: a boolean that indicates whether the #GFile implementation supports thread-default contexts. Since 2.22.
149  * @unmount_mountable_with_operation: Unmounts a mountable object using a #GMountOperation. Since 2.22.
150  * @unmount_mountable_with_operation_finish: Finishes an unmount operation using a #GMountOperation. Since 2.22.
151  * @eject_mountable_with_operation: Ejects a mountable object using a #GMountOperation. Since 2.22.
152  * @eject_mountable_with_operation_finish: Finishes an eject operation using a #GMountOperation. Since 2.22.
153  * @poll_mountable: Polls a mountable object for media changes. Since 2.22.
154  * @poll_mountable_finish: Finishes an poll operation for media changes. Since 2.22.
155  *
156  * An interface for writing VFS file handles.
157  **/
158 struct _GFileIface
159 {
160   GTypeInterface g_iface;
161
162   /* Virtual Table */
163
164   GFile *             (* dup)                         (GFile         *file);
165   guint               (* hash)                        (GFile         *file);
166   gboolean            (* equal)                       (GFile         *file1,
167                                                        GFile         *file2);
168   gboolean            (* is_native)                   (GFile         *file);
169   gboolean            (* has_uri_scheme)              (GFile         *file,
170                                                        const char    *uri_scheme);
171   char *              (* get_uri_scheme)              (GFile         *file);
172   char *              (* get_basename)                (GFile         *file);
173   char *              (* get_path)                    (GFile         *file);
174   char *              (* get_uri)                     (GFile         *file);
175   char *              (* get_parse_name)              (GFile         *file);
176   GFile *             (* get_parent)                  (GFile         *file);
177   gboolean            (* prefix_matches)              (GFile         *prefix,
178                                                        GFile         *file);
179   char *              (* get_relative_path)           (GFile         *parent,
180                                                        GFile         *descendant);
181   GFile *             (* resolve_relative_path)       (GFile        *file,
182                                                        const char   *relative_path);
183   GFile *             (* get_child_for_display_name)  (GFile        *file,
184                                                        const char   *display_name,
185                                                        GError      **error);
186
187   GFileEnumerator *   (* enumerate_children)          (GFile                *file,
188                                                        const char           *attributes,
189                                                        GFileQueryInfoFlags   flags,
190                                                        GCancellable         *cancellable,
191                                                        GError              **error);
192   void                (* enumerate_children_async)    (GFile                *file,
193                                                        const char           *attributes,
194                                                        GFileQueryInfoFlags   flags,
195                                                        int                   io_priority,
196                                                        GCancellable         *cancellable,
197                                                        GAsyncReadyCallback   callback,
198                                                        gpointer              user_data);
199   GFileEnumerator *   (* enumerate_children_finish)   (GFile                *file,
200                                                        GAsyncResult         *res,
201                                                        GError              **error);
202
203   GFileInfo *         (* query_info)                  (GFile                *file,
204                                                        const char           *attributes,
205                                                        GFileQueryInfoFlags   flags,
206                                                        GCancellable         *cancellable,
207                                                        GError              **error);
208   void                (* query_info_async)            (GFile                *file,
209                                                        const char           *attributes,
210                                                        GFileQueryInfoFlags   flags,
211                                                        int                   io_priority,
212                                                        GCancellable         *cancellable,
213                                                        GAsyncReadyCallback   callback,
214                                                        gpointer              user_data);
215   GFileInfo *         (* query_info_finish)           (GFile                *file,
216                                                        GAsyncResult         *res,
217                                                        GError              **error);
218
219   GFileInfo *         (* query_filesystem_info)       (GFile                *file,
220                                                        const char           *attributes,
221                                                        GCancellable         *cancellable,
222                                                        GError              **error);
223   void                (* query_filesystem_info_async) (GFile                *file,
224                                                        const char           *attributes,
225                                                        int                   io_priority,
226                                                        GCancellable         *cancellable,
227                                                        GAsyncReadyCallback   callback,
228                                                        gpointer              user_data);
229   GFileInfo *         (* query_filesystem_info_finish)(GFile                *file,
230                                                        GAsyncResult         *res,
231                                                        GError              **error);
232
233   GMount *            (* find_enclosing_mount)        (GFile                *file,
234                                                        GCancellable         *cancellable,
235                                                        GError              **error);
236   void                (* find_enclosing_mount_async)  (GFile                *file,
237                                                        int                   io_priority,
238                                                        GCancellable         *cancellable,
239                                                        GAsyncReadyCallback   callback,
240                                                        gpointer              user_data);
241   GMount *            (* find_enclosing_mount_finish) (GFile                *file,
242                                                        GAsyncResult         *res,
243                                                        GError              **error);
244
245   GFile *             (* set_display_name)            (GFile                *file,
246                                                        const char           *display_name,
247                                                        GCancellable         *cancellable,
248                                                        GError              **error);
249   void                (* set_display_name_async)      (GFile                *file,
250                                                        const char           *display_name,
251                                                        int                   io_priority,
252                                                        GCancellable         *cancellable,
253                                                        GAsyncReadyCallback   callback,
254                                                        gpointer              user_data);
255   GFile *             (* set_display_name_finish)     (GFile                *file,
256                                                        GAsyncResult         *res,
257                                                        GError              **error);
258
259   GFileAttributeInfoList * (* query_settable_attributes)    (GFile          *file,
260                                                              GCancellable   *cancellable,
261                                                              GError        **error);
262   void                (* _query_settable_attributes_async)  (void);
263   void                (* _query_settable_attributes_finish) (void);
264
265   GFileAttributeInfoList * (* query_writable_namespaces)    (GFile          *file,
266                                                              GCancellable   *cancellable,
267                                                              GError        **error);
268   void                (* _query_writable_namespaces_async)  (void);
269   void                (* _query_writable_namespaces_finish) (void);
270
271   gboolean            (* set_attribute)               (GFile                *file,
272                                                        const char           *attribute,
273                                                        GFileAttributeType    type,
274                                                        gpointer              value_p,
275                                                        GFileQueryInfoFlags   flags,
276                                                        GCancellable         *cancellable,
277                                                        GError              **error);
278   gboolean            (* set_attributes_from_info)    (GFile                *file,
279                                                        GFileInfo            *info,
280                                                        GFileQueryInfoFlags   flags,
281                                                        GCancellable         *cancellable,
282                                                        GError              **error);
283   void                (* set_attributes_async)        (GFile                *file,
284                                                        GFileInfo            *info,
285                                                        GFileQueryInfoFlags   flags,
286                                                        int                   io_priority,
287                                                        GCancellable         *cancellable,
288                                                        GAsyncReadyCallback   callback,
289                                                        gpointer              user_data);
290   gboolean            (* set_attributes_finish)       (GFile                *file,
291                                                        GAsyncResult         *result,
292                                                        GFileInfo           **info,
293                                                        GError              **error);
294
295   GFileInputStream *  (* read_fn)                     (GFile                *file,
296                                                        GCancellable         *cancellable,
297                                                        GError              **error);
298   void                (* read_async)                  (GFile                *file,
299                                                        int                   io_priority,
300                                                        GCancellable         *cancellable,
301                                                        GAsyncReadyCallback   callback,
302                                                        gpointer              user_data);
303   GFileInputStream *  (* read_finish)                 (GFile                *file,
304                                                        GAsyncResult         *res,
305                                                        GError              **error);
306
307   GFileOutputStream * (* append_to)                   (GFile                *file,
308                                                        GFileCreateFlags      flags,
309                                                        GCancellable         *cancellable,
310                                                        GError              **error);
311   void                (* append_to_async)             (GFile                *file,
312                                                        GFileCreateFlags      flags,
313                                                        int                   io_priority,
314                                                        GCancellable         *cancellable,
315                                                        GAsyncReadyCallback   callback,
316                                                        gpointer              user_data);
317   GFileOutputStream * (* append_to_finish)            (GFile                *file,
318                                                        GAsyncResult         *res,
319                                                        GError              **error);
320
321   GFileOutputStream * (* create)                      (GFile                *file,
322                                                        GFileCreateFlags      flags,
323                                                        GCancellable         *cancellable,
324                                                        GError              **error);
325   void                (* create_async)                (GFile                *file,
326                                                        GFileCreateFlags      flags,
327                                                        int                   io_priority,
328                                                        GCancellable         *cancellable,
329                                                        GAsyncReadyCallback   callback,
330                                                        gpointer              user_data);
331   GFileOutputStream * (* create_finish)               (GFile                *file,
332                                                        GAsyncResult         *res,
333                                                        GError              **error);
334
335   GFileOutputStream * (* replace)                     (GFile                *file,
336                                                        const char           *etag,
337                                                        gboolean              make_backup,
338                                                        GFileCreateFlags      flags,
339                                                        GCancellable         *cancellable,
340                                                        GError              **error);
341   void                (* replace_async)               (GFile                *file,
342                                                        const char           *etag,
343                                                        gboolean              make_backup,
344                                                        GFileCreateFlags      flags,
345                                                        int                   io_priority,
346                                                        GCancellable         *cancellable,
347                                                        GAsyncReadyCallback   callback,
348                                                        gpointer              user_data);
349   GFileOutputStream * (* replace_finish)              (GFile                *file,
350                                                        GAsyncResult         *res,
351                                                        GError              **error);
352
353   gboolean            (* delete_file)                 (GFile                *file,
354                                                        GCancellable         *cancellable,
355                                                        GError              **error);
356   void                (* delete_file_async)           (GFile                *file,
357                                                        int                   io_priority,
358                                                        GCancellable         *cancellable,
359                                                        GAsyncReadyCallback   callback,
360                                                        gpointer              user_data);
361   gboolean            (* delete_file_finish)          (GFile                *file,
362                                                        GAsyncResult         *result,
363                                                        GError              **error);
364
365   gboolean            (* trash)                       (GFile                *file,
366                                                        GCancellable         *cancellable,
367                                                        GError              **error);
368   void                (* trash_async)                 (GFile                *file,
369                                                        int                   io_priority,
370                                                        GCancellable         *cancellable,
371                                                        GAsyncReadyCallback   callback,
372                                                        gpointer              user_data);
373   gboolean            (* trash_finish)                (GFile                *file,
374                                                        GAsyncResult         *result,
375                                                        GError              **error);
376
377   gboolean            (* make_directory)              (GFile                *file,
378                                                        GCancellable         *cancellable,
379                                                        GError              **error);
380   void                (* _make_directory_async)       (void);
381   void                (* _make_directory_finish)      (void);
382
383   gboolean            (* make_symbolic_link)          (GFile                *file,
384                                                        const char           *symlink_value,
385                                                        GCancellable         *cancellable,
386                                                        GError              **error);
387   void                (* _make_symbolic_link_async)   (void);
388   void                (* _make_symbolic_link_finish)  (void);
389
390   gboolean            (* copy)                        (GFile                *source,
391                                                        GFile                *destination,
392                                                        GFileCopyFlags        flags,
393                                                        GCancellable         *cancellable,
394                                                        GFileProgressCallback progress_callback,
395                                                        gpointer              progress_callback_data,
396                                                        GError              **error);
397   void                (* copy_async)                  (GFile                *source,
398                                                        GFile                *destination,
399                                                        GFileCopyFlags        flags,
400                                                        int                   io_priority,
401                                                        GCancellable         *cancellable,
402                                                        GFileProgressCallback progress_callback,
403                                                        gpointer              progress_callback_data,
404                                                        GAsyncReadyCallback   callback,
405                                                        gpointer              user_data);
406   gboolean            (* copy_finish)                 (GFile                *file,
407                                                        GAsyncResult         *res,
408                                                        GError              **error);
409
410   gboolean            (* move)                        (GFile                *source,
411                                                        GFile                *destination,
412                                                        GFileCopyFlags        flags,
413                                                        GCancellable         *cancellable,
414                                                        GFileProgressCallback progress_callback,
415                                                        gpointer              progress_callback_data,
416                                                        GError              **error);
417   void                (* _move_async)                 (void);
418   void                (* _move_finish)                (void);
419
420   void                (* mount_mountable)             (GFile                *file,
421                                                        GMountMountFlags      flags,
422                                                        GMountOperation      *mount_operation,
423                                                        GCancellable         *cancellable,
424                                                        GAsyncReadyCallback   callback,
425                                                        gpointer              user_data);
426   GFile *             (* mount_mountable_finish)      (GFile                *file,
427                                                        GAsyncResult         *result,
428                                                        GError              **error);
429
430   void                (* unmount_mountable)           (GFile                *file,
431                                                        GMountUnmountFlags    flags,
432                                                        GCancellable         *cancellable,
433                                                        GAsyncReadyCallback   callback,
434                                                        gpointer              user_data);
435   gboolean            (* unmount_mountable_finish)    (GFile                *file,
436                                                        GAsyncResult         *result,
437                                                        GError              **error);
438
439   void                (* eject_mountable)             (GFile                *file,
440                                                        GMountUnmountFlags    flags,
441                                                        GCancellable         *cancellable,
442                                                        GAsyncReadyCallback   callback,
443                                                        gpointer              user_data);
444   gboolean            (* eject_mountable_finish)      (GFile                *file,
445                                                        GAsyncResult         *result,
446                                                        GError              **error);
447
448   void                (* mount_enclosing_volume)      (GFile                *location,
449                                                        GMountMountFlags      flags,
450                                                        GMountOperation      *mount_operation,
451                                                        GCancellable         *cancellable,
452                                                        GAsyncReadyCallback   callback,
453                                                        gpointer              user_data);
454   gboolean         (* mount_enclosing_volume_finish)  (GFile                *location,
455                                                        GAsyncResult         *result,
456                                                        GError              **error);
457
458   GFileMonitor *      (* monitor_dir)                 (GFile                *file,
459                                                        GFileMonitorFlags     flags,
460                                                        GCancellable         *cancellable,
461                                                        GError              **error);
462   GFileMonitor *      (* monitor_file)                (GFile                *file,
463                                                        GFileMonitorFlags     flags,
464                                                        GCancellable         *cancellable,
465                                                        GError              **error);
466
467   GFileIOStream *     (* open_readwrite)              (GFile                *file,
468                                                        GCancellable         *cancellable,
469                                                        GError              **error);
470   void                (* open_readwrite_async)        (GFile                *file,
471                                                        int                   io_priority,
472                                                        GCancellable         *cancellable,
473                                                        GAsyncReadyCallback   callback,
474                                                        gpointer              user_data);
475   GFileIOStream *     (* open_readwrite_finish)       (GFile                *file,
476                                                        GAsyncResult         *res,
477                                                        GError              **error);
478   GFileIOStream *     (* create_readwrite)            (GFile                *file,
479                                                        GFileCreateFlags      flags,
480                                                        GCancellable         *cancellable,
481                                                        GError              **error);
482   void                (* create_readwrite_async)      (GFile                *file,
483                                                        GFileCreateFlags      flags,
484                                                        int                   io_priority,
485                                                        GCancellable         *cancellable,
486                                                        GAsyncReadyCallback   callback,
487                                                        gpointer              user_data);
488   GFileIOStream *     (* create_readwrite_finish)      (GFile                *file,
489                                                        GAsyncResult         *res,
490                                                        GError              **error);
491   GFileIOStream *     (* replace_readwrite)           (GFile                *file,
492                                                        const char           *etag,
493                                                        gboolean              make_backup,
494                                                        GFileCreateFlags      flags,
495                                                        GCancellable         *cancellable,
496                                                        GError              **error);
497   void                (* replace_readwrite_async)     (GFile                *file,
498                                                        const char           *etag,
499                                                        gboolean              make_backup,
500                                                        GFileCreateFlags      flags,
501                                                        int                   io_priority,
502                                                        GCancellable         *cancellable,
503                                                        GAsyncReadyCallback   callback,
504                                                        gpointer              user_data);
505   GFileIOStream *     (* replace_readwrite_finish)    (GFile                *file,
506                                                        GAsyncResult         *res,
507                                                        GError              **error);
508
509   void                (* start_mountable)             (GFile                *file,
510                                                        GDriveStartFlags      flags,
511                                                        GMountOperation      *start_operation,
512                                                        GCancellable         *cancellable,
513                                                        GAsyncReadyCallback   callback,
514                                                        gpointer              user_data);
515   gboolean            (* start_mountable_finish)      (GFile                *file,
516                                                        GAsyncResult         *result,
517                                                        GError              **error);
518
519   void                (* stop_mountable)              (GFile                *file,
520                                                        GMountUnmountFlags    flags,
521                                                        GMountOperation      *mount_operation,
522                                                        GCancellable         *cancellable,
523                                                        GAsyncReadyCallback   callback,
524                                                        gpointer              user_data);
525   gboolean            (* stop_mountable_finish)       (GFile                *file,
526                                                        GAsyncResult         *result,
527                                                        GError              **error);
528
529   gboolean            supports_thread_contexts;
530
531   void                (* unmount_mountable_with_operation) (GFile           *file,
532                                                        GMountUnmountFlags    flags,
533                                                        GMountOperation      *mount_operation,
534                                                        GCancellable         *cancellable,
535                                                        GAsyncReadyCallback   callback,
536                                                        gpointer              user_data);
537   gboolean            (* unmount_mountable_with_operation_finish) (GFile    *file,
538                                                        GAsyncResult         *result,
539                                                        GError              **error);
540
541   void                (* eject_mountable_with_operation) (GFile             *file,
542                                                        GMountUnmountFlags    flags,
543                                                        GMountOperation      *mount_operation,
544                                                        GCancellable         *cancellable,
545                                                        GAsyncReadyCallback   callback,
546                                                        gpointer              user_data);
547   gboolean            (* eject_mountable_with_operation_finish) (GFile      *file,
548                                                        GAsyncResult         *result,
549                                                        GError              **error);
550
551   void                (* poll_mountable)              (GFile                *file,
552                                                        GCancellable         *cancellable,
553                                                        GAsyncReadyCallback   callback,
554                                                        gpointer              user_data);
555   gboolean            (* poll_mountable_finish)       (GFile                *file,
556                                                        GAsyncResult         *result,
557                                                        GError              **error);
558 };
559
560 GLIB_AVAILABLE_IN_ALL
561 GType                   g_file_get_type                   (void) G_GNUC_CONST;
562
563 GLIB_AVAILABLE_IN_ALL
564 GFile *                 g_file_new_for_path               (const char                 *path);
565 GLIB_AVAILABLE_IN_ALL
566 GFile *                 g_file_new_for_uri                (const char                 *uri);
567 GLIB_AVAILABLE_IN_ALL
568 GFile *                 g_file_new_for_commandline_arg    (const char                 *arg);
569 GLIB_AVAILABLE_IN_2_36
570 GFile *                 g_file_new_for_commandline_arg_and_cwd (const gchar           *arg,
571                                                                 const gchar           *cwd);
572 GLIB_AVAILABLE_IN_2_32
573 GFile *                 g_file_new_tmp                    (const char                 *tmpl,
574                                                            GFileIOStream             **iostream,
575                                                            GError                    **error);
576 GLIB_AVAILABLE_IN_ALL
577 GFile *                 g_file_parse_name                 (const char                 *parse_name);
578 GLIB_AVAILABLE_IN_ALL
579 GFile *                 g_file_dup                        (GFile                      *file);
580 GLIB_AVAILABLE_IN_ALL
581 guint                   g_file_hash                       (gconstpointer               file);
582 GLIB_AVAILABLE_IN_ALL
583 gboolean                g_file_equal                      (GFile                      *file1,
584                                                            GFile                      *file2);
585 GLIB_AVAILABLE_IN_ALL
586 char *                  g_file_get_basename               (GFile                      *file);
587 GLIB_AVAILABLE_IN_ALL
588 char *                  g_file_get_path                   (GFile                      *file);
589 GLIB_AVAILABLE_IN_ALL
590 char *                  g_file_get_uri                    (GFile                      *file);
591 GLIB_AVAILABLE_IN_ALL
592 char *                  g_file_get_parse_name             (GFile                      *file);
593 GLIB_AVAILABLE_IN_ALL
594 GFile *                 g_file_get_parent                 (GFile                      *file);
595 GLIB_AVAILABLE_IN_ALL
596 gboolean                g_file_has_parent                 (GFile                      *file,
597                                                            GFile                      *parent);
598 GLIB_AVAILABLE_IN_ALL
599 GFile *                 g_file_get_child                  (GFile                      *file,
600                                                            const char                 *name);
601 GLIB_AVAILABLE_IN_ALL
602 GFile *                 g_file_get_child_for_display_name (GFile                      *file,
603                                                            const char                 *display_name,
604                                                            GError                    **error);
605 GLIB_AVAILABLE_IN_ALL
606 gboolean                g_file_has_prefix                 (GFile                      *file,
607                                                            GFile                      *prefix);
608 GLIB_AVAILABLE_IN_ALL
609 char *                  g_file_get_relative_path          (GFile                      *parent,
610                                                            GFile                      *descendant);
611 GLIB_AVAILABLE_IN_ALL
612 GFile *                 g_file_resolve_relative_path      (GFile                      *file,
613                                                            const char                 *relative_path);
614 GLIB_AVAILABLE_IN_ALL
615 gboolean                g_file_is_native                  (GFile                      *file);
616 GLIB_AVAILABLE_IN_ALL
617 gboolean                g_file_has_uri_scheme             (GFile                      *file,
618                                                            const char                 *uri_scheme);
619 GLIB_AVAILABLE_IN_ALL
620 char *                  g_file_get_uri_scheme             (GFile                      *file);
621 GLIB_AVAILABLE_IN_ALL
622 GFileInputStream *      g_file_read                       (GFile                      *file,
623                                                            GCancellable               *cancellable,
624                                                            GError                    **error);
625 GLIB_AVAILABLE_IN_ALL
626 void                    g_file_read_async                 (GFile                      *file,
627                                                            int                         io_priority,
628                                                            GCancellable               *cancellable,
629                                                            GAsyncReadyCallback         callback,
630                                                            gpointer                    user_data);
631 GLIB_AVAILABLE_IN_ALL
632 GFileInputStream *      g_file_read_finish                (GFile                      *file,
633                                                            GAsyncResult               *res,
634                                                            GError                    **error);
635 GLIB_AVAILABLE_IN_ALL
636 GFileOutputStream *     g_file_append_to                  (GFile                      *file,
637                                                            GFileCreateFlags             flags,
638                                                            GCancellable               *cancellable,
639                                                            GError                    **error);
640 GLIB_AVAILABLE_IN_ALL
641 GFileOutputStream *     g_file_create                     (GFile                      *file,
642                                                            GFileCreateFlags             flags,
643                                                            GCancellable               *cancellable,
644                                                            GError                    **error);
645 GLIB_AVAILABLE_IN_ALL
646 GFileOutputStream *     g_file_replace                    (GFile                      *file,
647                                                            const char                 *etag,
648                                                            gboolean                    make_backup,
649                                                            GFileCreateFlags            flags,
650                                                            GCancellable               *cancellable,
651                                                            GError                    **error);
652 GLIB_AVAILABLE_IN_ALL
653 void                    g_file_append_to_async            (GFile                      *file,
654                                                            GFileCreateFlags            flags,
655                                                            int                         io_priority,
656                                                            GCancellable               *cancellable,
657                                                            GAsyncReadyCallback         callback,
658                                                            gpointer                    user_data);
659 GLIB_AVAILABLE_IN_ALL
660 GFileOutputStream *     g_file_append_to_finish           (GFile                      *file,
661                                                            GAsyncResult               *res,
662                                                            GError                    **error);
663 GLIB_AVAILABLE_IN_ALL
664 void                    g_file_create_async               (GFile                      *file,
665                                                            GFileCreateFlags            flags,
666                                                            int                         io_priority,
667                                                            GCancellable               *cancellable,
668                                                            GAsyncReadyCallback         callback,
669                                                            gpointer                    user_data);
670 GLIB_AVAILABLE_IN_ALL
671 GFileOutputStream *     g_file_create_finish              (GFile                      *file,
672                                                            GAsyncResult               *res,
673                                                            GError                    **error);
674 GLIB_AVAILABLE_IN_ALL
675 void                    g_file_replace_async              (GFile                      *file,
676                                                            const char                 *etag,
677                                                            gboolean                    make_backup,
678                                                            GFileCreateFlags            flags,
679                                                            int                         io_priority,
680                                                            GCancellable               *cancellable,
681                                                            GAsyncReadyCallback         callback,
682                                                            gpointer                    user_data);
683 GLIB_AVAILABLE_IN_ALL
684 GFileOutputStream *     g_file_replace_finish             (GFile                      *file,
685                                                            GAsyncResult               *res,
686                                                            GError                    **error);
687 GLIB_AVAILABLE_IN_ALL
688 GFileIOStream *         g_file_open_readwrite             (GFile                      *file,
689                                                            GCancellable               *cancellable,
690                                                            GError                    **error);
691 GLIB_AVAILABLE_IN_ALL
692 void                    g_file_open_readwrite_async       (GFile                      *file,
693                                                            int                         io_priority,
694                                                            GCancellable               *cancellable,
695                                                            GAsyncReadyCallback         callback,
696                                                            gpointer                    user_data);
697 GLIB_AVAILABLE_IN_ALL
698 GFileIOStream *         g_file_open_readwrite_finish      (GFile                      *file,
699                                                            GAsyncResult               *res,
700                                                            GError                    **error);
701 GLIB_AVAILABLE_IN_ALL
702 GFileIOStream *         g_file_create_readwrite           (GFile                      *file,
703                                                            GFileCreateFlags            flags,
704                                                            GCancellable               *cancellable,
705                                                            GError                    **error);
706 GLIB_AVAILABLE_IN_ALL
707 void                    g_file_create_readwrite_async     (GFile                      *file,
708                                                            GFileCreateFlags            flags,
709                                                            int                         io_priority,
710                                                            GCancellable               *cancellable,
711                                                            GAsyncReadyCallback         callback,
712                                                            gpointer                    user_data);
713 GLIB_AVAILABLE_IN_ALL
714 GFileIOStream *         g_file_create_readwrite_finish    (GFile                      *file,
715                                                            GAsyncResult               *res,
716                                                            GError                    **error);
717 GLIB_AVAILABLE_IN_ALL
718 GFileIOStream *         g_file_replace_readwrite          (GFile                      *file,
719                                                            const char                 *etag,
720                                                            gboolean                    make_backup,
721                                                            GFileCreateFlags            flags,
722                                                            GCancellable               *cancellable,
723                                                            GError                    **error);
724 GLIB_AVAILABLE_IN_ALL
725 void                    g_file_replace_readwrite_async    (GFile                      *file,
726                                                            const char                 *etag,
727                                                            gboolean                    make_backup,
728                                                            GFileCreateFlags            flags,
729                                                            int                         io_priority,
730                                                            GCancellable               *cancellable,
731                                                            GAsyncReadyCallback         callback,
732                                                            gpointer                    user_data);
733 GLIB_AVAILABLE_IN_ALL
734 GFileIOStream *         g_file_replace_readwrite_finish   (GFile                      *file,
735                                                            GAsyncResult               *res,
736                                                            GError                    **error);
737 GLIB_AVAILABLE_IN_ALL
738 gboolean                g_file_query_exists               (GFile                      *file,
739                                                            GCancellable               *cancellable);
740 GLIB_AVAILABLE_IN_ALL
741 GFileType               g_file_query_file_type            (GFile                      *file,
742                                                            GFileQueryInfoFlags         flags,
743                                                            GCancellable               *cancellable);
744 GLIB_AVAILABLE_IN_ALL
745 GFileInfo *             g_file_query_info                 (GFile                      *file,
746                                                            const char                 *attributes,
747                                                            GFileQueryInfoFlags         flags,
748                                                            GCancellable               *cancellable,
749                                                            GError                    **error);
750 GLIB_AVAILABLE_IN_ALL
751 void                    g_file_query_info_async           (GFile                      *file,
752                                                            const char                 *attributes,
753                                                            GFileQueryInfoFlags         flags,
754                                                            int                         io_priority,
755                                                            GCancellable               *cancellable,
756                                                            GAsyncReadyCallback         callback,
757                                                            gpointer                    user_data);
758 GLIB_AVAILABLE_IN_ALL
759 GFileInfo *             g_file_query_info_finish          (GFile                      *file,
760                                                            GAsyncResult               *res,
761                                                            GError                    **error);
762 GLIB_AVAILABLE_IN_ALL
763 GFileInfo *             g_file_query_filesystem_info      (GFile                      *file,
764                                                            const char                 *attributes,
765                                                            GCancellable               *cancellable,
766                                                            GError                    **error);
767 GLIB_AVAILABLE_IN_ALL
768 void                    g_file_query_filesystem_info_async (GFile                      *file,
769                                                            const char                 *attributes,
770                                                            int                         io_priority,
771                                                            GCancellable               *cancellable,
772                                                            GAsyncReadyCallback         callback,
773                                                            gpointer                    user_data);
774 GLIB_AVAILABLE_IN_ALL
775 GFileInfo *             g_file_query_filesystem_info_finish (GFile                      *file,
776                                                            GAsyncResult               *res,
777                                                            GError                    **error);
778 GLIB_AVAILABLE_IN_ALL
779 GMount *                g_file_find_enclosing_mount       (GFile                      *file,
780                                                            GCancellable               *cancellable,
781                                                            GError                    **error);
782 GLIB_AVAILABLE_IN_ALL
783 void                    g_file_find_enclosing_mount_async (GFile                      *file,
784                                                            int                         io_priority,
785                                                            GCancellable               *cancellable,
786                                                            GAsyncReadyCallback         callback,
787                                                            gpointer                    user_data);
788 GLIB_AVAILABLE_IN_ALL
789 GMount *                g_file_find_enclosing_mount_finish (GFile                     *file,
790                                                             GAsyncResult              *res,
791                                                             GError                   **error);
792 GLIB_AVAILABLE_IN_ALL
793 GFileEnumerator *       g_file_enumerate_children         (GFile                      *file,
794                                                            const char                 *attributes,
795                                                            GFileQueryInfoFlags         flags,
796                                                            GCancellable               *cancellable,
797                                                            GError                    **error);
798 GLIB_AVAILABLE_IN_ALL
799 void                    g_file_enumerate_children_async   (GFile                      *file,
800                                                            const char                 *attributes,
801                                                            GFileQueryInfoFlags         flags,
802                                                            int                         io_priority,
803                                                            GCancellable               *cancellable,
804                                                            GAsyncReadyCallback         callback,
805                                                            gpointer                    user_data);
806 GLIB_AVAILABLE_IN_ALL
807 GFileEnumerator *       g_file_enumerate_children_finish  (GFile                      *file,
808                                                            GAsyncResult               *res,
809                                                            GError                    **error);
810 GLIB_AVAILABLE_IN_ALL
811 GFile *                 g_file_set_display_name           (GFile                      *file,
812                                                            const char                 *display_name,
813                                                            GCancellable               *cancellable,
814                                                            GError                    **error);
815 GLIB_AVAILABLE_IN_ALL
816 void                    g_file_set_display_name_async     (GFile                      *file,
817                                                            const char                 *display_name,
818                                                            int                         io_priority,
819                                                            GCancellable               *cancellable,
820                                                            GAsyncReadyCallback         callback,
821                                                            gpointer                    user_data);
822 GLIB_AVAILABLE_IN_ALL
823 GFile *                 g_file_set_display_name_finish    (GFile                      *file,
824                                                            GAsyncResult               *res,
825                                                            GError                    **error);
826 GLIB_AVAILABLE_IN_ALL
827 gboolean                g_file_delete                     (GFile                      *file,
828                                                            GCancellable               *cancellable,
829                                                            GError                    **error);
830
831 GLIB_AVAILABLE_IN_2_34
832 void                    g_file_delete_async               (GFile                      *file,
833                                                            int                         io_priority,
834                                                            GCancellable               *cancellable,
835                                                            GAsyncReadyCallback         callback,
836                                                            gpointer                    user_data);
837
838 GLIB_AVAILABLE_IN_2_34
839 gboolean                g_file_delete_finish              (GFile                      *file,
840                                                            GAsyncResult               *result,
841                                                            GError                    **error);
842
843 GLIB_AVAILABLE_IN_ALL
844 gboolean                g_file_trash                      (GFile                      *file,
845                                                            GCancellable               *cancellable,
846                                                            GError                    **error);
847
848 GLIB_AVAILABLE_IN_2_38
849 void                    g_file_trash_async                (GFile                      *file,
850                                                            int                         io_priority,
851                                                            GCancellable               *cancellable,
852                                                            GAsyncReadyCallback         callback,
853                                                            gpointer                    user_data);
854
855 GLIB_AVAILABLE_IN_2_38
856 gboolean                g_file_trash_finish               (GFile                      *file,
857                                                            GAsyncResult               *result,
858                                                            GError                    **error);
859
860 GLIB_AVAILABLE_IN_ALL
861 gboolean                g_file_copy                       (GFile                      *source,
862                                                            GFile                      *destination,
863                                                            GFileCopyFlags              flags,
864                                                            GCancellable               *cancellable,
865                                                            GFileProgressCallback       progress_callback,
866                                                            gpointer                    progress_callback_data,
867                                                            GError                    **error);
868 GLIB_AVAILABLE_IN_ALL
869 void                    g_file_copy_async                 (GFile                      *source,
870                                                            GFile                      *destination,
871                                                            GFileCopyFlags              flags,
872                                                            int                         io_priority,
873                                                            GCancellable               *cancellable,
874                                                            GFileProgressCallback       progress_callback,
875                                                            gpointer                    progress_callback_data,
876                                                            GAsyncReadyCallback         callback,
877                                                            gpointer                    user_data);
878 GLIB_AVAILABLE_IN_ALL
879 gboolean                g_file_copy_finish                (GFile                      *file,
880                                                            GAsyncResult               *res,
881                                                            GError                    **error);
882 GLIB_AVAILABLE_IN_ALL
883 gboolean                g_file_move                       (GFile                      *source,
884                                                            GFile                      *destination,
885                                                            GFileCopyFlags              flags,
886                                                            GCancellable               *cancellable,
887                                                            GFileProgressCallback       progress_callback,
888                                                            gpointer                    progress_callback_data,
889                                                            GError                    **error);
890 GLIB_AVAILABLE_IN_ALL
891 gboolean                g_file_make_directory             (GFile                      *file,
892                                                            GCancellable               *cancellable,
893                                                            GError                    **error);
894 GLIB_AVAILABLE_IN_ALL
895 gboolean                g_file_make_directory_with_parents (GFile                     *file,
896                                                            GCancellable               *cancellable,
897                                                            GError                    **error);
898 GLIB_AVAILABLE_IN_ALL
899 gboolean                g_file_make_symbolic_link         (GFile                      *file,
900                                                            const char                 *symlink_value,
901                                                            GCancellable               *cancellable,
902                                                            GError                    **error);
903 GLIB_AVAILABLE_IN_ALL
904 GFileAttributeInfoList *g_file_query_settable_attributes  (GFile                      *file,
905                                                            GCancellable               *cancellable,
906                                                            GError                    **error);
907 GLIB_AVAILABLE_IN_ALL
908 GFileAttributeInfoList *g_file_query_writable_namespaces  (GFile                      *file,
909                                                            GCancellable               *cancellable,
910                                                            GError                    **error);
911 GLIB_AVAILABLE_IN_ALL
912 gboolean                g_file_set_attribute              (GFile                      *file,
913                                                            const char                 *attribute,
914                                                            GFileAttributeType          type,
915                                                            gpointer                    value_p,
916                                                            GFileQueryInfoFlags         flags,
917                                                            GCancellable               *cancellable,
918                                                            GError                    **error);
919 GLIB_AVAILABLE_IN_ALL
920 gboolean                g_file_set_attributes_from_info   (GFile                      *file,
921                                                            GFileInfo                  *info,
922                                                            GFileQueryInfoFlags         flags,
923                                                            GCancellable               *cancellable,
924                                                            GError                    **error);
925 GLIB_AVAILABLE_IN_ALL
926 void                    g_file_set_attributes_async       (GFile                      *file,
927                                                            GFileInfo                  *info,
928                                                            GFileQueryInfoFlags         flags,
929                                                            int                         io_priority,
930                                                            GCancellable               *cancellable,
931                                                            GAsyncReadyCallback         callback,
932                                                            gpointer                    user_data);
933 GLIB_AVAILABLE_IN_ALL
934 gboolean                g_file_set_attributes_finish      (GFile                      *file,
935                                                            GAsyncResult               *result,
936                                                            GFileInfo                 **info,
937                                                            GError                    **error);
938 GLIB_AVAILABLE_IN_ALL
939 gboolean                g_file_set_attribute_string       (GFile                      *file,
940                                                            const char                 *attribute,
941                                                            const char                 *value,
942                                                            GFileQueryInfoFlags         flags,
943                                                            GCancellable               *cancellable,
944                                                            GError                    **error);
945 GLIB_AVAILABLE_IN_ALL
946 gboolean                g_file_set_attribute_byte_string  (GFile                      *file,
947                                                            const char                 *attribute,
948                                                            const char                 *value,
949                                                            GFileQueryInfoFlags         flags,
950                                                            GCancellable               *cancellable,
951                                                            GError                    **error);
952 GLIB_AVAILABLE_IN_ALL
953 gboolean                g_file_set_attribute_uint32       (GFile                      *file,
954                                                            const char                 *attribute,
955                                                            guint32                     value,
956                                                            GFileQueryInfoFlags         flags,
957                                                            GCancellable               *cancellable,
958                                                            GError                    **error);
959 GLIB_AVAILABLE_IN_ALL
960 gboolean                g_file_set_attribute_int32        (GFile                      *file,
961                                                            const char                 *attribute,
962                                                            gint32                      value,
963                                                            GFileQueryInfoFlags         flags,
964                                                            GCancellable               *cancellable,
965                                                            GError                    **error);
966 GLIB_AVAILABLE_IN_ALL
967 gboolean                g_file_set_attribute_uint64       (GFile                      *file,
968                                                            const char                 *attribute,
969                                                            guint64                     value,
970                                                            GFileQueryInfoFlags         flags,
971                                                            GCancellable               *cancellable,
972                                                            GError                    **error);
973 GLIB_AVAILABLE_IN_ALL
974 gboolean                g_file_set_attribute_int64        (GFile                      *file,
975                                                            const char                 *attribute,
976                                                            gint64                      value,
977                                                            GFileQueryInfoFlags         flags,
978                                                            GCancellable               *cancellable,
979                                                            GError                    **error);
980 GLIB_AVAILABLE_IN_ALL
981 void                    g_file_mount_enclosing_volume     (GFile                      *location,
982                                                            GMountMountFlags            flags,
983                                                            GMountOperation            *mount_operation,
984                                                            GCancellable               *cancellable,
985                                                            GAsyncReadyCallback         callback,
986                                                            gpointer                    user_data);
987 GLIB_AVAILABLE_IN_ALL
988 gboolean                g_file_mount_enclosing_volume_finish (GFile                      *location,
989                                                            GAsyncResult               *result,
990                                                            GError                    **error);
991 GLIB_AVAILABLE_IN_ALL
992 void                    g_file_mount_mountable            (GFile                      *file,
993                                                            GMountMountFlags            flags,
994                                                            GMountOperation            *mount_operation,
995                                                            GCancellable               *cancellable,
996                                                            GAsyncReadyCallback         callback,
997                                                            gpointer                    user_data);
998 GLIB_AVAILABLE_IN_ALL
999 GFile *                 g_file_mount_mountable_finish     (GFile                      *file,
1000                                                            GAsyncResult               *result,
1001                                                            GError                    **error);
1002 GLIB_DEPRECATED_FOR(g_file_unmount_mountable_with_operation)
1003 void                    g_file_unmount_mountable          (GFile                      *file,
1004                                                            GMountUnmountFlags          flags,
1005                                                            GCancellable               *cancellable,
1006                                                            GAsyncReadyCallback         callback,
1007                                                            gpointer                    user_data);
1008
1009 GLIB_DEPRECATED_FOR(g_file_unmount_mountable_with_operation_finish)
1010 gboolean                g_file_unmount_mountable_finish   (GFile                      *file,
1011                                                            GAsyncResult               *result,
1012                                                            GError                    **error);
1013 GLIB_AVAILABLE_IN_ALL
1014 void                    g_file_unmount_mountable_with_operation (GFile                *file,
1015                                                            GMountUnmountFlags          flags,
1016                                                            GMountOperation            *mount_operation,
1017                                                            GCancellable               *cancellable,
1018                                                            GAsyncReadyCallback         callback,
1019                                                            gpointer                    user_data);
1020 GLIB_AVAILABLE_IN_ALL
1021 gboolean                g_file_unmount_mountable_with_operation_finish (GFile         *file,
1022                                                            GAsyncResult               *result,
1023                                                            GError                    **error);
1024 GLIB_DEPRECATED_FOR(g_file_eject_mountable_with_operation)
1025 void                    g_file_eject_mountable            (GFile                      *file,
1026                                                            GMountUnmountFlags          flags,
1027                                                            GCancellable               *cancellable,
1028                                                            GAsyncReadyCallback         callback,
1029                                                            gpointer                    user_data);
1030
1031 GLIB_DEPRECATED_FOR(g_file_eject_mountable_with_operation_finish)
1032 gboolean                g_file_eject_mountable_finish     (GFile                      *file,
1033                                                            GAsyncResult               *result,
1034                                                            GError                    **error);
1035 GLIB_AVAILABLE_IN_ALL
1036 void                    g_file_eject_mountable_with_operation (GFile                  *file,
1037                                                            GMountUnmountFlags          flags,
1038                                                            GMountOperation            *mount_operation,
1039                                                            GCancellable               *cancellable,
1040                                                            GAsyncReadyCallback         callback,
1041                                                            gpointer                    user_data);
1042 GLIB_AVAILABLE_IN_ALL
1043 gboolean                g_file_eject_mountable_with_operation_finish (GFile           *file,
1044                                                            GAsyncResult               *result,
1045                                                            GError                    **error);
1046
1047 GLIB_AVAILABLE_IN_ALL
1048 gboolean                g_file_copy_attributes            (GFile                      *source,
1049                                                            GFile                      *destination,
1050                                                            GFileCopyFlags              flags,
1051                                                            GCancellable               *cancellable,
1052                                                            GError                    **error);
1053
1054
1055 GLIB_AVAILABLE_IN_ALL
1056 GFileMonitor*           g_file_monitor_directory          (GFile                  *file,
1057                                                            GFileMonitorFlags       flags,
1058                                                            GCancellable           *cancellable,
1059                                                            GError                **error);
1060 GLIB_AVAILABLE_IN_ALL
1061 GFileMonitor*           g_file_monitor_file               (GFile                  *file,
1062                                                            GFileMonitorFlags       flags,
1063                                                            GCancellable           *cancellable,
1064                                                            GError                **error);
1065 GLIB_AVAILABLE_IN_ALL
1066 GFileMonitor*           g_file_monitor                    (GFile                  *file,
1067                                                            GFileMonitorFlags       flags,
1068                                                            GCancellable           *cancellable,
1069                                                            GError                **error);
1070
1071 GLIB_AVAILABLE_IN_ALL
1072 void                    g_file_start_mountable            (GFile                      *file,
1073                                                            GDriveStartFlags            flags,
1074                                                            GMountOperation            *start_operation,
1075                                                            GCancellable               *cancellable,
1076                                                            GAsyncReadyCallback         callback,
1077                                                            gpointer                    user_data);
1078 GLIB_AVAILABLE_IN_ALL
1079 gboolean                g_file_start_mountable_finish     (GFile                      *file,
1080                                                            GAsyncResult               *result,
1081                                                            GError                    **error);
1082 GLIB_AVAILABLE_IN_ALL
1083 void                    g_file_stop_mountable             (GFile                      *file,
1084                                                            GMountUnmountFlags          flags,
1085                                                            GMountOperation            *mount_operation,
1086                                                            GCancellable               *cancellable,
1087                                                            GAsyncReadyCallback         callback,
1088                                                            gpointer                    user_data);
1089 GLIB_AVAILABLE_IN_ALL
1090 gboolean                g_file_stop_mountable_finish      (GFile                      *file,
1091                                                            GAsyncResult               *result,
1092                                                            GError                    **error);
1093
1094 GLIB_AVAILABLE_IN_ALL
1095 void                    g_file_poll_mountable             (GFile                      *file,
1096                                                            GCancellable               *cancellable,
1097                                                            GAsyncReadyCallback         callback,
1098                                                            gpointer                    user_data);
1099 GLIB_AVAILABLE_IN_ALL
1100 gboolean                g_file_poll_mountable_finish      (GFile                      *file,
1101                                                            GAsyncResult               *result,
1102                                                            GError                    **error);
1103
1104 /* Utilities */
1105
1106 GLIB_AVAILABLE_IN_ALL
1107 GAppInfo *g_file_query_default_handler       (GFile                  *file,
1108                                               GCancellable           *cancellable,
1109                                               GError                **error);
1110 GLIB_AVAILABLE_IN_ALL
1111 gboolean g_file_load_contents                (GFile                  *file,
1112                                               GCancellable           *cancellable,
1113                                               char                  **contents,
1114                                               gsize                  *length,
1115                                               char                  **etag_out,
1116                                               GError                **error);
1117 GLIB_AVAILABLE_IN_ALL
1118 void     g_file_load_contents_async          (GFile                  *file,
1119                                               GCancellable           *cancellable,
1120                                               GAsyncReadyCallback     callback,
1121                                               gpointer                user_data);
1122 GLIB_AVAILABLE_IN_ALL
1123 gboolean g_file_load_contents_finish         (GFile                  *file,
1124                                               GAsyncResult           *res,
1125                                               char                  **contents,
1126                                               gsize                  *length,
1127                                               char                  **etag_out,
1128                                               GError                **error);
1129 GLIB_AVAILABLE_IN_ALL
1130 void     g_file_load_partial_contents_async  (GFile                  *file,
1131                                               GCancellable           *cancellable,
1132                                               GFileReadMoreCallback   read_more_callback,
1133                                               GAsyncReadyCallback     callback,
1134                                               gpointer                user_data);
1135 GLIB_AVAILABLE_IN_ALL
1136 gboolean g_file_load_partial_contents_finish (GFile                  *file,
1137                                               GAsyncResult           *res,
1138                                               char                  **contents,
1139                                               gsize                  *length,
1140                                               char                  **etag_out,
1141                                               GError                **error);
1142 GLIB_AVAILABLE_IN_ALL
1143 gboolean g_file_replace_contents             (GFile                  *file,
1144                                               const char             *contents,
1145                                               gsize                   length,
1146                                               const char             *etag,
1147                                               gboolean                make_backup,
1148                                               GFileCreateFlags        flags,
1149                                               char                  **new_etag,
1150                                               GCancellable           *cancellable,
1151                                               GError                **error);
1152 GLIB_AVAILABLE_IN_ALL
1153 void     g_file_replace_contents_async       (GFile                  *file,
1154                                               const char             *contents,
1155                                               gsize                   length,
1156                                               const char             *etag,
1157                                               gboolean                make_backup,
1158                                               GFileCreateFlags        flags,
1159                                               GCancellable           *cancellable,
1160                                               GAsyncReadyCallback     callback,
1161                                               gpointer                user_data);
1162 GLIB_AVAILABLE_IN_ALL
1163 gboolean g_file_replace_contents_finish      (GFile                  *file,
1164                                               GAsyncResult           *res,
1165                                               char                  **new_etag,
1166                                               GError                **error);
1167
1168 GLIB_AVAILABLE_IN_ALL
1169 gboolean g_file_supports_thread_contexts     (GFile                  *file);
1170
1171 G_END_DECLS
1172
1173 #endif /* __G_FILE_H__ */