~ubuntu-branches/debian/squeeze/glib2.0/squeeze

« back to all changes in this revision

Viewing changes to gio/gfile.h

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2009-02-15 13:00:43 UTC
  • mfrom: (1.3.1 upstream) (69.1.10 intrepid)
  • Revision ID: james.westby@ubuntu.com-20090215130043-q47fbt3owmt42m2f
Tags: 2.18.4-2
* Release to unstable
* debian/rules:
- bump SHVER, since we are already forcing a 2.18.0 dependecy on the
  symbols introduced in the development versions
* debian/control.in:
- added Homepage and Vcs-* control fields

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* GIO - GLib Input, Output and Streaming Library
2
 
 * 
 
2
 *
3
3
 * Copyright (C) 2006-2007 Red Hat, Inc.
4
4
 *
5
5
 * This library is free software; you can redistribute it and/or
27
27
#ifndef __G_FILE_H__
28
28
#define __G_FILE_H__
29
29
 
30
 
#include <glib-object.h>
31
 
#include <gio/gfileinfo.h>
32
 
#include <gio/gfileenumerator.h>
33
 
#include <gio/gfileinputstream.h>
34
 
#include <gio/gfileoutputstream.h>
35
 
#include <gio/gmountoperation.h>
36
 
#include <gio/gappinfo.h>
 
30
#include <gio/giotypes.h>
37
31
 
38
32
G_BEGIN_DECLS
39
33
 
42
36
#define G_IS_FILE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_FILE))
43
37
#define G_FILE_GET_IFACE(obj)  (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_FILE, GFileIface))
44
38
 
45
 
/**
46
 
 * GFileQueryInfoFlags:
47
 
 * @G_FILE_QUERY_INFO_NONE: No flags set.
48
 
 * @G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS: Don't follow symlinks.
49
 
 * 
50
 
 * Flags used when querying a #GFileInfo.
51
 
 */
52
 
typedef enum {
53
 
  G_FILE_QUERY_INFO_NONE = 0,
54
 
  G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS = (1<<0)   /*< nick=nofollow-symlinks >*/
55
 
} GFileQueryInfoFlags;
56
 
 
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.
62
 
 * 
63
 
 * Flags used when an operation may create a file.
64
 
 */
65
 
typedef enum  {
66
 
  G_FILE_CREATE_NONE = 0,
67
 
  G_FILE_CREATE_PRIVATE = (1<<0)
68
 
} GFileCreateFlags;
69
 
 
70
 
 
71
 
/**
72
 
 * GMountMountFlags:
73
 
 * @G_MOUNT_MOUNT_NONE: No flags set.
74
 
 * 
75
 
 * Flags used when mounting a mount.
76
 
 */
77
 
typedef enum  {
78
 
  G_MOUNT_MOUNT_NONE = 0
79
 
} GMountMountFlags;
80
 
 
81
 
 
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.
87
 
 * 
88
 
 * Flags used when an unmounting a mount.
89
 
 */
90
 
typedef enum  {
91
 
  G_MOUNT_UNMOUNT_NONE = 0,
92
 
  G_MOUNT_UNMOUNT_FORCE = (1<<0)
93
 
} GMountUnmountFlags;
94
 
 
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.
103
 
 *
104
 
 * Flags used when copying or moving files. 
105
 
 */
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;
114
 
 
115
 
/**
116
 
 * GFileMonitorFlags:
117
 
 * @G_FILE_MONITOR_NONE: No flags set.
118
 
 * @G_FILE_MONITOR_WATCH_MOUNTS: Watch for mount events. 
119
 
 *
120
 
 * Flags used to set what a #GFileMonitor will watch for. 
121
 
 */
122
 
typedef enum  {
123
 
  G_FILE_MONITOR_NONE = 0,
124
 
  G_FILE_MONITOR_WATCH_MOUNTS = (1<<0)
125
 
} GFileMonitorFlags;
126
 
 
 
39
#if 0
127
40
/**
128
41
 * GFile:
129
 
 * 
130
 
 * A handle to an object implementing the #GFileIface interface. 
131
 
 * Generally stores a location within the file system. Handles do not 
 
42
 *
 
43
 * A handle to an object implementing the #GFileIface interface.
 
44
 * Generally stores a location within the file system. Handles do not
132
45
 * necessarily represent files or directories that currently exist.
133
46
 **/
134
47
typedef struct _GFile                   GFile; /* Dummy typedef */
 
