Added new standard::description attribute. Requested by Vincent, and
[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 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
24 #error "Only <gio/gio.h> can be included directly."
25 #endif
26
27 #ifndef __G_FILE_INFO_H__
28 #define __G_FILE_INFO_H__
29
30 #include <glib-object.h>
31 #include <glib/gfileutils.h>
32 #include <gio/gfileattribute.h>
33 #include <gio/gicon.h>
34
35 G_BEGIN_DECLS
36
37 #define G_TYPE_FILE_INFO         (g_file_info_get_type ())
38 #define G_FILE_INFO(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_FILE_INFO, GFileInfo))
39 #define G_FILE_INFO_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_FILE_INFO, GFileInfoClass))
40 #define G_IS_FILE_INFO(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_FILE_INFO))
41 #define G_IS_FILE_INFO_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_FILE_INFO))
42 #define G_FILE_INFO_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_FILE_INFO, GFileInfoClass))
43
44 /**
45  * GFileInfo:
46  * 
47  * Stores information about a file system object referenced by a #GFile.
48  **/
49 typedef struct _GFileInfo        GFileInfo;
50 typedef struct _GFileInfoClass   GFileInfoClass;
51
52 /**
53  * GFileAttributeMatcher:
54  * 
55  * Determines if a string matches a file attribute.
56  **/
57 typedef struct _GFileAttributeMatcher GFileAttributeMatcher;
58
59 /**
60  * GFileType:
61  * @G_FILE_TYPE_UNKNOWN: File's type is unknown.
62  * @G_FILE_TYPE_REGULAR: File handle represents a regular file.
63  * @G_FILE_TYPE_DIRECTORY: File handle represents a directory.
64  * @G_FILE_TYPE_SYMBOLIC_LINK: File handle represents a symbolic link 
65  *    (Unix systems).
66  * @G_FILE_TYPE_SPECIAL: File is a "special" file, such as a socket, fifo, 
67  *    block device, or character device.
68  * @G_FILE_TYPE_SHORTCUT: File is a shortcut (Windows systems).
69  * @G_FILE_TYPE_MOUNTABLE: File is a mountable location.
70  * 
71  * Indicates the file's on-disk type.
72  **/
73 typedef enum {
74   G_FILE_TYPE_UNKNOWN = 0,
75   G_FILE_TYPE_REGULAR,
76   G_FILE_TYPE_DIRECTORY,
77   G_FILE_TYPE_SYMBOLIC_LINK,
78   G_FILE_TYPE_SPECIAL, /* socket, fifo, blockdev, chardev */
79   G_FILE_TYPE_SHORTCUT,
80   G_FILE_TYPE_MOUNTABLE
81 } GFileType;
82
83 /* Common Attributes:  */
84 /**
85  * G_FILE_ATTRIBUTE_STANDARD_TYPE:
86  * 
87  * A key in the "standard" namespace for storing file types. 
88  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
89  * The value for this key should contain a #GFileType.
90  **/
91 #define G_FILE_ATTRIBUTE_STANDARD_TYPE "standard::type"                     /* uint32 (GFileType) */
92
93 /**
94  * G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN:
95  * 
96  * A key in the "standard" namespace for checking if a file is hidden. 
97  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
98  **/
99 #define G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN "standard::is-hidden"           /* boolean */
100
101 /**
102  * G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP:
103  * 
104  * A key in the "standard" namespace for checking if a file is a backup file.
105  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
106  **/
107 #define G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP "standard::is-backup"           /* boolean */
108
109 /**
110  * G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK:
111  * 
112  * A key in the "standard" namespace for checking if the file is a symlink.
113  * Typically the actual type is something else, if we followed the symlink
114  * to get the type.
115  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
116  **/
117 #define G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK "standard::is-symlink"         /* boolean */
118
119 /**
120  * G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL:
121  * 
122  * A key in the "standard" namespace for checking if a file is virtual.
123  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
124  **/
125 #define G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL "standard::is-virtual"         /* boolean */
126
127 /**
128  * G_FILE_ATTRIBUTE_STANDARD_NAME:
129  * 
130  * A key in the "standard" namespace for getting the name of the file.
131  * The name is the on-disk filename which may not be in any known encoding,
132  * and can thus not be generally displayed as is.
133  * Use #G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME if you need to display the
134  * name in a user interface.
135  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
136  **/
137 #define G_FILE_ATTRIBUTE_STANDARD_NAME "standard::name"                     /* byte string */
138
139 /**
140  * G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME:
141  * 
142  * A key in the "standard" namespace for getting the display name of the file.
143  * A display name is guaranteed to be in UTF8 and can thus be displayed in
144  * the UI.
145  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
146  **/
147 #define G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME "standard::display-name"     /* string */
148
149 /**
150  * G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME:
151  * 
152  * A key in the "standard" namespace for edit name of the file.
153  * An edit name is similar to the display name, but it is meant to be
154  * used when you want to rename the file in the UI. The display name
155  * might contain information you don't want in the new filename (such as
156  * "(invalid unicode)" if the filename was in an invalid encoding).
157  * 
158  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
159  **/
160 #define G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME "standard::edit-name"           /* string */
161
162 /**
163  * G_FILE_ATTRIBUTE_STANDARD_COPY_NAME:
164  * 
165  * A key in the "standard" namespace for getting the copy name of the file.
166  * The copy name is an optional version of the name. If availible its always
167  * in UTF8, and corresponds directly to the original filename (only transcoded to
168  * UTF8). This is useful if you want to copy the file to another filesystem that
169  * might have a different encoding. If the filename is not a valid string in the
170  * encoding selected for the filesystem it is in then the copy name will not be set.
171  * 
172  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
173  **/
174 #define G_FILE_ATTRIBUTE_STANDARD_COPY_NAME "standard::copy-name"           /* string */
175
176 /**
177  * G_FILE_ATTRIBUTE_STANDARD_DESCRIPTION:
178  * 
179  * A key in the "standard" namespace for getting the description of the file.
180  * The description is a utf8 string that describes the file, generally containing
181  * the filename, but can also contain furter information. Example descriptions
182  * could be "filename (on hostname)" for a remote file or "filename (in trash)"
183  * for a file in the trash. This is useful for instance as the window title
184  * when displaying a directory or for a bookmarks menu.
185  * 
186  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
187  **/
188 #define G_FILE_ATTRIBUTE_STANDARD_DESCRIPTION "standard::description"        /* string */
189
190 /**
191  * G_FILE_ATTRIBUTE_STANDARD_ICON:
192  * 
193  * A key in the "standard" namespace for getting the icon for the file.
194  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_OBJECT.
195  * The value for this key should contain a #GIcon.
196  **/
197 #define G_FILE_ATTRIBUTE_STANDARD_ICON "standard::icon"                     /* object (GIcon) */
198
199 /**
200  * G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE:
201  * 
202  * A key in the "standard" namespace for getting the content type of the file.
203  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
204  * The value for this key should contain a valid content type.
205  **/
206 #define G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE "standard::content-type"     /* string */
207
208 /**
209  * G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE:
210  * 
211  * A key in the "standard" namespace for getting the fast content type.
212  * The fast content type isn't as reliable as the regular one, as it
213  * only uses the filename to guess it, but it is faster to calculate than the
214  * regular content type.
215  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
216  * 
217  **/
218 #define G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE "standard::fast-content-type" /* string */
219
220 /**
221  * G_FILE_ATTRIBUTE_STANDARD_SIZE:
222  * 
223  * A key in the "standard" namespace for getting the file's size (in bytes).
224  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
225  **/
226 #define G_FILE_ATTRIBUTE_STANDARD_SIZE "standard::size"                     /* uint64 */
227
228 /**
229  * G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET:
230  * 
231  * A key in the "standard" namespace for getting the symlink target, if the file
232  * is a symlink. Corresponding #GFileAttributeType is 
233  * %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
234  **/
235 #define G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET "standard::symlink-target" /* byte string */
236
237 /**
238  * G_FILE_ATTRIBUTE_STANDARD_TARGET_URI:
239  * 
240  * A key in the "standard" namespace for getting the target URI for the file, in
241  * the case of %G_FILE_TYPE_SHORTCUT or %G_FILE_TYPE_MOUNTABLE files.
242  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
243  **/
244 #define G_FILE_ATTRIBUTE_STANDARD_TARGET_URI "standard::target-uri"         /* string */
245
246 /**
247  * G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER:
248  * 
249  * A key in the "standard" namespace for setting the sort order of a file. 
250  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_INT32.
251  * An example use would be in file managers, which would use this key 
252  * to set the order files are displayed. Files with smaller sort order
253  * should be sorted first, and files without sort order as if sort order
254  * was zero.
255  **/
256 #define G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER "standard::sort-order"         /* int32  */
257
258 /* Entity tags, used to avoid missing updates on save */
259
260 /**
261  * G_FILE_ATTRIBUTE_ETAG_VALUE:
262  * 
263  * A key in the "etag" namespace for getting the value of the file's
264  * entity tag. Corresponding #GFileAttributeType is 
265  * %G_FILE_ATTRIBUTE_TYPE_STRING.
266  **/
267 #define G_FILE_ATTRIBUTE_ETAG_VALUE "etag::value"                 /* string */
268
269 /* File identifier, for e.g. avoiding loops when doing recursive 
270  * directory scanning 
271  */
272
273 /**
274  * G_FILE_ATTRIBUTE_ID_FILE:
275  * 
276  * A key in the "id" namespace for getting a file identifier.
277  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
278  * An example use would be during listing files, to avoid recursive
279  * directory scanning.
280  **/
281 #define G_FILE_ATTRIBUTE_ID_FILE "id::file"                     /* string */
282
283 /**
284  * G_FILE_ATTRIBUTE_ID_FILESYSTEM:
285  * 
286  * A key in the "id" namespace for getting the file system identifier.
287  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
288  * An example use would be during drag and drop to see if the source
289  * and target are on the same filesystem (default to move) or not (default
290  * to copy).
291  **/
292 #define G_FILE_ATTRIBUTE_ID_FILESYSTEM "id::filesystem"         /* string */
293
294 /* Calculated Access Rights for current user */
295
296 /**
297  * G_FILE_ATTRIBUTE_ACCESS_CAN_READ:
298  * 
299  * A key in the "access" namespace for getting read privileges. 
300  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
301  * This attribute will be %TRUE if the user is able to read the file.
302  **/
303 #define G_FILE_ATTRIBUTE_ACCESS_CAN_READ "access::can-read"       /* boolean */
304
305 /**
306  * G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE:
307  * 
308  * A key in the "access" namespace for getting write privileges.
309  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
310  * This attribute will be %TRUE if the user is able to write to the file.
311  **/
312 #define G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE "access::can-write"     /* boolean */
313
314 /**
315  * G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE:
316  * 
317  * A key in the "access" namespace for getting execution privileges.
318  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
319  * This attribute will be %TRUE if the user is able to execute the file.
320  **/
321 #define G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE "access::can-execute" /* boolean */
322
323 /**
324  * G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE:
325  * 
326  * A key in the "access" namespace for checking deletion privileges.
327  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
328  * This attribute will be %TRUE if the user is able to delete the file.
329  **/
330 #define G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE "access::can-delete"   /* boolean */
331
332 /**
333  * G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH:
334  * 
335  * A key in the "access" namespace for checking trashing privileges.
336  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
337  * This attribute will be %TRUE if the user is able to move the file to 
338  * the trash.
339  **/
340 #define G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH "access::can-trash"     /* boolean */
341
342 /**
343  * G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME:
344  * 
345  * A key in the "access" namespace for checking renaming privileges.
346  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
347  * This attribute will be %TRUE if the user is able to rename the file.
348  **/
349 #define G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME "access::can-rename"   /* boolean */ 
350
351 /* TODO: Should we have special version for directories? can_enumerate, etc */
352
353 /* Mountable attributes */
354
355 /**
356  * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT:
357  * 
358  * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) is mountable.
359  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
360  **/
361 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT "mountable::can-mount"     /* boolean */
362
363 /**
364  * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT:
365  * 
366  * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE)  is unmountable.
367  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
368  **/
369 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT "mountable::can-unmount" /* boolean */
370
371 /**
372  * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT:
373  * 
374  * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be ejected.
375  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
376  **/
377 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT "mountable::can-eject"     /* boolean */
378
379 /**
380  * G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE:
381  * 
382  * A key in the "mountable" namespace for getting the unix device.
383  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
384  **/
385 #define G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE "mountable::unix-device" /* uint32 */
386
387 /**
388  * G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI:
389  * 
390  * A key in the "mountable" namespace for getting the HAL UDI for the mountable
391  * file. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
392  **/
393 #define G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI "mountable::hal-udi"         /* string */
394
395 /* Time attributes */
396
397 /**
398  * G_FILE_ATTRIBUTE_TIME_MODIFIED:
399  * 
400  * A key in the "time" namespace for getting the time the file was last
401  * modified. Corresponding #GFileAttributeType is 
402  * %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the 
403  * file was modified.
404  **/
405 #define G_FILE_ATTRIBUTE_TIME_MODIFIED "time::modified"           /* uint64 */
406
407 /**
408  * G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC:
409  * 
410  * A key in the "time" namespace for getting the milliseconds of the time
411  * the file was last modified. This should be used in conjunction with 
412  * #G_FILE_ATTRIBUTE_TIME_MODIFIED. Corresponding #GFileAttributeType is 
413  * %G_FILE_ATTRIBUTE_TYPE_UINT32.
414  **/
415 #define G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC "time::modified-usec" /* uint32 */
416
417 /**
418  * G_FILE_ATTRIBUTE_TIME_ACCESS:
419  * 
420  * A key in the "time" namespace for getting the time the file was last
421  * accessed. Corresponding #GFileAttributeType is 
422  * %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the 
423  * file was last accessed.
424  **/
425 #define G_FILE_ATTRIBUTE_TIME_ACCESS "time::access"               /* uint64 */
426
427 /**
428  * G_FILE_ATTRIBUTE_TIME_ACCESS_USEC:
429  * 
430  * A key in the "time" namespace for getting the milliseconds of the time
431  * the file was last accessed. This should be used in conjunction with
432  * #G_FILE_ATTRIBUTE_TIME_ACCESS. Corresponding #GFileAttributeType is 
433  * %G_FILE_ATTRIBUTE_TYPE_UINT32.
434  **/
435 #define G_FILE_ATTRIBUTE_TIME_ACCESS_USEC "time::access-usec"     /* uint32 */
436
437 /**
438  * G_FILE_ATTRIBUTE_TIME_CHANGED:
439  * 
440  * A key in the "time" namespace for getting the time the file was last
441  * changed. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64, 
442  * and contains the UNIX time since the file was last changed.
443  *
444  * This corresponds to the traditional UNIX ctime.
445  **/
446 #define G_FILE_ATTRIBUTE_TIME_CHANGED "time::changed"             /* uint64 */
447
448 /**
449  * G_FILE_ATTRIBUTE_TIME_CHANGED_USEC:
450  * 
451  * A key in the "time" namespace for getting the milliseconds of the time
452  * the file was last changed. This should be used in conjunction with
453  * #G_FILE_ATTRIBUTE_TIME_CHANGED. Corresponding #GFileAttributeType is 
454  * %G_FILE_ATTRIBUTE_TYPE_UINT32. 
455  **/
456 #define G_FILE_ATTRIBUTE_TIME_CHANGED_USEC "time::changed-usec"   /* uint32 */
457
458 /**
459  * G_FILE_ATTRIBUTE_TIME_CREATED:
460  * 
461  * A key in the "time" namespace for getting the time the file was created.
462  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64, 
463  * and contains the UNIX time since the file was created.
464  *
465  * This corresponds to the NTFS ctime.
466  **/
467 #define G_FILE_ATTRIBUTE_TIME_CREATED "time::created"             /* uint64 */
468
469 /**
470  * G_FILE_ATTRIBUTE_TIME_CREATED_USEC:
471  * 
472  * A key in the "time" namespace for getting the milliseconds of the time
473  * the file was created. This should be used in conjunction with
474  * #G_FILE_ATTRIBUTE_TIME_CREATED. Corresponding #GFileAttributeType is 
475  * %G_FILE_ATTRIBUTE_TYPE_UINT32. 
476  **/
477 #define G_FILE_ATTRIBUTE_TIME_CREATED_USEC "time::created-usec"   /* uint32 */
478
479 /* Unix specific attributes */
480
481 /**
482  * G_FILE_ATTRIBUTE_UNIX_DEVICE:
483  * 
484  * A key in the "unix" namespace for getting the device id of the device the 
485  * file is located on (see stat() documentation). This attribute is only 
486  * available for UNIX file systems. Corresponding #GFileAttributeType is 
487  * %G_FILE_ATTRIBUTE_TYPE_UINT32. 
488  **/
489 #define G_FILE_ATTRIBUTE_UNIX_DEVICE "unix::device"               /* uint32 */
490
491 /**
492  * G_FILE_ATTRIBUTE_UNIX_INODE:
493  * 
494  * A key in the "unix" namespace for getting the inode of the file.
495  * This attribute is only available for UNIX file systems. Corresponding 
496  * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
497  **/
498 #define G_FILE_ATTRIBUTE_UNIX_INODE "unix::inode"                 /* uint64 */
499
500 /**
501  * G_FILE_ATTRIBUTE_UNIX_MODE:
502  * 
503  * A key in the "unix" namespace for getting the mode of the file
504  * (e.g. whether the file is a regular file, symlink, etc). See lstat() 
505  * documentation. This attribute is only available for UNIX file systems. 
506  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
507  **/
508 #define G_FILE_ATTRIBUTE_UNIX_MODE "unix::mode"                   /* uint32 */
509
510 /**
511  * G_FILE_ATTRIBUTE_UNIX_NLINK:
512  * 
513  * A key in the "unix" namespace for getting the number of hard links 
514  * for a file. See lstat() documentation. This attribute is only available 
515  * for UNIX file systems. Corresponding #GFileAttributeType is 
516  * %G_FILE_ATTRIBUTE_TYPE_UINT32.
517  **/
518 #define G_FILE_ATTRIBUTE_UNIX_NLINK "unix::nlink"                 /* uint32 */
519
520 /**
521  * G_FILE_ATTRIBUTE_UNIX_UID:
522  * 
523  * A key in the "unix" namespace for getting the user ID for the file. 
524  * This attribute is only available for UNIX file systems. 
525  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
526  **/
527 #define G_FILE_ATTRIBUTE_UNIX_UID "unix::uid"                     /* uint32 */
528
529 /**
530  * G_FILE_ATTRIBUTE_UNIX_GID:
531  * 
532  * A key in the "unix" namespace for getting the group ID for the file.
533  * This attribute is only available for UNIX file systems. 
534  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
535  **/
536 #define G_FILE_ATTRIBUTE_UNIX_GID "unix::gid"                     /* uint32 */
537
538 /**
539  * G_FILE_ATTRIBUTE_UNIX_RDEV:
540  * 
541  * A key in the "unix" namespace for getting the device ID for the file 
542  * (if it is a special file). See lstat() documentation. This attribute 
543  * is only available for UNIX file systems. Corresponding #GFileAttributeType 
544  * is %G_FILE_ATTRIBUTE_TYPE_UINT32.
545  **/
546 #define G_FILE_ATTRIBUTE_UNIX_RDEV "unix::rdev"                   /* uint32 */
547
548 /**
549  * G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE:
550  * 
551  * A key in the "unix" namespace for getting the block size for the file 
552  * system. This attribute is only available for UNIX file systems. 
553  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
554  **/
555 #define G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE "unix::block-size"       /* uint32 */
556
557 /**
558  * G_FILE_ATTRIBUTE_UNIX_BLOCKS:
559  * 
560  * A key in the "unix" namespace for getting the number of blocks allocated 
561  * for the file. This attribute is only available for UNIX file systems. 
562  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
563  **/
564 #define G_FILE_ATTRIBUTE_UNIX_BLOCKS "unix::blocks"               /* uint64 */
565
566 /**
567  * G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT:
568  * 
569  * A key in the "unix" namespace for checking if the file represents a 
570  * UNIX mount point. This attribute is %TRUE if the file is a UNIX mount 
571  * point. This attribute is only available for UNIX file systems. 
572  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
573  **/
574 #define G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT "unix::is-mountpoint" /* boolean */
575
576 /* DOS specific attributes */
577
578 /**
579  * G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE:
580  * 
581  * A key in the "dos" namespace for checking if the file's archive flag 
582  * is set. This attribute is %TRUE if the archive flag is set. This attribute 
583  * is only available for DOS file systems. Corresponding #GFileAttributeType 
584  * is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
585  **/
586 #define G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE "dos::is-archive"         /* boolean */
587
588 /**
589  * G_FILE_ATTRIBUTE_DOS_IS_SYSTEM:
590  * 
591  * A key in the "dos" namespace for checking if the file's backup flag 
592  * is set. This attribute is %TRUE if the backup flag is set. This attribute 
593  * is only available for DOS file systems. Corresponding #GFileAttributeType 
594  * is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
595  **/
596 #define G_FILE_ATTRIBUTE_DOS_IS_SYSTEM "dos::is-system"           /* boolean */
597
598 /* Owner attributes */
599
600 /**
601  * G_FILE_ATTRIBUTE_OWNER_USER:
602  * 
603  * A key in the "owner" namespace for getting the user name of the 
604  * file's owner. Corresponding #GFileAttributeType is 
605  * %G_FILE_ATTRIBUTE_TYPE_STRING.
606  **/
607 #define G_FILE_ATTRIBUTE_OWNER_USER "owner::user"                 /* string */
608
609 /**
610  * G_FILE_ATTRIBUTE_OWNER_USER_REAL:
611  * 
612  * A key in the "owner" namespace for getting the real name of the 
613  * user that owns the file. Corresponding #GFileAttributeType is 
614  * %G_FILE_ATTRIBUTE_TYPE_STRING.
615  **/
616 #define G_FILE_ATTRIBUTE_OWNER_USER_REAL "owner::user-real"       /* string */
617
618 /**
619  * G_FILE_ATTRIBUTE_OWNER_GROUP:
620  * 
621  * A key in the "owner" namespace for getting the file owner's group.
622  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
623  **/
624 #define G_FILE_ATTRIBUTE_OWNER_GROUP "owner::group"               /* string */
625
626 /* Thumbnails */
627
628 /**
629  * G_FILE_ATTRIBUTE_THUMBNAIL_PATH:
630  * 
631  * A key in the "thumbnail" namespace for getting the path to the thumbnail 
632  * image. Corresponding #GFileAttributeType is 
633  * %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
634  **/
635 #define G_FILE_ATTRIBUTE_THUMBNAIL_PATH "thumbnail::path"         /* bytestring */
636 /**
637  * G_FILE_ATTRIBUTE_THUMBNAILING_FAILED:
638  * 
639  * A key in the "thumbnail" namespace for checking if thumbnailing failed. 
640  * This attribute is %TRUE if thumbnailing failed. Corresponding 
641  * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN. 
642  **/
643 #define G_FILE_ATTRIBUTE_THUMBNAILING_FAILED "thumbnail::failed"         /* boolean */
644
645 /* File system info (for g_file_get_filesystem_info) */
646
647 /**
648  * G_FILE_ATTRIBUTE_FILESYSTEM_SIZE:
649  * 
650  * A key in the "filesystem" namespace for getting the total size (in bytes) of the file system, 
651  * used in g_file_query_filesystem_info(). Corresponding #GFileAttributeType 
652  * is %G_FILE_ATTRIBUTE_TYPE_UINT64.
653  **/
654 #define G_FILE_ATTRIBUTE_FILESYSTEM_SIZE "filesystem::size"                       /* uint64 */
655
656 /**
657  * G_FILE_ATTRIBUTE_FILESYSTEM_FREE:
658  * 
659  * A key in the "filesystem" namespace for getting the number of bytes of free space left on the 
660  * file system. Corresponding #GFileAttributeType is 
661  * %G_FILE_ATTRIBUTE_TYPE_UINT64.
662  **/
663 #define G_FILE_ATTRIBUTE_FILESYSTEM_FREE "filesystem::free"                       /* uint64 */
664
665 /**
666  * G_FILE_ATTRIBUTE_FILESYSTEM_TYPE:
667  * 
668  * A key in the "filesystem" namespace for getting the file system's type.
669  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
670  **/
671 #define G_FILE_ATTRIBUTE_FILESYSTEM_TYPE "filesystem::type"                       /* string */
672
673 /**
674  * G_FILE_ATTRIBUTE_FILESYSTEM_READONLY:
675  *
676  * A key in the "filesystem" namespace for checking if the file system 
677  * is read only. Is set to %TRUE if the file system is read only. 
678  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
679  **/
680 #define G_FILE_ATTRIBUTE_FILESYSTEM_READONLY "filesystem::readonly"               /* boolean */
681
682 /**
683  * G_FILE_ATTRIBUTE_GVFS_BACKEND:
684  * 
685  * A key in the "gvfs" namespace that gets the name of the current
686  * GVFS backend in use. Corresponding #GFileAttributeType is 
687  * %G_FILE_ATTRIBUTE_TYPE_STRING.
688  **/
689 #define G_FILE_ATTRIBUTE_GVFS_BACKEND "gvfs::backend"             /* string */
690
691 /**
692  * G_FILE_ATTRIBUTE_SELINUX_CONTEXT:
693  * 
694  * A key in the "selinux" namespace for getting the file's SELinux
695  * context. Corresponding #GFileAttributeType is 
696  * %G_FILE_ATTRIBUTE_TYPE_STRING. Note that this attribute is only
697  * available if GLib has been built with SELinux support.
698  **/
699 #define G_FILE_ATTRIBUTE_SELINUX_CONTEXT "selinux::context"       /* string */
700
701 GType g_file_info_get_type (void) G_GNUC_CONST;
702
703 GFileInfo *        g_file_info_new                       (void);
704 GFileInfo *        g_file_info_dup                       (GFileInfo  *other);
705 void               g_file_info_copy_into                 (GFileInfo  *src_info,
706                                                           GFileInfo  *dest_info);
707 gboolean           g_file_info_has_attribute             (GFileInfo  *info,
708                                                           const char *attribute);
709 char **            g_file_info_list_attributes           (GFileInfo  *info,
710                                                           const char *name_space);
711 gboolean           g_file_info_get_attribute_data        (GFileInfo  *info,
712                                                           const char *attribute,
713                                                           GFileAttributeType *type,
714                                                           gpointer   *value_pp,
715                                                           GFileAttributeStatus *status);
716 GFileAttributeType g_file_info_get_attribute_type        (GFileInfo  *info,
717                                                           const char *attribute);
718 void               g_file_info_remove_attribute          (GFileInfo  *info,
719                                                           const char *attribute);
720 GFileAttributeStatus g_file_info_get_attribute_status    (GFileInfo  *info,
721                                                           const char *attribute);
722 char *             g_file_info_get_attribute_as_string   (GFileInfo  *info,
723                                                           const char *attribute);
724 const char *       g_file_info_get_attribute_string      (GFileInfo  *info,
725                                                           const char *attribute);
726 const char *       g_file_info_get_attribute_byte_string (GFileInfo  *info,
727                                                           const char *attribute);
728 gboolean           g_file_info_get_attribute_boolean     (GFileInfo  *info,
729                                                           const char *attribute);
730 guint32            g_file_info_get_attribute_uint32      (GFileInfo  *info,
731                                                           const char *attribute);
732 gint32             g_file_info_get_attribute_int32       (GFileInfo  *info,
733                                                           const char *attribute);
734 guint64            g_file_info_get_attribute_uint64      (GFileInfo  *info,
735                                                           const char *attribute);
736 gint64             g_file_info_get_attribute_int64       (GFileInfo  *info,
737                                                           const char *attribute);
738 GObject *          g_file_info_get_attribute_object      (GFileInfo  *info,
739                                                           const char *attribute);
740
741 void               g_file_info_set_attribute             (GFileInfo  *info,
742                                                           const char *attribute,
743                                                           GFileAttributeType type,
744                                                           gpointer    value_p);
745 void               g_file_info_set_attribute_string      (GFileInfo  *info,
746                                                           const char *attribute,
747                                                           const char *attr_value);
748 void               g_file_info_set_attribute_byte_string (GFileInfo  *info,
749                                                           const char *attribute,
750                                                           const char *attr_value);
751 void               g_file_info_set_attribute_boolean     (GFileInfo  *info,
752                                                           const char *attribute,
753                                                           gboolean    attr_value);
754 void               g_file_info_set_attribute_uint32      (GFileInfo  *info,
755                                                           const char *attribute,
756                                                           guint32     attr_value);
757 void               g_file_info_set_attribute_int32       (GFileInfo  *info,
758                                                           const char *attribute,
759                                                           gint32      attr_value);
760 void               g_file_info_set_attribute_uint64      (GFileInfo  *info,
761                                                           const char *attribute,
762                                                           guint64     attr_value);
763 void               g_file_info_set_attribute_int64       (GFileInfo  *info,
764                                                           const char *attribute,
765                                                           gint64      attr_value);
766 void               g_file_info_set_attribute_object      (GFileInfo  *info,
767                                                           const char *attribute,
768                                                           GObject    *attr_value);
769
770 void               g_file_info_clear_status              (GFileInfo  *info);
771
772 /* Helper getters: */
773 GFileType         g_file_info_get_file_type          (GFileInfo         *info);
774 gboolean          g_file_info_get_is_hidden          (GFileInfo         *info);
775 gboolean          g_file_info_get_is_backup          (GFileInfo         *info);
776 gboolean          g_file_info_get_is_symlink         (GFileInfo         *info);
777 const char *      g_file_info_get_name               (GFileInfo         *info);
778 const char *      g_file_info_get_display_name       (GFileInfo         *info);
779 const char *      g_file_info_get_edit_name          (GFileInfo         *info);
780 GIcon *           g_file_info_get_icon               (GFileInfo         *info);
781 const char *      g_file_info_get_content_type       (GFileInfo         *info);
782 goffset           g_file_info_get_size               (GFileInfo         *info);
783 void              g_file_info_get_modification_time  (GFileInfo         *info,
784                                                       GTimeVal          *result);
785 const char *      g_file_info_get_symlink_target     (GFileInfo         *info);
786 const char *      g_file_info_get_etag               (GFileInfo         *info);
787 gint32            g_file_info_get_sort_order         (GFileInfo         *info);
788
789 void              g_file_info_set_attribute_mask     (GFileInfo         *info,
790                                                       GFileAttributeMatcher *mask);
791 void              g_file_info_unset_attribute_mask   (GFileInfo         *info);
792
793 /* Helper setters: */
794 void              g_file_info_set_file_type          (GFileInfo         *info,
795                                                       GFileType          type);
796 void              g_file_info_set_is_hidden          (GFileInfo         *info,
797                                                       gboolean           is_hidden);
798 void              g_file_info_set_is_symlink         (GFileInfo         *info,
799                                                       gboolean           is_symlink);
800 void              g_file_info_set_name               (GFileInfo         *info,
801                                                       const char        *name);
802 void              g_file_info_set_display_name       (GFileInfo         *info,
803                                                       const char        *display_name);
804 void              g_file_info_set_edit_name          (GFileInfo         *info,
805                                                       const char        *edit_name);
806 void              g_file_info_set_icon               (GFileInfo         *info,
807                                                       GIcon             *icon);
808 void              g_file_info_set_content_type       (GFileInfo         *info,
809                                                       const char        *content_type);
810 void              g_file_info_set_size               (GFileInfo         *info,
811                                                       goffset            size);
812 void              g_file_info_set_modification_time  (GFileInfo         *info,
813                                                       GTimeVal          *mtime);
814 void              g_file_info_set_symlink_target     (GFileInfo         *info,
815                                                       const char        *symlink_target);
816 void              g_file_info_set_sort_order         (GFileInfo         *info,
817                                                       gint32             sort_order);
818
819 GFileAttributeMatcher *g_file_attribute_matcher_new            (const char            *attributes);
820 GFileAttributeMatcher *g_file_attribute_matcher_ref            (GFileAttributeMatcher *matcher);
821 void                   g_file_attribute_matcher_unref          (GFileAttributeMatcher *matcher);
822 gboolean               g_file_attribute_matcher_matches        (GFileAttributeMatcher *matcher,
823                                                                 const char            *attribute);
824 gboolean               g_file_attribute_matcher_matches_only   (GFileAttributeMatcher *matcher,
825                                                                 const char            *attribute);
826 gboolean               g_file_attribute_matcher_enumerate_namespace (GFileAttributeMatcher *matcher,
827                                                                      const char            *ns);
828 const char *           g_file_attribute_matcher_enumerate_next (GFileAttributeMatcher *matcher);
829
830 G_END_DECLS
831
832
833 #endif /* __G_FILE_INFO_H__ */