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