48
#endif
135
49
typedef struct _GFileIface              GFileIface;
136
 
typedef struct _GFileMonitor            GFileMonitor;
137
 
 
138
 
/**
139
 
 * GMount:
140
 
 * 
141
 
 * A handle to an object implementing the #GMountIface interface.
142
 
 **/
143
 
typedef struct _GMount         GMount; /* Dummy typedef */
144
 
 
145
 
/**
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.
150
 
 *
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. 
154
 
 **/
155
 
typedef void (*GFileProgressCallback) (goffset current_num_bytes,
156
 
                                       goffset total_num_bytes,
157
 
                                       gpointer user_data);
158
 
 
159
 
/**
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.
164
 
 *
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.
169
 
 *
170
 
 * Returns: %TRUE if more data should be read back. %FALSE otherwise.
171
 
 **/
172
 
typedef gboolean (* GFileReadMoreCallback) (const char *file_contents,
173
 
                                            goffset file_size,
174
 
                                            gpointer callback_data);
 
50
 
175
51
 
176
52
/**
177
53
 * GFileIface:
183
59
 * @has_uri_scheme: Checks to see if a #GFile has a given URI scheme.
184
60
 * @get_uri_scheme: Gets the URI scheme for a #GFile.
185
61
 * @get_basename: Gets the basename for a given #GFile.
186
 
 * @get_path: Gets the current path within a #GFile. 
 
62
 * @get_path: Gets the current path within a #GFile.
187
63
 * @get_uri: Gets a URI for the path within a #GFile.
188
64
 * @get_parse_name: Gets the parsed name for the #GFile.
189
65
 * @get_parent: Gets the parent directory for the #GFile.
244
120
 * @copy_async: Asynchronously copies a file.
245
121
 * @copy_finish: Finishes an asynchronous copy operation.
246
122
 * @move: Moves a file.
247
 
 * @_move_async: Asynchronously moves a file. 
 
123
 * @_move_async: Asynchronously moves a file.
248
124
 * @_move_finish: Finishes an asynchronous move operation.
249
125
 * @mount_mountable: Mounts a mountable object.
250
126
 * @mount_mountable_finish: Finishes a mounting operation.
252
128
 * @unmount_mountable_finish: Finishes an unmount operation.
253
129
 * @eject_mountable: Ejects a mountable.
254
130
 * @eject_mountable_finish: Finishes an eject operation.
255
 
 * @mount_enclosing_volume: Mounts a specified location. 
 
131
 * @mount_enclosing_volume: Mounts a specified location.
256
132
 * @mount_enclosing_volume_finish: Finishes mounting a specified location.
257
133
 * @monitor_dir: Creates a #GFileMonitor for the location.
258
134
 * @monitor_file: Creates a #GFileMonitor for the location.
259
 
 * 
260
 
 * An interface for writing VFS file handles.  
261
 
 **/ 
 
135
 *
 
136
 * An interface for writing VFS file handles.
 
137
 **/
262
138
struct _GFileIface
263
139
{
264
140
  GTypeInterface g_iface;
265
141
 
266
142
  /* Virtual Table */
267
143
 
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);
290
 
  
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);
306
 
  
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);
322
 
  
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);
336
 
  
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);
348
 
  
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);
362
 
  
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);
368
 
  
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);
374
 
  
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);
398
 
  
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);
410
 
  
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);
424
 
  
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);
438
 
  
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);
456
 
  
457
 
  gboolean            (*delete_file)        (GFile                *file,
458
 
                                             GCancellable         *cancellable,
459
 
                                             GError              **error);
460
 
  void                (*_delete_file_async) (void);
461
 
  void                (*_delete_file_finish) (void);
462
 
  
463
 
  gboolean            (*trash)              (GFile                *file,
464
 
                                             GCancellable         *cancellable,
465
 
                                             GError              **error);
466
 
  void                (*_trash_async) (void);
467
 
  void                (*_trash_finish) (void);
468
 
  
469
 
  gboolean            (*make_directory)     (GFile                *file,
470
 
                                             GCancellable         *cancellable,
471
 
                                             GError              **error);
472
 
  void                (*_make_directory_async) (void);
473
 
  void                (*_make_directory_finish) (void);
474
 
  
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);
481
 
  
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);
501
 
  
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);
509
 
 
510
 
  void                (*_move_async) (void);
511
 
  void                (*_move_finish) (void);
