Add define for selinux context attribute. Fix missing : -> :: namespace
[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_ICON:
178  * 
179  * A key in the "standard" namespace for getting the icon for the file.
180  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_OBJECT.
181  * The value for this key should contain a #GIcon.
182  **/
183 #define G_FILE_ATTRIBUTE_STANDARD_ICON "standard::icon"                     /* object (GIcon) */
184
185 /**
186  * G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE:
187  * 
188  * A key in the "standard" namespace for getting the content type of the file.
189  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
190  * The value for this key should contain a valid content type.
191  **/
192 #define G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE "standard::content-type"     /* string */
193
194 /**
195  * G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE:
196  * 
197  * A key in the "standard" namespace for getting the fast content type.
198  * The fast content type isn't as reliable as the regular one, as it
199  * only uses the filename to guess it, but it is faster to calculate than the
200  * regular content type.
201  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
202  * 
203  **/
204 #define G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE "standard::fast-content-type" /* string */
205
206 /**
207  * G_FILE_ATTRIBUTE_STANDARD_SIZE:
208  * 
209  * A key in the "standard" namespace for getting the file's size (in bytes).
210  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
211  **/
212 #define G_FILE_ATTRIBUTE_STANDARD_SIZE "standard::size"                     /* uint64 */
213
214 /**
215  * G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET:
216  * 
217  * A key in the "standard" namespace for getting the symlink target, if the file
218  * is a symlink. Corresponding #GFileAttributeType is 
219  * %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
220  **/
221 #define G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET "standard::symlink-target" /* byte string */
222
223 /**
224  * G_FILE_ATTRIBUTE_STANDARD_TARGET_URI:
225  * 
226  * A key in the "standard" namespace for getting the target URI for the file, in
227  * the case of %G_FILE_TYPE_SHORTCUT or %G_FILE_TYPE_MOUNTABLE files.
228  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
229  **/
230 #define G_FILE_ATTRIBUTE_STANDARD_TARGET_URI "standard::target-uri"         /* string */
231
232 /**
233  * G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER:
234  * 
235  * A key in the "standard" namespace for setting the sort order of a file. 
236  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_INT32.
237  * An example use would be in file managers, which would use this key 
238  * to set the order files are displayed. Files with smaller sort order
239  * should be sorted first, and files without sort order as if sort order
240  * was zero.
241  **/
242 #define G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER "standard::sort-order"         /* int32  */
243
244 /* Entity tags, used to avoid missing updates on save */
245
246 /**
247  * G_FILE_ATTRIBUTE_ETAG_VALUE:
248  * 
249  * A key in the "etag" namespace for getting the value of the file's
250  * entity tag. Corresponding #GFileAttributeType is 
251  * %G_FILE_ATTRIBUTE_TYPE_STRING.
252  **/
253 #define G_FILE_ATTRIBUTE_ETAG_VALUE "etag::value"                 /* string */
254
255 /* File identifier, for e.g. avoiding loops when doing recursive 
256  * directory scanning 
257  */
258
259 /**
260  * G_FILE_ATTRIBUTE_ID_FILE:
261  * 
262  * A key in the "id" namespace for getting a file identifier.
263  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
264  * An example use would be during listing files, to avoid recursive
265  * directory scanning.
266  **/
267 #define G_FILE_ATTRIBUTE_ID_FILE "id::file"                     /* string */
268
269 /**
270  * G_FILE_ATTRIBUTE_ID_FILESYSTEM:
271  * 
272  * A key in the "id" namespace for getting the file system identifier.
273  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
274  * An example use would be during drag and drop to see if the source
275  * and target are on the same filesystem (default to move) or not (default
276  * to copy).
277  **/
278 #define G_FILE_ATTRIBUTE_ID_FILESYSTEM "id::filesystem"         /* string */
279
280 /* Calculated Access Rights for current user */
281
282 /**
283  * G_FILE_ATTRIBUTE_ACCESS_CAN_READ:
284  * 
285  * A key in the "access" namespace for getting read privileges. 
286  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
287  * This attribute will be %TRUE if the user is able to read the file.
288  **/
289 #define G_FILE_ATTRIBUTE_ACCESS_CAN_READ "access::can-read"       /* boolean */
290
291 /**
292  * G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE:
293  * 
294  * A key in the "access" namespace for getting write privileges.
295  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
296  * This attribute will be %TRUE if the user is able to write to the file.
297  **/
298 #define G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE "access::can-write"     /* boolean */
299
300 /**
301  * G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE:
302  * 
303  * A key in the "access" namespace for getting execution privileges.
304  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
305  * This attribute will be %TRUE if the user is able to execute the file.
306  **/
307 #define G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE "access::can-execute" /* boolean */
308
309 /**
310  * G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE:
311  * 
312  * A key in the "access" namespace for checking deletion privileges.
313  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
314  * This attribute will be %TRUE if the user is able to delete the file.
315  **/
316 #define G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE "access::can-delete"   /* boolean */
317
318 /**
319  * G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH:
320  * 
321  * A key in the "access" namespace for checking trashing privileges.
322  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
323  * This attribute will be %TRUE if the user is able to move the file to 
324  * the trash.
325  **/
326 #define G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH "access::can-trash"     /* boolean */
327
328 /**
329  * G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME:
330  * 
331  * A key in the "access" namespace for checking renaming privileges.
332  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
333  * This attribute will be %TRUE if the user is able to rename the file.
334  **/
335 #define G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME "access::can-rename"   /* boolean */ 
336
337 /* TODO: Should we have special version for directories? can_enumerate, etc */
338
339 /* Mountable attributes */
340
341 /**
342  * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT:
343  * 
344  * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) is mountable.
345  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
346  **/
347 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT "mountable::can-mount"     /* boolean */
348
349 /**
350  * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT:
351  * 
352  * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE)  is unmountable.
353  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
354  **/
355 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT "mountable::can-unmount" /* boolean */
356
357 /**
358  * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT:
359  * 
360  * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be ejected.
361  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
362  **/
363 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT "mountable::can-eject"     /* boolean */
364
365 /**
366  * G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE:
367  * 
368  * A key in the "mountable" namespace for getting the unix device.
369  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
370  **/
371 #define G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE "mountable::unix-device" /* uint32 */
372
373 /**
374  * G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI:
375  * 
376  * A key in the "mountable" namespace for getting the HAL UDI for the mountable
377  * file. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
378  **/
379 #define G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI "mountable::hal-udi"         /* string */
380
381 /* Time attributes */
382
383 /**
384  * G_FILE_ATTRIBUTE_TIME_MODIFIED:
385  * 
386  * A key in the "time" namespace for getting the time the file was last
387  * modified. Corresponding #GFileAttributeType is 
388  * %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the 
389  * file was modified.
390  **/
391 #define G_FILE_ATTRIBUTE_TIME_MODIFIED "time::modified"           /* uint64 */
392
393 /**
394  * G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC:
395  * 
396  * A key in the "time" namespace for getting the milliseconds of the time
397  * the file was last modified. This should be used in conjunction with 
398  * #G_FILE_ATTRIBUTE_TIME_MODIFIED. Corresponding #GFileAttributeType is 
399  * %G_FILE_ATTRIBUTE_TYPE_UINT32.
400  **/
401 #define G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC "time::modified-usec" /* uint32 */
402
403 /**
404  * G_FILE_ATTRIBUTE_TIME_ACCESS:
405  * 
406  * A key in the "time" namespace for getting the time the file was last
407  * accessed. Corresponding #GFileAttributeType is 
408  * %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the 
409  * file was last accessed.
410  **/
411 #define G_FILE_ATTRIBUTE_TIME_ACCESS "time::access"               /* uint64 */
412
413 /**
414  * G_FILE_ATTRIBUTE_TIME_ACCESS_USEC:
415  * 
416  * A key in the "time" namespace for getting the milliseconds of the time
417  * the file was last accessed. This should be used in conjunction with
418  * #G_FILE_ATTRIBUTE_TIME_ACCESS. Corresponding #GFileAttributeType is 
419  * %G_FILE_ATTRIBUTE_TYPE_UINT32.
420  **/
421 #define G_FILE_ATTRIBUTE_TIME_ACCESS_USEC "time::access-usec"     /* uint32 */
422
423 /**
424  * G_FILE_ATTRIBUTE_TIME_CHANGED:
425  * 
426  * A key in the "time" namespace for getting the time the file was last
427  * changed. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64, 
428  * and contains the UNIX time since the file was last changed.
429  *
430  * This corresponds to the traditional UNIX ctime.
431  **/
432 #define G_FILE_ATTRIBUTE_TIME_CHANGED "time::changed"             /* uint64 */
433
434 /**
435  * G_FILE_ATTRIBUTE_TIME_CHANGED_USEC:
436  * 
437  * A key in the "time" namespace for getting the milliseconds of the time
438  * the file was last changed. This should be used in conjunction with
439  * #G_FILE_ATTRIBUTE_TIME_CHANGED. Corresponding #GFileAttributeType is 
440  * %G_FILE_ATTRIBUTE_TYPE_UINT32. 
441  **/
442 #define G_FILE_ATTRIBUTE_TIME_CHANGED_USEC "time::changed-usec"   /* uint32 */
443
444 /**
445  * G_FILE_ATTRIBUTE_TIME_CREATED:
446  * 
447  * A key in the "time" namespace for getting the time the file was created.
448  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64, 
449  * and contains the UNIX time since the file was created.
450  *
451  * This corresponds to the NTFS ctime.
452  **/
453 #define G_FILE_ATTRIBUTE_TIME_CREATED "time::created"             /* uint64 */
454
455 /**
456  * G_FILE_ATTRIBUTE_TIME_CREATED_USEC:
457  * 
458  * A key in the "time" namespace for getting the milliseconds of the time
459  * the file was created. This should be used in conjunction with
460  * #G_FILE_ATTRIBUTE_TIME_CREATED. Corresponding #GFileAttributeType is 
461  * %G_FILE_ATTRIBUTE_TYPE_UINT32. 
462  **/
463 #define G_FILE_ATTRIBUTE_TIME_CREATED_USEC "time::created-usec"   /* uint32 */
464
465 /* Unix specific attributes */
466
467 /**
468  * G_FILE_ATTRIBUTE_UNIX_DEVICE:
469  * 
470  * A key in the "unix" namespace for getting the device id of the device the 
471  * file is located on (see stat() documentation). This attribute is only 
472  * available for UNIX file systems. Corresponding #GFileAttributeType is 
473  * %G_FILE_ATTRIBUTE_TYPE_UINT32. 
474  **/
475 #define G_FILE_ATTRIBUTE_UNIX_DEVICE "unix::device"               /* uint32 */
476
477 /**
478  * G_FILE_ATTRIBUTE_UNIX_INODE:
479  * 
480  * A key in the "unix" namespace for getting the inode of the file.
481  * This attribute is only available for UNIX file systems. Corresponding 
482  * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
483  **/
484 #define G_FILE_ATTRIBUTE_UNIX_INODE "unix::inode"                 /* uint64 */
485
486 /**
487  * G_FILE_ATTRIBUTE_UNIX_MODE:
488  * 
489  * A key in the "unix" namespace for getting the mode of the file
490  * (e.g. whether the file is a regular file, symlink, etc). See lstat() 
491  * documentation. This attribute is only available for UNIX file systems. 
492  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
493  **/
494 #define G_FILE_ATTRIBUTE_UNIX_MODE "unix::mode"                   /* uint32 */
495
496 /**
497  * G_FILE_ATTRIBUTE_UNIX_NLINK:
498  * 
499  * A key in the "unix" namespace for getting the number of hard links 
500  * for a file. See lstat() documentation. This attribute is only available 
501  * for UNIX file systems. Corresponding #GFileAttributeType is 
502  * %G_FILE_ATTRIBUTE_TYPE_UINT32.
503  **/
504 #define G_FILE_ATTRIBUTE_UNIX_NLINK "unix::nlink"                 /* uint32 */
505
506 /**
507  * G_FILE_ATTRIBUTE_UNIX_UID:
508  * 
509  * A key in the "unix" namespace for getting the user ID for the file. 
510  * This attribute is only available for UNIX file systems. 
511  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
512  **/
513 #define G_FILE_ATTRIBUTE_UNIX_UID "unix::uid"                     /* uint32 */
514
515 /**
516  * G_FILE_ATTRIBUTE_UNIX_GID:
517  * 
518  * A key in the "unix" namespace for getting the group ID for the file.
519  * This attribute is only available for UNIX file systems. 
520  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
521  **/
522 #define G_FILE_ATTRIBUTE_UNIX_GID "unix::gid"                     /* uint32 */
523
524 /**
525  * G_FILE_ATTRIBUTE_UNIX_RDEV:
526  * 
527  * A key in the "unix" namespace for getting the device ID for the file 
528  * (if it is a special file). See lstat() documentation. This attribute 
529  * is only available for UNIX file systems. Corresponding #GFileAttributeType 
530  * is %G_FILE_ATTRIBUTE_TYPE_UINT32.
531  **/
532 #define G_FILE_ATTRIBUTE_UNIX_RDEV "unix::rdev"                   /* uint32 */
533
534 /**
535  * G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE:
536  * 
537  * A key in the "unix" namespace for getting the block size for the file 
538  * system. This attribute is only available for UNIX file systems. 
539  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
540  **/
541 #define G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE "unix::block-size"       /* uint32 */
542
543 /**
544  * G_FILE_ATTRIBUTE_UNIX_BLOCKS:
545  * 
546  * A key in the "unix" namespace for getting the number of blocks allocated 
547  * for the file. This attribute is only available for UNIX file systems. 
548  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
549  **/
550 #define G_FILE_ATTRIBUTE_UNIX_BLOCKS "unix::blocks"               /* uint64 */
551
552 /**
553  * G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT:
554  * 
555  * A key in the "unix" namespace for checking if the file represents a 
556  * UNIX mount point. This attribute is %TRUE if the file is a UNIX mount 
557  * point. This attribute is only available for UNIX file systems. 
558  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
559  **/
560 #define G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT "unix::is-mountpoint" /* boolean */
561
562 /* DOS specific attributes */
563
564 /**
565  * G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE:
566  * 
567  * A key in the "dos" namespace for checking if the file's archive flag 
568  * is set. This attribute is %TRUE if the archive flag is set. This attribute 
569  * is only available for DOS file systems. Corresponding #GFileAttributeType 
570  * is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
571  **/
572 #define G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE "dos::is-archive"         /* boolean */
573
574 /**
575  * G_FILE_ATTRIBUTE_DOS_IS_SYSTEM:
576  * 
577  * A key in the "dos" namespace for checking if the file's backup flag 
578  * is set. This attribute is %TRUE if the backup flag is set. This attribute 
579  * is only available for DOS file systems. Corresponding #GFileAttributeType 
580  * is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
581  **/
582 #define G_FILE_ATTRIBUTE_DOS_IS_SYSTEM "dos::is-system"           /* boolean */
583
584 /* Owner attributes */
585
586 /**
587  * G_FILE_ATTRIBUTE_OWNER_USER:
588  * 
589  * A key in the "owner" namespace for getting the user name of the 
590  * file's owner. Corresponding #GFileAttributeType is 
591  * %G_FILE_ATTRIBUTE_TYPE_STRING.
592  **/
593 #define G_FILE_ATTRIBUTE_OWNER_USER "owner::user"                 /* string */
594
595 /**
596  * G_FILE_ATTRIBUTE_OWNER_USER_REAL:
597  * 
598  * A key in the "owner" namespace for getting the real name of the 
599  * user that owns the file. Corresponding #GFileAttributeType is 
600  * %G_FILE_ATTRIBUTE_TYPE_STRING.
601  **/
602 #define G_FILE_ATTRIBUTE_OWNER_USER_REAL "owner::user-real"       /* string */
603
604 /**
605  * G_FILE_ATTRIBUTE_OWNER_GROUP:
606  * 
607  * A key in the "owner" namespace for getting the file owner's group.
608  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
609  **/
610 #define G_FILE_ATTRIBUTE_OWNER_GROUP "owner::group"               /* string */
611
612 /* Thumbnails */
613
614 /**
615  * G_FILE_ATTRIBUTE_THUMBNAIL_PATH:
616  * 
617  * A key in the "thumbnail" namespace for getting the path to the thumbnail 
618  * image. Corresponding #GFileAttributeType is 
619  * %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
620  **/
621 #define G_FILE_ATTRIBUTE_THUMBNAIL_PATH "thumbnail::path"         /* bytestring */
622 /**
623  * G_FILE_ATTRIBUTE_THUMBNAILING_FAILED:
624  * 
625  * A key in the "thumbnail" namespace for checking if thumbnailing failed. 
626  * This attribute is %TRUE if thumbnailing failed. Corresponding 
627  * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN. 
628  **/
629 #define G_FILE_ATTRIBUTE_THUMBNAILING_FAILED "thumbnail::failed"         /* boolean */
630
631 /* File system info (for g_file_get_filesystem_info) */
632
633 /**
634  * G_FILE_ATTRIBUTE_FILESYSTEM_SIZE:
635  * 
636  * A key in the "filesystem" namespace for getting the total size (in bytes) of the file system, 
637  * used in g_file_query_filesystem_info(). Corresponding #GFileAttributeType 
638  * is %G_FILE_ATTRIBUTE_TYPE_UINT64.
639  **/
640 #define G_FILE_ATTRIBUTE_FILESYSTEM_SIZE "filesystem::size"                       /* uint64 */
641
642 /**
643  * G_FILE_ATTRIBUTE_FILESYSTEM_FREE:
644  * 
645  * A key in the "filesystem" namespace for getting the number of bytes of free space left on the 
646  * file system. Corresponding #GFileAttributeType is 
647  * %G_FILE_ATTRIBUTE_TYPE_UINT64.
648  **/
649 #define G_FILE_ATTRIBUTE_FILESYSTEM_FREE "filesystem::free"                       /* uint64 */
650
651 /**
652  * G_FILE_ATTRIBUTE_FILESYSTEM_TYPE:
653  * 
654  * A key in the "filesystem" namespace for getting the file system's type.
655  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
656  **/
657 #define G_FILE_ATTRIBUTE_FILESYSTEM_TYPE "filesystem::type"                       /* string */
658
659 /**
660  * G_FILE_ATTRIBUTE_FILESYSTEM_READONLY:
661  * * A key in the "filesystem" namespace for checking if the file system 
662  * is read only. Is set to %TRUE if the file system is read only. 
663  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
664  **/
665 #define G_FILE_ATTRIBUTE_FILESYSTEM_READONLY "filesystem::readonly"               /* boolean */
666
667 /**
668  * G_FILE_ATTRIBUTE_GVFS_BACKEND:
669  * 
670  * A key in the "gvfs" namespace that gets the name of the current
671  * GVFS backend in use. Corresponding #GFileAttributeType is 
672  * %G_FILE_ATTRIBUTE_TYPE_STRING.
673  **/
674 #define G_FILE_ATTRIBUTE_GVFS_BACKEND "gvfs::backend"             /* string */
675
676 /**
677  * G_FILE_ATTRIBUTE_SELINUX_CONTEXT:
678  * 
679  * A key in the "selinux" namespace for getting the file's SELinux
680  * context. Corresponding #GFileAttributeType is 
681  * %G_FILE_ATTRIBUTE_TYPE_STRING.
682  **/
683 #define G_FILE_ATTRIBUTE_SELINUX_CONTEXT "selinux::context"       /* string */
684
685 GType g_file_info_get_type (void) G_GNUC_CONST;
686
687 GFileInfo *        g_file_info_new                       (void);
688 GFileInfo *        g_file_info_dup                       (GFileInfo  *other);
689 void               g_file_info_copy_into                 (GFileInfo  *src_info,
690                                                           GFileInfo  *dest_info);
691 gboolean           g_file_info_has_attribute             (GFileInfo  *info,
692                                                           const char *attribute);
693 char **            g_file_info_list_attributes           (GFileInfo  *info,
694                                                           const char *name_space);
695 gboolean           g_file_info_get_attribute_data        (GFileInfo  *info,
696                                                           const char *attribute,
697                                                           GFileAttributeType *type,
698                                                           gpointer   *value_pp,
699                                                           GFileAttributeStatus *status);
700 GFileAttributeType g_file_info_get_attribute_type        (GFileInfo  *info,
701                                                           const char *attribute);
702 void               g_file_info_remove_attribute          (GFileInfo  *info,
703                                                           const char *attribute);
704 GFileAttributeStatus g_file_info_get_attribute_status    (GFileInfo  *info,
705                                                           const char *attribute);
706 char *             g_file_info_get_attribute_as_string   (GFileInfo  *info,
707                                                           const char *attribute);
708 const char *       g_file_info_get_attribute_string      (GFileInfo  *info,
709                                                           const char *attribute);
710 const char *       g_file_info_get_attribute_byte_string (GFileInfo  *info,
711                                                           const char *attribute);
712 gboolean           g_file_info_get_attribute_boolean     (GFileInfo  *info,
713                                                           const char *attribute);
714 guint32            g_file_info_get_attribute_uint32      (GFileInfo  *info,
715                                                           const char *attribute);
716 gint32             g_file_info_get_attribute_int32       (GFileInfo  *info,
717                                                           const char *attribute);
718 guint64            g_file_info_get_attribute_uint64      (GFileInfo  *info,
719                                                           const char *attribute);
720 gint64             g_file_info_get_attribute_int64       (GFileInfo  *info,
721                                                           const char *attribute);
722 GObject *          g_file_info_get_attribute_object      (GFileInfo  *info,
723                                                           const char *attribute);
724
725 void               g_file_info_set_attribute             (GFileInfo  *info,
726                                                           const char *attribute,
727                                                           GFileAttributeType type,
728                                                           gpointer    value_p);
729 void               g_file_info_set_attribute_string      (GFileInfo  *info,
730                                                           const char *attribute,
731                                                           const char *attr_value);
732 void               g_file_info_set_attribute_byte_string (GFileInfo  *info,
733                                                           const char *attribute,
734                                                           const char *attr_value);
735 void               g_file_info_set_attribute_boolean     (GFileInfo  *info,
736                                                           const char *attribute,
737                                                           gboolean    attr_value);
738 void               g_file_info_set_attribute_uint32      (GFileInfo  *info,
739                                                           const char *attribute,
740                                                           guint32     attr_value);
741 void               g_file_info_set_attribute_int32       (GFileInfo  *info,
742                                                           const char *attribute,
743                                                           gint32      attr_value);
744 void               g_file_info_set_attribute_uint64      (GFileInfo  *info,
745                                                           const char *attribute,
746                                                           guint64     attr_value);
747 void               g_file_info_set_attribute_int64       (GFileInfo  *info,
748                                                           const char *attribute,
749                                                           gint64      attr_value);
750 void               g_file_info_set_attribute_object      (GFileInfo  *info,
751                                                           const char *attribute,
752                                                           GObject    *attr_value);
753
754 void               g_file_info_clear_status              (GFileInfo  *info);
755
756 /* Helper getters: */
757 GFileType         g_file_info_get_file_type          (GFileInfo         *info);
758 gboolean          g_file_info_get_is_hidden          (GFileInfo         *info);
759 gboolean          g_file_info_get_is_backup          (GFileInfo         *info);
760 gboolean          g_file_info_get_is_symlink         (GFileInfo         *info);
761 const char *      g_file_info_get_name               (GFileInfo         *info);
762 const char *      g_file_info_get_display_name       (GFileInfo         *info);
763 const char *      g_file_info_get_edit_name          (GFileInfo         *info);
764 GIcon *           g_file_info_get_icon               (GFileInfo         *info);
765 const char *      g_file_info_get_content_type       (GFileInfo         *info);
766 goffset           g_file_info_get_size               (GFileInfo         *info);
767 void              g_file_info_get_modification_time  (GFileInfo         *info,
768                                                       GTimeVal          *result);
769 const char *      g_file_info_get_symlink_target     (GFileInfo         *info);
770 const char *      g_file_info_get_etag               (GFileInfo         *info);
771 gint32            g_file_info_get_sort_order         (GFileInfo         *info);
772
773 void              g_file_info_set_attribute_mask     (GFileInfo         *info,
774                                                       GFileAttributeMatcher *mask);
775 void              g_file_info_unset_attribute_mask   (GFileInfo         *info);
776
777 /* Helper setters: */
778 void              g_file_info_set_file_type          (GFileInfo         *info,
779                                                       GFileType          type);
780 void              g_file_info_set_is_hidden          (GFileInfo         *info,
781                                                       gboolean           is_hidden);
782 void              g_file_info_set_is_symlink         (GFileInfo         *info,
783                                                       gboolean           is_symlink);
784 void              g_file_info_set_name               (GFileInfo         *info,
785                                                       const char        *name);
786 void              g_file_info_set_display_name       (GFileInfo         *info,
787                                                       const char        *display_name);
788 void              g_file_info_set_edit_name          (GFileInfo         *info,
789                                                       const char        *edit_name);
790 void              g_file_info_set_icon               (GFileInfo         *info,
791                                                       GIcon             *icon);
792 void              g_file_info_set_content_type       (GFileInfo         *info,
793                                                       const char        *content_type);
794 void              g_file_info_set_size               (GFileInfo         *info,
795                                                       goffset            size);
796 void              g_file_info_set_modification_time  (GFileInfo         *info,
797                                                       GTimeVal          *mtime);
798 void              g_file_info_set_symlink_target     (GFileInfo         *info,
799                                                       const char        *symlink_target);
800 void              g_file_info_set_sort_order         (GFileInfo         *info,
801                                                       gint32             sort_order);
802
803 GFileAttributeMatcher *g_file_attribute_matcher_new            (const char            *attributes);
804 GFileAttributeMatcher *g_file_attribute_matcher_ref            (GFileAttributeMatcher *matcher);
805 void                   g_file_attribute_matcher_unref          (GFileAttributeMatcher *matcher);
806 gboolean               g_file_attribute_matcher_matches        (GFileAttributeMatcher *matcher,
807                                                                 const char            *attribute);
808 gboolean               g_file_attribute_matcher_matches_only   (GFileAttributeMatcher *matcher,
809                                                                 const char            *attribute);
810 gboolean               g_file_attribute_matcher_enumerate_namespace (GFileAttributeMatcher *matcher,
811                                                                      const char            *ns);
812 const char *           g_file_attribute_matcher_enumerate_next (GFileAttributeMatcher *matcher);
813
814 G_END_DECLS
815
816
817 #endif /* __G_FILE_INFO_H__ */