Only allow including <gio/gio.h> from apps
[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_FLAGS_NONE = 0,
52   G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS = (1<<0)   /*< nick=nofollow-symlinks >*/
53 } GFileQueryInfoFlags;
54
55 /**
56  * GFileCreateFlags:
57  * @G_FILE_CREATE_FLAGS_NONE: No flags set.
58  * @G_FILE_CREATE_FLAGS_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_FLAGS_NONE = 0,
65   G_FILE_CREATE_FLAGS_PRIVATE = (1<<0)
66 } GFileCreateFlags;
67
68 /**
69  * GFileCopyFlags:
70  * @G_FILE_COPY_FLAGS_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_FLAGS_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_FLAGS_NONE: No flags set.
91  * @G_FILE_MONITOR_FLAGS_MONITOR_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_FLAGS_NONE = 0,
97   G_FILE_MONITOR_FLAGS_MONITOR_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  * @g_file_mount_enclosing_volume: Mounts a specified location. 
230  * @g_file_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                                                    const GFileAttributeValue *value,
345                                                    GFileQueryInfoFlags   flags,
346                                                    GCancellable         *cancellable,
347                                                    GError              **error);
348   gboolean            (*set_attributes_from_info) (GFile          *file,
349                                                    GFileInfo            *info,
350                                                    GFileQueryInfoFlags   flags,
351                                                    GCancellable         *cancellable,
352                                                    GError              **error);
353   void                (*set_attributes_async)     (GFile                      *file,
354                                                    GFileInfo                  *info,
355                                                    GFileQueryInfoFlags        flags,
356                                                    int                         io_priority,
357                                                    GCancellable               *cancellable,
358                                                    GAsyncReadyCallback         callback,
359                                                    gpointer                    user_data);
360   gboolean            (*set_attributes_finish)    (GFile                      *file,
361                                                    GAsyncResult               *result,
362                                                    GFileInfo                 **info,
363                                                    GError                    **error);
364   
365   GFileInputStream *  (*read_fn)            (GFile                *file,
366                                              GCancellable         *cancellable,
367                                              GError              **error);
368   void                (*read_async)         (GFile                *file,
369                                              int                   io_priority,
370                                              GCancellable         *cancellable,
371                                              GAsyncReadyCallback   callback,
372                                              gpointer              user_data);
373   GFileInputStream *  (*read_finish)        (GFile                *file,
374                                              GAsyncResult         *res,
375                                              GError              **error);
376   
377   GFileOutputStream * (*append_to)          (GFile                *file,
378                                              GFileCreateFlags      flags,
379                                              GCancellable         *cancellable,
380                                              GError               **error);
381   void                 (*append_to_async)   (GFile                      *file,
382                                              GFileCreateFlags            flags,
383                                              int                         io_priority,
384                                              GCancellable               *cancellable,
385                                              GAsyncReadyCallback         callback,
386                                              gpointer                    user_data);
387   GFileOutputStream *  (*append_to_finish)  (GFile                      *file,
388                                              GAsyncResult               *res,
389                                              GError                    **error);
390   
391   GFileOutputStream *  (*create)            (GFile                *file,
392                                              GFileCreateFlags      flags,
393                                              GCancellable         *cancellable,
394                                              GError               **error);
395   void                 (*create_async)      (GFile                      *file,
396                                              GFileCreateFlags            flags,
397                                              int                         io_priority,
398                                              GCancellable               *cancellable,
399                                              GAsyncReadyCallback         callback,
400                                              gpointer                    user_data);
401   GFileOutputStream *  (*create_finish)     (GFile                      *file,
402                                              GAsyncResult               *res,
403                                              GError                    **error);
404   
405   GFileOutputStream *  (*replace)           (GFile                *file,
406                                              const char           *etag,
407                                              gboolean              make_backup,
408                                              GFileCreateFlags      flags,
409                                              GCancellable         *cancellable,
410                                              GError              **error);
411   void                 (*replace_async)     (GFile                      *file,
412                                              const char                 *etag,
413                                              gboolean                    make_backup,
414                                              GFileCreateFlags            flags,
415                                              int                         io_priority,
416                                              GCancellable               *cancellable,
417                                              GAsyncReadyCallback         callback,
418                                              gpointer                    user_data);
419   GFileOutputStream *  (*replace_finish)    (GFile                      *file,
420                                              GAsyncResult               *res,
421                                              GError                    **error);
422   
423   gboolean            (*delete_file)        (GFile                *file,
424                                              GCancellable         *cancellable,
425                                              GError              **error);
426   void                (*_delete_file_async) (void);
427   void                (*_delete_file_finish) (void);
428   
429   gboolean            (*trash)              (GFile                *file,
430                                              GCancellable         *cancellable,
431                                              GError              **error);
432   void                (*_trash_async) (void);
433   void                (*_trash_finish) (void);
434   
435   gboolean            (*make_directory)     (GFile                *file,
436                                              GCancellable         *cancellable,
437                                              GError              **error);
438   void                (*_make_directory_async) (void);
439   void                (*_make_directory_finish) (void);
440   
441   gboolean            (*make_symbolic_link) (GFile                *file,
442                                              const char           *symlink_value,
443                                              GCancellable         *cancellable,
444                                              GError              **error);
445   void                (*_make_symbolic_link_async) (void);
446   void                (*_make_symbolic_link_finish) (void);
447   
448   gboolean            (*copy)               (GFile                *source,
449                                              GFile                *destination,
450                                              GFileCopyFlags        flags,
451                                              GCancellable         *cancellable,
452                                              GFileProgressCallback progress_callback,
453                                              gpointer              progress_callback_data,
454                                              GError              **error);
455   void                (*_copy_async) (void);
456   void                (*_copy_finish) (void);
457   
458   gboolean            (*move)               (GFile                *source,
459                                              GFile                *destination,
460                                              GFileCopyFlags        flags,
461                                              GCancellable         *cancellable,
462                                              GFileProgressCallback progress_callback,
463                                              gpointer              progress_callback_data,
464                                              GError              **error);
465
466   void                (*_move_async) (void);
467   void                (*_move_finish) (void);
468
469
470   void                (*mount_mountable)           (GFile               *file,
471                                                     GMountOperation     *mount_operation,
472                                                     GCancellable         *cancellable,
473                                                     GAsyncReadyCallback  callback,
474                                                     gpointer             user_data);
475   GFile *             (*mount_mountable_finish)    (GFile               *file,
476                                                     GAsyncResult        *result,
477                                                     GError             **error);
478   void                (*unmount_mountable)         (GFile               *file,
479                                                     GCancellable         *cancellable,
480                                                     GAsyncReadyCallback  callback,
481                                                     gpointer             user_data);
482   gboolean            (*unmount_mountable_finish)  (GFile               *file,
483                                                     GAsyncResult        *result,
484                                                     GError             **error);
485   void                (*eject_mountable)           (GFile               *file,
486                                                     GCancellable        *cancellable,
487                                                     GAsyncReadyCallback  callback,
488                                                     gpointer             user_data);
489   gboolean            (*eject_mountable_finish)    (GFile               *file,
490                                                     GAsyncResult        *result,
491                                                     GError             **error);
492
493
494   void     (*mount_enclosing_volume)        (GFile *location,
495                                              GMountOperation *mount_operation,
496                                              GCancellable *cancellable,
497                                              GAsyncReadyCallback callback,
498                                              gpointer user_data);
499   gboolean (*mount_enclosing_volume_finish) (GFile *location,
500                                              GAsyncResult *result,
501                                              GError **error);
502   
503   GDirectoryMonitor* (*monitor_dir)         (GFile                  *file,
504                                              GFileMonitorFlags       flags,
505                                              GCancellable           *cancellable);
506
507   GFileMonitor*      (*monitor_file)        (GFile                  *file,
508                                              GFileMonitorFlags       flags,
509                                              GCancellable           *cancellable);
510
511 };
512
513 GType g_file_get_type (void) G_GNUC_CONST;
514
515 GFile *                 g_file_new_for_path               (const char                 *path);
516 GFile *                 g_file_new_for_uri                (const char                 *uri);
517 GFile *                 g_file_new_for_commandline_arg    (const char                 *arg);
518 GFile *                 g_file_parse_name                 (const char                 *parse_name);
519 GFile *                 g_file_dup                        (GFile                      *file);
520 guint                   g_file_hash                       (gconstpointer               file);
521 gboolean                g_file_equal                      (GFile                      *file1,
522                                                            GFile                      *file2);
523 char *                  g_file_get_basename               (GFile                      *file);
524 char *                  g_file_get_path                   (GFile                      *file);
525 char *                  g_file_get_uri                    (GFile                      *file);
526 char *                  g_file_get_parse_name             (GFile                      *file);
527 GFile *                 g_file_get_parent                 (GFile                      *file);
528 GFile *                 g_file_get_child                  (GFile                      *file,
529                                                            const char                 *name);
530 GFile *                 g_file_get_child_for_display_name (GFile                      *file,
531                                                            const char                 *display_name,
532                                                            GError                    **error);
533 gboolean                g_file_contains_file              (GFile                      *parent,
534                                                            GFile                      *descendant);
535 char *                  g_file_get_relative_path          (GFile                      *parent,
536                                                            GFile                      *descendant);
537 GFile *                 g_file_resolve_relative_path      (GFile                      *file,
538                                                            const char                 *relative_path);
539 gboolean                g_file_is_native                  (GFile                      *file);
540 gboolean                g_file_has_uri_scheme             (GFile                      *file,
541                                                            const char                 *uri_scheme);
542 char *                  g_file_get_uri_scheme             (GFile                      *file);
543 GFileInputStream *      g_file_read                       (GFile                      *file,
544                                                            GCancellable               *cancellable,
545                                                            GError                    **error);
546 void                    g_file_read_async                 (GFile                      *file,
547                                                            int                         io_priority,
548                                                            GCancellable               *cancellable,
549                                                            GAsyncReadyCallback         callback,
550                                                            gpointer                    user_data);
551 GFileInputStream *      g_file_read_finish                (GFile                      *file,
552                                                            GAsyncResult               *res,
553                                                            GError                    **error);
554 GFileOutputStream *     g_file_append_to                  (GFile                      *file,
555                                                            GFileCreateFlags             flags,
556                                                            GCancellable               *cancellable,
557                                                            GError                    **error);
558 GFileOutputStream *     g_file_create                     (GFile                      *file,
559                                                            GFileCreateFlags             flags,
560                                                            GCancellable               *cancellable,
561                                                            GError                    **error);
562 GFileOutputStream *     g_file_replace                    (GFile                      *file,
563                                                            const char                 *etag,
564                                                            gboolean                    make_backup,
565                                                            GFileCreateFlags            flags,
566                                                            GCancellable               *cancellable,
567                                                            GError                    **error);
568 void                    g_file_append_to_async            (GFile                      *file,
569                                                            GFileCreateFlags            flags,
570                                                            int                         io_priority,
571                                                            GCancellable               *cancellable,
572                                                            GAsyncReadyCallback         callback,
573                                                            gpointer                    user_data);
574 GFileOutputStream *     g_file_append_to_finish           (GFile                      *file,
575                                                            GAsyncResult               *res,
576                                                            GError                    **error);
577 void                    g_file_create_async               (GFile                      *file,
578                                                            GFileCreateFlags            flags,
579                                                            int                         io_priority,
580                                                            GCancellable               *cancellable,
581                                                            GAsyncReadyCallback         callback,
582                                                            gpointer                    user_data);
583 GFileOutputStream *     g_file_create_finish              (GFile                      *file,
584                                                            GAsyncResult               *res,
585                                                            GError                    **error);
586 void                    g_file_replace_async              (GFile                      *file,
587                                                            const char                 *etag,
588                                                            gboolean                    make_backup,
589                                                            GFileCreateFlags            flags,
590                                                            int                         io_priority,
591                                                            GCancellable               *cancellable,
592                                                            GAsyncReadyCallback         callback,
593                                                            gpointer                    user_data);
594 GFileOutputStream *     g_file_replace_finish             (GFile                      *file,
595                                                            GAsyncResult               *res,
596                                                            GError                    **error);
597 GFileInfo *             g_file_query_info                 (GFile                      *file,
598                                                            const char                 *attributes,
599                                                            GFileQueryInfoFlags         flags,
600                                                            GCancellable               *cancellable,
601                                                            GError                    **error);
602 void                    g_file_query_info_async           (GFile                      *file,
603                                                            const char                 *attributes,
604                                                            GFileQueryInfoFlags         flags,
605                                                            int                         io_priority,
606                                                            GCancellable               *cancellable,
607                                                            GAsyncReadyCallback         callback,
608                                                            gpointer                    user_data);
609 GFileInfo *             g_file_query_info_finish          (GFile                      *file,
610                                                            GAsyncResult               *res,
611                                                            GError                    **error);
612 GFileInfo *             g_file_query_filesystem_info      (GFile                      *file,
613                                                            const char                 *attributes,
614                                                            GCancellable               *cancellable,
615                                                            GError                    **error);
616 GMount *                g_file_find_enclosing_mount      (GFile                      *file,
617                                                           GCancellable               *cancellable,
618                                                           GError                    **error);
619 GFileEnumerator *       g_file_enumerate_children         (GFile                      *file,
620                                                            const char                 *attributes,
621                                                            GFileQueryInfoFlags         flags,
622                                                            GCancellable               *cancellable,
623                                                            GError                    **error);
624 void                    g_file_enumerate_children_async   (GFile                      *file,
625                                                            const char                 *attributes,
626                                                            GFileQueryInfoFlags         flags,
627                                                            int                         io_priority,
628                                                            GCancellable               *cancellable,
629                                                            GAsyncReadyCallback         callback,
630                                                            gpointer                    user_data);
631 GFileEnumerator *       g_file_enumerate_children_finish  (GFile                      *file,
632                                                            GAsyncResult               *res,
633                                                            GError                    **error);
634 GFile *                 g_file_set_display_name           (GFile                      *file,
635                                                            const char                 *display_name,
636                                                            GCancellable               *cancellable,
637                                                            GError                    **error);
638 void                    g_file_set_display_name_async     (GFile                      *file,
639                                                            const char                 *display_name,
640                                                            int                         io_priority,
641                                                            GCancellable               *cancellable,
642                                                            GAsyncReadyCallback         callback,
643                                                            gpointer                    user_data);
644 GFile *                 g_file_set_display_name_finish    (GFile                      *file,
645                                                            GAsyncResult               *res,
646                                                            GError                    **error);
647 gboolean                g_file_delete                     (GFile                      *file,
648                                                            GCancellable               *cancellable,
649                                                            GError                    **error);
650 gboolean                g_file_trash                      (GFile                      *file,
651                                                            GCancellable               *cancellable,
652                                                            GError                    **error);
653 gboolean                g_file_copy                       (GFile                      *source,
654                                                            GFile                      *destination,
655                                                            GFileCopyFlags              flags,
656                                                            GCancellable               *cancellable,
657                                                            GFileProgressCallback       progress_callback,
658                                                            gpointer                    progress_callback_data,
659                                                            GError                    **error);
660 gboolean                g_file_move                       (GFile                      *source,
661                                                            GFile                      *destination,
662                                                            GFileCopyFlags              flags,
663                                                            GCancellable               *cancellable,
664                                                            GFileProgressCallback       progress_callback,
665                                                            gpointer                    progress_callback_data,
666                                                            GError                    **error);
667 gboolean                g_file_make_directory             (GFile                      *file,
668                                                            GCancellable               *cancellable,
669                                                            GError                    **error);
670 gboolean                g_file_make_symbolic_link         (GFile                      *file,
671                                                            const char                 *symlink_value,
672                                                            GCancellable               *cancellable,
673                                                            GError                    **error);
674 GFileAttributeInfoList *g_file_query_settable_attributes  (GFile                      *file,
675                                                            GCancellable               *cancellable,
676                                                            GError                    **error);
677 GFileAttributeInfoList *g_file_query_writable_namespaces  (GFile                      *file,
678                                                            GCancellable               *cancellable,
679                                                            GError                    **error);
680 gboolean                g_file_set_attribute              (GFile                      *file,
681                                                            const char                 *attribute,
682                                                            const GFileAttributeValue  *value,
683                                                            GFileQueryInfoFlags         flags,
684                                                            GCancellable               *cancellable,
685                                                            GError                    **error);
686 gboolean                g_file_set_attributes_from_info   (GFile                      *file,
687                                                            GFileInfo                  *info,
688                                                            GFileQueryInfoFlags         flags,
689                                                            GCancellable               *cancellable,
690                                                            GError                    **error);
691 void                    g_file_set_attributes_async       (GFile                      *file,
692                                                            GFileInfo                  *info,
693                                                            GFileQueryInfoFlags         flags,
694                                                            int                         io_priority,
695                                                            GCancellable               *cancellable,
696                                                            GAsyncReadyCallback         callback,
697                                                            gpointer                    user_data);
698 gboolean                g_file_set_attributes_finish      (GFile                      *file,
699                                                            GAsyncResult               *result,
700                                                            GFileInfo                 **info,
701                                                            GError                    **error);
702 gboolean                g_file_set_attribute_string       (GFile                      *file,
703                                                            const char                 *attribute,
704                                                            const char                 *value,
705                                                            GFileQueryInfoFlags         flags,
706                                                            GCancellable               *cancellable,
707                                                            GError                    **error);
708 gboolean                g_file_set_attribute_byte_string  (GFile                      *file,
709                                                            const char                 *attribute,
710                                                            const char                 *value,
711                                                            GFileQueryInfoFlags         flags,
712                                                            GCancellable               *cancellable,
713                                                            GError                    **error);
714 gboolean                g_file_set_attribute_uint32       (GFile                      *file,
715                                                            const char                 *attribute,
716                                                            guint32                     value,
717                                                            GFileQueryInfoFlags         flags,
718                                                            GCancellable               *cancellable,
719                                                            GError                    **error);
720 gboolean                g_file_set_attribute_int32        (GFile                      *file,
721                                                            const char                 *attribute,
722                                                            gint32                      value,
723                                                            GFileQueryInfoFlags         flags,
724                                                            GCancellable               *cancellable,
725                                                            GError                    **error);
726 gboolean                g_file_set_attribute_uint64       (GFile                      *file,
727                                                            const char                 *attribute,
728                                                            guint64                     value,
729                                                            GFileQueryInfoFlags         flags,
730                                                            GCancellable               *cancellable,
731                                                            GError                    **error);
732 gboolean                g_file_set_attribute_int64        (GFile                      *file,
733                                                            const char                 *attribute,
734                                                            gint64                      value,
735                                                            GFileQueryInfoFlags         flags,
736                                                            GCancellable               *cancellable,
737                                                            GError                    **error);
738 void                    g_file_mount_enclosing_volume     (GFile                      *location,
739                                                            GMountOperation            *mount_operation,
740                                                            GCancellable               *cancellable,
741                                                            GAsyncReadyCallback         callback,
742                                                            gpointer                    user_data);
743 gboolean                g_file_mount_enclosing_volume_finish (GFile                      *location,
744                                                            GAsyncResult               *result,
745                                                            GError                    **error);
746 void                    g_file_mount_mountable            (GFile                      *file,
747                                                            GMountOperation            *mount_operation,
748                                                            GCancellable               *cancellable,
749                                                            GAsyncReadyCallback         callback,
750                                                            gpointer                    user_data);
751 GFile *                 g_file_mount_mountable_finish     (GFile                      *file,
752                                                            GAsyncResult               *result,
753                                                            GError                    **error);
754 void                    g_file_unmount_mountable          (GFile                      *file,
755                                                            GCancellable               *cancellable,
756                                                            GAsyncReadyCallback         callback,
757                                                            gpointer                    user_data);
758 gboolean                g_file_unmount_mountable_finish   (GFile                      *file,
759                                                            GAsyncResult               *result,
760                                                            GError                    **error);
761 void                    g_file_eject_mountable            (GFile                      *file,
762                                                            GCancellable               *cancellable,
763                                                            GAsyncReadyCallback         callback,
764                                                            gpointer                    user_data);
765 gboolean                g_file_eject_mountable_finish     (GFile                      *file,
766                                                            GAsyncResult               *result,
767                                                            GError                    **error);
768
769 gboolean                g_file_copy_attributes            (GFile                      *source,
770                                                            GFile                      *destination,
771                                                            GFileCopyFlags              flags,
772                                                            GCancellable               *cancellable,
773                                                            GError                    **error);
774
775
776 GDirectoryMonitor* g_file_monitor_directory          (GFile                  *file,
777                                                       GFileMonitorFlags       flags,
778                                                       GCancellable           *cancellable);
779 GFileMonitor*      g_file_monitor_file               (GFile                  *file,
780                                                       GFileMonitorFlags       flags,
781                                                       GCancellable           *cancellable);
782
783
784 /* Utilities */
785
786 gboolean g_file_load_contents                (GFile                  *file,
787                                               GCancellable           *cancellable,
788                                               char                  **contents,
789                                               gsize                  *length,
790                                               char                  **etag_out,
791                                               GError                **error);
792 void     g_file_load_contents_async          (GFile                  *file,
793                                               GCancellable           *cancellable,
794                                               GAsyncReadyCallback     callback,
795                                               gpointer                user_data);
796 gboolean g_file_load_contents_finish         (GFile                  *file,
797                                               GAsyncResult           *res,
798                                               char                  **contents,
799                                               gsize                  *length,
800                                               char                  **etag_out,
801                                               GError                **error);
802 void     g_file_load_partial_contents_async  (GFile                  *file,
803                                               GCancellable           *cancellable,
804                                               GFileReadMoreCallback   read_more_callback,
805                                               GAsyncReadyCallback     callback,
806                                               gpointer                user_data);
807 gboolean g_file_load_partial_contents_finish (GFile                  *file,
808                                               GAsyncResult           *res,
809                                               char                  **contents,
810                                               gsize                  *length,
811                                               char                  **etag_out,
812                                               GError                **error);
813 gboolean g_file_replace_contents             (GFile                  *file,
814                                               const char             *contents,
815                                               gsize                   length,
816                                               const char             *etag,
817                                               gboolean                make_backup,
818                                               GFileCreateFlags        flags,
819                                               char                  **new_etag,
820                                               GCancellable           *cancellable,
821                                               GError                **error);
822 void     g_file_replace_contents_async       (GFile                  *file,
823                                               const char             *contents,
824                                               gsize                   length,
825                                               const char             *etag,
826                                               gboolean                make_backup,
827                                               GFileCreateFlags        flags,
828                                               GCancellable           *cancellable,
829                                               GAsyncReadyCallback     callback,
830                                               gpointer                user_data);
831 gboolean g_file_replace_contents_finish      (GFile                  *file,
832                                               GAsyncResult           *res,
833                                               char                  **new_etag,
834                                               GError                **error);
835
836 G_END_DECLS
837
838 #endif /* __G_FILE_H__ */