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