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