512
 
 
513
 
 
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);
539
 
 
540
 
 
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);
550
 
  
551
 
  GFileMonitor*      (*monitor_dir)         (GFile                  *file,
552
 
                                             GFileMonitorFlags       flags,
553
 
                                             GCancellable           *cancellable,
554
 
                                             GError                **error);
555
 
 
556
 
  GFileMonitor*      (*monitor_file)        (GFile                  *file,
557
 
                                             GFileMonitorFlags       flags,
558
 
                                             GCancellable           *cancellable,
559
 
                                             GError                **error);
560
 
 
 
144
  GFile *             (* dup)                         (GFile         *file);
 
145
  guint               (* hash)                        (GFile         *file);
 
146
  gboolean            (* equal)                       (GFile         *file1,
 
147
                                                       GFile         *file2);
 
148
  gboolean            (* is_native)                   (GFile         *file);
 
149
  gboolean            (* has_uri_scheme)              (GFile         *file,
 
150
                                                       const char    *uri_scheme);
 
151
  char *              (* get_uri_scheme)              (GFile         *file);
 
152
  char *              (* get_basename)                (GFile         *file);
 
153
  char *              (* get_path)                    (GFile         *file);
 
154
  char *              (* get_uri)                     (GFile         *file);
 
155
  char *              (* get_parse_name)              (GFile         *file);
 
156
  GFile *             (* get_parent)                  (GFile         *file);
 
157
  gboolean            (* prefix_matches)              (GFile         *prefix,
 
158
                                                       GFile         *file);
 
159
  char *              (* get_relative_path)           (GFile         *parent,
 
160
                                                       GFile         *descendant);
 
161
  GFile *             (* resolve_relative_path)       (GFile        *file,
 
162
                                                       const char   *relative_path);
 
163
  GFile *             (* get_child_for_display_name)  (GFile        *file,
 
164
                                                       const char   *display_name,
 
165
                                                       GError      **error);
 
166
 
 
167
  GFileEnumerator *   (* enumerate_children)          (GFile                *file,
 
168
                                                       const char           *attributes,
 
169
                                                       GFileQueryInfoFlags   flags,
 
170
                                                       GCancellable         *cancellable,
 
171
                                                       GError              **error);
 
172
  void                (* enumerate_children_async)    (GFile                *file,
 
173
                                                       const char           *attributes,
 
174
                                                       GFileQueryInfoFlags   flags,
 
175
                                                       int                   io_priority,
 
176
                                                       GCancellable         *cancellable,
 
177
                                                       GAsyncReadyCallback   callback,
 
178
                                                       gpointer              user_data);
 
179
  GFileEnumerator *   (* enumerate_children_finish)   (GFile                *file,
 
180
                                                       GAsyncResult         *res,
 
181
                                                       GError              **error);
 
182
 
 
183
  GFileInfo *         (* query_info)                  (GFile                *file,
 
184
                                                       const char           *attributes,
 
185
                                                       GFileQueryInfoFlags   flags,
 
186
                                                       GCancellable         *cancellable,
 
187
                                                       GError              **error);
 
188
  void                (* query_info_async)            (GFile                *file,
 
189
                                                       const char           *attributes,
 
190
                                                       GFileQueryInfoFlags   flags,
 
191
                                                       int                   io_priority,
 
192
                                                       GCancellable         *cancellable,
 
193
                                                       GAsyncReadyCallback   callback,
 
194
                                                       gpointer              user_data);
 
195
  GFileInfo *         (* query_info_finish)           (GFile                *file,
 
196
                                                       GAsyncResult         *res,
 
197
                                                       GError              **error);
 
198
 
 
199
  GFileInfo *         (* query_filesystem_info)       (GFile                *file,
 
200
                                                       const char           *attributes,
 
201
                                                       GCancellable         *cancellable,
 
202
                                                       GError              **error);
 
203
  void                (* query_filesystem_info_async) (GFile                *file,
 
204
                                                       const char           *attributes,
 
205
                                                       int                   io_priority,
 
206
                                                       GCancellable         *cancellable,
 
207
                                                       GAsyncReadyCallback   callback,
 
208
                                                       gpointer              user_data);
 
209
  GFileInfo *         (* query_filesystem_info_finish)(GFile                *file,
 
210
                                                       GAsyncResult         *res,
 
211
                                                       GError              **error);
 
