Add async version of g_file_make_directory()
[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)        (GFile                *file,
381                                                        int                   io_priority,
382                                                        GCancellable         *cancellable,
383                                                        GAsyncReadyCallback   callback,
384                                                        gpointer              user_data);
385   gboolean            (* make_directory_finish)       (GFile                *file,
386                                                        GAsyncResult         *result,
387                                                        GError              **error);
388
389   gboolean            (* make_symbolic_link)          (GFile                *file,
390                                                        const char           *symlink_value,
391                                                        GCancellable         *cancellable,
392                                                        GError              **error);
393   void                (* _make_symbolic_link_async)   (void);
394   void                (* _make_symbolic_link_finish)  (void);
395
396   gboolean            (* copy)                        (GFile                *source,
397                                                        GFile                *destination,
398                                                        GFileCopyFlags        flags,
399                                                        GCancellable         *cancellable,
400                                                        GFileProgressCallback progress_callback,
401                                                        gpointer              progress_callback_data,
402                                                        GError              **error);
403   void                (* copy_async)                  (GFile                *source,
404                                                        GFile                *destination,
405                                                        GFileCopyFlags        flags,
406                                                        int                   io_priority,
407                                                        GCancellable         *cancellable,
408                                                        GFileProgressCallback progress_callback,
409                                                        gpointer              progress_callback_data,
410                                                        GAsyncReadyCallback   callback,
411                                                        gpointer              user_data);
412   gboolean            (* copy_finish)                 (GFile                *file,
413                                                        GAsyncResult         *res,
414                                                        GError              **error);
415
416   gboolean            (* move)                        (GFile                *source,
417                                                        GFile                *destination,
418                                                        GFileCopyFlags        flags,
419                                                        GCancellable         *cancellable,
420                                                        GFileProgressCallback progress_callback,
421                                                        gpointer              progress_callback_data,
422                                                        GError              **error);
423   void                (* _move_async)                 (void);
424   void                (* _move_finish)                (void);
425
426   void                (* mount_mountable)             (GFile                *file,
427                                                        GMountMountFlags      flags,
428                                                        GMountOperation      *mount_operation,
429                                                        GCancellable         *cancellable,
430                                                        GAsyncReadyCallback   callback,
431                                                        gpointer              user_data);
432   GFile *             (* mount_mountable_finish)      (GFile                *file,
433                                                        GAsyncResult         *result,
434                                                        GError              **error);
435
436   void                (* unmount_mountable)           (GFile                *file,
437                                                        GMountUnmountFlags    flags,
438                                                        GCancellable         *cancellable,
439                                                        GAsyncReadyCallback   callback,
440                                                        gpointer              user_data);
441   gboolean            (* unmount_mountable_finish)    (GFile                *file,
442                                                        GAsyncResult         *result,
443                                                        GError              **error);
444
445   void                (* eject_mountable)             (GFile                *file,
446                                                        GMountUnmountFlags    flags,
447                                                        GCancellable         *cancellable,
448                                                        GAsyncReadyCallback   callback,
449                                                        gpointer              user_data);
450   gboolean            (* eject_mountable_finish)      (GFile                *file,
451                                                        GAsyncResult         *result,
452                                                        GError              **error);
453
454   void                (* mount_enclosing_volume)      (GFile                *location,
455                                                        GMountMountFlags      flags,
456                                                        GMountOperation      *mount_operation,
457                                                        GCancellable         *cancellable,
458                                                        GAsyncReadyCallback   callback,
459                                                        gpointer              user_data);
460   gboolean         (* mount_enclosing_volume_finish)  (GFile                *location,
461                                                        GAsyncResult         *result,
462                                                        GError              **error);
463
464   GFileMonitor *      (* monitor_dir)                 (GFile                *file,
465                                                        GFileMonitorFlags     flags,
466                                                        GCancellable         *cancellable,
467                                                        GError              **error);
468   GFileMonitor *      (* monitor_file)                (GFile                *file,
469                                                        GFileMonitorFlags     flags,
470                                                        GCancellable         *cancellable,
471                                                        GError              **error);
472
473   GFileIOStream *     (* open_readwrite)              (GFile                *file,
474                                                        GCancellable         *cancellable,
475                                                        GError              **error);
476   void                (* open_readwrite_async)        (GFile                *file,
477                                                        int                   io_priority,
478                                                        GCancellable         *cancellable,
479                                                        GAsyncReadyCallback   callback,
480                                                        gpointer              user_data);
481   GFileIOStream *     (* open_readwrite_finish)       (GFile                *file,
482                                                        GAsyncResult         *res,
483                                                        GError              **error);
484   GFileIOStream *     (* create_readwrite)            (GFile                *file,
485                                                        GFileCreateFlags      flags,
486                                                        GCancellable         *cancellable,
487                                                        GError              **error);
488   void                (* create_readwrite_async)      (GFile                *file,
489                                                        GFileCreateFlags      flags,
490                                                        int                   io_priority,
491                                                        GCancellable         *cancellable,
492                                                        GAsyncReadyCallback   callback,
493                                                        gpointer              user_data);
494   GFileIOStream *     (* create_readwrite_finish)      (GFile                *file,
495                                                        GAsyncResult         *res,
496                                                        GError              **error);
497   GFileIOStream *     (* replace_readwrite)           (GFile                *file,
498                                                        const char           *etag,
499                                                        gboolean              make_backup,
500                                                        GFileCreateFlags      flags,
501                                                        GCancellable         *cancellable,
502                                                        GError              **error);
503   void                (* replace_readwrite_async)     (GFile                *file,
504                                                        const char           *etag,
505                                                        gboolean              make_backup,
506                                                        GFileCreateFlags      flags,
507                                                        int                   io_priority,
508                                                        GCancellable         *cancellable,
509                                                        GAsyncReadyCallback   callback,
510                                                        gpointer              user_data);
511   GFileIOStream *     (* replace_readwrite_finish)    (GFile                *file,
512                                                        GAsyncResult         *res,
513                                                        GError              **error);
514
515   void                (* start_mountable)             (GFile                *file,
516                                                        GDriveStartFlags      flags,
517                                                        GMountOperation      *start_operation,
518                                                        GCancellable         *cancellable,
519                                                        GAsyncReadyCallback   callback,
520                                                        gpointer              user_data);
521   gboolean            (* start_mountable_finish)      (GFile                *file,
522                                                        GAsyncResult         *result,
523                                                        GError              **error);
524
525   void                (* stop_mountable)              (GFile                *file,
526                                                        GMountUnmountFlags    flags,
527                                                        GMountOperation      *mount_operation,
528                                                        GCancellable         *cancellable,
529                                                        GAsyncReadyCallback   callback,
530                                                        gpointer              user_data);
531   gboolean            (* stop_mountable_finish)       (GFile                *file,
532                                                        GAsyncResult         *result,
533                                                        GError              **error);
534
535   gboolean            supports_thread_contexts;
536
537   void                (* unmount_mountable_with_operation) (GFile           *file,
538                                                        GMountUnmountFlags    flags,
539                                                        GMountOperation      *mount_operation,
540                                                        GCancellable         *cancellable,
541                                                        GAsyncReadyCallback   callback,
542                                                        gpointer              user_data);
543   gboolean            (* unmount_mountable_with_operation_finish) (GFile    *file,
544                                                        GAsyncResult         *result,
545                                                        GError              **error);
546
547   void                (* eject_mountable_with_operation) (GFile             *file,
548                                                        GMountUnmountFlags    flags,
549                                                        GMountOperation      *mount_operation,
550                                                        GCancellable         *cancellable,
551                                                        GAsyncReadyCallback   callback,
552                                                        gpointer              user_data);
553   gboolean            (* eject_mountable_with_operation_finish) (GFile      *file,
554                                                        GAsyncResult         *result,
555                                                        GError              **error);
556
557   void                (* poll_mountable)              (GFile                *file,
558                                                        GCancellable         *cancellable,
559                                                        GAsyncReadyCallback   callback,
560                                                        gpointer              user_data);
561   gboolean            (* poll_mountable_finish)       (GFile                *file,
562                                                        GAsyncResult         *result,
563                                                        GError              **error);
564 };
565
566 GLIB_AVAILABLE_IN_ALL
567 GType                   g_file_get_type                   (void) G_GNUC_CONST;
568
569 GLIB_AVAILABLE_IN_ALL
570 GFile *                 g_file_new_for_path               (const char                 *path);
571 GLIB_AVAILABLE_IN_ALL
572 GFile *                 g_file_new_for_uri                (const char                 *uri);
573 GLIB_AVAILABLE_IN_ALL
574 GFile *                 g_file_new_for_commandline_arg    (const char                 *arg);
575 GLIB_AVAILABLE_IN_2_36
576 GFile *                 g_file_new_for_commandline_arg_and_cwd (const gchar           *arg,
577                                                                 const gchar           *cwd);
578 GLIB_AVAILABLE_IN_2_32
579 GFile *                 g_file_new_tmp                    (const char                 *tmpl,
580                                                            GFileIOStream             **iostream,
581                                                            GError                    **error);
582 GLIB_AVAILABLE_IN_ALL
583 GFile *                 g_file_parse_name                 (const char                 *parse_name);
584 GLIB_AVAILABLE_IN_ALL
585 GFile *                 g_file_dup                        (GFile                      *file);
586 GLIB_AVAILABLE_IN_ALL
587 guint                   g_file_hash                       (gconstpointer               file);
588 GLIB_AVAILABLE_IN_ALL
589 gboolean                g_file_equal                      (GFile                      *file1,
590                                                            GFile                      *file2);
591 GLIB_AVAILABLE_IN_ALL
592 char *                  g_file_get_basename               (GFile                      *file);
593 GLIB_AVAILABLE_IN_ALL
594 char *                  g_file_get_path                   (GFile                      *file);
595 GLIB_AVAILABLE_IN_ALL
596 char *                  g_file_get_uri                    (GFile                      *file);
597 GLIB_AVAILABLE_IN_ALL
598 char *                  g_file_get_parse_name             (GFile                      *file);
599 GLIB_AVAILABLE_IN_ALL
600 GFile *                 g_file_get_parent                 (GFile                      *file);
601 GLIB_AVAILABLE_IN_ALL
602 gboolean                g_file_has_parent                 (GFile                      *file,
603                                                            GFile                      *parent);
604 GLIB_AVAILABLE_IN_ALL
605 GFile *                 g_file_get_child                  (GFile                      *file,
606                                                            const char                 *name);
607 GLIB_AVAILABLE_IN_ALL
608 GFile *                 g_file_get_child_for_display_name (GFile                      *file,
609                                                            const char                 *display_name,
610                                                            GError                    **error);
611 GLIB_AVAILABLE_IN_ALL
612 gboolean                g_file_has_prefix                 (GFile                      *file,
613                                                            GFile                      *prefix);
614 GLIB_AVAILABLE_IN_ALL
615 char *                  g_file_get_relative_path          (GFile                      *parent,
616                                                            GFile                      *descendant);
617 GLIB_AVAILABLE_IN_ALL
618 GFile *                 g_file_resolve_relative_path      (GFile                      *file,
619                                                            const char                 *relative_path);
620 GLIB_AVAILABLE_IN_ALL
621 gboolean                g_file_is_native                  (GFile                      *file);
622 GLIB_AVAILABLE_IN_ALL
623 gboolean                g_file_has_uri_scheme             (GFile                      *file,
624                                                            const char                 *uri_scheme);
625 GLIB_AVAILABLE_IN_ALL
626 char *                  g_file_get_uri_scheme             (GFile                      *file);
627 GLIB_AVAILABLE_IN_ALL
628 GFileInputStream *      g_file_read                       (GFile                      *file,
629                                                            GCancellable               *cancellable,
630                                                            GError                    **error);
631 GLIB_AVAILABLE_IN_ALL
632 void                    g_file_read_async                 (GFile                      *file,
633                                                            int                         io_priority,
634                                                            GCancellable               *cancellable,
635                                                            GAsyncReadyCallback         callback,
636                                                            gpointer                    user_data);
637 GLIB_AVAILABLE_IN_ALL
638 GFileInputStream *      g_file_read_finish                (GFile                      *file,
639                                                            GAsyncResult               *res,
640                                                            GError                    **error);
641 GLIB_AVAILABLE_IN_ALL
642 GFileOutputStream *     g_file_append_to                  (GFile                      *file,
643                                                            GFileCreateFlags             flags,
644                                                            GCancellable               *cancellable,
645                                                            GError                    **error);
646 GLIB_AVAILABLE_IN_ALL
647 GFileOutputStream *     g_file_create                     (GFile                      *file,
648                                                            GFileCreateFlags             flags,
649                                                            GCancellable               *cancellable,
650                                                            GError                    **error);
651 GLIB_AVAILABLE_IN_ALL
652 GFileOutputStream *     g_file_replace                    (GFile                      *file,
653                                                            const char                 *etag,
654                                                            gboolean                    make_backup,
655                                                            GFileCreateFlags            flags,
656                                                            GCancellable               *cancellable,
657                                                            GError                    **error);
658 GLIB_AVAILABLE_IN_ALL
659 void                    g_file_append_to_async            (GFile                      *file,
660                                                            GFileCreateFlags            flags,
661                                                            int                         io_priority,
662                                                            GCancellable               *cancellable,
663                                                            GAsyncReadyCallback         callback,
664                                                            gpointer                    user_data);
665 GLIB_AVAILABLE_IN_ALL
666 GFileOutputStream *     g_file_append_to_finish           (GFile                      *file,
667                                                            GAsyncResult               *res,
668                                                            GError                    **error);
669 GLIB_AVAILABLE_IN_ALL
670 void                    g_file_create_async               (GFile                      *file,
671                                                            GFileCreateFlags            flags,
672                                                            int                         io_priority,
673                                                            GCancellable               *cancellable,
674                                                            GAsyncReadyCallback         callback,
675                                                            gpointer                    user_data);
676 GLIB_AVAILABLE_IN_ALL
677 GFileOutputStream *     g_file_create_finish              (GFile                      *file,
678                                                            GAsyncResult               *res,
679                                                            GError                    **error);
680 GLIB_AVAILABLE_IN_ALL
681 void                    g_file_replace_async              (GFile                      *file,
682                                                            const char                 *etag,
683                                                            gboolean                    make_backup,
684                                                            GFileCreateFlags            flags,
685                                                            int                         io_priority,
686                                                            GCancellable               *cancellable,
687                                                            GAsyncReadyCallback         callback,
688                                                            gpointer                    user_data);
689 GLIB_AVAILABLE_IN_ALL
690 GFileOutputStream *     g_file_replace_finish             (GFile                      *file,
691                                                            GAsyncResult               *res,
692                                                            GError                    **error);
693 GLIB_AVAILABLE_IN_ALL
694 GFileIOStream *         g_file_open_readwrite             (GFile                      *file,
695                                                            GCancellable               *cancellable,
696                                                            GError                    **error);
697 GLIB_AVAILABLE_IN_ALL
698 void                    g_file_open_readwrite_async       (GFile                      *file,
699                                                            int                         io_priority,
700                                                            GCancellable               *cancellable,
701                                                            GAsyncReadyCallback         callback,
702                                                            gpointer                    user_data);
703 GLIB_AVAILABLE_IN_ALL
704 GFileIOStream *         g_file_open_readwrite_finish      (GFile                      *file,
705                                                            GAsyncResult               *res,
706                                                            GError                    **error);
707 GLIB_AVAILABLE_IN_ALL
708 GFileIOStream *         g_file_create_readwrite           (GFile                      *file,
709                                                            GFileCreateFlags            flags,
710                                                            GCancellable               *cancellable,
711                                                            GError                    **error);
712 GLIB_AVAILABLE_IN_ALL
713 void                    g_file_create_readwrite_async     (GFile                      *file,
714                                                            GFileCreateFlags            flags,
715                                                            int                         io_priority,
716                                                            GCancellable               *cancellable,
717                                                            GAsyncReadyCallback         callback,
718                                                            gpointer                    user_data);
719 GLIB_AVAILABLE_IN_ALL
720 GFileIOStream *         g_file_create_readwrite_finish    (GFile                      *file,
721                                                            GAsyncResult               *res,
722                                                            GError                    **error);
723 GLIB_AVAILABLE_IN_ALL
724 GFileIOStream *         g_file_replace_readwrite          (GFile                      *file,
725                                                            const char                 *etag,
726                                                            gboolean                    make_backup,
727                                                            GFileCreateFlags            flags,
728                                                            GCancellable               *cancellable,
729                                                            GError                    **error);
730 GLIB_AVAILABLE_IN_ALL
731 void                    g_file_replace_readwrite_async    (GFile                      *file,
732                                                            const char                 *etag,
733                                                            gboolean                    make_backup,
734                                                            GFileCreateFlags            flags,
735                                                            int                         io_priority,
736                                                            GCancellable               *cancellable,
737                                                            GAsyncReadyCallback         callback,
738                                                            gpointer                    user_data);
739 GLIB_AVAILABLE_IN_ALL
740 GFileIOStream *         g_file_replace_readwrite_finish   (GFile                      *file,
741                                                            GAsyncResult               *res,
742                                                            GError                    **error);
743 GLIB_AVAILABLE_IN_ALL
744 gboolean                g_file_query_exists               (GFile                      *file,
745                                                            GCancellable               *cancellable);
746 GLIB_AVAILABLE_IN_ALL
747 GFileType               g_file_query_file_type            (GFile                      *file,
748                                                            GFileQueryInfoFlags         flags,
749                                                            GCancellable               *cancellable);
750 GLIB_AVAILABLE_IN_ALL
751 GFileInfo *             g_file_query_info                 (GFile                      *file,
752                                                            const char                 *attributes,
753                                                            GFileQueryInfoFlags         flags,
754                                                            GCancellable               *cancellable,
755                                                            GError                    **error);
756 GLIB_AVAILABLE_IN_ALL
757 void                    g_file_query_info_async           (GFile                      *file,
758                                                            const char                 *attributes,
759                                                            GFileQueryInfoFlags         flags,
760                                                            int                         io_priority,
761                                                            GCancellable               *cancellable,
762                                                            GAsyncReadyCallback         callback,
763                                                            gpointer                    user_data);
764 GLIB_AVAILABLE_IN_ALL
765 GFileInfo *             g_file_query_info_finish          (GFile                      *file,
766                                                            GAsyncResult               *res,
767                                                            GError                    **error);
768 GLIB_AVAILABLE_IN_ALL
769 GFileInfo *             g_file_query_filesystem_info      (GFile                      *file,
770                                                            const char                 *attributes,
771                                                            GCancellable               *cancellable,
772                                                            GError                    **error);
773 GLIB_AVAILABLE_IN_ALL
774 void                    g_file_query_filesystem_info_async (GFile                      *file,
775                                                            const char                 *attributes,
776                                                            int                         io_priority,
777                                                            GCancellable               *cancellable,
778                                                            GAsyncReadyCallback         callback,
779                                                            gpointer                    user_data);
780 GLIB_AVAILABLE_IN_ALL
781 GFileInfo *             g_file_query_filesystem_info_finish (GFile                      *file,
782                                                            GAsyncResult               *res,
783                                                            GError                    **error);
784 GLIB_AVAILABLE_IN_ALL
785 GMount *                g_file_find_enclosing_mount       (GFile                      *file,
786                                                            GCancellable               *cancellable,
787                                                            GError                    **error);
788 GLIB_AVAILABLE_IN_ALL
789 void                    g_file_find_enclosing_mount_async (GFile                      *file,
790                                                            int                         io_priority,
791                                                            GCancellable               *cancellable,
792                                                            GAsyncReadyCallback         callback,
793                                                            gpointer                    user_data);
794 GLIB_AVAILABLE_IN_ALL
795 GMount *                g_file_find_enclosing_mount_finish (GFile                     *file,
796                                                             GAsyncResult              *res,
797                                                             GError                   **error);
798 GLIB_AVAILABLE_IN_ALL
799 GFileEnumerator *       g_file_enumerate_children         (GFile                      *file,
800                                                            const char                 *attributes,
801                                                            GFileQueryInfoFlags         flags,
802                                                            GCancellable               *cancellable,
803                                                            GError                    **error);
804 GLIB_AVAILABLE_IN_ALL
805 void                    g_file_enumerate_children_async   (GFile                      *file,
806                                                            const char                 *attributes,
807                                                            GFileQueryInfoFlags         flags,
808                                                            int                         io_priority,
809                                                            GCancellable               *cancellable,
810                                                            GAsyncReadyCallback         callback,
811                                                            gpointer                    user_data);
812 GLIB_AVAILABLE_IN_ALL
813 GFileEnumerator *       g_file_enumerate_children_finish  (GFile                      *file,
814                                                            GAsyncResult               *res,
815                                                            GError                    **error);
816 GLIB_AVAILABLE_IN_ALL
817 GFile *                 g_file_set_display_name           (GFile                      *file,
818                                                            const char                 *display_name,
819                                                            GCancellable               *cancellable,
820                                                            GError                    **error);
821 GLIB_AVAILABLE_IN_ALL
822 void                    g_file_set_display_name_async     (GFile                      *file,
823                                                            const char                 *display_name,
824                                                            int                         io_priority,
825                                                            GCancellable               *cancellable,
826                                                            GAsyncReadyCallback         callback,
827                                                            gpointer                    user_data);
828 GLIB_AVAILABLE_IN_ALL
829 GFile *                 g_file_set_display_name_finish    (GFile                      *file,
830                                                            GAsyncResult               *res,
831                                                            GError                    **error);
832 GLIB_AVAILABLE_IN_ALL
833 gboolean                g_file_delete                     (GFile                      *file,
834                                                            GCancellable               *cancellable,
835                                                            GError                    **error);
836
837 GLIB_AVAILABLE_IN_2_34
838 void                    g_file_delete_async               (GFile                      *file,
839                                                            int                         io_priority,
840                                                            GCancellable               *cancellable,
841                                                            GAsyncReadyCallback         callback,
842                                                            gpointer                    user_data);
843
844 GLIB_AVAILABLE_IN_2_34
845 gboolean                g_file_delete_finish              (GFile                      *file,
846                                                            GAsyncResult               *result,
847                                                            GError                    **error);
848
849 GLIB_AVAILABLE_IN_ALL
850 gboolean                g_file_trash                      (GFile                      *file,
851                                                            GCancellable               *cancellable,
852                                                            GError                    **error);
853
854 GLIB_AVAILABLE_IN_2_38
855 void                    g_file_trash_async                (GFile                      *file,
856                                                            int                         io_priority,
857                                                            GCancellable               *cancellable,
858                                                            GAsyncReadyCallback         callback,
859                                                            gpointer                    user_data);
860
861 GLIB_AVAILABLE_IN_2_38
862 gboolean                g_file_trash_finish               (GFile                      *file,
863                                                            GAsyncResult               *result,
864                                                            GError                    **error);
865
866 GLIB_AVAILABLE_IN_ALL
867 gboolean                g_file_copy                       (GFile                      *source,
868                                                            GFile                      *destination,
869                                                            GFileCopyFlags              flags,
870                                                            GCancellable               *cancellable,
871                                                            GFileProgressCallback       progress_callback,
872                                                            gpointer                    progress_callback_data,
873                                                            GError                    **error);
874 GLIB_AVAILABLE_IN_ALL
875 void                    g_file_copy_async                 (GFile                      *source,
876                                                            GFile                      *destination,
877                                                            GFileCopyFlags              flags,
878                                                            int                         io_priority,
879                                                            GCancellable               *cancellable,
880                                                            GFileProgressCallback       progress_callback,
881                                                            gpointer                    progress_callback_data,
882                                                            GAsyncReadyCallback         callback,
883                                                            gpointer                    user_data);
884 GLIB_AVAILABLE_IN_ALL
885 gboolean                g_file_copy_finish                (GFile                      *file,
886                                                            GAsyncResult               *res,
887                                                            GError                    **error);
888 GLIB_AVAILABLE_IN_ALL
889 gboolean                g_file_move                       (GFile                      *source,
890                                                            GFile                      *destination,
891                                                            GFileCopyFlags              flags,
892                                                            GCancellable               *cancellable,
893                                                            GFileProgressCallback       progress_callback,
894                                                            gpointer                    progress_callback_data,
895                                                            GError                    **error);
896 GLIB_AVAILABLE_IN_ALL
897 gboolean                g_file_make_directory             (GFile                      *file,
898                                                            GCancellable               *cancellable,
899                                                            GError                    **error);
900 GLIB_AVAILABLE_IN_2_38
901 void                    g_file_make_directory_async       (GFile                      *file,
902                                                            int                         io_priority,
903                                                            GCancellable               *cancellable,
904                                                            GAsyncReadyCallback         callback,
905                                                            gpointer                    user_data);
906 GLIB_AVAILABLE_IN_2_38
907 gboolean                g_file_make_directory_finish      (GFile                      *file,
908                                                            GAsyncResult               *result,
909                                                            GError                    **error);
910
911 GLIB_AVAILABLE_IN_ALL
912 gboolean                g_file_make_directory_with_parents (GFile                     *file,
913                                                            GCancellable               *cancellable,
914                                                            GError                    **error);
915 GLIB_AVAILABLE_IN_ALL
916 gboolean                g_file_make_symbolic_link         (GFile                      *file,
917                                                            const char                 *symlink_value,
918                                                            GCancellable               *cancellable,
919                                                            GError                    **error);
920 GLIB_AVAILABLE_IN_ALL
921 GFileAttributeInfoList *g_file_query_settable_attributes  (GFile                      *file,
922                                                            GCancellable               *cancellable,
923                                                            GError                    **error);
924 GLIB_AVAILABLE_IN_ALL
925 GFileAttributeInfoList *g_file_query_writable_namespaces  (GFile                      *file,
926                                                            GCancellable               *cancellable,
927                                                            GError                    **error);
928 GLIB_AVAILABLE_IN_ALL
929 gboolean                g_file_set_attribute              (GFile                      *file,
930                                                            const char                 *attribute,
931                                                            GFileAttributeType          type,
932                                                            gpointer                    value_p,
933                                                            GFileQueryInfoFlags         flags,
934                                                            GCancellable               *cancellable,
935                                                            GError                    **error);
936 GLIB_AVAILABLE_IN_ALL
937 gboolean                g_file_set_attributes_from_info   (GFile                      *file,
938                                                            GFileInfo                  *info,
939                                                            GFileQueryInfoFlags         flags,
940                                                            GCancellable               *cancellable,
941                                                            GError                    **error);
942 GLIB_AVAILABLE_IN_ALL
943 void                    g_file_set_attributes_async       (GFile                      *file,
944                                                            GFileInfo                  *info,
945                                                            GFileQueryInfoFlags         flags,
946                                                            int                         io_priority,
947                                                            GCancellable               *cancellable,
948                                                            GAsyncReadyCallback         callback,
949                                                            gpointer                    user_data);
950 GLIB_AVAILABLE_IN_ALL
951 gboolean                g_file_set_attributes_finish      (GFile                      *file,
952                                                            GAsyncResult               *result,
953                                                            GFileInfo                 **info,
954                                                            GError                    **error);
955 GLIB_AVAILABLE_IN_ALL
956 gboolean                g_file_set_attribute_string       (GFile                      *file,
957                                                            const char                 *attribute,
958                                                            const char                 *value,
959                                                            GFileQueryInfoFlags         flags,
960                                                            GCancellable               *cancellable,
961                                                            GError                    **error);
962 GLIB_AVAILABLE_IN_ALL
963 gboolean                g_file_set_attribute_byte_string  (GFile                      *file,
964                                                            const char                 *attribute,
965                                                            const char                 *value,
966                                                            GFileQueryInfoFlags         flags,
967                                                            GCancellable               *cancellable,
968                                                            GError                    **error);
969 GLIB_AVAILABLE_IN_ALL
970 gboolean                g_file_set_attribute_uint32       (GFile                      *file,
971                                                            const char                 *attribute,
972                                                            guint32                     value,
973                                                            GFileQueryInfoFlags         flags,
974                                                            GCancellable               *cancellable,
975                                                            GError                    **error);
976 GLIB_AVAILABLE_IN_ALL
977 gboolean                g_file_set_attribute_int32        (GFile                      *file,
978                                                            const char                 *attribute,
979                                                            gint32                      value,
980                                                            GFileQueryInfoFlags         flags,
981                                                            GCancellable               *cancellable,
982                                                            GError                    **error);
983 GLIB_AVAILABLE_IN_ALL
984 gboolean                g_file_set_attribute_uint64       (GFile                      *file,
985                                                            const char                 *attribute,
986                                                            guint64                     value,
987                                                            GFileQueryInfoFlags         flags,
988                                                            GCancellable               *cancellable,
989                                                            GError                    **error);
990 GLIB_AVAILABLE_IN_ALL
991 gboolean                g_file_set_attribute_int64        (GFile                      *file,
992                                                            const char                 *attribute,
993                                                            gint64                      value,
994                                                            GFileQueryInfoFlags         flags,
995                                                            GCancellable               *cancellable,
996                                                            GError                    **error);
997 GLIB_AVAILABLE_IN_ALL
998 void                    g_file_mount_enclosing_volume     (GFile                      *location,
999                                                            GMountMountFlags            flags,
1000                                                            GMountOperation            *mount_operation,
1001                                                            GCancellable               *cancellable,
1002                                                            GAsyncReadyCallback         callback,
1003                                                            gpointer                    user_data);
1004 GLIB_AVAILABLE_IN_ALL
1005 gboolean                g_file_mount_enclosing_volume_finish (GFile                      *location,
1006                                                            GAsyncResult               *result,
1007                                                            GError                    **error);
1008 GLIB_AVAILABLE_IN_ALL
1009 void                    g_file_mount_mountable            (GFile                      *file,
1010                                                            GMountMountFlags            flags,
1011                                                            GMountOperation            *mount_operation,
1012                                                            GCancellable               *cancellable,
1013                                                            GAsyncReadyCallback         callback,
1014                                                            gpointer                    user_data);
1015 GLIB_AVAILABLE_IN_ALL
1016 GFile *                 g_file_mount_mountable_finish     (GFile                      *file,
1017                                                            GAsyncResult               *result,
1018                                                            GError                    **error);
1019 GLIB_DEPRECATED_FOR(g_file_unmount_mountable_with_operation)
1020 void                    g_file_unmount_mountable          (GFile                      *file,
1021                                                            GMountUnmountFlags          flags,
1022                                                            GCancellable               *cancellable,
1023                                                            GAsyncReadyCallback         callback,
1024                                                            gpointer                    user_data);
1025
1026 GLIB_DEPRECATED_FOR(g_file_unmount_mountable_with_operation_finish)
1027 gboolean                g_file_unmount_mountable_finish   (GFile                      *file,
1028                                                            GAsyncResult               *result,
1029                                                            GError                    **error);
1030 GLIB_AVAILABLE_IN_ALL
1031 void                    g_file_unmount_mountable_with_operation (GFile                *file,
1032                                                            GMountUnmountFlags          flags,
1033                                                            GMountOperation            *mount_operation,
1034                                                            GCancellable               *cancellable,
1035                                                            GAsyncReadyCallback         callback,
1036                                                            gpointer                    user_data);
1037 GLIB_AVAILABLE_IN_ALL
1038 gboolean                g_file_unmount_mountable_with_operation_finish (GFile         *file,
1039                                                            GAsyncResult               *result,
1040                                                            GError                    **error);
1041 GLIB_DEPRECATED_FOR(g_file_eject_mountable_with_operation)
1042 void                    g_file_eject_mountable            (GFile                      *file,
1043                                                            GMountUnmountFlags          flags,
1044                                                            GCancellable               *cancellable,
1045                                                            GAsyncReadyCallback         callback,
1046                                                            gpointer                    user_data);
1047
1048 GLIB_DEPRECATED_FOR(g_file_eject_mountable_with_operation_finish)
1049 gboolean                g_file_eject_mountable_finish     (GFile                      *file,
1050                                                            GAsyncResult               *result,
1051                                                            GError                    **error);
1052 GLIB_AVAILABLE_IN_ALL
1053 void                    g_file_eject_mountable_with_operation (GFile                  *file,
1054                                                            GMountUnmountFlags          flags,
1055                                                            GMountOperation            *mount_operation,
1056                                                            GCancellable               *cancellable,
1057                                                            GAsyncReadyCallback         callback,
1058                                                            gpointer                    user_data);
1059 GLIB_AVAILABLE_IN_ALL
1060 gboolean                g_file_eject_mountable_with_operation_finish (GFile           *file,
1061                                                            GAsyncResult               *result,
1062                                                            GError                    **error);
1063
1064 GLIB_AVAILABLE_IN_ALL
1065 gboolean                g_file_copy_attributes            (GFile                      *source,
1066                                                            GFile                      *destination,
1067                                                            GFileCopyFlags              flags,
1068                                                            GCancellable               *cancellable,
1069                                                            GError                    **error);
1070
1071
1072 GLIB_AVAILABLE_IN_ALL
1073 GFileMonitor*           g_file_monitor_directory          (GFile                  *file,
1074                                                            GFileMonitorFlags       flags,
1075                                                            GCancellable           *cancellable,
1076                                                            GError                **error);
1077 GLIB_AVAILABLE_IN_ALL
1078 GFileMonitor*           g_file_monitor_file               (GFile                  *file,
1079                                                            GFileMonitorFlags       flags,
1080                                                            GCancellable           *cancellable,
1081                                                            GError                **error);
1082 GLIB_AVAILABLE_IN_ALL
1083 GFileMonitor*           g_file_monitor                    (GFile                  *file,
1084                                                            GFileMonitorFlags       flags,
1085                                                            GCancellable           *cancellable,
1086                                                            GError                **error);
1087
1088 GLIB_AVAILABLE_IN_ALL
1089 void                    g_file_start_mountable            (GFile                      *file,
1090                                                            GDriveStartFlags            flags,
1091                                                            GMountOperation            *start_operation,
1092                                                            GCancellable               *cancellable,
1093                                                            GAsyncReadyCallback         callback,
1094                                                            gpointer                    user_data);
1095 GLIB_AVAILABLE_IN_ALL
1096 gboolean                g_file_start_mountable_finish     (GFile                      *file,
1097                                                            GAsyncResult               *result,
1098                                                            GError                    **error);
1099 GLIB_AVAILABLE_IN_ALL
1100 void                    g_file_stop_mountable             (GFile                      *file,
1101                                                            GMountUnmountFlags          flags,
1102                                                            GMountOperation            *mount_operation,
1103                                                            GCancellable               *cancellable,
1104                                                            GAsyncReadyCallback         callback,
1105                                                            gpointer                    user_data);
1106 GLIB_AVAILABLE_IN_ALL
1107 gboolean                g_file_stop_mountable_finish      (GFile                      *file,
1108                                                            GAsyncResult               *result,
1109                                                            GError                    **error);
1110
1111 GLIB_AVAILABLE_IN_ALL
1112 void                    g_file_poll_mountable             (GFile                      *file,
1113                                                            GCancellable               *cancellable,
1114                                                            GAsyncReadyCallback         callback,
1115                                                            gpointer                    user_data);
1116 GLIB_AVAILABLE_IN_ALL
1117 gboolean                g_file_poll_mountable_finish      (GFile                      *file,
1118                                                            GAsyncResult               *result,
1119                                                            GError                    **error);
1120
1121 /* Utilities */
1122
1123 GLIB_AVAILABLE_IN_ALL
1124 GAppInfo *g_file_query_default_handler       (GFile                  *file,
1125                                               GCancellable           *cancellable,
1126                                               GError                **error);
1127 GLIB_AVAILABLE_IN_ALL
1128 gboolean g_file_load_contents                (GFile                  *file,
1129                                               GCancellable           *cancellable,
1130                                               char                  **contents,
1131                                               gsize                  *length,
1132                                               char                  **etag_out,
1133                                               GError                **error);
1134 GLIB_AVAILABLE_IN_ALL
1135 void     g_file_load_contents_async          (GFile                  *file,
1136                                               GCancellable           *cancellable,
1137                                               GAsyncReadyCallback     callback,
1138                                               gpointer                user_data);
1139 GLIB_AVAILABLE_IN_ALL
1140 gboolean g_file_load_contents_finish         (GFile                  *file,
1141                                               GAsyncResult           *res,
1142                                               char                  **contents,
1143                                               gsize                  *length,
1144                                               char                  **etag_out,
1145                                               GError                **error);
1146 GLIB_AVAILABLE_IN_ALL
1147 void     g_file_load_partial_contents_async  (GFile                  *file,
1148                                               GCancellable           *cancellable,
1149                                               GFileReadMoreCallback   read_more_callback,
1150                                               GAsyncReadyCallback     callback,
1151                                               gpointer                user_data);
1152 GLIB_AVAILABLE_IN_ALL
1153 gboolean g_file_load_partial_contents_finish (GFile                  *file,
1154                                               GAsyncResult           *res,
1155                                               char                  **contents,
1156                                               gsize                  *length,
1157                                               char                  **etag_out,
1158                                               GError                **error);
1159 GLIB_AVAILABLE_IN_ALL
1160 gboolean g_file_replace_contents             (GFile                  *file,
1161                                               const char             *contents,
1162                                               gsize                   length,
1163                                               const char             *etag,
1164                                               gboolean                make_backup,
1165                                               GFileCreateFlags        flags,
1166                                               char                  **new_etag,
1167                                               GCancellable           *cancellable,
1168                                               GError                **error);
1169 GLIB_AVAILABLE_IN_ALL
1170 void     g_file_replace_contents_async       (GFile                  *file,
1171                                               const char             *contents,
1172                                               gsize                   length,
1173                                               const char             *etag,
1174                                               gboolean                make_backup,
1175                                               GFileCreateFlags        flags,
1176                                               GCancellable           *cancellable,
1177                                               GAsyncReadyCallback     callback,
1178                                               gpointer                user_data);
1179 GLIB_AVAILABLE_IN_ALL
1180 gboolean g_file_replace_contents_finish      (GFile                  *file,
1181                                               GAsyncResult           *res,
1182                                               char                  **new_etag,
1183                                               GError                **error);
1184
1185 GLIB_AVAILABLE_IN_ALL
1186 gboolean g_file_supports_thread_contexts     (GFile                  *file);
1187
1188 G_END_DECLS
1189
1190 #endif /* __G_FILE_H__ */