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