212
 
 
213
  GMount *            (* find_enclosing_mount)        (GFile                *file,
 
214
                                                       GCancellable         *cancellable,
 
215
                                                       GError              **error);
 
216
  void                (* find_enclosing_mount_async)  (GFile                *file,
 
217
                                                       int                   io_priority,
 
218
                                                       GCancellable         *cancellable,
 
219
                                                       GAsyncReadyCallback   callback,
 
220
                                                       gpointer              user_data);
 
221
  GMount *            (* find_enclosing_mount_finish) (GFile                *file,
 
222
                                                       GAsyncResult         *res,
 
223
                                                       GError              **error);
 
224
 
 
225
  GFile *             (* set_display_name)            (GFile                *file,
 
226
                                                       const char           *display_name,
 
227
                                                       GCancellable         *cancellable,
 
228
                                                       GError              **error);
 
229
  void                (* set_display_name_async)      (GFile                *file,
 
230
                                                       const char           *display_name,
 
231
                                                       int                   io_priority,
 
232
                                                       GCancellable         *cancellable,
 
233
                                                       GAsyncReadyCallback   callback,
 
234
                                                       gpointer              user_data);
 
235
  GFile *             (* set_display_name_finish)     (GFile                *file,
 
236
                                                       GAsyncResult         *res,
 
237
                                                       GError              **error);
 
238
 
 
239
  GFileAttributeInfoList * (* query_settable_attributes)    (GFile          *file,
 
240
                                                             GCancellable   *cancellable,
 
241
                                                             GError        **error);
 
242
  void                (* _query_settable_attributes_async)  (void);
 
243
  void                (* _query_settable_attributes_finish) (void);
 
244
 
 
245
  GFileAttributeInfoList * (* query_writable_namespaces)    (GFile          *file,
 
246
                                                             GCancellable   *cancellable,
 
247
                                                             GError        **error);
 
248
  void                (* _query_writable_namespaces_async)  (void);
 
249
  void                (* _query_writable_namespaces_finish) (void);
 
250
 
 
251
  gboolean            (* set_attribute)               (GFile                *file,
 
252
                                                       const char           *attribute,
 
253
                                                       GFileAttributeType    type,
 
254
                                                       gpointer              value_p,
 
255
                                                       GFileQueryInfoFlags   flags,
 
256
                                                       GCancellable         *cancellable,
 
257
                                                       GError              **error);
 
258
  gboolean            (* set_attributes_from_info)    (GFile                *file,
 
259
                                                       GFileInfo            *info,
 
260
                                                       GFileQueryInfoFlags   flags,
 
261
                                                       GCancellable         *cancellable,
 
262
                                                       GError              **error);
 
263
  void                (* set_attributes_async)        (GFile                *file,
 
264
                                                       GFileInfo            *info,
 
265
                                                       GFileQueryInfoFlags   flags,
 
266
                                                       int                   io_priority,
 
267
                                                       GCancellable         *cancellable,
 
268
                                                       GAsyncReadyCallback   callback,
 
269
                                                       gpointer              user_data);
 
270
  gboolean            (* set_attributes_finish)       (GFile                *file,
 
271
                                                       GAsyncResult         *result,
 
272
                                                       GFileInfo           **info,
 
273
                                                       GError              **error);
 
274
 
 
275
  GFileInputStream *  (* read_fn)                     (GFile                *file,
 
276
                                                       GCancellable         *cancellable,
 
277
                                                       GError              **error);
 
278
  void                (* read_async)                  (GFile                *file,
 
279
                                                       int                   io_priority,
 
280
                                                       GCancellable         *cancellable,
 
281
                                                       GAsyncReadyCallback   callback,
 
282
                                                       gpointer              user_data);
 
283
  GFileInputStream *  (* read_finish)                 (GFile                *file,
 
284
                                                       GAsyncResult         *res,
 
285
                                                       GError              **error);
 
286
 
 
287
  GFileOutputStream * (* append_to)                   (GFile                *file,
 
288
                                                       GFileCreateFlags      flags,
 
289
                                                       GCancellable         *cancellable,
 
290
                                                       GError              **error);
 
291
  void                (* append_to_async)             (GFile                *file,
 
292
                                                       GFileCreateFlags      flags,
 
293
                                                       int                   io_priority,
 
294
                                                       GCancellable         *cancellable,
 
295
                                                       GAsyncReadyCallback   callback,
 
296
                                                       gpointer              user_data);
 
