Add GIOStream operations to GFile
[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  *
136  * An interface for writing VFS file handles.
137  **/
138 struct _GFileIface
139 {
140   GTypeInterface g_iface;
141
142   /* Virtual Table */
143
144   GFile *             (* dup)                         (GFile         *file);
145   guint               (* hash)                        (GFile         *file);
146   gboolean            (* equal)                       (GFile         *file1,
147                                                        GFile         *file2);
148   gboolean            (* is_native)                   (GFile         *file);
149   gboolean            (* has_uri_scheme)              (GFile         *file,
150                                                        const char    *uri_scheme);
151   char *              (* get_uri_scheme)              (GFile         *file);
152   char *              (* get_basename)                (GFile         *file);
153   char *              (* get_path)                    (GFile         *file);
154   char *              (* get_uri)                     (GFile         *file);
155   char *              (* get_parse_name)              (GFile         *file);
156   GFile *             (* get_parent)                  (GFile         *file);
157   gboolean            (* prefix_matches)              (GFile         *prefix,
158                                                        GFile         *file);
159   char *              (* get_relative_path)           (GFile         *parent,
160                                                        GFile         *descendant);
161   GFile *             (* resolve_relative_path)       (GFile        *file,
162                                                        const char   *relative_path);
163   GFile *             (* get_child_for_display_name)  (GFile        *file,
164                                                        const char   *display_name,
165                                                        GError      **error);
166
167   GFileEnumerator *   (* enumerate_children)          (GFile                *file,
168                                                        const char           *attributes,
169                                                        GFileQueryInfoFlags   flags,
170                                                        GCancellable         *cancellable,
171                                                        GError              **error);
172   void                (* enumerate_children_async)    (GFile                *file,
173                                                        const char           *attributes,
174                                                        GFileQueryInfoFlags   flags,
175                                                        int                   io_priority,
176                                                        GCancellable         *cancellable,
177                                                        GAsyncReadyCallback   callback,
178                                                        gpointer              user_data);
179   GFileEnumerator *   (* enumerate_children_finish)   (GFile                *file,
180                                                        GAsyncResult         *res,
181                                                        GError              **error);
182
183   GFileInfo *         (* query_info)                  (GFile                *file,
184                                                        const char           *attributes,
185                                                        GFileQueryInfoFlags   flags,
186                                                        GCancellable         *cancellable,
187                                                        GError              **error);
188   void                (* query_info_async)            (GFile                *file,
189                                                        const char           *attributes,
190                                                        GFileQueryInfoFlags   flags,
191                                                        int                   io_priority,
192                                                        GCancellable         *cancellable,
193                                                        GAsyncReadyCallback   callback,
194                                                        gpointer              user_data);
195   GFileInfo *         (* query_info_finish)           (GFile                *file,
196                                                        GAsyncResult         *res,
197                                                        GError              **error);
198
199   GFileInfo *         (* query_filesystem_info)       (GFile                *file,
200                                                        const char           *attributes,
201                                                        GCancellable         *cancellable,
202                                                        GError              **error);
203   void                (* query_filesystem_info_async) (GFile                *file,
204                                                        const char           *attributes,
205                                                        int                   io_priority,
206                                                        GCancellable         *cancellable,
207                                                        GAsyncReadyCallback   callback,
208                                                        gpointer              user_data);
209   GFileInfo *         (* query_filesystem_info_finish)(GFile                *file,
210                                                        GAsyncResult         *res,
211                                                        GError              **error);
212
213   GMount *            (* find_enclosing_mount)        (GFile                *file,
214                                                        GCancellable         *cancellable,
215                                                        GError              **error);
216   void                (* find_enclosing_mount_async)  (GFile                *file,
217                                                        int                   io_priority,
218                                                        GCancellable         *cancellable,
219                                                        GAsyncReadyCallback   callback,
220                                                        gpointer              user_data);
221   GMount *            (* find_enclosing_mount_finish) (GFile                *file,
222                                                        GAsyncResult         *res,
223                                                        GError              **error);
224
225   GFile *             (* set_display_name)            (GFile                *file,
226                                                        const char           *display_name,
227                                                        GCancellable         *cancellable,
228                                                        GError              **error);
229   void                (* set_display_name_async)      (GFile                *file,
230                                                        const char           *display_name,
231                                                        int                   io_priority,
232                                                        GCancellable         *cancellable,
233                                                        GAsyncReadyCallback   callback,
234                                                        gpointer              user_data);
235   GFile *             (* set_display_name_finish)     (GFile                *file,
236                                                        GAsyncResult         *res,
237                                                        GError              **error);
238
239   GFileAttributeInfoList * (* query_settable_attributes)    (GFile          *file,
240                                                              GCancellable   *cancellable,
241                                                              GError        **error);
242   void                (* _query_settable_attributes_async)  (void);
243   void                (* _query_settable_attributes_finish) (void);
244
245   GFileAttributeInfoList * (* query_writable_namespaces)    (GFile          *file,
246                                                              GCancellable   *cancellable,
247                                                              GError        **error);
248   void                (* _query_writable_namespaces_async)  (void);
249   void                (* _query_writable_namespaces_finish) (void);
250
251   gboolean            (* set_attribute)               (GFile                *file,
252                                                        const char           *attribute,
253                                                        GFileAttributeType    type,
254                                                        gpointer              value_p,
255                                                        GFileQueryInfoFlags   flags,
256                                                        GCancellable         *cancellable,
257                                                        GError              **error);
258   gboolean            (* set_attributes_from_info)    (GFile                *file,
259                                                        GFileInfo            *info,
260                                                        GFileQueryInfoFlags   flags,
261                                                        GCancellable         *cancellable,
262                                                        GError              **error);
263   void                (* set_attributes_async)        (GFile                *file,
264                                                        GFileInfo            *info,
265                                                        GFileQueryInfoFlags   flags,
266                                                        int                   io_priority,
267                                                        GCancellable         *cancellable,
268                                                        GAsyncReadyCallback   callback,
269                                                        gpointer              user_data);
270   gboolean            (* set_attributes_finish)       (GFile                *file,
271                                                        GAsyncResult         *result,
272                                                        GFileInfo           **info,
273                                                        GError              **error);
274
275   GFileInputStream *  (* read_fn)                     (GFile                *file,
276                                                        GCancellable         *cancellable,
277                                                        GError              **error);
278   void                (* read_async)                  (GFile                *file,
279                                                        int                   io_priority,
280                                                        GCancellable         *cancellable,
281                                                        GAsyncReadyCallback   callback,
282                                                        gpointer              user_data);
283   GFileInputStream *  (* read_finish)                 (GFile                *file,
284                                                        GAsyncResult         *res,
285                                                        GError              **error);
286
287   GFileOutputStream * (* append_to)                   (GFile                *file,
288                                                        GFileCreateFlags      flags,
289                                                        GCancellable         *cancellable,
290                                                        GError              **error);
291   void                (* append_to_async)             (GFile                *file,
292                                                        GFileCreateFlags      flags,
293                                                        int                   io_priority,
294                                                        GCancellable         *cancellable,
295                                                        GAsyncReadyCallback   callback,
296                                                        gpointer              user_data);
297   GFileOutputStream * (* append_to_finish)            (GFile                *file,
298                                                        GAsyncResult         *res,
299                                                        GError              **error);
300
301   GFileOutputStream * (* create)                      (GFile                *file,
302                                                        GFileCreateFlags      flags,
303                                                        GCancellable         *cancellable,
304                                                        GError              **error);
305   void                (* create_async)                (GFile                *file,
306                                                        GFileCreateFlags      flags,
307                                                        int                   io_priority,
308                                                        GCancellable         *cancellable,
309                                                        GAsyncReadyCallback   callback,
310                                                        gpointer              user_data);
311   GFileOutputStream * (* create_finish)               (GFile                *file,
312                                                        GAsyncResult         *res,
313                                                        GError              **error);
314
315   GFileOutputStream * (* replace)                     (GFile                *file,
316                                                        const char           *etag,
317                                                        gboolean              make_backup,
318                                                        GFileCreateFlags      flags,
319                                                        GCancellable         *cancellable,
320                                                        GError              **error);
321   void                (* replace_async)               (GFile                *file,
322                                                        const char           *etag,
323                                                        gboolean              make_backup,
324                                                        GFileCreateFlags      flags,
325                                                        int                   io_priority,
326                                                        GCancellable         *cancellable,
327                                                        GAsyncReadyCallback   callback,
328                                                        gpointer              user_data);
329   GFileOutputStream * (* replace_finish)              (GFile                *file,
330                                                        GAsyncResult         *res,
331                                                        GError              **error);
332
333   gboolean            (* delete_file)                 (GFile                *file,
334                                                        GCancellable         *cancellable,
335                                                        GError              **error);
336   void                (* _delete_file_async)          (void);
337   void                (* _delete_file_finish)         (void);
338
339   gboolean            (* trash)                       (GFile                *file,
340                                                        GCancellable         *cancellable,
341                                                        GError              **error);
342   void                (* _trash_async)                (void);
343   void                (* _trash_finish)               (void);
344
345   gboolean            (* make_directory)              (GFile                *file,
346                                                        GCancellable         *cancellable,
347                                                        GError              **error);
348   void                (* _make_directory_async)       (void);
349   void                (* _make_directory_finish)      (void);
350
351   gboolean            (* make_symbolic_link)          (GFile                *file,
352                                                        const char           *symlink_value,
353                                                        GCancellable         *cancellable,
354                                                        GError              **error);
355   void                (* _make_symbolic_link_async)   (void);
356   void                (* _make_symbolic_link_finish)  (void);
357
358   gboolean            (* copy)                        (GFile                *source,
359                                                        GFile                *destination,
360                                                        GFileCopyFlags        flags,
361                                                        GCancellable         *cancellable,
362                                                        GFileProgressCallback progress_callback,
363                                                        gpointer              progress_callback_data,
364                                                        GError              **error);
365   void                (* copy_async)                  (GFile                *source,
366                                                        GFile                *destination,
367                                                        GFileCopyFlags        flags,
368                                                        int                   io_priority,
369                                                        GCancellable         *cancellable,
370                                                        GFileProgressCallback progress_callback,
371                                                        gpointer              progress_callback_data,
372                                                        GAsyncReadyCallback   callback,
373                                                        gpointer              user_data);
374   gboolean            (* copy_finish)                 (GFile                *file,
375                                                        GAsyncResult         *res,
376                                                        GError              **error);
377
378   gboolean            (* move)                        (GFile                *source,
379                                                        GFile                *destination,
380                                                        GFileCopyFlags        flags,
381                                                        GCancellable         *cancellable,
382                                                        GFileProgressCallback progress_callback,
383                                                        gpointer              progress_callback_data,
384                                                        GError              **error);
385   void                (* _move_async)                 (void);
386   void                (* _move_finish)                (void);
387
388   void                (* mount_mountable)             (GFile                *file,
389                                                        GMountMountFlags      flags,
390                                                        GMountOperation      *mount_operation,
391                                                        GCancellable         *cancellable,
392                                                        GAsyncReadyCallback   callback,
393                                                        gpointer              user_data);
394   GFile *             (* mount_mountable_finish)      (GFile                *file,
395                                                        GAsyncResult         *result,
396                                                        GError              **error);
397
398   void                (* unmount_mountable)           (GFile                *file,
399                                                        GMountUnmountFlags    flags,
400                                                        GCancellable         *cancellable,
401                                                        GAsyncReadyCallback   callback,
402                                                        gpointer              user_data);
403   gboolean            (* unmount_mountable_finish)    (GFile                *file,
404                                                        GAsyncResult         *result,
405                                                        GError              **error);
406
407   void                (* eject_mountable)             (GFile                *file,
408                                                        GMountUnmountFlags    flags,
409                                                        GCancellable         *cancellable,
410                                                        GAsyncReadyCallback   callback,
411                                                        gpointer              user_data);
412   gboolean            (* eject_mountable_finish)      (GFile                *file,
413                                                        GAsyncResult         *result,
414                                                        GError              **error);
415
416   void                (* mount_enclosing_volume)      (GFile                *location,
417                                                        GMountMountFlags      flags,
418                                                        GMountOperation      *mount_operation,
419                                                        GCancellable         *cancellable,
420                                                        GAsyncReadyCallback   callback,
421                                                        gpointer              user_data);
422   gboolean         (* mount_enclosing_volume_finish)  (GFile                *location,
423                                                        GAsyncResult         *result,
424                                                        GError              **error);
425
426   GFileMonitor *      (* monitor_dir)                 (GFile                *file,
427                                                        GFileMonitorFlags     flags,
428                                                        GCancellable         *cancellable,
429                                                        GError              **error);
430   GFileMonitor *      (* monitor_file)                (GFile                *file,
431                                                        GFileMonitorFlags     flags,
432                                                        GCancellable         *cancellable,
433                                                        GError              **error);
434
435   GFileIOStream *     (* open_readwrite)              (GFile                *file,
436                                                        GCancellable         *cancellable,
437                                                        GError              **error);
438   void                (* open_readwrite_async)        (GFile                *file,
439                                                        int                   io_priority,
440                                                        GCancellable         *cancellable,
441                                                        GAsyncReadyCallback   callback,
442                                                        gpointer              user_data);
443   GFileIOStream *     (* open_readwrite_finish)       (GFile                *file,
444                                                        GAsyncResult         *res,
445                                                        GError              **error);
446   GFileIOStream *     (* create_readwrite)            (GFile                *file,
447                                                        GFileCreateFlags      flags,
448                                                        GCancellable         *cancellable,
449                                                        GError              **error);
450   void                (* create_readwrite_async)      (GFile                *file,
451                                                        GFileCreateFlags      flags,
452                                                        int                   io_priority,
453                                                        GCancellable         *cancellable,
454                                                        GAsyncReadyCallback   callback,
455                                                        gpointer              user_data);
456   GFileIOStream *     (* create_readwrite_finish)      (GFile                *file,
457                                                        GAsyncResult         *res,
458                                                        GError              **error);
459   GFileIOStream *     (* replace_readwrite)           (GFile                *file,
460                                                        const char           *etag,
461                                                        gboolean              make_backup,
462                                                        GFileCreateFlags      flags,
463                                                        GCancellable         *cancellable,
464                                                        GError              **error);
465   void                (* replace_readwrite_async)     (GFile                *file,
466                                                        const char           *etag,
467                                                        gboolean              make_backup,
468                                                        GFileCreateFlags      flags,
469                                                        int                   io_priority,
470                                                        GCancellable         *cancellable,
471                                                        GAsyncReadyCallback   callback,
472                                                        gpointer              user_data);
473   GFileIOStream *     (* replace_readwrite_finish)    (GFile                *file,
474                                                        GAsyncResult         *res,
475                                                        GError              **error);
476 };
477
478 GType                   g_file_get_type                   (void) G_GNUC_CONST;
479
480 GFile *                 g_file_new_for_path               (const char                 *path);
481 GFile *                 g_file_new_for_uri                (const char                 *uri);
482 GFile *                 g_file_new_for_commandline_arg    (const char                 *arg);
483 GFile *                 g_file_parse_name                 (const char                 *parse_name);
484 GFile *                 g_file_dup                        (GFile                      *file);
485 guint                   g_file_hash                       (gconstpointer               file);
486 gboolean                g_file_equal                      (GFile                      *file1,
487                                                            GFile                      *file2);
488 char *                  g_file_get_basename               (GFile                      *file);
489 char *                  g_file_get_path                   (GFile                      *file);
490 char *                  g_file_get_uri                    (GFile                      *file);
491 char *                  g_file_get_parse_name             (GFile                      *file);
492 GFile *                 g_file_get_parent                 (GFile                      *file);
493 GFile *                 g_file_get_child                  (GFile                      *file,
494                                                            const char                 *name);
495 GFile *                 g_file_get_child_for_display_name (GFile                      *file,
496                                                            const char                 *display_name,
497                                                            GError                    **error);
498 gboolean                g_file_has_prefix                 (GFile                      *file,
499                                                            GFile                      *prefix);
500 char *                  g_file_get_relative_path          (GFile                      *parent,
501                                                            GFile                      *descendant);
502 GFile *                 g_file_resolve_relative_path      (GFile                      *file,
503                                                            const char                 *relative_path);
504 gboolean                g_file_is_native                  (GFile                      *file);
505 gboolean                g_file_has_uri_scheme             (GFile                      *file,
506                                                            const char                 *uri_scheme);
507 char *                  g_file_get_uri_scheme             (GFile                      *file);
508 GFileInputStream *      g_file_read                       (GFile                      *file,
509                                                            GCancellable               *cancellable,
510                                                            GError                    **error);
511 void                    g_file_read_async                 (GFile                      *file,
512                                                            int                         io_priority,
513                                                            GCancellable               *cancellable,
514                                                            GAsyncReadyCallback         callback,
515                                                            gpointer                    user_data);
516 GFileInputStream *      g_file_read_finish                (GFile                      *file,
517                                                            GAsyncResult               *res,
518                                                            GError                    **error);
519 GFileOutputStream *     g_file_append_to                  (GFile                      *file,
520                                                            GFileCreateFlags             flags,
521                                                            GCancellable               *cancellable,
522                                                            GError                    **error);
523 GFileOutputStream *     g_file_create                     (GFile                      *file,
524                                                            GFileCreateFlags             flags,
525                                                            GCancellable               *cancellable,
526                                                            GError                    **error);
527 GFileOutputStream *     g_file_replace                    (GFile                      *file,
528                                                            const char                 *etag,
529                                                            gboolean                    make_backup,
530                                                            GFileCreateFlags            flags,
531                                                            GCancellable               *cancellable,
532                                                            GError                    **error);
533 void                    g_file_append_to_async            (GFile                      *file,
534                                                            GFileCreateFlags            flags,
535                                                            int                         io_priority,
536                                                            GCancellable               *cancellable,
537                                                            GAsyncReadyCallback         callback,
538                                                            gpointer                    user_data);
539 GFileOutputStream *     g_file_append_to_finish           (GFile                      *file,
540                                                            GAsyncResult               *res,
541                                                            GError                    **error);
542 void                    g_file_create_async               (GFile                      *file,
543                                                            GFileCreateFlags            flags,
544                                                            int                         io_priority,
545                                                            GCancellable               *cancellable,
546                                                            GAsyncReadyCallback         callback,
547                                                            gpointer                    user_data);
548 GFileOutputStream *     g_file_create_finish              (GFile                      *file,
549                                                            GAsyncResult               *res,
550                                                            GError                    **error);
551 void                    g_file_replace_async              (GFile                      *file,
552                                                            const char                 *etag,
553                                                            gboolean                    make_backup,
554                                                            GFileCreateFlags            flags,
555                                                            int                         io_priority,
556                                                            GCancellable               *cancellable,
557                                                            GAsyncReadyCallback         callback,
558                                                            gpointer                    user_data);
559 GFileOutputStream *     g_file_replace_finish             (GFile                      *file,
560                                                            GAsyncResult               *res,
561                                                            GError                    **error);
562 GFileIOStream *         g_file_open_readwrite             (GFile                      *file,
563                                                            GCancellable               *cancellable,
564                                                            GError                    **error);
565 void                    g_file_open_readwrite_async       (GFile                      *file,
566                                                            int                         io_priority,
567                                                            GCancellable               *cancellable,
568                                                            GAsyncReadyCallback         callback,
569                                                            gpointer                    user_data);
570 GFileIOStream *         g_file_open_readwrite_finish      (GFile                      *file,
571                                                            GAsyncResult               *res,
572                                                            GError                    **error);
573 GFileIOStream *         g_file_create_readwrite           (GFile                      *file,
574                                                            GFileCreateFlags            flags,
575                                                            GCancellable               *cancellable,
576                                                            GError                    **error);
577 void                    g_file_create_readwrite_async     (GFile                      *file,
578                                                            GFileCreateFlags            flags,
579                                                            int                         io_priority,
580                                                            GCancellable               *cancellable,
581                                                            GAsyncReadyCallback         callback,
582                                                            gpointer                    user_data);
583 GFileIOStream *         g_file_create_readwrite_finish    (GFile                      *file,
584                                                            GAsyncResult               *res,
585                                                            GError                    **error);
586 GFileIOStream *         g_file_replace_readwrite          (GFile                      *file,
587                                                            const char                 *etag,
588                                                            gboolean                    make_backup,
589                                                            GFileCreateFlags            flags,
590                                                            GCancellable               *cancellable,
591                                                            GError                    **error);
592 void                    g_file_replace_readwrite_async    (GFile                      *file,
593                                                            const char                 *etag,
594                                                            gboolean                    make_backup,
595                                                            GFileCreateFlags            flags,
596                                                            int                         io_priority,
597                                                            GCancellable               *cancellable,
598                                                            GAsyncReadyCallback         callback,
599                                                            gpointer                    user_data);
600 GFileIOStream *         g_file_replace_readwrite_finish   (GFile                      *file,
601                                                            GAsyncResult               *res,
602                                                            GError                    **error);
603 gboolean                g_file_query_exists               (GFile                      *file,
604                                                            GCancellable               *cancellable);
605 GFileType               g_file_query_file_type            (GFile                      *file,
606                                                            GFileQueryInfoFlags         flags,
607                                                            GCancellable               *cancellable);
608 GFileInfo *             g_file_query_info                 (GFile                      *file,
609                                                            const char                 *attributes,
610                                                            GFileQueryInfoFlags         flags,
611                                                            GCancellable               *cancellable,
612                                                            GError                    **error);
613 void                    g_file_query_info_async           (GFile                      *file,
614                                                            const char                 *attributes,
615                                                            GFileQueryInfoFlags         flags,
616                                                            int                         io_priority,
617                                                            GCancellable               *cancellable,
618                                                            GAsyncReadyCallback         callback,
619                                                            gpointer                    user_data);
620 GFileInfo *             g_file_query_info_finish          (GFile                      *file,
621                                                            GAsyncResult               *res,
622                                                            GError                    **error);
623 GFileInfo *             g_file_query_filesystem_info      (GFile                      *file,
624                                                            const char                 *attributes,
625                                                            GCancellable               *cancellable,
626                                                            GError                    **error);
627 void                    g_file_query_filesystem_info_async (GFile                      *file,
628                                                            const char                 *attributes,
629                                                            int                         io_priority,
630                                                            GCancellable               *cancellable,
631                                                            GAsyncReadyCallback         callback,
632                                                            gpointer                    user_data);
633 GFileInfo *             g_file_query_filesystem_info_finish (GFile                      *file,
634                                                            GAsyncResult               *res,
635                                                            GError                    **error);
636 GMount *                g_file_find_enclosing_mount       (GFile                      *file,
637                                                            GCancellable               *cancellable,
638                                                            GError                    **error);
639 void                    g_file_find_enclosing_mount_async (GFile                      *file,
640                                                            int                         io_priority,
641                                                            GCancellable               *cancellable,
642                                                            GAsyncReadyCallback         callback,
643                                                            gpointer                    user_data);
644 GMount *                g_file_find_enclosing_mount_finish (GFile                     *file,
645                                                             GAsyncResult              *res,
646                                                             GError                   **error);
647 GFileEnumerator *       g_file_enumerate_children         (GFile                      *file,
648                                                            const char                 *attributes,
649                                                            GFileQueryInfoFlags         flags,
650                                                            GCancellable               *cancellable,
651                                                            GError                    **error);
652 void                    g_file_enumerate_children_async   (GFile                      *file,
653                                                            const char                 *attributes,
654                                                            GFileQueryInfoFlags         flags,
655                                                            int                         io_priority,
656                                                            GCancellable               *cancellable,
657                                                            GAsyncReadyCallback         callback,
658                                                            gpointer                    user_data);
659 GFileEnumerator *       g_file_enumerate_children_finish  (GFile                      *file,
660                                                            GAsyncResult               *res,
661                                                            GError                    **error);
662 GFile *                 g_file_set_display_name           (GFile                      *file,
663                                                            const char                 *display_name,
664                                                            GCancellable               *cancellable,
665                                                            GError                    **error);
666 void                    g_file_set_display_name_async     (GFile                      *file,
667                                                            const char                 *display_name,
668                                                            int                         io_priority,
669                                                            GCancellable               *cancellable,
670                                                            GAsyncReadyCallback         callback,
671                                                            gpointer                    user_data);
672 GFile *                 g_file_set_display_name_finish    (GFile                      *file,
673                                                            GAsyncResult               *res,
674                                                            GError                    **error);
675 gboolean                g_file_delete                     (GFile                      *file,
676                                                            GCancellable               *cancellable,
677                                                            GError                    **error);
678 gboolean                g_file_trash                      (GFile                      *file,
679                                                            GCancellable               *cancellable,
680                                                            GError                    **error);
681 gboolean                g_file_copy                       (GFile                      *source,
682                                                            GFile                      *destination,
683                                                            GFileCopyFlags              flags,
684                                                            GCancellable               *cancellable,
685                                                            GFileProgressCallback       progress_callback,
686                                                            gpointer                    progress_callback_data,
687                                                            GError                    **error);
688 void                    g_file_copy_async                 (GFile                      *source,
689                                                            GFile                      *destination,
690                                                            GFileCopyFlags              flags,
691                                                            int                         io_priority,
692                                                            GCancellable               *cancellable,
693                                                            GFileProgressCallback       progress_callback,
694                                                            gpointer                    progress_callback_data,
695                                                            GAsyncReadyCallback         callback,
696                                                            gpointer                    user_data);
697 gboolean                g_file_copy_finish                (GFile                      *file,
698                                                            GAsyncResult               *res,
699                                                            GError                    **error);
700 gboolean                g_file_move                       (GFile                      *source,
701                                                            GFile                      *destination,
702                                                            GFileCopyFlags              flags,
703                                                            GCancellable               *cancellable,
704                                                            GFileProgressCallback       progress_callback,
705                                                            gpointer                    progress_callback_data,
706                                                            GError                    **error);
707 gboolean                g_file_make_directory             (GFile                      *file,
708                                                            GCancellable               *cancellable,
709                                                            GError                    **error);
710 gboolean                g_file_make_directory_with_parents (GFile                     *file,
711                                                            GCancellable               *cancellable,
712                                                            GError                    **error);
713 gboolean                g_file_make_symbolic_link         (GFile                      *file,
714                                                            const char                 *symlink_value,
715                                                            GCancellable               *cancellable,
716                                                            GError                    **error);
717 GFileAttributeInfoList *g_file_query_settable_attributes  (GFile                      *file,
718                                                            GCancellable               *cancellable,
719                                                            GError                    **error);
720 GFileAttributeInfoList *g_file_query_writable_namespaces  (GFile                      *file,
721                                                            GCancellable               *cancellable,
722                                                            GError                    **error);
723 gboolean                g_file_set_attribute              (GFile                      *file,
724                                                            const char                 *attribute,
725                                                            GFileAttributeType          type,
726                                                            gpointer                    value_p,
727                                                            GFileQueryInfoFlags         flags,
728                                                            GCancellable               *cancellable,
729                                                            GError                    **error);
730 gboolean                g_file_set_attributes_from_info   (GFile                      *file,
731                                                            GFileInfo                  *info,
732                                                            GFileQueryInfoFlags         flags,
733                                                            GCancellable               *cancellable,
734                                                            GError                    **error);
735 void                    g_file_set_attributes_async       (GFile                      *file,
736                                                            GFileInfo                  *info,
737                                                            GFileQueryInfoFlags         flags,
738                                                            int                         io_priority,
739                                                            GCancellable               *cancellable,
740                                                            GAsyncReadyCallback         callback,
741                                                            gpointer                    user_data);
742 gboolean                g_file_set_attributes_finish      (GFile                      *file,
743                                                            GAsyncResult               *result,
744                                                            GFileInfo                 **info,
745                                                            GError                    **error);
746 gboolean                g_file_set_attribute_string       (GFile                      *file,
747                                                            const char                 *attribute,
748                                                            const char                 *value,
749                                                            GFileQueryInfoFlags         flags,
750                                                            GCancellable               *cancellable,
751                                                            GError                    **error);
752 gboolean                g_file_set_attribute_byte_string  (GFile                      *file,
753                                                            const char                 *attribute,
754                                                            const char                 *value,
755                                                            GFileQueryInfoFlags         flags,
756                                                            GCancellable               *cancellable,
757                                                            GError                    **error);
758 gboolean                g_file_set_attribute_uint32       (GFile                      *file,
759                                                            const char                 *attribute,
760                                                            guint32                     value,
761                                                            GFileQueryInfoFlags         flags,
762                                                            GCancellable               *cancellable,
763                                                            GError                    **error);
764 gboolean                g_file_set_attribute_int32        (GFile                      *file,
765                                                            const char                 *attribute,
766                                                            gint32                      value,
767                                                            GFileQueryInfoFlags         flags,
768                                                            GCancellable               *cancellable,
769                                                            GError                    **error);
770 gboolean                g_file_set_attribute_uint64       (GFile                      *file,
771                                                            const char                 *attribute,
772                                                            guint64                     value,
773                                                            GFileQueryInfoFlags         flags,
774                                                            GCancellable               *cancellable,
775                                                            GError                    **error);
776 gboolean                g_file_set_attribute_int64        (GFile                      *file,
777                                                            const char                 *attribute,
778                                                            gint64                      value,
779                                                            GFileQueryInfoFlags         flags,
780                                                            GCancellable               *cancellable,
781                                                            GError                    **error);
782 void                    g_file_mount_enclosing_volume     (GFile                      *location,
783                                                            GMountMountFlags            flags,
784                                                            GMountOperation            *mount_operation,
785                                                            GCancellable               *cancellable,
786                                                            GAsyncReadyCallback         callback,
787                                                            gpointer                    user_data);
788 gboolean                g_file_mount_enclosing_volume_finish (GFile                      *location,
789                                                            GAsyncResult               *result,
790                                                            GError                    **error);
791 void                    g_file_mount_mountable            (GFile                      *file,
792                                                            GMountMountFlags            flags,
793                                                            GMountOperation            *mount_operation,
794                                                            GCancellable               *cancellable,
795                                                            GAsyncReadyCallback         callback,
796                                                            gpointer                    user_data);
797 GFile *                 g_file_mount_mountable_finish     (GFile                      *file,
798                                                            GAsyncResult               *result,
799                                                            GError                    **error);
800 void                    g_file_unmount_mountable          (GFile                      *file,
801                                                            GMountUnmountFlags          flags,
802                                                            GCancellable               *cancellable,
803                                                            GAsyncReadyCallback         callback,
804                                                            gpointer                    user_data);
805 gboolean                g_file_unmount_mountable_finish   (GFile                      *file,
806                                                            GAsyncResult               *result,
807                                                            GError                    **error);
808 void                    g_file_eject_mountable            (GFile                      *file,
809                                                            GMountUnmountFlags          flags,
810                                                            GCancellable               *cancellable,
811                                                            GAsyncReadyCallback         callback,
812                                                            gpointer                    user_data);
813 gboolean                g_file_eject_mountable_finish     (GFile                      *file,
814                                                            GAsyncResult               *result,
815                                                            GError                    **error);
816
817 gboolean                g_file_copy_attributes            (GFile                      *source,
818                                                            GFile                      *destination,
819                                                            GFileCopyFlags              flags,
820                                                            GCancellable               *cancellable,
821                                                            GError                    **error);
822
823
824 GFileMonitor*           g_file_monitor_directory          (GFile                  *file,
825                                                            GFileMonitorFlags       flags,
826                                                            GCancellable           *cancellable,
827                                                            GError                **error);
828 GFileMonitor*           g_file_monitor_file               (GFile                  *file,
829                                                            GFileMonitorFlags       flags,
830                                                            GCancellable           *cancellable,
831                                                            GError                **error);
832 GFileMonitor*           g_file_monitor                    (GFile                  *file,
833                                                            GFileMonitorFlags       flags,
834                                                            GCancellable           *cancellable,
835                                                            GError                **error);
836
837
838 /* Utilities */
839
840 GAppInfo *g_file_query_default_handler       (GFile                  *file,
841                                               GCancellable           *cancellable,
842                                               GError                **error);
843 gboolean g_file_load_contents                (GFile                  *file,
844                                               GCancellable           *cancellable,
845                                               char                  **contents,
846                                               gsize                  *length,
847                                               char                  **etag_out,
848                                               GError                **error);
849 void     g_file_load_contents_async          (GFile                  *file,
850                                               GCancellable           *cancellable,
851                                               GAsyncReadyCallback     callback,
852                                               gpointer                user_data);
853 gboolean g_file_load_contents_finish         (GFile                  *file,
854                                               GAsyncResult           *res,
855                                               char                  **contents,
856                                               gsize                  *length,
857                                               char                  **etag_out,
858                                               GError                **error);
859 void     g_file_load_partial_contents_async  (GFile                  *file,
860                                               GCancellable           *cancellable,
861                                               GFileReadMoreCallback   read_more_callback,
862                                               GAsyncReadyCallback     callback,
863                                               gpointer                user_data);
864 gboolean g_file_load_partial_contents_finish (GFile                  *file,
865                                               GAsyncResult           *res,
866                                               char                  **contents,
867                                               gsize                  *length,
868                                               char                  **etag_out,
869                                               GError                **error);
870 gboolean g_file_replace_contents             (GFile                  *file,
871                                               const char             *contents,
872                                               gsize                   length,
873                                               const char             *etag,
874                                               gboolean                make_backup,
875                                               GFileCreateFlags        flags,
876                                               char                  **new_etag,
877                                               GCancellable           *cancellable,
878                                               GError                **error);
879 void     g_file_replace_contents_async       (GFile                  *file,
880                                               const char             *contents,
881                                               gsize                   length,
882                                               const char             *etag,
883                                               gboolean                make_backup,
884                                               GFileCreateFlags        flags,
885                                               GCancellable           *cancellable,
886                                               GAsyncReadyCallback     callback,
887                                               gpointer                user_data);
888 gboolean g_file_replace_contents_finish      (GFile                  *file,
889                                               GAsyncResult           *res,
890                                               char                  **new_etag,
891                                               GError                **error);
892
893 G_END_DECLS
894
895 #endif /* __G_FILE_H__ */