Update the docs for the new network APIs
[platform/upstream/glib.git] / gio / gfile.h
1 /* GIO - GLib Input, Output and Streaming Library
2  *
3  * Copyright (C) 2006-2007 Red Hat, Inc.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General
16  * Public License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18  * Boston, MA 02111-1307, USA.
19  *
20  * Author: Alexander Larsson <alexl@redhat.com>
21  */
22
23 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
24 #error "Only <gio/gio.h> can be included directly."
25 #endif
26
27 #ifndef __G_FILE_H__
28 #define __G_FILE_H__
29
30 #include <gio/giotypes.h>
31
32 G_BEGIN_DECLS
33
34 #define G_TYPE_FILE            (g_file_get_type ())
35 #define G_FILE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_FILE, GFile))
36 #define G_IS_FILE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_FILE))
37 #define G_FILE_GET_IFACE(obj)  (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_FILE, GFileIface))
38
39 #if 0
40 /**
41  * GFile:
42  *
43  * A handle to an object implementing the #GFileIface interface.
44  * Generally stores a location within the file system. Handles do not
45  * necessarily represent files or directories that currently exist.
46  **/
47 typedef struct _GFile                   GFile; /* Dummy typedef */
48 #endif
49 typedef struct _GFileIface              GFileIface;
50
51
52 /**
53  * GFileIface:
54  * @g_iface: The parent interface.
55  * @dup: Duplicates a #GFile.
56  * @hash: Creates a hash of a #GFile.
57  * @equal: Checks equality of two given #GFile<!-- -->s.
58  * @is_native: Checks to see if a file is native to the system.
59  * @has_uri_scheme: Checks to see if a #GFile has a given URI scheme.
60  * @get_uri_scheme: Gets the URI scheme for a #GFile.
61  * @get_basename: Gets the basename for a given #GFile.
62  * @get_path: Gets the current path within a #GFile.
63  * @get_uri: Gets a URI for the path within a #GFile.
64  * @get_parse_name: Gets the parsed name for the #GFile.
65  * @get_parent: Gets the parent directory for the #GFile.
66  * @prefix_matches: Checks whether a #GFile contains a specified file.
67  * @get_relative_path: Gets the path for a #GFile relative to a given path.
68  * @resolve_relative_path: Resolves a relative path for a #GFile to an absolute path.
69  * @get_child_for_display_name: Gets the child #GFile for a given display name.
70  * @enumerate_children: Gets a #GFileEnumerator with the children of a #GFile.
71  * @enumerate_children_async: Asynchronously gets a #GFileEnumerator with the children of a #GFile.
72  * @enumerate_children_finish: Finishes asynchronously enumerating the children.
73  * @query_info: Gets the #GFileInfo for a #GFile.
74  * @query_info_async: Asynchronously gets the #GFileInfo for a #GFile.
75  * @query_info_finish: Finishes an asynchronous query info operation.
76  * @query_filesystem_info: Gets a #GFileInfo for the file system #GFile is on.
77  * @query_filesystem_info_async: Asynchronously gets a #GFileInfo for the file system #GFile is on.
78  * @query_filesystem_info_finish: Finishes asynchronously getting the file system info.
79  * @find_enclosing_mount: Gets a #GMount for the #GFile.
80  * @find_enclosing_mount_async: Asynchronously gets the #GMount for a #GFile.
81  * @find_enclosing_mount_finish: Finishes asynchronously getting the volume.
82  * @set_display_name: Sets the display name for a #GFile.
83  * @set_display_name_async: Asynchronously sets a #GFile's display name.
84  * @set_display_name_finish: Finishes asynchronously setting a #GFile's display name.
85  * @query_settable_attributes: Returns a list of #GFileAttribute<!-- -->s that can be set.
86  * @_query_settable_attributes_async: Asynchronously gets a list of #GFileAttribute<!-- -->s that can be set.
87  * @_query_settable_attributes_finish: Finishes asynchronously querying settable attributes.
88  * @query_writable_namespaces: Returns a list of #GFileAttribute namespaces that are writable.
89  * @_query_writable_namespaces_async: Asynchronously gets a list of #GFileAttribute namespaces that are writable.
90  * @_query_writable_namespaces_finish: Finishes asynchronously querying the writable namespaces.
91  * @set_attribute: Sets a #GFileAttribute.
92  * @set_attributes_from_info: Sets a #GFileAttribute with information from a #GFileInfo.
93  * @set_attributes_async: Asynchronously sets a file's attributes.
94  * @set_attributes_finish: Finishes setting a file's attributes asynchronously.
95  * @read_fn: Reads a file asynchronously.
96  * @read_async: Asynchronously reads a file.
97  * @read_finish: Finishes asynchronously reading a file.
98  * @append_to: Writes to the end of a file.
99  * @append_to_async: Asynchronously writes to the end of a file.
100  * @append_to_finish: Finishes an asynchronous file append operation.
101  * @create: Creates a new file.
102  * @create_async: Asynchronously creates a file.
103  * @create_finish: Finishes asynchronously creating a file.
104  * @replace: Replaces the contents of a file.
105  * @replace_async: Asynchronously replaces the contents of a file.
106  * @replace_finish: Finishes asynchronously replacing a file.
107  * @delete_file: Deletes a file.
108  * @_delete_file_async: Asynchronously deletes a file.
109  * @_delete_file_finish: Finishes an asynchronous delete.
110  * @trash: Sends a #GFile to the Trash location.
111  * @_trash_async: Asynchronously sends a #GFile to the Trash location.
112  * @_trash_finish: Finishes an asynchronous file trashing operation.
113  * @make_directory: Makes a directory.
114  * @_make_directory_async: Asynchronously makes a directory.
115  * @_make_directory_finish: Finishes making a directory asynchronously.
116  * @make_symbolic_link: Makes a symbolic link.
117  * @_make_symbolic_link_async: Asynchronously makes a symbolic link
118  * @_make_symbolic_link_finish: Finishes making a symbolic link asynchronously.
119  * @copy: Copies a file.
120  * @copy_async: Asynchronously copies a file.
121  * @copy_finish: Finishes an asynchronous copy operation.
122  * @move: Moves a file.
123  * @_move_async: Asynchronously moves a file.
124  * @_move_finish: Finishes an asynchronous move operation.
125  * @mount_mountable: Mounts a mountable object.
126  * @mount_mountable_finish: Finishes a mounting operation.
127  * @unmount_mountable: Unmounts a mountable object.
128  * @unmount_mountable_finish: Finishes an unmount operation.
129  * @eject_mountable: Ejects a mountable.
130  * @eject_mountable_finish: Finishes an eject operation.
131  * @mount_enclosing_volume: Mounts a specified location.
132  * @mount_enclosing_volume_finish: Finishes mounting a specified location.
133  * @monitor_dir: Creates a #GFileMonitor for the location.
134  * @monitor_file: Creates a #GFileMonitor for the location.
135  * @open_readwrite: Open file read/write. Since 2.22.
136  * @open_readwrite_async: Asynchronously opens file read/write. Since 2.22.
137  * @open_readwrite_finish: Finishes an asynchronous open read/write. Since 2.22.
138  * @create_readwrite: Creates file read/write. Since 2.22.
139  * @create_readwrite_async: Asynchronously creates file read/write. Since 2.22.
140  * @create_readwrite_finish: Finishes an asynchronous creates read/write. Since 2.22.
141  * @replace_readwrite: Replaces file read/write. Since 2.22.
142  * @replace_readwrite_async: Asynchronously replaces file read/write. Since 2.22.
143  * @replace_readwrite_finish: Finishes an asynchronous replace read/write. Since 2.22.
144  *
145  * An interface for writing VFS file handles.
146  **/
147 struct _GFileIface
148 {
149   GTypeInterface g_iface;
150
151   /* Virtual Table */
152
153   GFile *             (* dup)                         (GFile         *file);
154   guint               (* hash)                        (GFile         *file);
155   gboolean            (* equal)                       (GFile         *file1,
156                                                        GFile         *file2);
157   gboolean            (* is_native)                   (GFile         *file);
158   gboolean            (* has_uri_scheme)              (GFile         *file,
159                                                        const char    *uri_scheme);
160   char *              (* get_uri_scheme)              (GFile         *file);
161   char *              (* get_basename)                (GFile         *file);
162   char *              (* get_path)                    (GFile         *file);
163   char *              (* get_uri)                     (GFile         *file);
164   char *              (* get_parse_name)              (GFile         *file);
165   GFile *             (* get_parent)                  (GFile         *file);
166   gboolean            (* prefix_matches)              (GFile         *prefix,
167                                                        GFile         *file);
168   char *              (* get_relative_path)           (GFile         *parent,
169                                                        GFile         *descendant);
170   GFile *             (* resolve_relative_path)       (GFile        *file,
171                                                        const char   *relative_path);
172   GFile *             (* get_child_for_display_name)  (GFile        *file,
173                                                        const char   *display_name,
174                                                        GError      **error);
175
176   GFileEnumerator *   (* enumerate_children)          (GFile                *file,
177                                                        const char           *attributes,
178                                                        GFileQueryInfoFlags   flags,
179                                                        GCancellable         *cancellable,
180                                                        GError              **error);
181   void                (* enumerate_children_async)    (GFile                *file,
182                                                        const char           *attributes,
183                                                        GFileQueryInfoFlags   flags,
184                                                        int                   io_priority,
185                                                        GCancellable         *cancellable,
186                                                        GAsyncReadyCallback   callback,
187                                                        gpointer              user_data);
188   GFileEnumerator *   (* enumerate_children_finish)   (GFile                *file,
189                                                        GAsyncResult         *res,
190                                                        GError              **error);
191
192   GFileInfo *         (* query_info)                  (GFile                *file,
193                                                        const char           *attributes,
194                                                        GFileQueryInfoFlags   flags,
195                                                        GCancellable         *cancellable,
196                                                        GError              **error);
197   void                (* query_info_async)            (GFile                *file,
198                                                        const char           *attributes,
199                                                        GFileQueryInfoFlags   flags,
200                                                        int                   io_priority,
201                                                        GCancellable         *cancellable,
202                                                        GAsyncReadyCallback   callback,
203                                                        gpointer              user_data);
204   GFileInfo *         (* query_info_finish)           (GFile                *file,
205                                                        GAsyncResult         *res,
206                                                        GError              **error);
207
208   GFileInfo *         (* query_filesystem_info)       (GFile                *file,
209                                                        const char           *attributes,
210                                                        GCancellable         *cancellable,
211                                                        GError              **error);
212   void                (* query_filesystem_info_async) (GFile                *file,
213                                                        const char           *attributes,
214                                                        int                   io_priority,
215                                                        GCancellable         *cancellable,
216                                                        GAsyncReadyCallback   callback,
217                                                        gpointer              user_data);
218   GFileInfo *         (* query_filesystem_info_finish)(GFile                *file,
219                                                        GAsyncResult         *res,
220                                                        GError              **error);
221
222   GMount *            (* find_enclosing_mount)        (GFile                *file,
223                                                        GCancellable         *cancellable,
224                                                        GError              **error);
225   void                (* find_enclosing_mount_async)  (GFile                *file,
226                                                        int                   io_priority,
227                                                        GCancellable         *cancellable,
228                                                        GAsyncReadyCallback   callback,
229                                                        gpointer              user_data);
230   GMount *            (* find_enclosing_mount_finish) (GFile                *file,
231                                                        GAsyncResult         *res,
232                                                        GError              **error);
233
234   GFile *             (* set_display_name)            (GFile                *file,
235                                                        const char           *display_name,
236                                                        GCancellable         *cancellable,
237                                                        GError              **error);
238   void                (* set_display_name_async)      (GFile                *file,
239                                                        const char           *display_name,
240                                                        int                   io_priority,
241                                                        GCancellable         *cancellable,
242                                                        GAsyncReadyCallback   callback,
243                                                        gpointer              user_data);
244   GFile *             (* set_display_name_finish)     (GFile                *file,
245                                                        GAsyncResult         *res,
246                                                        GError              **error);
247
248   GFileAttributeInfoList * (* query_settable_attributes)    (GFile          *file,
249                                                              GCancellable   *cancellable,
250                                                              GError        **error);
251   void                (* _query_settable_attributes_async)  (void);
252   void                (* _query_settable_attributes_finish) (void);
253
254   GFileAttributeInfoList * (* query_writable_namespaces)    (GFile          *file,
255                                                              GCancellable   *cancellable,
256                                                              GError        **error);
257   void                (* _query_writable_namespaces_async)  (void);
258   void                (* _query_writable_namespaces_finish) (void);
259
260   gboolean            (* set_attribute)               (GFile                *file,
261                                                        const char           *attribute,
262                                                        GFileAttributeType    type,
263                                                        gpointer              value_p,
264                                                        GFileQueryInfoFlags   flags,
265                                                        GCancellable         *cancellable,
266                                                        GError              **error);
267   gboolean            (* set_attributes_from_info)    (GFile                *file,
268                                                        GFileInfo            *info,
269                                                        GFileQueryInfoFlags   flags,
270                                                        GCancellable         *cancellable,
271                                                        GError              **error);
272   void                (* set_attributes_async)        (GFile                *file,
273                                                        GFileInfo            *info,
274                                                        GFileQueryInfoFlags   flags,
275                                                        int                   io_priority,
276                                                        GCancellable         *cancellable,
277                                                        GAsyncReadyCallback   callback,
278                                                        gpointer              user_data);
279   gboolean            (* set_attributes_finish)       (GFile                *file,
280                                                        GAsyncResult         *result,
281                                                        GFileInfo           **info,
282                                                        GError              **error);
283
284   GFileInputStream *  (* read_fn)                     (GFile                *file,
285                                                        GCancellable         *cancellable,
286                                                        GError              **error);
287   void                (* read_async)                  (GFile                *file,
288                                                        int                   io_priority,
289                                                        GCancellable         *cancellable,
290                                                        GAsyncReadyCallback   callback,
291                                                        gpointer              user_data);
292   GFileInputStream *  (* read_finish)                 (GFile                *file,
293                                                        GAsyncResult         *res,
294                                                        GError              **error);
295
296   GFileOutputStream * (* append_to)                   (GFile                *file,
297                                                        GFileCreateFlags      flags,
298                                                        GCancellable         *cancellable,
299                                                        GError              **error);
300   void                (* append_to_async)             (GFile                *file,
301                                                        GFileCreateFlags      flags,
302                                                        int                   io_priority,
303                                                        GCancellable         *cancellable,
304                                                        GAsyncReadyCallback   callback,
305                                                        gpointer              user_data);
306   GFileOutputStream * (* append_to_finish)            (GFile                *file,
307                                                        GAsyncResult         *res,
308                                                        GError              **error);
309
310   GFileOutputStream * (* create)                      (GFile                *file,
311                                                        GFileCreateFlags      flags,
312                                                        GCancellable         *cancellable,
313                                                        GError              **error);
314   void                (* create_async)                (GFile                *file,
315                                                        GFileCreateFlags      flags,
316                                                        int                   io_priority,
317                                                        GCancellable         *cancellable,
318                                                        GAsyncReadyCallback   callback,
319                                                        gpointer              user_data);
320   GFileOutputStream * (* create_finish)               (GFile                *file,
321                                                        GAsyncResult         *res,
322                                                        GError              **error);
323
324   GFileOutputStream * (* replace)                     (GFile                *file,
325                                                        const char           *etag,
326                                                        gboolean              make_backup,
327                                                        GFileCreateFlags      flags,
328                                                        GCancellable         *cancellable,
329                                                        GError              **error);
330   void                (* replace_async)               (GFile                *file,
331                                                        const char           *etag,
332                                                        gboolean              make_backup,
333                                                        GFileCreateFlags      flags,
334                                                        int                   io_priority,
335                                                        GCancellable         *cancellable,
336                                                        GAsyncReadyCallback   callback,
337                                                        gpointer              user_data);
338   GFileOutputStream * (* replace_finish)              (GFile                *file,
339                                                        GAsyncResult         *res,
340                                                        GError              **error);
341
342   gboolean            (* delete_file)                 (GFile                *file,
343                                                        GCancellable         *cancellable,
344                                                        GError              **error);
345   void                (* _delete_file_async)          (void);
346   void                (* _delete_file_finish)         (void);
347
348   gboolean            (* trash)                       (GFile                *file,
349                                                        GCancellable         *cancellable,
350                                                        GError              **error);
351   void                (* _trash_async)                (void);
352   void                (* _trash_finish)               (void);
353
354   gboolean            (* make_directory)              (GFile                *file,
355                                                        GCancellable         *cancellable,
356                                                        GError              **error);
357   void                (* _make_directory_async)       (void);
358   void                (* _make_directory_finish)      (void);
359
360   gboolean            (* make_symbolic_link)          (GFile                *file,
361                                                        const char           *symlink_value,
362                                                        GCancellable         *cancellable,
363                                                        GError              **error);
364   void                (* _make_symbolic_link_async)   (void);
365   void                (* _make_symbolic_link_finish)  (void);
366
367   gboolean            (* copy)                        (GFile                *source,
368                                                        GFile                *destination,
369                                                        GFileCopyFlags        flags,
370                                                        GCancellable         *cancellable,
371                                                        GFileProgressCallback progress_callback,
372                                                        gpointer              progress_callback_data,
373                                                        GError              **error);
374   void                (* copy_async)                  (GFile                *source,
375                                                        GFile                *destination,
376                                                        GFileCopyFlags        flags,
377                                                        int                   io_priority,
378                                                        GCancellable         *cancellable,
379                                                        GFileProgressCallback progress_callback,
380                                                        gpointer              progress_callback_data,
381                                                        GAsyncReadyCallback   callback,
382                                                        gpointer              user_data);
383   gboolean            (* copy_finish)                 (GFile                *file,
384                                                        GAsyncResult         *res,
385                                                        GError              **error);
386
387   gboolean            (* move)                        (GFile                *source,
388                                                        GFile                *destination,
389                                                        GFileCopyFlags        flags,
390                                                        GCancellable         *cancellable,
391                                                        GFileProgressCallback progress_callback,
392                                                        gpointer              progress_callback_data,
393                                                        GError              **error);
394   void                (* _move_async)                 (void);
395   void                (* _move_finish)                (void);
396
397   void                (* mount_mountable)             (GFile                *file,
398                                                        GMountMountFlags      flags,
399                                                        GMountOperation      *mount_operation,
400                                                        GCancellable         *cancellable,
401                                                        GAsyncReadyCallback   callback,
402                                                        gpointer              user_data);
403   GFile *             (* mount_mountable_finish)      (GFile                *file,
404                                                        GAsyncResult         *result,
405                                                        GError              **error);
406
407   void                (* unmount_mountable)           (GFile                *file,
408                                                        GMountUnmountFlags    flags,
409                                                        GCancellable         *cancellable,
410                                                        GAsyncReadyCallback   callback,
411                                                        gpointer              user_data);
412   gboolean            (* unmount_mountable_finish)    (GFile                *file,
413                                                        GAsyncResult         *result,
414                                                        GError              **error);
415
416   void                (* eject_mountable)             (GFile                *file,
417                                                        GMountUnmountFlags    flags,
418                                                        GCancellable         *cancellable,
419                                                        GAsyncReadyCallback   callback,
420                                                        gpointer              user_data);
421   gboolean            (* eject_mountable_finish)      (GFile                *file,
422                                                        GAsyncResult         *result,
423                                                        GError              **error);
424
425   void                (* mount_enclosing_volume)      (GFile                *location,
426                                                        GMountMountFlags      flags,
427                                                        GMountOperation      *mount_operation,
428                                                        GCancellable         *cancellable,
429                                                        GAsyncReadyCallback   callback,
430                                                        gpointer              user_data);
431   gboolean         (* mount_enclosing_volume_finish)  (GFile                *location,
432                                                        GAsyncResult         *result,
433                                                        GError              **error);
434
435   GFileMonitor *      (* monitor_dir)                 (GFile                *file,
436                                                        GFileMonitorFlags     flags,
437                                                        GCancellable         *cancellable,
438                                                        GError              **error);
439   GFileMonitor *      (* monitor_file)                (GFile                *file,
440                                                        GFileMonitorFlags     flags,
441                                                        GCancellable         *cancellable,
442                                                        GError              **error);
443
444   GFileIOStream *     (* open_readwrite)              (GFile                *file,
445                                                        GCancellable         *cancellable,
446                                                        GError              **error);
447   void                (* open_readwrite_async)        (GFile                *file,
448                                                        int                   io_priority,
449                                                        GCancellable         *cancellable,
450                                                        GAsyncReadyCallback   callback,
451                                                        gpointer              user_data);
452   GFileIOStream *     (* open_readwrite_finish)       (GFile                *file,
453                                                        GAsyncResult         *res,
454                                                        GError              **error);
455   GFileIOStream *     (* create_readwrite)            (GFile                *file,
456                                                        GFileCreateFlags      flags,
457                                                        GCancellable         *cancellable,
458                                                        GError              **error);
459   void                (* create_readwrite_async)      (GFile                *file,
460                                                        GFileCreateFlags      flags,
461                                                        int                   io_priority,
462                                                        GCancellable         *cancellable,
463                                                        GAsyncReadyCallback   callback,
464                                                        gpointer              user_data);
465   GFileIOStream *     (* create_readwrite_finish)      (GFile                *file,
466                                                        GAsyncResult         *res,
467                                                        GError              **error);
468   GFileIOStream *     (* replace_readwrite)           (GFile                *file,
469                                                        const char           *etag,
470                                                        gboolean              make_backup,
471                                                        GFileCreateFlags      flags,
472                                                        GCancellable         *cancellable,
473                                                        GError              **error);
474   void                (* replace_readwrite_async)     (GFile                *file,
475                                                        const char           *etag,
476                                                        gboolean              make_backup,
477                                                        GFileCreateFlags      flags,
478                                                        int                   io_priority,
479                                                        GCancellable         *cancellable,
480                                                        GAsyncReadyCallback   callback,
481                                                        gpointer              user_data);
482   GFileIOStream *     (* replace_readwrite_finish)    (GFile                *file,
483                                                        GAsyncResult         *res,
484                                                        GError              **error);
485 };
486
487 GType                   g_file_get_type                   (void) G_GNUC_CONST;
488
489 GFile *                 g_file_new_for_path               (const char                 *path);
490 GFile *                 g_file_new_for_uri                (const char                 *uri);
491 GFile *                 g_file_new_for_commandline_arg    (const char                 *arg);
492 GFile *                 g_file_parse_name                 (const char                 *parse_name);
493 GFile *                 g_file_dup                        (GFile                      *file);
494 guint                   g_file_hash                       (gconstpointer               file);
495 gboolean                g_file_equal                      (GFile                      *file1,
496                                                            GFile                      *file2);
497 char *                  g_file_get_basename               (GFile                      *file);
498 char *                  g_file_get_path                   (GFile                      *file);
499 char *                  g_file_get_uri                    (GFile                      *file);
500 char *                  g_file_get_parse_name             (GFile                      *file);
501 GFile *                 g_file_get_parent                 (GFile                      *file);
502 GFile *                 g_file_get_child                  (GFile                      *file,
503                                                            const char                 *name);
504 GFile *                 g_file_get_child_for_display_name (GFile                      *file,
505                                                            const char                 *display_name,
506                                                            GError                    **error);
507 gboolean                g_file_has_prefix                 (GFile                      *file,
508                                                            GFile                      *prefix);
509 char *                  g_file_get_relative_path          (GFile                      *parent,
510                                                            GFile                      *descendant);
511 GFile *                 g_file_resolve_relative_path      (GFile                      *file,
512                                                            const char                 *relative_path);
513 gboolean                g_file_is_native                  (GFile                      *file);
514 gboolean                g_file_has_uri_scheme             (GFile                      *file,
515                                                            const char                 *uri_scheme);
516 char *                  g_file_get_uri_scheme             (GFile                      *file);
517 GFileInputStream *      g_file_read                       (GFile                      *file,
518                                                            GCancellable               *cancellable,
519                                                            GError                    **error);
520 void                    g_file_read_async                 (GFile                      *file,
521                                                            int                         io_priority,
522                                                            GCancellable               *cancellable,
523                                                            GAsyncReadyCallback         callback,
524                                                            gpointer                    user_data);
525 GFileInputStream *      g_file_read_finish                (GFile                      *file,
526                                                            GAsyncResult               *res,
527                                                            GError                    **error);
528 GFileOutputStream *     g_file_append_to                  (GFile                      *file,
529                                                            GFileCreateFlags             flags,
530                                                            GCancellable               *cancellable,
531                                                            GError                    **error);
532 GFileOutputStream *     g_file_create                     (GFile                      *file,
533                                                            GFileCreateFlags             flags,
534                                                            GCancellable               *cancellable,
535                                                            GError                    **error);
536 GFileOutputStream *     g_file_replace                    (GFile                      *file,
537                                                            const char                 *etag,
538                                                            gboolean                    make_backup,
539                                                            GFileCreateFlags            flags,
540                                                            GCancellable               *cancellable,
541                                                            GError                    **error);
542 void                    g_file_append_to_async            (GFile                      *file,
543                                                            GFileCreateFlags            flags,
544                                                            int                         io_priority,
545                                                            GCancellable               *cancellable,
546                                                            GAsyncReadyCallback         callback,
547                                                            gpointer                    user_data);
548 GFileOutputStream *     g_file_append_to_finish           (GFile                      *file,
549                                                            GAsyncResult               *res,
550                                                            GError                    **error);
551 void                    g_file_create_async               (GFile                      *file,
552                                                            GFileCreateFlags            flags,
553                                                            int                         io_priority,
554                                                            GCancellable               *cancellable,
555                                                            GAsyncReadyCallback         callback,
556                                                            gpointer                    user_data);
557 GFileOutputStream *     g_file_create_finish              (GFile                      *file,
558                                                            GAsyncResult               *res,
559                                                            GError                    **error);
560 void                    g_file_replace_async              (GFile                      *file,
561                                                            const char                 *etag,
562                                                            gboolean                    make_backup,
563                                                            GFileCreateFlags            flags,
564                                                            int                         io_priority,
565                                                            GCancellable               *cancellable,
566                                                            GAsyncReadyCallback         callback,
567                                                            gpointer                    user_data);
568 GFileOutputStream *     g_file_replace_finish             (GFile                      *file,
569                                                            GAsyncResult               *res,
570                                                            GError                    **error);
571 GFileIOStream *         g_file_open_readwrite             (GFile                      *file,
572                                                            GCancellable               *cancellable,
573                                                            GError                    **error);
574 void                    g_file_open_readwrite_async       (GFile                      *file,
575                                                            int                         io_priority,
576                                                            GCancellable               *cancellable,
577                                                            GAsyncReadyCallback         callback,
578                                                            gpointer                    user_data);
579 GFileIOStream *         g_file_open_readwrite_finish      (GFile                      *file,
580                                                            GAsyncResult               *res,
581                                                            GError                    **error);
582 GFileIOStream *         g_file_create_readwrite           (GFile                      *file,
583                                                            GFileCreateFlags            flags,
584                                                            GCancellable               *cancellable,
585                                                            GError                    **error);
586 void                    g_file_create_readwrite_async     (GFile                      *file,
587                                                            GFileCreateFlags            flags,
588                                                            int                         io_priority,
589                                                            GCancellable               *cancellable,
590                                                            GAsyncReadyCallback         callback,
591                                                            gpointer                    user_data);
592 GFileIOStream *         g_file_create_readwrite_finish    (GFile                      *file,
593                                                            GAsyncResult               *res,
594                                                            GError                    **error);
595 GFileIOStream *         g_file_replace_readwrite          (GFile                      *file,
596                                                            const char                 *etag,
597                                                            gboolean                    make_backup,
598                                                            GFileCreateFlags            flags,
599                                                            GCancellable               *cancellable,
600                                                            GError                    **error);
601 void                    g_file_replace_readwrite_async    (GFile                      *file,
602                                                            const char                 *etag,
603                                                            gboolean                    make_backup,
604                                                            GFileCreateFlags            flags,
605                                                            int                         io_priority,
606                                                            GCancellable               *cancellable,
607                                                            GAsyncReadyCallback         callback,
608                                                            gpointer                    user_data);
609 GFileIOStream *         g_file_replace_readwrite_finish   (GFile                      *file,
610                                                            GAsyncResult               *res,
611                                                            GError                    **error);
612 gboolean                g_file_query_exists               (GFile                      *file,
613                                                            GCancellable               *cancellable);
614 GFileType               g_file_query_file_type            (GFile                      *file,
615                                                            GFileQueryInfoFlags         flags,
616                                                            GCancellable               *cancellable);
617 GFileInfo *             g_file_query_info                 (GFile                      *file,
618                                                            const char                 *attributes,
619                                                            GFileQueryInfoFlags         flags,
620                                                            GCancellable               *cancellable,
621                                                            GError                    **error);
622 void                    g_file_query_info_async           (GFile                      *file,
623                                                            const char                 *attributes,
624                                                            GFileQueryInfoFlags         flags,
625                                                            int                         io_priority,
626                                                            GCancellable               *cancellable,
627                                                            GAsyncReadyCallback         callback,
628                                                            gpointer                    user_data);
629 GFileInfo *             g_file_query_info_finish          (GFile                      *file,
630                                                            GAsyncResult               *res,
631                                                            GError                    **error);
632 GFileInfo *             g_file_query_filesystem_info      (GFile                      *file,
633                                                            const char                 *attributes,
634                                                            GCancellable               *cancellable,
635                                                            GError                    **error);
636 void                    g_file_query_filesystem_info_async (GFile                      *file,
637                                                            const char                 *attributes,
638                                                            int                         io_priority,
639                                                            GCancellable               *cancellable,
640                                                            GAsyncReadyCallback         callback,
641                                                            gpointer                    user_data);
642 GFileInfo *             g_file_query_filesystem_info_finish (GFile                      *file,
643                                                            GAsyncResult               *res,
644                                                            GError                    **error);
645 GMount *                g_file_find_enclosing_mount       (GFile                      *file,
646                                                            GCancellable               *cancellable,
647                                                            GError                    **error);
648 void                    g_file_find_enclosing_mount_async (GFile                      *file,
649                                                            int                         io_priority,
650                                                            GCancellable               *cancellable,
651                                                            GAsyncReadyCallback         callback,
652                                                            gpointer                    user_data);
653 GMount *                g_file_find_enclosing_mount_finish (GFile                     *file,
654                                                             GAsyncResult              *res,
655                                                             GError                   **error);
656 GFileEnumerator *       g_file_enumerate_children         (GFile                      *file,
657                                                            const char                 *attributes,
658                                                            GFileQueryInfoFlags         flags,
659                                                            GCancellable               *cancellable,
660                                                            GError                    **error);
661 void                    g_file_enumerate_children_async   (GFile                      *file,
662                                                            const char                 *attributes,
663                                                            GFileQueryInfoFlags         flags,
664                                                            int                         io_priority,
665                                                            GCancellable               *cancellable,
666                                                            GAsyncReadyCallback         callback,
667                                                            gpointer                    user_data);
668 GFileEnumerator *       g_file_enumerate_children_finish  (GFile                      *file,
669                                                            GAsyncResult               *res,
670                                                            GError                    **error);
671 GFile *                 g_file_set_display_name           (GFile                      *file,
672                                                            const char                 *display_name,
673                                                            GCancellable               *cancellable,
674                                                            GError                    **error);
675 void                    g_file_set_display_name_async     (GFile                      *file,
676                                                            const char                 *display_name,
677                                                            int                         io_priority,
678                                                            GCancellable               *cancellable,
679                                                            GAsyncReadyCallback         callback,
680                                                            gpointer                    user_data);
681 GFile *                 g_file_set_display_name_finish    (GFile                      *file,
682                                                            GAsyncResult               *res,
683                                                            GError                    **error);
684 gboolean                g_file_delete                     (GFile                      *file,
685                                                            GCancellable               *cancellable,
686                                                            GError                    **error);
687 gboolean                g_file_trash                      (GFile                      *file,
688                                                            GCancellable               *cancellable,
689                                                            GError                    **error);
690 gboolean                g_file_copy                       (GFile                      *source,
691                                                            GFile                      *destination,
692                                                            GFileCopyFlags              flags,
693                                                            GCancellable               *cancellable,
694                                                            GFileProgressCallback       progress_callback,
695                                                            gpointer                    progress_callback_data,
696                                                            GError                    **error);
697 void                    g_file_copy_async                 (GFile                      *source,
698                                                            GFile                      *destination,
699                                                            GFileCopyFlags              flags,
700                                                            int                         io_priority,
701                                                            GCancellable               *cancellable,
702                                                            GFileProgressCallback       progress_callback,
703                                                            gpointer                    progress_callback_data,
704                                                            GAsyncReadyCallback         callback,
705                                                            gpointer                    user_data);
706 gboolean                g_file_copy_finish                (GFile                      *file,
707                                                            GAsyncResult               *res,
708                                                            GError                    **error);
709 gboolean                g_file_move                       (GFile                      *source,
710                                                            GFile                      *destination,
711                                                            GFileCopyFlags              flags,
712                                                            GCancellable               *cancellable,
713                                                            GFileProgressCallback       progress_callback,
714                                                            gpointer                    progress_callback_data,
715                                                            GError                    **error);
716 gboolean                g_file_make_directory             (GFile                      *file,
717                                                            GCancellable               *cancellable,
718                                                            GError                    **error);
719 gboolean                g_file_make_directory_with_parents (GFile                     *file,
720                                                            GCancellable               *cancellable,
721                                                            GError                    **error);
722 gboolean                g_file_make_symbolic_link         (GFile                      *file,
723                                                            const char                 *symlink_value,
724                                                            GCancellable               *cancellable,
725                                                            GError                    **error);
726 GFileAttributeInfoList *g_file_query_settable_attributes  (GFile                      *file,
727                                                            GCancellable               *cancellable,
728                                                            GError                    **error);
729 GFileAttributeInfoList *g_file_query_writable_namespaces  (GFile                      *file,
730                                                            GCancellable               *cancellable,
731                                                            GError                    **error);
732 gboolean                g_file_set_attribute              (GFile                      *file,
733                                                            const char                 *attribute,
734                                                            GFileAttributeType          type,
735                                                            gpointer                    value_p,
736                                                            GFileQueryInfoFlags         flags,
737                                                            GCancellable               *cancellable,
738                                                            GError                    **error);
739 gboolean                g_file_set_attributes_from_info   (GFile                      *file,
740                                                            GFileInfo                  *info,
741                                                            GFileQueryInfoFlags         flags,
742                                                            GCancellable               *cancellable,
743                                                            GError                    **error);
744 void                    g_file_set_attributes_async       (GFile                      *file,
745                                                            GFileInfo                  *info,
746                                                            GFileQueryInfoFlags         flags,
747                                                            int                         io_priority,
748                                                            GCancellable               *cancellable,
749                                                            GAsyncReadyCallback         callback,
750                                                            gpointer                    user_data);
751 gboolean                g_file_set_attributes_finish      (GFile                      *file,
752                                                            GAsyncResult               *result,
753                                                            GFileInfo                 **info,
754                                                            GError                    **error);
755 gboolean                g_file_set_attribute_string       (GFile                      *file,
756                                                            const char                 *attribute,
757                                                            const char                 *value,
758                                                            GFileQueryInfoFlags         flags,
759                                                            GCancellable               *cancellable,
760                                                            GError                    **error);
761 gboolean                g_file_set_attribute_byte_string  (GFile                      *file,
762                                                            const char                 *attribute,
763                                                            const char                 *value,
764                                                            GFileQueryInfoFlags         flags,
765                                                            GCancellable               *cancellable,
766                                                            GError                    **error);
767 gboolean                g_file_set_attribute_uint32       (GFile                      *file,
768                                                            const char                 *attribute,
769                                                            guint32                     value,
770                                                            GFileQueryInfoFlags         flags,
771                                                            GCancellable               *cancellable,
772                                                            GError                    **error);
773 gboolean                g_file_set_attribute_int32        (GFile                      *file,
774                                                            const char                 *attribute,
775                                                            gint32                      value,
776                                                            GFileQueryInfoFlags         flags,
777                                                            GCancellable               *cancellable,
778                                                            GError                    **error);
779 gboolean                g_file_set_attribute_uint64       (GFile                      *file,
780                                                            const char                 *attribute,
781                                                            guint64                     value,
782                                                            GFileQueryInfoFlags         flags,
783                                                            GCancellable               *cancellable,
784                                                            GError                    **error);
785 gboolean                g_file_set_attribute_int64        (GFile                      *file,
786                                                            const char                 *attribute,
787                                                            gint64                      value,
788                                                            GFileQueryInfoFlags         flags,
789                                                            GCancellable               *cancellable,
790                                                            GError                    **error);
791 void                    g_file_mount_enclosing_volume     (GFile                      *location,
792                                                            GMountMountFlags            flags,
793                                                            GMountOperation            *mount_operation,
794                                                            GCancellable               *cancellable,
795                                                            GAsyncReadyCallback         callback,
796                                                            gpointer                    user_data);
797 gboolean                g_file_mount_enclosing_volume_finish (GFile                      *location,
798                                                            GAsyncResult               *result,
799                                                            GError                    **error);
800 void                    g_file_mount_mountable            (GFile                      *file,
801                                                            GMountMountFlags            flags,
802                                                            GMountOperation            *mount_operation,
803                                                            GCancellable               *cancellable,
804                                                            GAsyncReadyCallback         callback,
805                                                            gpointer                    user_data);
806 GFile *                 g_file_mount_mountable_finish     (GFile                      *file,
807                                                            GAsyncResult               *result,
808                                                            GError                    **error);
809 void                    g_file_unmount_mountable          (GFile                      *file,
810                                                            GMountUnmountFlags          flags,
811                                                            GCancellable               *cancellable,
812                                                            GAsyncReadyCallback         callback,
813                                                            gpointer                    user_data);
814 gboolean                g_file_unmount_mountable_finish   (GFile                      *file,
815                                                            GAsyncResult               *result,
816                                                            GError                    **error);
817 void                    g_file_eject_mountable            (GFile                      *file,
818                                                            GMountUnmountFlags          flags,
819                                                            GCancellable               *cancellable,
820                                                            GAsyncReadyCallback         callback,
821                                                            gpointer                    user_data);
822 gboolean                g_file_eject_mountable_finish     (GFile                      *file,
823                                                            GAsyncResult               *result,
824                                                            GError                    **error);
825
826 gboolean                g_file_copy_attributes            (GFile                      *source,
827                                                            GFile                      *destination,
828                                                            GFileCopyFlags              flags,
829                                                            GCancellable               *cancellable,
830                                                            GError                    **error);
831
832
833 GFileMonitor*           g_file_monitor_directory          (GFile                  *file,
834                                                            GFileMonitorFlags       flags,
835                                                            GCancellable           *cancellable,
836                                                            GError                **error);
837 GFileMonitor*           g_file_monitor_file               (GFile                  *file,
838                                                            GFileMonitorFlags       flags,
839                                                            GCancellable           *cancellable,
840                                                            GError                **error);
841 GFileMonitor*           g_file_monitor                    (GFile                  *file,
842                                                            GFileMonitorFlags       flags,
843                                                            GCancellable           *cancellable,
844                                                            GError                **error);
845
846
847 /* Utilities */
848
849 GAppInfo *g_file_query_default_handler       (GFile                  *file,
850                                               GCancellable           *cancellable,
851                                               GError                **error);
852 gboolean g_file_load_contents                (GFile                  *file,
853                                               GCancellable           *cancellable,
854                                               char                  **contents,
855                                               gsize                  *length,
856                                               char                  **etag_out,
857                                               GError                **error);
858 void     g_file_load_contents_async          (GFile                  *file,
859                                               GCancellable           *cancellable,
860                                               GAsyncReadyCallback     callback,
861                                               gpointer                user_data);
862 gboolean g_file_load_contents_finish         (GFile                  *file,
863                                               GAsyncResult           *res,
864                                               char                  **contents,
865                                               gsize                  *length,
866                                               char                  **etag_out,
867                                               GError                **error);
868 void     g_file_load_partial_contents_async  (GFile                  *file,
869                                               GCancellable           *cancellable,
870                                               GFileReadMoreCallback   read_more_callback,
871                                               GAsyncReadyCallback     callback,
872                                               gpointer                user_data);
873 gboolean g_file_load_partial_contents_finish (GFile                  *file,
874                                               GAsyncResult           *res,
875                                               char                  **contents,
876                                               gsize                  *length,
877                                               char                  **etag_out,
878                                               GError                **error);
879 gboolean g_file_replace_contents             (GFile                  *file,
880                                               const char             *contents,
881                                               gsize                   length,
882                                               const char             *etag,
883                                               gboolean                make_backup,
884                                               GFileCreateFlags        flags,
885                                               char                  **new_etag,
886                                               GCancellable           *cancellable,
887                                               GError                **error);
888 void     g_file_replace_contents_async       (GFile                  *file,
889                                               const char             *contents,
890                                               gsize                   length,
891                                               const char             *etag,
892                                               gboolean                make_backup,
893                                               GFileCreateFlags        flags,
894                                               GCancellable           *cancellable,
895                                               GAsyncReadyCallback     callback,
896                                               gpointer                user_data);
897 gboolean g_file_replace_contents_finish      (GFile                  *file,
898                                               GAsyncResult           *res,
899                                               char                  **new_etag,
900                                               GError                **error);
901
902 G_END_DECLS
903
904 #endif /* __G_FILE_H__ */