297
  GFileOutputStream * (* append_to_finish)            (GFile                *file,
 
298
                                                       GAsyncResult         *res,
 
299
                                                       GError              **error);
 
300
 
 
301
  GFileOutputStream * (* create)                      (GFile                *file,
 
302
                                                       GFileCreateFlags      flags,
 
303
                                                       GCancellable         *cancellable,
 
304
                                                       GError              **error);
 
305
  void                (* create_async)                (GFile                *file,
 
306
                                                       GFileCreateFlags      flags,
 
307
                                                       int                   io_priority,
 
308
                                                       GCancellable         *cancellable,
 
309
                                                       GAsyncReadyCallback   callback,
 
310
                                                       gpointer              user_data);
 
311
  GFileOutputStream * (* create_finish)               (GFile                *file,
 
312
                                                       GAsyncResult         *res,
 
313
                                                       GError              **error);
 
314
 
 
315
  GFileOutputStream * (* replace)                     (GFile                *file,
 
316
                                                       const char           *etag,
 
317
                                                       gboolean              make_backup,
 
318
                                                       GFileCreateFlags      flags,
 
319
                                                       GCancellable         *cancellable,
 
320
                                                       GError              **error);
 
321
  void                (* replace_async)               (GFile                *file,
 
322
                                                       const char           *etag,
 
323
                                                       gboolean              make_backup,
 
324
                                                       GFileCreateFlags      flags,
 
325
                                                       int                   io_priority,
 
326
                                                       GCancellable         *cancellable,
 
327
                                                       GAsyncReadyCallback   callback,
 
328
                                                       gpointer              user_data);
 
329
  GFileOutputStream * (* replace_finish)              (GFile                *file,
 
330
                                                       GAsyncResult         *res,
 
331
                                                       GError              **error);
 
332
 
 
333
  gboolean            (* delete_file)                 (GFile                *file,
 
334
                                                       GCancellable         *cancellable,
 
335
                                                       GError              **error);
 
336
  void                (* _delete_file_async)          (void);
 
337
  void                (* _delete_file_finish)         (void);
 
338
 
 
339
  gboolean            (* trash)                       (GFile                *file,
 
340
                                                       GCancellable         *cancellable,
 
341
                                                       GError              **error);
 
342
  void                (* _trash_async)                (void);
 
343
  void                (* _trash_finish)               (void);
 
344
 
 
345
  gboolean            (* make_directory)              (GFile                *file,
 
346
                                                       GCancellable         *cancellable,
 
347
                                                       GError              **error);
 
348
  void                (* _make_directory_async)       (void);
 
349
  void                (* _make_directory_finish)      (void);
 
350
 
 
351
  gboolean            (* make_symbolic_link)          (GFile                *file,
 
352
                                                       const char           *symlink_value,
 
353
                                                       GCancellable         *cancellable,
 
354
                                                       GError              **error);
 
355
  void                (* _make_symbolic_link_async)   (void);
 
356
  void                (* _make_symbolic_link_finish)  (void);
 
357
 
 
358
  gboolean            (* copy)                        (GFile                *source,
 
359
                                                       GFile                *destination,
 
360
                                                       GFileCopyFlags        flags,
 
361
                                                       GCancellable         *cancellable,
 
362
                                                       GFileProgressCallback progress_callback,
 
363
                                                       gpointer              progress_callback_data,
 
364
                                                       GError              **error);
 
365
  void                (* copy_async)                  (GFile                *source,
 
366
                                                       GFile                *destination,
 
367
                                                       GFileCopyFlags        flags,
 
368
                                                       int                   io_priority,
 
369
                                                       GCancellable         *cancellable,
 
370
                                                       GFileProgressCallback progress_callback,
 
371
                                                       gpointer              progress_callback_data,
 
372
                                                       GAsyncReadyCallback   callback,
 
373
                                                       gpointer              user_data);
 
374
  gboolean            (* copy_finish)                 (GFile                *file,
 
375
                                                       GAsyncResult         *res,
 
376
                                                       GError              **error);
 
377
 
 
378
  gboolean            (* move)                        (GFile                *source,
 
379
                                                       GFile                *destination,
 
380
                                                       GFileCopyFlags        flags,
 
381
                                                       GCancellable         *cancellable,
 
382
                                                       GFileProgressCallback progress_callback,
 
383
                                                       gpointer              progress_callback_data,
 
384
                                                       GError              **error);
 
