gio: Fix some header/source parameter-naming mismatches
[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   gboolean            (* measure_disk_usage)          (GFile                         *file,
566                                                        GFileMeasureFlags              flags,
567                                                        GCancellable                  *cancellable,
568                                                        GFileMeasureProgressCallback   progress_callback,
569                                                        gpointer                       progress_data,
570                                                        guint64                       *disk_usage,
571                                                        guint64                       *num_dirs,
572                                                        guint64                       *num_files,
573                                                        GError                       **error);
574   void                (* measure_disk_usage_async)    (GFile                         *file,
575                                                        GFileMeasureFlags              flags,
576                                                        gint                           io_priority,
577                                                        GCancellable                  *cancellable,
578                                                        GFileMeasureProgressCallback   progress_callback,
579                                                        gpointer                       progress_data,
580                                                        GAsyncReadyCallback            callback,
581                                                        gpointer                       user_data);
582   gboolean            (* measure_disk_usage_finish)   (GFile                         *file,
583                                                        GAsyncResult                  *result,
584                                                        guint64                       *disk_usage,
585                                                        guint64                       *num_dirs,
586                                                        guint64                       *num_files,
587                                                        GError                       **error);
588 };
589
590 GLIB_AVAILABLE_IN_ALL
591 GType                   g_file_get_type                   (void) G_GNUC_CONST;
592
593 GLIB_AVAILABLE_IN_ALL
594 GFile *                 g_file_new_for_path               (const char                 *path);
595 GLIB_AVAILABLE_IN_ALL
596 GFile *                 g_file_new_for_uri                (const char                 *uri);
597 GLIB_AVAILABLE_IN_ALL
598 GFile *                 g_file_new_for_commandline_arg    (const char                 *arg);
599 GLIB_AVAILABLE_IN_2_36
600 GFile *                 g_file_new_for_commandline_arg_and_cwd (const gchar           *arg,
601                                                                 const gchar           *cwd);
602 GLIB_AVAILABLE_IN_2_32
603 GFile *                 g_file_new_tmp                    (const char                 *tmpl,
604                                                            GFileIOStream             **iostream,
605                                                            GError                    **error);
606 GLIB_AVAILABLE_IN_ALL
607 GFile *                 g_file_parse_name                 (const char                 *parse_name);
608 GLIB_AVAILABLE_IN_ALL
609 GFile *                 g_file_dup                        (GFile                      *file);
610 GLIB_AVAILABLE_IN_ALL
611 guint                   g_file_hash                       (gconstpointer               file);
612 GLIB_AVAILABLE_IN_ALL
613 gboolean                g_file_equal                      (GFile                      *file1,
614                                                            GFile                      *file2);
615 GLIB_AVAILABLE_IN_ALL
616 char *                  g_file_get_basename               (GFile                      *file);
617 GLIB_AVAILABLE_IN_ALL
618 char *                  g_file_get_path                   (GFile                      *file);
619 GLIB_AVAILABLE_IN_ALL
620 char *                  g_file_get_uri                    (GFile                      *file);
621 GLIB_AVAILABLE_IN_ALL
622 char *                  g_file_get_parse_name             (GFile                      *file);
623 GLIB_AVAILABLE_IN_ALL
624 GFile *                 g_file_get_parent                 (GFile                      *file);
625 GLIB_AVAILABLE_IN_ALL
626 gboolean                g_file_has_parent                 (GFile                      *file,
627                                                            GFile                      *parent);
628 GLIB_AVAILABLE_IN_ALL
629 GFile *                 g_file_get_child                  (GFile                      *file,
630                                                            const char                 *name);
631 GLIB_AVAILABLE_IN_ALL
632 GFile *                 g_file_get_child_for_display_name (GFile                      *file,
633                                                            const char                 *display_name,
634                                                            GError                    **error);
635 GLIB_AVAILABLE_IN_ALL
636 gboolean                g_file_has_prefix                 (GFile                      *file,
637                                                            GFile                      *prefix);
638 GLIB_AVAILABLE_IN_ALL
639 char *                  g_file_get_relative_path          (GFile                      *parent,
640                                                            GFile                      *descendant);
641 GLIB_AVAILABLE_IN_ALL
642 GFile *                 g_file_resolve_relative_path      (GFile                      *file,
643                                                            const char                 *relative_path);
644 GLIB_AVAILABLE_IN_ALL
645 gboolean                g_file_is_native                  (GFile                      *file);
646 GLIB_AVAILABLE_IN_ALL
647 gboolean                g_file_has_uri_scheme             (GFile                      *file,
648                                                            const char                 *uri_scheme);
649 GLIB_AVAILABLE_IN_ALL
650 char *                  g_file_get_uri_scheme             (GFile                      *file);
651 GLIB_AVAILABLE_IN_ALL
652 GFileInputStream *      g_file_read                       (GFile                      *file,
653                                                            GCancellable               *cancellable,
654                                                            GError                    **error);
655 GLIB_AVAILABLE_IN_ALL
656 void                    g_file_read_async                 (GFile                      *file,
657                                                            int                         io_priority,
658                                                            GCancellable               *cancellable,
659                                                            GAsyncReadyCallback         callback,
660                                                            gpointer                    user_data);
661 GLIB_AVAILABLE_IN_ALL
662 GFileInputStream *      g_file_read_finish                (GFile                      *file,
663                                                            GAsyncResult               *res,
664                                                            GError                    **error);
665 GLIB_AVAILABLE_IN_ALL
666 GFileOutputStream *     g_file_append_to                  (GFile                      *file,
667                                                            GFileCreateFlags             flags,
668                                                            GCancellable               *cancellable,
669                                                            GError                    **error);
670 GLIB_AVAILABLE_IN_ALL
671 GFileOutputStream *     g_file_create                     (GFile                      *file,
672                                                            GFileCreateFlags             flags,
673                                                            GCancellable               *cancellable,
674                                                            GError                    **error);
675 GLIB_AVAILABLE_IN_ALL
676 GFileOutputStream *     g_file_replace                    (GFile                      *file,
677                                                            const char                 *etag,
678                                                            gboolean                    make_backup,
679                                                            GFileCreateFlags            flags,
680                                                            GCancellable               *cancellable,
681                                                            GError                    **error);
682 GLIB_AVAILABLE_IN_ALL
683 void                    g_file_append_to_async            (GFile                      *file,
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_append_to_finish           (GFile                      *file,
691                                                            GAsyncResult               *res,
692                                                            GError                    **error);
693 GLIB_AVAILABLE_IN_ALL
694 void                    g_file_create_async               (GFile                      *file,
695                                                            GFileCreateFlags            flags,
696                                                            int                         io_priority,
697                                                            GCancellable               *cancellable,
698                                                            GAsyncReadyCallback         callback,
699                                                            gpointer                    user_data);
700 GLIB_AVAILABLE_IN_ALL
701 GFileOutputStream *     g_file_create_finish              (GFile                      *file,
702                                                            GAsyncResult               *res,
703                                                            GError                    **error);
704 GLIB_AVAILABLE_IN_ALL
705 void                    g_file_replace_async              (GFile                      *file,
706                                                            const char                 *etag,
707                                                            gboolean                    make_backup,
708                                                            GFileCreateFlags            flags,
709                                                            int                         io_priority,
710                                                            GCancellable               *cancellable,
711                                                            GAsyncReadyCallback         callback,
712                                                            gpointer                    user_data);
713 GLIB_AVAILABLE_IN_ALL
714 GFileOutputStream *     g_file_replace_finish             (GFile                      *file,
715                                                            GAsyncResult               *res,
716                                                            GError                    **error);
717 GLIB_AVAILABLE_IN_ALL
718 GFileIOStream *         g_file_open_readwrite             (GFile                      *file,
719                                                            GCancellable               *cancellable,
720                                                            GError                    **error);
721 GLIB_AVAILABLE_IN_ALL
722 void                    g_file_open_readwrite_async       (GFile                      *file,
723                                                            int                         io_priority,
724                                                            GCancellable               *cancellable,
725                                                            GAsyncReadyCallback         callback,
726                                                            gpointer                    user_data);
727 GLIB_AVAILABLE_IN_ALL
728 GFileIOStream *         g_file_open_readwrite_finish      (GFile                      *file,
729                                                            GAsyncResult               *res,
730                                                            GError                    **error);
731 GLIB_AVAILABLE_IN_ALL
732 GFileIOStream *         g_file_create_readwrite           (GFile                      *file,
733                                                            GFileCreateFlags            flags,
734                                                            GCancellable               *cancellable,
735                                                            GError                    **error);
736 GLIB_AVAILABLE_IN_ALL
737 void                    g_file_create_readwrite_async     (GFile                      *file,
738                                                            GFileCreateFlags            flags,
739                                                            int                         io_priority,
740                                                            GCancellable               *cancellable,
741                                                            GAsyncReadyCallback         callback,
742                                                            gpointer                    user_data);
743 GLIB_AVAILABLE_IN_ALL
744 GFileIOStream *         g_file_create_readwrite_finish    (GFile                      *file,
745                                                            GAsyncResult               *res,
746                                                            GError                    **error);
747 GLIB_AVAILABLE_IN_ALL
748 GFileIOStream *         g_file_replace_readwrite          (GFile                      *file,
749                                                            const char                 *etag,
750                                                            gboolean                    make_backup,
751                                                            GFileCreateFlags            flags,
752                                                            GCancellable               *cancellable,
753                                                            GError                    **error);
754 GLIB_AVAILABLE_IN_ALL
755 void                    g_file_replace_readwrite_async    (GFile                      *file,
756                                                            const char                 *etag,
757                                                            gboolean                    make_backup,
758                                                            GFileCreateFlags            flags,
759                                                            int                         io_priority,
760                                                            GCancellable               *cancellable,
761                                                            GAsyncReadyCallback         callback,
762                                                            gpointer                    user_data);
763 GLIB_AVAILABLE_IN_ALL
764 GFileIOStream *         g_file_replace_readwrite_finish   (GFile                      *file,
765                                                            GAsyncResult               *res,
766                                                            GError                    **error);
767 GLIB_AVAILABLE_IN_ALL
768 gboolean                g_file_query_exists               (GFile                      *file,
769                                                            GCancellable               *cancellable);
770 GLIB_AVAILABLE_IN_ALL
771 GFileType               g_file_query_file_type            (GFile                      *file,
772                                                            GFileQueryInfoFlags         flags,
773                                                            GCancellable               *cancellable);
774 GLIB_AVAILABLE_IN_ALL
775 GFileInfo *             g_file_query_info                 (GFile                      *file,
776                                                            const char                 *attributes,
777                                                            GFileQueryInfoFlags         flags,
778                                                            GCancellable               *cancellable,
779                                                            GError                    **error);
780 GLIB_AVAILABLE_IN_ALL
781 void                    g_file_query_info_async           (GFile                      *file,
782                                                            const char                 *attributes,
783                                                            GFileQueryInfoFlags         flags,
784                                                            int                         io_priority,
785                                                            GCancellable               *cancellable,
786                                                            GAsyncReadyCallback         callback,
787                                                            gpointer                    user_data);
788 GLIB_AVAILABLE_IN_ALL
789 GFileInfo *             g_file_query_info_finish          (GFile                      *file,
790                                                            GAsyncResult               *res,
791                                                            GError                    **error);
792 GLIB_AVAILABLE_IN_ALL
793 GFileInfo *             g_file_query_filesystem_info      (GFile                      *file,
794                                                            const char                 *attributes,
795                                                            GCancellable               *cancellable,
796                                                            GError                    **error);
797 GLIB_AVAILABLE_IN_ALL
798 void                    g_file_query_filesystem_info_async (GFile                      *file,
799                                                            const char                 *attributes,
800                                                            int                         io_priority,
801                                                            GCancellable               *cancellable,
802                                                            GAsyncReadyCallback         callback,
803                                                            gpointer                    user_data);
804 GLIB_AVAILABLE_IN_ALL
805 GFileInfo *             g_file_query_filesystem_info_finish (GFile                      *file,
806                                                            GAsyncResult               *res,
807                                                            GError                    **error);
808 GLIB_AVAILABLE_IN_ALL
809 GMount *                g_file_find_enclosing_mount       (GFile                      *file,
810                                                            GCancellable               *cancellable,
811                                                            GError                    **error);
812 GLIB_AVAILABLE_IN_ALL
813 void                    g_file_find_enclosing_mount_async (GFile                      *file,
814                                                            int                         io_priority,
815                                                            GCancellable               *cancellable,
816                                                            GAsyncReadyCallback         callback,
817                                                            gpointer                    user_data);
818 GLIB_AVAILABLE_IN_ALL
819 GMount *                g_file_find_enclosing_mount_finish (GFile                     *file,
820                                                             GAsyncResult              *res,
821                                                             GError                   **error);
822 GLIB_AVAILABLE_IN_ALL
823 GFileEnumerator *       g_file_enumerate_children         (GFile                      *file,
824                                                            const char                 *attributes,
825                                                            GFileQueryInfoFlags         flags,
826                                                            GCancellable               *cancellable,
827                                                            GError                    **error);
828 GLIB_AVAILABLE_IN_ALL
829 void                    g_file_enumerate_children_async   (GFile                      *file,
830                                                            const char                 *attributes,
831                                                            GFileQueryInfoFlags         flags,
832                                                            int                         io_priority,
833                                                            GCancellable               *cancellable,
834                                                            GAsyncReadyCallback         callback,
835                                                            gpointer                    user_data);
836 GLIB_AVAILABLE_IN_ALL
837 GFileEnumerator *       g_file_enumerate_children_finish  (GFile                      *file,
838                                                            GAsyncResult               *res,
839                                                            GError                    **error);
840 GLIB_AVAILABLE_IN_ALL
841 GFile *                 g_file_set_display_name           (GFile                      *file,
842                                                            const char                 *display_name,
843                                                            GCancellable               *cancellable,
844                                                            GError                    **error);
845 GLIB_AVAILABLE_IN_ALL
846 void                    g_file_set_display_name_async     (GFile                      *file,
847                                                            const char                 *display_name,
848                                                            int                         io_priority,
849                                                            GCancellable               *cancellable,
850                                                            GAsyncReadyCallback         callback,
851                                                            gpointer                    user_data);
852 GLIB_AVAILABLE_IN_ALL
853 GFile *                 g_file_set_display_name_finish    (GFile                      *file,
854                                                            GAsyncResult               *res,
855                                                            GError                    **error);
856 GLIB_AVAILABLE_IN_ALL
857 gboolean                g_file_delete                     (GFile                      *file,
858                                                            GCancellable               *cancellable,
859                                                            GError                    **error);
860
861 GLIB_AVAILABLE_IN_2_34
862 void                    g_file_delete_async               (GFile                      *file,
863                                                            int                         io_priority,
864                                                            GCancellable               *cancellable,
865                                                            GAsyncReadyCallback         callback,
866                                                            gpointer                    user_data);
867
868 GLIB_AVAILABLE_IN_2_34
869 gboolean                g_file_delete_finish              (GFile                      *file,
870                                                            GAsyncResult               *result,
871                                                            GError                    **error);
872
873 GLIB_AVAILABLE_IN_ALL
874 gboolean                g_file_trash                      (GFile                      *file,
875                                                            GCancellable               *cancellable,
876                                                            GError                    **error);
877
878 GLIB_AVAILABLE_IN_2_38
879 void                    g_file_trash_async                (GFile                      *file,
880                                                            int                         io_priority,
881                                                            GCancellable               *cancellable,
882                                                            GAsyncReadyCallback         callback,
883                                                            gpointer                    user_data);
884
885 GLIB_AVAILABLE_IN_2_38
886 gboolean                g_file_trash_finish               (GFile                      *file,
887                                                            GAsyncResult               *result,
888                                                            GError                    **error);
889
890 GLIB_AVAILABLE_IN_ALL
891 gboolean                g_file_copy                       (GFile                      *source,
892                                                            GFile                      *destination,
893                                                            GFileCopyFlags              flags,
894                                                            GCancellable               *cancellable,
895                                                            GFileProgressCallback       progress_callback,
896                                                            gpointer                    progress_callback_data,
897                                                            GError                    **error);
898 GLIB_AVAILABLE_IN_ALL
899 void                    g_file_copy_async                 (GFile                      *source,
900                                                            GFile                      *destination,
901                                                            GFileCopyFlags              flags,
902                                                            int                         io_priority,
903                                                            GCancellable               *cancellable,
904                                                            GFileProgressCallback       progress_callback,
905                                                            gpointer                    progress_callback_data,
906                                                            GAsyncReadyCallback         callback,
907                                                            gpointer                    user_data);
908 GLIB_AVAILABLE_IN_ALL
909 gboolean                g_file_copy_finish                (GFile                      *file,
910                                                            GAsyncResult               *res,
911                                                            GError                    **error);
912 GLIB_AVAILABLE_IN_ALL
913 gboolean                g_file_move                       (GFile                      *source,
914                                                            GFile                      *destination,
915                                                            GFileCopyFlags              flags,
916                                                            GCancellable               *cancellable,
917                                                            GFileProgressCallback       progress_callback,
918                                                            gpointer                    progress_callback_data,
919                                                            GError                    **error);
920 GLIB_AVAILABLE_IN_ALL
921 gboolean                g_file_make_directory             (GFile                      *file,
922                                                            GCancellable               *cancellable,
923                                                            GError                    **error);
924 GLIB_AVAILABLE_IN_2_38
925 void                    g_file_make_directory_async       (GFile                      *file,
926                                                            int                         io_priority,
927                                                            GCancellable               *cancellable,
928                                                            GAsyncReadyCallback         callback,
929                                                            gpointer                    user_data);
930 GLIB_AVAILABLE_IN_2_38
931 gboolean                g_file_make_directory_finish      (GFile                      *file,
932                                                            GAsyncResult               *result,
933                                                            GError                    **error);
934
935 GLIB_AVAILABLE_IN_ALL
936 gboolean                g_file_make_directory_with_parents (GFile                     *file,
937                                                            GCancellable               *cancellable,
938                                                            GError                    **error);
939 GLIB_AVAILABLE_IN_ALL
940 gboolean                g_file_make_symbolic_link         (GFile                      *file,
941                                                            const char                 *symlink_value,
942                                                            GCancellable               *cancellable,
943                                                            GError                    **error);
944 GLIB_AVAILABLE_IN_ALL
945 GFileAttributeInfoList *g_file_query_settable_attributes  (GFile                      *file,
946                                                            GCancellable               *cancellable,
947                                                            GError                    **error);
948 GLIB_AVAILABLE_IN_ALL
949 GFileAttributeInfoList *g_file_query_writable_namespaces  (GFile                      *file,
950                                                            GCancellable               *cancellable,
951                                                            GError                    **error);
952 GLIB_AVAILABLE_IN_ALL
953 gboolean                g_file_set_attribute              (GFile                      *file,
954                                                            const char                 *attribute,
955                                                            GFileAttributeType          type,
956                                                            gpointer                    value_p,
957                                                            GFileQueryInfoFlags         flags,
958                                                            GCancellable               *cancellable,
959                                                            GError                    **error);
960 GLIB_AVAILABLE_IN_ALL
961 gboolean                g_file_set_attributes_from_info   (GFile                      *file,
962                                                            GFileInfo                  *info,
963                                                            GFileQueryInfoFlags         flags,
964                                                            GCancellable               *cancellable,
965                                                            GError                    **error);
966 GLIB_AVAILABLE_IN_ALL
967 void                    g_file_set_attributes_async       (GFile                      *file,
968                                                            GFileInfo                  *info,
969                                                            GFileQueryInfoFlags         flags,
970                                                            int                         io_priority,
971                                                            GCancellable               *cancellable,
972                                                            GAsyncReadyCallback         callback,
973                                                            gpointer                    user_data);
974 GLIB_AVAILABLE_IN_ALL
975 gboolean                g_file_set_attributes_finish      (GFile                      *file,
976                                                            GAsyncResult               *result,
977                                                            GFileInfo                 **info,
978                                                            GError                    **error);
979 GLIB_AVAILABLE_IN_ALL
980 gboolean                g_file_set_attribute_string       (GFile                      *file,
981                                                            const char                 *attribute,
982                                                            const char                 *value,
983                                                            GFileQueryInfoFlags         flags,
984                                                            GCancellable               *cancellable,
985                                                            GError                    **error);
986 GLIB_AVAILABLE_IN_ALL
987 gboolean                g_file_set_attribute_byte_string  (GFile                      *file,
988                                                            const char                 *attribute,
989                                                            const char                 *value,
990                                                            GFileQueryInfoFlags         flags,
991                                                            GCancellable               *cancellable,
992                                                            GError                    **error);
993 GLIB_AVAILABLE_IN_ALL
994 gboolean                g_file_set_attribute_uint32       (GFile                      *file,
995                                                            const char                 *attribute,
996                                                            guint32                     value,
997                                                            GFileQueryInfoFlags         flags,
998                                                            GCancellable               *cancellable,
999                                                            GError                    **error);
1000 GLIB_AVAILABLE_IN_ALL
1001 gboolean                g_file_set_attribute_int32        (GFile                      *file,
1002                                                            const char                 *attribute,
1003                                                            gint32                      value,
1004                                                            GFileQueryInfoFlags         flags,
1005                                                            GCancellable               *cancellable,
1006                                                            GError                    **error);
1007 GLIB_AVAILABLE_IN_ALL
1008 gboolean                g_file_set_attribute_uint64       (GFile                      *file,
1009                                                            const char                 *attribute,
1010                                                            guint64                     value,
1011                                                            GFileQueryInfoFlags         flags,
1012                                                            GCancellable               *cancellable,
1013                                                            GError                    **error);
1014 GLIB_AVAILABLE_IN_ALL
1015 gboolean                g_file_set_attribute_int64        (GFile                      *file,
1016                                                            const char                 *attribute,
1017                                                            gint64                      value,
1018                                                            GFileQueryInfoFlags         flags,
1019                                                            GCancellable               *cancellable,
1020                                                            GError                    **error);
1021 GLIB_AVAILABLE_IN_ALL
1022 void                    g_file_mount_enclosing_volume     (GFile                      *location,
1023                                                            GMountMountFlags            flags,
1024                                                            GMountOperation            *mount_operation,
1025                                                            GCancellable               *cancellable,
1026                                                            GAsyncReadyCallback         callback,
1027                                                            gpointer                    user_data);
1028 GLIB_AVAILABLE_IN_ALL
1029 gboolean                g_file_mount_enclosing_volume_finish (GFile                      *location,
1030                                                            GAsyncResult               *result,
1031                                                            GError                    **error);
1032 GLIB_AVAILABLE_IN_ALL
1033 void                    g_file_mount_mountable            (GFile                      *file,
1034                                                            GMountMountFlags            flags,
1035                                                            GMountOperation            *mount_operation,
1036                                                            GCancellable               *cancellable,
1037                                                            GAsyncReadyCallback         callback,
1038                                                            gpointer                    user_data);
1039 GLIB_AVAILABLE_IN_ALL
1040 GFile *                 g_file_mount_mountable_finish     (GFile                      *file,
1041                                                            GAsyncResult               *result,
1042                                                            GError                    **error);
1043 GLIB_DEPRECATED_FOR(g_file_unmount_mountable_with_operation)
1044 void                    g_file_unmount_mountable          (GFile                      *file,
1045                                                            GMountUnmountFlags          flags,
1046                                                            GCancellable               *cancellable,
1047                                                            GAsyncReadyCallback         callback,
1048                                                            gpointer                    user_data);
1049
1050 GLIB_DEPRECATED_FOR(g_file_unmount_mountable_with_operation_finish)
1051 gboolean                g_file_unmount_mountable_finish   (GFile                      *file,
1052                                                            GAsyncResult               *result,
1053                                                            GError                    **error);
1054 GLIB_AVAILABLE_IN_ALL
1055 void                    g_file_unmount_mountable_with_operation (GFile                *file,
1056                                                            GMountUnmountFlags          flags,
1057                                                            GMountOperation            *mount_operation,
1058                                                            GCancellable               *cancellable,
1059                                                            GAsyncReadyCallback         callback,
1060                                                            gpointer                    user_data);
1061 GLIB_AVAILABLE_IN_ALL
1062 gboolean                g_file_unmount_mountable_with_operation_finish (GFile         *file,
1063                                                            GAsyncResult               *result,
1064                                                            GError                    **error);
1065 GLIB_DEPRECATED_FOR(g_file_eject_mountable_with_operation)
1066 void                    g_file_eject_mountable            (GFile                      *file,
1067                                                            GMountUnmountFlags          flags,
1068                                                            GCancellable               *cancellable,
1069                                                            GAsyncReadyCallback         callback,
1070                                                            gpointer                    user_data);
1071
1072 GLIB_DEPRECATED_FOR(g_file_eject_mountable_with_operation_finish)
1073 gboolean                g_file_eject_mountable_finish     (GFile                      *file,
1074                                                            GAsyncResult               *result,
1075                                                            GError                    **error);
1076 GLIB_AVAILABLE_IN_ALL
1077 void                    g_file_eject_mountable_with_operation (GFile                  *file,
1078                                                            GMountUnmountFlags          flags,
1079                                                            GMountOperation            *mount_operation,
1080                                                            GCancellable               *cancellable,
1081                                                            GAsyncReadyCallback         callback,
1082                                                            gpointer                    user_data);
1083 GLIB_AVAILABLE_IN_ALL
1084 gboolean                g_file_eject_mountable_with_operation_finish (GFile           *file,
1085                                                            GAsyncResult               *result,
1086                                                            GError                    **error);
1087
1088 GLIB_AVAILABLE_IN_ALL
1089 gboolean                g_file_copy_attributes            (GFile                      *source,
1090                                                            GFile                      *destination,
1091                                                            GFileCopyFlags              flags,
1092                                                            GCancellable               *cancellable,
1093                                                            GError                    **error);
1094
1095
1096 GLIB_AVAILABLE_IN_ALL
1097 GFileMonitor*           g_file_monitor_directory          (GFile                  *file,
1098                                                            GFileMonitorFlags       flags,
1099                                                            GCancellable           *cancellable,
1100                                                            GError                **error);
1101 GLIB_AVAILABLE_IN_ALL
1102 GFileMonitor*           g_file_monitor_file               (GFile                  *file,
1103                                                            GFileMonitorFlags       flags,
1104                                                            GCancellable           *cancellable,
1105                                                            GError                **error);
1106 GLIB_AVAILABLE_IN_ALL
1107 GFileMonitor*           g_file_monitor                    (GFile                  *file,
1108                                                            GFileMonitorFlags       flags,
1109                                                            GCancellable           *cancellable,
1110                                                            GError                **error);
1111
1112 GLIB_AVAILABLE_IN_2_38
1113 gboolean                g_file_measure_disk_usage         (GFile                         *file,
1114                                                            GFileMeasureFlags              flags,
1115                                                            GCancellable                  *cancellable,
1116                                                            GFileMeasureProgressCallback   progress_callback,
1117                                                            gpointer                       progress_data,
1118                                                            guint64                       *disk_usage,
1119                                                            guint64                       *num_dirs,
1120                                                            guint64                       *num_files,
1121                                                            GError                       **error);
1122
1123 GLIB_AVAILABLE_IN_2_38
1124 void                    g_file_measure_disk_usage_async   (GFile                         *file,
1125                                                            GFileMeasureFlags              flags,
1126                                                            gint                           io_priority,
1127                                                            GCancellable                  *cancellable,
1128                                                            GFileMeasureProgressCallback   progress_callback,
1129                                                            gpointer                       progress_data,
1130                                                            GAsyncReadyCallback            callback,
1131                                                            gpointer                       user_data);
1132
1133 GLIB_AVAILABLE_IN_2_38
1134 gboolean                g_file_measure_disk_usage_finish  (GFile                         *file,
1135                                                            GAsyncResult                  *result,
1136                                                            guint64                       *disk_usage,
1137                                                            guint64                       *num_dirs,
1138                                                            guint64                       *num_files,
1139                                                            GError                       **error);
1140
1141 GLIB_AVAILABLE_IN_ALL
1142 void                    g_file_start_mountable            (GFile                      *file,
1143                                                            GDriveStartFlags            flags,
1144                                                            GMountOperation            *start_operation,
1145                                                            GCancellable               *cancellable,
1146                                                            GAsyncReadyCallback         callback,
1147                                                            gpointer                    user_data);
1148 GLIB_AVAILABLE_IN_ALL
1149 gboolean                g_file_start_mountable_finish     (GFile                      *file,
1150                                                            GAsyncResult               *result,
1151                                                            GError                    **error);
1152 GLIB_AVAILABLE_IN_ALL
1153 void                    g_file_stop_mountable             (GFile                      *file,
1154                                                            GMountUnmountFlags          flags,
1155                                                            GMountOperation            *mount_operation,
1156                                                            GCancellable               *cancellable,
1157                                                            GAsyncReadyCallback         callback,
1158                                                            gpointer                    user_data);
1159 GLIB_AVAILABLE_IN_ALL
1160 gboolean                g_file_stop_mountable_finish      (GFile                      *file,
1161                                                            GAsyncResult               *result,
1162                                                            GError                    **error);
1163
1164 GLIB_AVAILABLE_IN_ALL
1165 void                    g_file_poll_mountable             (GFile                      *file,
1166                                                            GCancellable               *cancellable,
1167                                                            GAsyncReadyCallback         callback,
1168                                                            gpointer                    user_data);
1169 GLIB_AVAILABLE_IN_ALL
1170 gboolean                g_file_poll_mountable_finish      (GFile                      *file,
1171                                                            GAsyncResult               *result,
1172                                                            GError                    **error);
1173
1174 /* Utilities */
1175
1176 GLIB_AVAILABLE_IN_ALL
1177 GAppInfo *g_file_query_default_handler       (GFile                  *file,
1178                                               GCancellable           *cancellable,
1179                                               GError                **error);
1180 GLIB_AVAILABLE_IN_ALL
1181 gboolean g_file_load_contents                (GFile                  *file,
1182                                               GCancellable           *cancellable,
1183                                               char                  **contents,
1184                                               gsize                  *length,
1185                                               char                  **etag_out,
1186                                               GError                **error);
1187 GLIB_AVAILABLE_IN_ALL
1188 void     g_file_load_contents_async          (GFile                  *file,
1189                                               GCancellable           *cancellable,
1190                                               GAsyncReadyCallback     callback,
1191                                               gpointer                user_data);
1192 GLIB_AVAILABLE_IN_ALL
1193 gboolean g_file_load_contents_finish         (GFile                  *file,
1194                                               GAsyncResult           *res,
1195                                               char                  **contents,
1196                                               gsize                  *length,
1197                                               char                  **etag_out,
1198                                               GError                **error);
1199 GLIB_AVAILABLE_IN_ALL
1200 void     g_file_load_partial_contents_async  (GFile                  *file,
1201                                               GCancellable           *cancellable,
1202                                               GFileReadMoreCallback   read_more_callback,
1203                                               GAsyncReadyCallback     callback,
1204                                               gpointer                user_data);
1205 GLIB_AVAILABLE_IN_ALL
1206 gboolean g_file_load_partial_contents_finish (GFile                  *file,
1207                                               GAsyncResult           *res,
1208                                               char                  **contents,
1209                                               gsize                  *length,
1210                                               char                  **etag_out,
1211                                               GError                **error);
1212 GLIB_AVAILABLE_IN_ALL
1213 gboolean g_file_replace_contents             (GFile                  *file,
1214                                               const char             *contents,
1215                                               gsize                   length,
1216                                               const char             *etag,
1217                                               gboolean                make_backup,
1218                                               GFileCreateFlags        flags,
1219                                               char                  **new_etag,
1220                                               GCancellable           *cancellable,
1221                                               GError                **error);
1222 GLIB_AVAILABLE_IN_ALL
1223 void     g_file_replace_contents_async       (GFile                  *file,
1224                                               const char             *contents,
1225                                               gsize                   length,
1226                                               const char             *etag,
1227                                               gboolean                make_backup,
1228                                               GFileCreateFlags        flags,
1229                                               GCancellable           *cancellable,
1230                                               GAsyncReadyCallback     callback,
1231                                               gpointer                user_data);
1232 GLIB_AVAILABLE_IN_2_40
1233 void     g_file_replace_contents_bytes_async (GFile                  *file,
1234                                               GBytes                 *contents,
1235                                               const char             *etag,
1236                                               gboolean                make_backup,
1237                                               GFileCreateFlags        flags,
1238                                               GCancellable           *cancellable,
1239                                               GAsyncReadyCallback     callback,
1240                                               gpointer                user_data);
1241 GLIB_AVAILABLE_IN_ALL
1242 gboolean g_file_replace_contents_finish      (GFile                  *file,
1243                                               GAsyncResult           *res,
1244                                               char                  **new_etag,
1245                                               GError                **error);
1246
1247 GLIB_AVAILABLE_IN_ALL
1248 gboolean g_file_supports_thread_contexts     (GFile                  *file);
1249
1250 G_END_DECLS
1251
1252 #endif /* __G_FILE_H__ */