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