385
  void                (* _move_async)                 (void);
 
386
  void                (* _move_finish)                (void);
 
387
 
 
388
  void                (* mount_mountable)             (GFile                *file,
 
389
                                                       GMountMountFlags      flags,
 
390
                                                       GMountOperation      *mount_operation,
 
391
                                                       GCancellable         *cancellable,
 
392
                                                       GAsyncReadyCallback   callback,
 
393
                                                       gpointer              user_data);
 
394
  GFile *             (* mount_mountable_finish)      (GFile                *file,
 
395
                                                       GAsyncResult         *result,
 
396
                                                       GError              **error);
 
397
 
 
398
  void                (* unmount_mountable)           (GFile                *file,
 
399
                                                       GMountUnmountFlags    flags,
 
400
                                                       GCancellable         *cancellable,
 
401
                                                       GAsyncReadyCallback   callback,
 
402
                                                       gpointer              user_data);
 
403
  gboolean            (* unmount_mountable_finish)    (GFile                *file,
 
404
                                                       GAsyncResult         *result,
 
405
                                                       GError              **error);
 
406
 
 
407
  void                (* eject_mountable)             (GFile                *file,
 
408
                                                       GMountUnmountFlags    flags,
 
409
                                                       GCancellable         *cancellable,
 
410
                                                       GAsyncReadyCallback   callback,
 
411
                                                       gpointer              user_data);
 
412
  gboolean            (* eject_mountable_finish)      (GFile                *file,
 
413
                                                       GAsyncResult         *result,
 
414
                                                       GError              **error);
 
415
 
 
416
  void                (* mount_enclosing_volume)      (GFile                *location,
 
417
                                                       GMountMountFlags      flags,
 
418
                                                       GMountOperation      *mount_operation,
 
419
                                                       GCancellable         *cancellable,
 
420
                                                       GAsyncReadyCallback   callback,
 
421
                                                       gpointer              user_data);
 
422
  gboolean         (* mount_enclosing_volume_finish)  (GFile                *location,
 
423
                                                       GAsyncResult         *result,
 
424
                                                       GError              **error);
 
425
 
 
426
  GFileMonitor *      (* monitor_dir)                 (GFile                *file,
 
427
                                                       GFileMonitorFlags     flags,
 
428
                                                       GCancellable         *cancellable,
 
429
                                                       GError              **error);
 
430
  GFileMonitor *      (* monitor_file)                (GFile                *file,
 
431
                                                       GFileMonitorFlags     flags,
 
432
                                                       GCancellable         *cancellable,
 
433
                                                       GError              **error);
561
434
};
562
435
 
563
 
GType g_file_get_type (void) G_GNUC_CONST;
 
436
GType                   g_file_get_type                   (void) G_GNUC_CONST;
564
437
 
565
438
GFile *                 g_file_new_for_path               (const char                 *path);
566
439
GFile *                 g_file_new_for_uri                (const char                 *uri);
646
519
                                                           GError                    **error);
647
520
gboolean                g_file_query_exists               (GFile                      *file,
648
521
                                                           GCancellable               *cancellable);
 
522
GFileType               g_file_query_file_type            (GFile                      *file,
 
523
                                                           GFileQueryInfoFlags         flags,
 
524
                                                           GCancellable               *cancellable);
649
525
GFileInfo *             g_file_query_info                 (GFile                      *file,
650
526
                                                           const char                 *attributes,
651
527
                                                           GFileQueryInfoFlags         flags,
748
624
gboolean                g_file_make_directory             (GFile                      *file,
749
625
                                                           GCancellable               *cancellable,
750
626
                                                           GError                    **error);
 
627
gboolean                g_file_make_directory_with_parents (GFile                     *file,
 
628
                                                           GCancellable               *cancellable,
 
629
                                                           GError                    **error);
751
630
gboolean                g_file_make_symbolic_link         (GFile                      *file,
752
631
                                                           const char                 *symlink_value,
753
632
                                                           GCancellable               *cancellable,
867
746
                                                           GFileMonitorFlags       flags,
868
747
                                                           GCancellable           *cancellable,
869
748
                                                           GError                **error);
 
749
GFileMonitor*           g_file_monitor                    (GFile                  *file,
 
750
                                                           GFileMonitorFlags       flags,
 
751
                                                           GCancellable           *cancellable,
 
752
                                                           GError                **error);
870
753
 
871
754
 
872
755
/* Utilities */