More trivial doc fixes
[platform/upstream/glib.git] / gio / gfileinfo.h
1 /* GIO - GLib Input, Output and Streaming Library
2  * 
3  * Copyright (C) 2006-2007 Red Hat, Inc.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General
16  * Public License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18  * Boston, MA 02111-1307, USA.
19  *
20  * Author: Alexander Larsson <alexl@redhat.com>
21  */
22
23 #ifndef __G_FILE_INFO_H__
24 #define __G_FILE_INFO_H__
25
26 #include <glib-object.h>
27 #include <glib/gfileutils.h>
28 #include <gio/gfileattribute.h>
29 #include <gio/gicon.h>
30
31 G_BEGIN_DECLS
32
33 #define G_TYPE_FILE_INFO         (g_file_info_get_type ())
34 #define G_FILE_INFO(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_FILE_INFO, GFileInfo))
35 #define G_FILE_INFO_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_FILE_INFO, GFileInfoClass))
36 #define G_IS_FILE_INFO(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_FILE_INFO))
37 #define G_IS_FILE_INFO_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_FILE_INFO))
38 #define G_FILE_INFO_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_FILE_INFO, GFileInfoClass))
39
40 /**
41  * GFileInfo:
42  * 
43  * Stores information about a file system object referenced by a #GFile.
44  **/
45 typedef struct _GFileInfo        GFileInfo;
46 typedef struct _GFileInfoClass   GFileInfoClass;
47
48 /**
49  * GFileAttributeMatcher:
50  * 
51  * Determines if a string matches a file attribute.
52  **/
53 typedef struct _GFileAttributeMatcher GFileAttributeMatcher;
54
55 /**
56  * GFileType:
57  * @G_FILE_TYPE_UNKNOWN: File's type is unknown.
58  * @G_FILE_TYPE_REGULAR: File handle represents a regular file.
59  * @G_FILE_TYPE_DIRECTORY: File handle represents a directory.
60  * @G_FILE_TYPE_SYMBOLIC_LINK: File handle represents a symbolic link 
61  *    (Unix systems).
62  * @G_FILE_TYPE_SPECIAL: File is a "special" file, such as a socket, fifo, 
63  *    block device, or character device.
64  * @G_FILE_TYPE_SHORTCUT: File is a shortcut (Windows systems).
65  * @G_FILE_TYPE_MOUNTABLE: File is a mountable location.
66  * 
67  * Indicates the file's on-disk type.
68  **/
69 typedef enum {
70   G_FILE_TYPE_UNKNOWN = 0,
71   G_FILE_TYPE_REGULAR,
72   G_FILE_TYPE_DIRECTORY,
73   G_FILE_TYPE_SYMBOLIC_LINK,
74   G_FILE_TYPE_SPECIAL, /* socket, fifo, blockdev, chardev */
75   G_FILE_TYPE_SHORTCUT,
76   G_FILE_TYPE_MOUNTABLE
77 } GFileType;
78
79 /* Common Attributes:  */
80 /**
81  * G_FILE_ATTRIBUTE_STD_TYPE:
82  * 
83  * A key in the "std" namespace for storing file types. 
84  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
85  * The value for this key should contain a #GFileType.
86  **/
87 #define G_FILE_ATTRIBUTE_STD_TYPE "std:type"                     /* uint32 (GFileType) */
88
89 /**
90  * G_FILE_ATTRIBUTE_STD_IS_HIDDEN:
91  * 
92  * A key in the "std" namespace for checking if a file is hidden. 
93  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
94  **/
95 #define G_FILE_ATTRIBUTE_STD_IS_HIDDEN "std:is_hidden"           /* boolean */
96
97 /**
98  * G_FILE_ATTRIBUTE_STD_IS_BACKUP:
99  * 
100  * A key in the "std" namespace for checking if a file is a backup file.
101  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
102  **/
103 #define G_FILE_ATTRIBUTE_STD_IS_BACKUP "std:is_backup"           /* boolean */
104
105 /**
106  * G_FILE_ATTRIBUTE_STD_IS_SYMLINK:
107  * 
108  * A key in the "std" namespace for checking if the file is a symlink.
109  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
110  **/
111 #define G_FILE_ATTRIBUTE_STD_IS_SYMLINK "std:is_symlink"         /* boolean */
112
113 /**
114  * G_FILE_ATTRIBUTE_STD_IS_VIRTUAL:
115  * 
116  * A key in the "std" namespace for checking if a file is virtual.
117  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
118  **/
119 #define G_FILE_ATTRIBUTE_STD_IS_VIRTUAL "std:is_virtual"         /* boolean */
120
121 /**
122  * G_FILE_ATTRIBUTE_STD_NAME:
123  * 
124  * A key in the "std" namespace for getting the name of the file.
125  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
126  **/
127 #define G_FILE_ATTRIBUTE_STD_NAME "std:name"                     /* byte string */
128
129 /**
130  * G_FILE_ATTRIBUTE_STD_DISPLAY_NAME:
131  * 
132  * A key in the "std" namespace for getting the display name of the file.
133  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
134  **/
135 #define G_FILE_ATTRIBUTE_STD_DISPLAY_NAME "std:display_name"     /* string */
136
137 /**
138  * G_FILE_ATTRIBUTE_STD_EDIT_NAME:
139  * 
140  * A key in the "std" namespace for edit name of the file.
141  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
142  **/
143 #define G_FILE_ATTRIBUTE_STD_EDIT_NAME "std:edit_name"           /* string */
144
145 /**
146  * G_FILE_ATTRIBUTE_STD_COPY_NAME:
147  * 
148  * A key in the "std" namespace for getting the copy name of the file.
149  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
150  **/
151 #define G_FILE_ATTRIBUTE_STD_COPY_NAME "std:copy_name"           /* string */
152
153 /**
154  * G_FILE_ATTRIBUTE_STD_ICON:
155  * 
156  * A key in the "std" namespace for getting the icon for the file.
157  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_OBJECT.
158  * The value for this key should contain a #GIcon.
159  **/
160 #define G_FILE_ATTRIBUTE_STD_ICON "std:icon"                     /* object (GIcon) */
161
162 /**
163  * G_FILE_ATTRIBUTE_STD_CONTENT_TYPE:
164  * 
165  * A key in the "std" namespace for getting the content type of the file.
166  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
167  * The value for this key should contain a valid content type.
168  **/
169 #define G_FILE_ATTRIBUTE_STD_CONTENT_TYPE "std:content_type"     /* string */
170
171 /**
172  * G_FILE_ATTRIBUTE_STD_FAST_CONTENT_TYPE:
173  * 
174  * A key in the "std" namespace for getting the fast content type.
175  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
176  * 
177  **/
178 #define G_FILE_ATTRIBUTE_STD_FAST_CONTENT_TYPE "std:fast_content_type" /* string */
179
180 /**
181  * G_FILE_ATTRIBUTE_STD_SIZE:
182  * 
183  * A key in the "std" namespace for getting the file's size.
184  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
185  **/
186 #define G_FILE_ATTRIBUTE_STD_SIZE "std:size"                     /* uint64 */
187
188 /**
189  * G_FILE_ATTRIBUTE_STD_SYMLINK_TARGET:
190  * 
191  * A key in the "std" namespace for getting the symlink target, if the file
192  * is a symlink. Corresponding #GFileAttributeType is 
193  * %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
194  **/
195 #define G_FILE_ATTRIBUTE_STD_SYMLINK_TARGET "std:symlink_target" /* byte string */
196
197 /**
198  * G_FILE_ATTRIBUTE_STD_TARGET_URI:
199  * 
200  * A key in the "std" namespace for getting the target URI for the file.
201  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
202  **/
203 #define G_FILE_ATTRIBUTE_STD_TARGET_URI "std:target_uri"         /* string */
204
205 /**
206  * G_FILE_ATTRIBUTE_STD_SORT_ORDER:
207  * 
208  * A key in the "std" namespace for setting the sort order of a file. 
209  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_INT32.
210  * An example use would be in file managers, which would use this key 
211  * to set the order files are displayed.
212  **/
213 #define G_FILE_ATTRIBUTE_STD_SORT_ORDER "std:sort_order"         /* int32  */
214
215 /* Entity tags, used to avoid missing updates on save */
216
217 /**
218  * G_FILE_ATTRIBUTE_ETAG_VALUE:
219  * 
220  * A key in the "etag" namespace for getting the value of the file's
221  * entity tag. Corresponding #GFileAttributeType is 
222  * %G_FILE_ATTRIBUTE_TYPE_STRING.
223  **/
224 #define G_FILE_ATTRIBUTE_ETAG_VALUE "etag:value"                 /* string */
225
226 /* File identifier, for e.g. avoiding loops when doing recursive 
227  * directory scanning 
228  */
229
230 /**
231  * G_FILE_ATTRIBUTE_ID_FILE:
232  * 
233  * A key in the "id" namespace for getting a file identifier.
234  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
235  * An example use would be during listing files, to avoid recursive
236  * directory scanning.
237  **/
238 #define G_FILE_ATTRIBUTE_ID_FILE "id:file"                     /* string */
239
240 /**
241  * G_FILE_ATTRIBUTE_ID_FS:
242  * 
243  * A key in the "id" namespace for getting the file system identifier.
244  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
245  * An example use would be during listing files, to avoid recursive
246  * directory scanning.
247  **/
248 #define G_FILE_ATTRIBUTE_ID_FS "id:fs"                         /* string */
249
250 /* Calculated Access Rights for current user */
251
252 /**
253  * G_FILE_ATTRIBUTE_ACCESS_CAN_READ:
254  * 
255  * A key in the "access" namespace for getting read privileges. 
256  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
257  * This attribute will be %TRUE if the user is able to read the file.
258  **/
259 #define G_FILE_ATTRIBUTE_ACCESS_CAN_READ "access:can_read"       /* boolean */
260
261 /**
262  * G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE:
263  * 
264  * A key in the "access" namespace for getting write privileges.
265  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
266  * This attribute will be %TRUE if the user is able to write to the file.
267  **/
268 #define G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE "access:can_write"     /* boolean */
269
270 /**
271  * G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE:
272  * 
273  * A key in the "access" namespace for getting execution privileges.
274  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
275  * This attribute will be %TRUE if the user is able to execute the file.
276  **/
277 #define G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE "access:can_execute" /* boolean */
278
279 /**
280  * G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE:
281  * 
282  * A key in the "access" namespace for checking deletion privileges.
283  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
284  * This attribute will be %TRUE if the user is able to delete the file.
285  **/
286 #define G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE "access:can_delete"   /* boolean */
287
288 /**
289  * G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH:
290  * 
291  * A key in the "access" namespace for checking trashing privileges.
292  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
293  * This attribute will be %TRUE if the user is able to send the file to 
294  * the virtual file system trash location.
295  **/
296 #define G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH "access:can_trash"     /* boolean */
297
298 /**
299  * G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME:
300  * 
301  * A key in the "access" namespace for checking renaming privileges.
302  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
303  * This attribute will be %TRUE if the user is able to rename the file.
304  **/
305 #define G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME "access:can_rename"   /* boolean */ 
306
307 /* TODO: Should we have special version for directories? can_enumerate, etc */
308
309 /* Mountable attributes */
310
311 /**
312  * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT:
313  * 
314  * A key in the "mountable" namespace for checking if a file is mountable.
315  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
316  **/
317 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT "mountable:can_mount"     /* boolean */
318
319 /**
320  * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT:
321  * 
322  * A key in the "mountable" namespace for checking if a file is unmountable.
323  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
324  **/
325 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT "mountable:can_unmount" /* boolean */
326
327 /**
328  * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT:
329  * 
330  * A key in the "mountable" namespace for checking if a file can be ejected.
331  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
332  **/
333 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT "mountable:can_eject"     /* boolean */
334
335 /**
336  * G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE:
337  * 
338  * A key in the "mountable" namespace for getting the unix device.
339  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
340  **/
341 #define G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE "mountable:unix_device" /* uint32 */
342
343 /**
344  * G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI:
345  * 
346  * A key in the "mountable" namespace for getting the HAL UDI for the mounted
347  * file. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
348  **/
349 #define G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI "mountable:hal_udi"         /* string */
350
351 /* Time attributes */
352
353 /**
354  * G_FILE_ATTRIBUTE_TIME_MODIFIED:
355  * 
356  * A key in the "time" namespace for getting the time the file was last
357  * modified. Corresponding #GFileAttributeType is 
358  * %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the 
359  * file was modified.
360  **/
361 #define G_FILE_ATTRIBUTE_TIME_MODIFIED "time:modified"           /* uint64 */
362
363 /**
364  * G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC:
365  * 
366  * A key in the "time" namespace for getting the milliseconds of the time
367  * the file was last modified. This should be used in conjunction with 
368  * #G_FILE_ATTRIBUTE_TIME_MODIFIED. Corresponding #GFileAttributeType is 
369  * %G_FILE_ATTRIBUTE_TYPE_UINT32.
370  **/
371 #define G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC "time:modified_usec" /* uint32 */
372
373 /**
374  * G_FILE_ATTRIBUTE_TIME_ACCESS:
375  * 
376  * A key in the "time" namespace for getting the time the file was last
377  * accessed. Corresponding #GFileAttributeType is 
378  * %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the 
379  * file was last accessed.
380  **/
381 #define G_FILE_ATTRIBUTE_TIME_ACCESS "time:access"               /* uint64 */
382
383 /**
384  * G_FILE_ATTRIBUTE_TIME_ACCESS_USEC:
385  * 
386  * A key in the "time" namespace for getting the milliseconds of the time
387  * the file was last accessed. This should be used in conjunction with
388  * #G_FILE_ATTRIBUTE_TIME_ACCESS. Corresponding #GFileAttributeType is 
389  * %G_FILE_ATTRIBUTE_TYPE_UINT32.
390  **/
391 #define G_FILE_ATTRIBUTE_TIME_ACCESS_USEC "time:access_usec"     /* uint32 */
392
393 /**
394  * G_FILE_ATTRIBUTE_TIME_CHANGED:
395  * 
396  * A key in the "time" namespace for getting the time the file was last
397  * changed. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64, 
398  * and contains the UNIX time since the file was last changed.
399  *
400  * This corresponds to the traditional UNIX ctime.
401  **/
402 #define G_FILE_ATTRIBUTE_TIME_CHANGED "time:changed"             /* uint64 */
403
404 /**
405  * G_FILE_ATTRIBUTE_TIME_CHANGED_USEC:
406  * 
407  * A key in the "time" namespace for getting the milliseconds of the time
408  * the file was last changed. This should be used in conjunction with
409  * #G_FILE_ATTRIBUTE_TIME_CHANGED. Corresponding #GFileAttributeType is 
410  * %G_FILE_ATTRIBUTE_TYPE_UINT32. 
411  **/
412 #define G_FILE_ATTRIBUTE_TIME_CHANGED_USEC "time:changed_usec"   /* uint32 */
413
414 /**
415  * G_FILE_ATTRIBUTE_TIME_CREATED:
416  * 
417  * A key in the "time" namespace for getting the time the file was created.
418  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64, 
419  * and contains the UNIX time since the file was created.
420  *
421  * This corresponds to the NTFS ctime.
422  **/
423 #define G_FILE_ATTRIBUTE_TIME_CREATED "time:created"             /* uint64 */
424
425 /**
426  * G_FILE_ATTRIBUTE_TIME_CREATED_USEC:
427  * 
428  * A key in the "time" namespace for getting the milliseconds of the time
429  * the file was created. This should be used in conjunction with
430  * #G_FILE_ATTRIBUTE_TIME_CREATED. Corresponding #GFileAttributeType is 
431  * %G_FILE_ATTRIBUTE_TYPE_UINT32. 
432  **/
433 #define G_FILE_ATTRIBUTE_TIME_CREATED_USEC "time:created_usec"   /* uint32 */
434
435 /* Unix specific attributes */
436
437 /**
438  * G_FILE_ATTRIBUTE_UNIX_DEVICE:
439  * 
440  * A key in the "unix" namespace for getting the device id of the device the 
441  * file is located on (see stat() documentation). This attribute is only 
442  * available for UNIX file systems. Corresponding #GFileAttributeType is 
443  * %G_FILE_ATTRIBUTE_TYPE_UINT32. 
444  **/
445 #define G_FILE_ATTRIBUTE_UNIX_DEVICE "unix:device"               /* uint32 */
446
447 /**
448  * G_FILE_ATTRIBUTE_UNIX_INODE:
449  * 
450  * A key in the "unix" namespace for getting the inode of the file.
451  * This attribute is only available for UNIX file systems. Corresponding 
452  * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
453  **/
454 #define G_FILE_ATTRIBUTE_UNIX_INODE "unix:inode"                 /* uint64 */
455
456 /**
457  * G_FILE_ATTRIBUTE_UNIX_MODE:
458  * 
459  * A key in the "unix" namespace for getting the mode of the file
460  * (e.g. whether the file is a regular file, symlink, etc). See lstat() 
461  * documentation. This attribute is only available for UNIX file systems. 
462  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
463  **/
464 #define G_FILE_ATTRIBUTE_UNIX_MODE "unix:mode"                   /* uint32 */
465
466 /**
467  * G_FILE_ATTRIBUTE_UNIX_NLINK:
468  * 
469  * A key in the "unix" namespace for getting the number of hard links 
470  * for a file. See lstat() documentation. This attribute is only available 
471  * for UNIX file systems. Corresponding #GFileAttributeType is 
472  * %G_FILE_ATTRIBUTE_TYPE_UINT32.
473  **/
474 #define G_FILE_ATTRIBUTE_UNIX_NLINK "unix:nlink"                 /* uint32 */
475
476 /**
477  * G_FILE_ATTRIBUTE_UNIX_UID:
478  * 
479  * A key in the "unix" namespace for getting the user ID for the file. 
480  * This attribute is only available for UNIX file systems. 
481  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
482  **/
483 #define G_FILE_ATTRIBUTE_UNIX_UID "unix:uid"                     /* uint32 */
484
485 /**
486  * G_FILE_ATTRIBUTE_UNIX_GID:
487  * 
488  * A key in the "unix" namespace for getting the group ID for the file.
489  * This attribute is only available for UNIX file systems. 
490  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
491  **/
492 #define G_FILE_ATTRIBUTE_UNIX_GID "unix:gid"                     /* uint32 */
493
494 /**
495  * G_FILE_ATTRIBUTE_UNIX_RDEV:
496  * 
497  * A key in the "unix" namespace for getting the device ID for the file 
498  * (if it is a special file). See lstat() documentation. This attribute 
499  * is only available for UNIX file systems. Corresponding #GFileAttributeType 
500  * is %G_FILE_ATTRIBUTE_TYPE_UINT32.
501  **/
502 #define G_FILE_ATTRIBUTE_UNIX_RDEV "unix:rdev"                   /* uint32 */
503
504 /**
505  * G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE:
506  * 
507  * A key in the "unix" namespace for getting the block size for the file 
508  * system. This attribute is only available for UNIX file systems. 
509  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
510  **/
511 #define G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE "unix:block_size"       /* uint32 */
512
513 /**
514  * G_FILE_ATTRIBUTE_UNIX_BLOCKS:
515  * 
516  * A key in the "unix" namespace for getting the number of blocks allocated 
517  * for the file. This attribute is only available for UNIX file systems. 
518  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
519  **/
520 #define G_FILE_ATTRIBUTE_UNIX_BLOCKS "unix:blocks"               /* uint64 */
521
522 /**
523  * G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT:
524  * 
525  * A key in the "unix" namespace for checking if the file represents a 
526  * UNIX mount point. This attribute is %TRUE if the file is a UNIX mount 
527  * point. This attribute is only available for UNIX file systems. 
528  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
529  **/
530 #define G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT "unix:is_mountpoint" /* boolean */
531
532 /* DOS specific attributes */
533
534 /**
535  * G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE:
536  * 
537  * A key in the "dos" namespace for checking if the file's archive flag 
538  * is set. This attribute is %TRUE if the archive flag is set. This attribute 
539  * is only available for DOS file systems. Corresponding #GFileAttributeType 
540  * is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
541  **/
542 #define G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE "dos:is_archive"         /* boolean */
543
544 /**
545  * G_FILE_ATTRIBUTE_DOS_IS_SYSTEM:
546  * 
547  * A key in the "dos" namespace for checking if the file's backup flag 
548  * is set. This attribute is %TRUE if the backup flag is set. This attribute 
549  * is only available for DOS file systems. Corresponding #GFileAttributeType 
550  * is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
551  **/
552 #define G_FILE_ATTRIBUTE_DOS_IS_SYSTEM "dos:is_system"           /* boolean */
553
554 /* Owner attributes */
555
556 /**
557  * G_FILE_ATTRIBUTE_OWNER_USER:
558  * 
559  * A key in the "owner" namespace for getting the user name of the 
560  * file's owner. Corresponding #GFileAttributeType is 
561  * %G_FILE_ATTRIBUTE_TYPE_STRING.
562  **/
563 #define G_FILE_ATTRIBUTE_OWNER_USER "owner:user"                 /* string */
564
565 /**
566  * G_FILE_ATTRIBUTE_OWNER_USER_REAL:
567  * 
568  * A key in the "owner" namespace for getting the real name of the 
569  * user that owns the file. Corresponding #GFileAttributeType is 
570  * %G_FILE_ATTRIBUTE_TYPE_STRING.
571  **/
572 #define G_FILE_ATTRIBUTE_OWNER_USER_REAL "owner:user_real"       /* string */
573
574 /**
575  * G_FILE_ATTRIBUTE_OWNER_GROUP:
576  * 
577  * A key in the "owner" namespace for getting the file owner's group.
578  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
579  **/
580 #define G_FILE_ATTRIBUTE_OWNER_GROUP "owner:group"               /* string */
581
582 /* Thumbnails */
583
584 /**
585  * G_FILE_ATTRIBUTE_THUMBNAIL_PATH:
586  * 
587  * A key in the "thumbnail" namespace for getting the path to the thumbnail 
588  * image. Corresponding #GFileAttributeType is 
589  * %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
590  **/
591 #define G_FILE_ATTRIBUTE_THUMBNAIL_PATH "thumbnail:path"         /* bytestring */
592 /**
593  * G_FILE_ATTRIBUTE_THUMBNAILING_FAILED:
594  * 
595  * A key in the "thumbnail" namespace for checking if thumbnailing failed. 
596  * This attribute is %TRUE if thumbnailing failed. Corresponding 
597  * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN. 
598  **/
599 #define G_FILE_ATTRIBUTE_THUMBNAILING_FAILED "thumbnail:failed"         /* boolean */
600
601 /* File system info (for g_file_get_filesystem_info) */
602
603 /**
604  * G_FILE_ATTRIBUTE_FS_SIZE:
605  * 
606  * A key in the "fs" namespace for getting the size of the file system, 
607  * used in g_file_get_filesystem_info(). Corresponding #GFileAttributeType 
608  * is %G_FILE_ATTRIBUTE_TYPE_UINT64.
609  **/
610 #define G_FILE_ATTRIBUTE_FS_SIZE "fs:size"                       /* uint64 */
611
612 /**
613  * G_FILE_ATTRIBUTE_FS_FREE:
614  * 
615  * A key in the "fs" namespace for getting the free space left on the 
616  * file system. Corresponding #GFileAttributeType is 
617  * %G_FILE_ATTRIBUTE_TYPE_UINT64.
618  **/
619 #define G_FILE_ATTRIBUTE_FS_FREE "fs:free"                       /* uint64 */
620
621 /**
622  * G_FILE_ATTRIBUTE_FS_TYPE:
623  * 
624  * A key in the "fs" namespace for getting the file system's type.
625  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
626  **/
627 #define G_FILE_ATTRIBUTE_FS_TYPE "fs:type"                       /* string */
628
629 /**
630  * G_FILE_ATTRIBUTE_FS_READONLY:
631  * 
632  * A key in the "fs" namespace for checking if the file system is read only.
633  * Is set to %TRUE if the file system is read only. Corresponding 
634  * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
635  **/
636 #define G_FILE_ATTRIBUTE_FS_READONLY "fs:readonly"               /* boolean */
637
638 /**
639  * G_FILE_ATTRIBUTE_GVFS_BACKEND:
640  * 
641  * A key in the "gvfs" namespace that gets the name of the current
642  * GVFS backend in use. Corresponding #GFileAttributeType is 
643  * %G_FILE_ATTRIBUTE_TYPE_STRING.
644  **/
645 #define G_FILE_ATTRIBUTE_GVFS_BACKEND "gvfs:backend"             /* string */
646
647 GType g_file_info_get_type (void) G_GNUC_CONST;
648
649 GFileInfo *        g_file_info_new                       (void);
650 GFileInfo *        g_file_info_dup                       (GFileInfo  *other);
651 void               g_file_info_copy_into                 (GFileInfo  *src_info,
652                                                           GFileInfo  *dest_info);
653 gboolean           g_file_info_has_attribute             (GFileInfo  *info,
654                                                           const char *attribute);
655 char **            g_file_info_list_attributes           (GFileInfo  *info,
656                                                           const char *name_space);
657 GFileAttributeType g_file_info_get_attribute_type        (GFileInfo  *info,
658                                                           const char *attribute);
659 void               g_file_info_remove_attribute          (GFileInfo  *info,
660                                                           const char *attribute);
661 GFileAttributeValue * g_file_info_get_attribute          (GFileInfo  *info,
662                                                           const char *attribute);
663 const char *       g_file_info_get_attribute_string      (GFileInfo  *info,
664                                                           const char *attribute);
665 const char *       g_file_info_get_attribute_byte_string (GFileInfo  *info,
666                                                           const char *attribute);
667 gboolean           g_file_info_get_attribute_boolean     (GFileInfo  *info,
668                                                           const char *attribute);
669 guint32            g_file_info_get_attribute_uint32      (GFileInfo  *info,
670                                                           const char *attribute);
671 gint32             g_file_info_get_attribute_int32       (GFileInfo  *info,
672                                                           const char *attribute);
673 guint64            g_file_info_get_attribute_uint64      (GFileInfo  *info,
674                                                           const char *attribute);
675 gint64             g_file_info_get_attribute_int64       (GFileInfo  *info,
676                                                           const char *attribute);
677 GObject *          g_file_info_get_attribute_object      (GFileInfo  *info,
678                                                           const char *attribute);
679
680 void               g_file_info_set_attribute             (GFileInfo  *info,
681                                                           const char *attribute,
682                                                           const GFileAttributeValue *attr_value);
683 void               g_file_info_set_attribute_string      (GFileInfo  *info,
684                                                           const char *attribute,
685                                                           const char *attr_value);
686 void               g_file_info_set_attribute_byte_string (GFileInfo  *info,
687                                                           const char *attribute,
688                                                           const char *attr_value);
689 void               g_file_info_set_attribute_boolean     (GFileInfo  *info,
690                                                           const char *attribute,
691                                                           gboolean    attr_value);
692 void               g_file_info_set_attribute_uint32      (GFileInfo  *info,
693                                                           const char *attribute,
694                                                           guint32     attr_value);
695 void               g_file_info_set_attribute_int32       (GFileInfo  *info,
696                                                           const char *attribute,
697                                                           gint32      attr_value);
698 void               g_file_info_set_attribute_uint64      (GFileInfo  *info,
699                                                           const char *attribute,
700                                                           guint64     attr_value);
701 void               g_file_info_set_attribute_int64       (GFileInfo  *info,
702                                                           const char *attribute,
703                                                           gint64      attr_value);
704 void               g_file_info_set_attribute_object      (GFileInfo  *info,
705                                                           const char *attribute,
706                                                           GObject    *attr_value);
707
708 void               g_file_info_clear_status              (GFileInfo  *info);
709
710 /* Helper getters: */
711 GFileType         g_file_info_get_file_type          (GFileInfo         *info);
712 gboolean          g_file_info_get_is_hidden          (GFileInfo         *info);
713 gboolean          g_file_info_get_is_backup          (GFileInfo         *info);
714 gboolean          g_file_info_get_is_symlink         (GFileInfo         *info);
715 const char *      g_file_info_get_name               (GFileInfo         *info);
716 const char *      g_file_info_get_display_name       (GFileInfo         *info);
717 const char *      g_file_info_get_edit_name          (GFileInfo         *info);
718 GIcon *           g_file_info_get_icon               (GFileInfo         *info);
719 const char *      g_file_info_get_content_type       (GFileInfo         *info);
720 goffset           g_file_info_get_size               (GFileInfo         *info);
721 void              g_file_info_get_modification_time  (GFileInfo         *info,
722                                                       GTimeVal          *result);
723 const char *      g_file_info_get_symlink_target     (GFileInfo         *info);
724 const char *      g_file_info_get_etag               (GFileInfo         *info);
725 gint32            g_file_info_get_sort_order         (GFileInfo         *info);
726
727 void              g_file_info_set_attribute_mask     (GFileInfo         *info,
728                                                       GFileAttributeMatcher *mask);
729 void              g_file_info_unset_attribute_mask   (GFileInfo         *info);
730
731 /* Helper setters: */
732 void              g_file_info_set_file_type          (GFileInfo         *info,
733                                                       GFileType          type);
734 void              g_file_info_set_is_hidden          (GFileInfo         *info,
735                                                       gboolean           is_hidden);
736 void              g_file_info_set_is_symlink         (GFileInfo         *info,
737                                                       gboolean           is_symlink);
738 void              g_file_info_set_name               (GFileInfo         *info,
739                                                       const char        *name);
740 void              g_file_info_set_display_name       (GFileInfo         *info,
741                                                       const char        *display_name);
742 void              g_file_info_set_edit_name          (GFileInfo         *info,
743                                                       const char        *edit_name);
744 void              g_file_info_set_icon               (GFileInfo         *info,
745                                                       GIcon             *icon);
746 void              g_file_info_set_content_type       (GFileInfo         *info,
747                                                       const char        *content_type);
748 void              g_file_info_set_size               (GFileInfo         *info,
749                                                       goffset            size);
750 void              g_file_info_set_modification_time  (GFileInfo         *info,
751                                                       GTimeVal          *mtime);
752 void              g_file_info_set_symlink_target     (GFileInfo         *info,
753                                                       const char        *symlink_target);
754 void              g_file_info_set_sort_order         (GFileInfo         *info,
755                                                       gint32             sort_order);
756
757 GFileAttributeMatcher *g_file_attribute_matcher_new            (const char            *attributes);
758 GFileAttributeMatcher *g_file_attribute_matcher_ref            (GFileAttributeMatcher *matcher);
759 void                   g_file_attribute_matcher_unref          (GFileAttributeMatcher *matcher);
760 gboolean               g_file_attribute_matcher_matches        (GFileAttributeMatcher *matcher,
761                                                                 const char            *attribute);
762 gboolean               g_file_attribute_matcher_matches_only   (GFileAttributeMatcher *matcher,
763                                                                 const char            *attribute);
764 gboolean               g_file_attribute_matcher_enumerate_namespace (GFileAttributeMatcher *matcher,
765                                                                      const char            *ns);
766 const char *           g_file_attribute_matcher_enumerate_next (GFileAttributeMatcher *matcher);
767
768 G_END_DECLS
769
770
771 #endif /* __G_FILE_INFO_H__ */