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