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