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