Initial commit
[platform/upstream/glib2.0.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_STANDARD_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  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
202  *
203  * Since: 2.20
204  **/
205 #define G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE "standard::allocated-size" /* uint64 */
206
207 /**
208  * G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET:
209  *
210  * A key in the "standard" namespace for getting the symlink target, if the file
211  * is a symlink. Corresponding #GFileAttributeType is
212  * %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
213  **/
214 #define G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET "standard::symlink-target" /* byte string */
215
216 /**
217  * G_FILE_ATTRIBUTE_STANDARD_TARGET_URI:
218  *
219  * A key in the "standard" namespace for getting the target URI for the file, in
220  * the case of %G_FILE_TYPE_SHORTCUT or %G_FILE_TYPE_MOUNTABLE files.
221  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
222  **/
223 #define G_FILE_ATTRIBUTE_STANDARD_TARGET_URI "standard::target-uri"         /* string */
224
225 /**
226  * G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER:
227  *
228  * A key in the "standard" namespace for setting the sort order of a file.
229  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_INT32.
230  * An example use would be in file managers, which would use this key
231  * to set the order files are displayed. Files with smaller sort order
232  * should be sorted first, and files without sort order as if sort order
233  * was zero.
234  **/
235 #define G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER "standard::sort-order"         /* int32  */
236
237 /* Entity tags, used to avoid missing updates on save */
238
239 /**
240  * G_FILE_ATTRIBUTE_ETAG_VALUE:
241  *
242  * A key in the "etag" namespace for getting the value of the file's
243  * entity tag. Corresponding #GFileAttributeType is
244  * %G_FILE_ATTRIBUTE_TYPE_STRING.
245  **/
246 #define G_FILE_ATTRIBUTE_ETAG_VALUE "etag::value"                 /* string */
247
248 /* File identifier, for e.g. avoiding loops when doing recursive
249  * directory scanning
250  */
251
252 /**
253  * G_FILE_ATTRIBUTE_ID_FILE:
254  *
255  * A key in the "id" namespace for getting a file identifier.
256  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
257  * An example use would be during listing files, to avoid recursive
258  * directory scanning.
259  **/
260 #define G_FILE_ATTRIBUTE_ID_FILE "id::file"                     /* string */
261
262 /**
263  * G_FILE_ATTRIBUTE_ID_FILESYSTEM:
264  *
265  * A key in the "id" namespace for getting the file system identifier.
266  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
267  * An example use would be during drag and drop to see if the source
268  * and target are on the same filesystem (default to move) or not (default
269  * to copy).
270  **/
271 #define G_FILE_ATTRIBUTE_ID_FILESYSTEM "id::filesystem"         /* string */
272
273 /* Calculated Access Rights for current user */
274
275 /**
276  * G_FILE_ATTRIBUTE_ACCESS_CAN_READ:
277  *
278  * A key in the "access" namespace for getting read privileges.
279  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
280  * This attribute will be %TRUE if the user is able to read the file.
281  **/
282 #define G_FILE_ATTRIBUTE_ACCESS_CAN_READ "access::can-read"       /* boolean */
283
284 /**
285  * G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE:
286  *
287  * A key in the "access" namespace for getting write privileges.
288  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
289  * This attribute will be %TRUE if the user is able to write to the file.
290  **/
291 #define G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE "access::can-write"     /* boolean */
292
293 /**
294  * G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE:
295  *
296  * A key in the "access" namespace for getting execution privileges.
297  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
298  * This attribute will be %TRUE if the user is able to execute the file.
299  **/
300 #define G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE "access::can-execute" /* boolean */
301
302 /**
303  * G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE:
304  *
305  * A key in the "access" namespace for checking deletion privileges.
306  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
307  * This attribute will be %TRUE if the user is able to delete the file.
308  **/
309 #define G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE "access::can-delete"   /* boolean */
310
311 /**
312  * G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH:
313  *
314  * A key in the "access" namespace for checking trashing privileges.
315  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
316  * This attribute will be %TRUE if the user is able to move the file to
317  * the trash.
318  **/
319 #define G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH "access::can-trash"     /* boolean */
320
321 /**
322  * G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME:
323  *
324  * A key in the "access" namespace for checking renaming privileges.
325  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
326  * This attribute will be %TRUE if the user is able to rename the file.
327  **/
328 #define G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME "access::can-rename"   /* boolean */
329
330 /* TODO: Should we have special version for directories? can_enumerate, etc */
331
332 /* Mountable attributes */
333
334 /**
335  * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT:
336  *
337  * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) is mountable.
338  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
339  **/
340 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT "mountable::can-mount"     /* boolean */
341
342 /**
343  * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT:
344  *
345  * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE)  is unmountable.
346  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
347  **/
348 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT "mountable::can-unmount" /* boolean */
349
350 /**
351  * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT:
352  *
353  * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be ejected.
354  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
355  **/
356 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT "mountable::can-eject"     /* boolean */
357
358 /**
359  * G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE:
360  *
361  * A key in the "mountable" namespace for getting the unix device.
362  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
363  **/
364 #define G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE "mountable::unix-device" /* uint32 */
365
366 /**
367  * G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE:
368  *
369  * A key in the "mountable" namespace for getting the unix device file.
370  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
371  *
372  * Since: 2.22
373  **/
374 #define G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE "mountable::unix-device-file" /* string */
375
376 /**
377  * G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI:
378  *
379  * A key in the "mountable" namespace for getting the HAL UDI for the mountable
380  * file. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
381  **/
382 #define G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI "mountable::hal-udi"         /* string */
383
384 /**
385  * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START:
386  *
387  * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be started.
388  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
389  *
390  * Since: 2.22
391  */
392 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START "mountable::can-start"     /* boolean */
393
394 /**
395  * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START_DEGRADED:
396  *
397  * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be started
398  * degraded.
399  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
400  *
401  * Since: 2.22
402  */
403 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START_DEGRADED "mountable::can-start-degraded"     /* boolean */
404
405 /**
406  * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_STOP:
407  *
408  * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be stopped.
409  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
410  *
411  * Since: 2.22
412  */
413 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_STOP "mountable::can-stop"      /* boolean */
414
415 /**
416  * G_FILE_ATTRIBUTE_MOUNTABLE_START_STOP_TYPE:
417  *
418  * A key in the "mountable" namespace for getting the #GDriveStartStopType.
419  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
420  *
421  * Since: 2.22
422  */
423 #define G_FILE_ATTRIBUTE_MOUNTABLE_START_STOP_TYPE "mountable::start-stop-type" /* uint32 (GDriveStartStopType) */
424
425 /**
426  * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_POLL:
427  *
428  * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be polled.
429  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
430  *
431  * Since: 2.22
432  */
433 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_POLL "mountable::can-poll"      /* boolean */
434
435 /**
436  * G_FILE_ATTRIBUTE_MOUNTABLE_IS_MEDIA_CHECK_AUTOMATIC:
437  *
438  * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE)
439  * is automatically polled for media.
440  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
441  *
442  * Since: 2.22
443  */
444 #define G_FILE_ATTRIBUTE_MOUNTABLE_IS_MEDIA_CHECK_AUTOMATIC "mountable::is-media-check-automatic"      /* boolean */
445
446 /* Time attributes */
447
448 /**
449  * G_FILE_ATTRIBUTE_TIME_MODIFIED:
450  *
451  * A key in the "time" namespace for getting the time the file was last
452  * modified. Corresponding #GFileAttributeType is
453  * %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the
454  * file was modified.
455  **/
456 #define G_FILE_ATTRIBUTE_TIME_MODIFIED "time::modified"           /* uint64 */
457
458 /**
459  * G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC:
460  *
461  * A key in the "time" namespace for getting the miliseconds of the time
462  * the file was last modified. This should be used in conjunction with
463  * #G_FILE_ATTRIBUTE_TIME_MODIFIED. Corresponding #GFileAttributeType is
464  * %G_FILE_ATTRIBUTE_TYPE_UINT32.
465  **/
466 #define G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC "time::modified-usec" /* uint32 */
467
468 /**
469  * G_FILE_ATTRIBUTE_TIME_ACCESS:
470  *
471  * A key in the "time" namespace for getting the time the file was last
472  * accessed. Corresponding #GFileAttributeType is
473  * %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the
474  * file was last accessed.
475  **/
476 #define G_FILE_ATTRIBUTE_TIME_ACCESS "time::access"               /* uint64 */
477
478 /**
479  * G_FILE_ATTRIBUTE_TIME_ACCESS_USEC:
480  *
481  * A key in the "time" namespace for getting the microseconds of the time
482  * the file was last accessed. This should be used in conjunction with
483  * #G_FILE_ATTRIBUTE_TIME_ACCESS. Corresponding #GFileAttributeType is
484  * %G_FILE_ATTRIBUTE_TYPE_UINT32.
485  **/
486 #define G_FILE_ATTRIBUTE_TIME_ACCESS_USEC "time::access-usec"     /* uint32 */
487
488 /**
489  * G_FILE_ATTRIBUTE_TIME_CHANGED:
490  *
491  * A key in the "time" namespace for getting the time the file was last
492  * changed. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64,
493  * and contains the UNIX time since the file was last changed.
494  *
495  * This corresponds to the traditional UNIX ctime.
496  **/
497 #define G_FILE_ATTRIBUTE_TIME_CHANGED "time::changed"             /* uint64 */
498
499 /**
500  * G_FILE_ATTRIBUTE_TIME_CHANGED_USEC:
501  *
502  * A key in the "time" namespace for getting the microseconds of the time
503  * the file was last changed. This should be used in conjunction with
504  * #G_FILE_ATTRIBUTE_TIME_CHANGED. Corresponding #GFileAttributeType is
505  * %G_FILE_ATTRIBUTE_TYPE_UINT32.
506  **/
507 #define G_FILE_ATTRIBUTE_TIME_CHANGED_USEC "time::changed-usec"   /* uint32 */
508
509 /**
510  * G_FILE_ATTRIBUTE_TIME_CREATED:
511  *
512  * A key in the "time" namespace for getting the time the file was created.
513  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64,
514  * and contains the UNIX time since the file was created.
515  *
516  * This corresponds to the NTFS ctime.
517  **/
518 #define G_FILE_ATTRIBUTE_TIME_CREATED "time::created"             /* uint64 */
519
520 /**
521  * G_FILE_ATTRIBUTE_TIME_CREATED_USEC:
522  *
523  * A key in the "time" namespace for getting the microseconds of the time
524  * the file was created. This should be used in conjunction with
525  * #G_FILE_ATTRIBUTE_TIME_CREATED. Corresponding #GFileAttributeType is
526  * %G_FILE_ATTRIBUTE_TYPE_UINT32.
527  **/
528 #define G_FILE_ATTRIBUTE_TIME_CREATED_USEC "time::created-usec"   /* uint32 */
529
530 /* Unix specific attributes */
531
532 /**
533  * G_FILE_ATTRIBUTE_UNIX_DEVICE:
534  *
535  * A key in the "unix" namespace for getting the device id of the device the
536  * file is located on (see stat() documentation). This attribute is only
537  * available for UNIX file systems. Corresponding #GFileAttributeType is
538  * %G_FILE_ATTRIBUTE_TYPE_UINT32.
539  **/
540 #define G_FILE_ATTRIBUTE_UNIX_DEVICE "unix::device"               /* uint32 */
541
542 /**
543  * G_FILE_ATTRIBUTE_UNIX_INODE:
544  *
545  * A key in the "unix" namespace for getting the inode of the file.
546  * This attribute is only available for UNIX file systems. Corresponding
547  * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
548  **/
549 #define G_FILE_ATTRIBUTE_UNIX_INODE "unix::inode"                 /* uint64 */
550
551 /**
552  * G_FILE_ATTRIBUTE_UNIX_MODE:
553  *
554  * A key in the "unix" namespace for getting the mode of the file
555  * (e.g. whether the file is a regular file, symlink, etc). See lstat()
556  * documentation. This attribute is only available for UNIX file systems.
557  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
558  **/
559 #define G_FILE_ATTRIBUTE_UNIX_MODE "unix::mode"                   /* uint32 */
560
561 /**
562  * G_FILE_ATTRIBUTE_UNIX_NLINK:
563  *
564  * A key in the "unix" namespace for getting the number of hard links
565  * for a file. See lstat() documentation. This attribute is only available
566  * for UNIX file systems. Corresponding #GFileAttributeType is
567  * %G_FILE_ATTRIBUTE_TYPE_UINT32.
568  **/
569 #define G_FILE_ATTRIBUTE_UNIX_NLINK "unix::nlink"                 /* uint32 */
570
571 /**
572  * G_FILE_ATTRIBUTE_UNIX_UID:
573  *
574  * A key in the "unix" namespace for getting the user ID for the file.
575  * This attribute is only available for UNIX file systems.
576  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
577  **/
578 #define G_FILE_ATTRIBUTE_UNIX_UID "unix::uid"                     /* uint32 */
579
580 /**
581  * G_FILE_ATTRIBUTE_UNIX_GID:
582  *
583  * A key in the "unix" namespace for getting the group ID for the file.
584  * This attribute is only available for UNIX file systems.
585  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
586  **/
587 #define G_FILE_ATTRIBUTE_UNIX_GID "unix::gid"                     /* uint32 */
588
589 /**
590  * G_FILE_ATTRIBUTE_UNIX_RDEV:
591  *
592  * A key in the "unix" namespace for getting the device ID for the file
593  * (if it is a special file). See lstat() documentation. This attribute
594  * is only available for UNIX file systems. Corresponding #GFileAttributeType
595  * is %G_FILE_ATTRIBUTE_TYPE_UINT32.
596  **/
597 #define G_FILE_ATTRIBUTE_UNIX_RDEV "unix::rdev"                   /* uint32 */
598
599 /**
600  * G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE:
601  *
602  * A key in the "unix" namespace for getting the block size for the file
603  * system. This attribute is only available for UNIX file systems.
604  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
605  **/
606 #define G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE "unix::block-size"       /* uint32 */
607
608 /**
609  * G_FILE_ATTRIBUTE_UNIX_BLOCKS:
610  *
611  * A key in the "unix" namespace for getting the number of blocks allocated
612  * for the file. This attribute is only available for UNIX file systems.
613  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
614  **/
615 #define G_FILE_ATTRIBUTE_UNIX_BLOCKS "unix::blocks"               /* uint64 */
616
617 /**
618  * G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT:
619  *
620  * A key in the "unix" namespace for checking if the file represents a
621  * UNIX mount point. This attribute is %TRUE if the file is a UNIX mount
622  * point. This attribute is only available for UNIX file systems.
623  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
624  **/
625 #define G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT "unix::is-mountpoint" /* boolean */
626
627 /* DOS specific attributes */
628
629 /**
630  * G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE:
631  *
632  * A key in the "dos" namespace for checking if the file's archive flag
633  * is set. This attribute is %TRUE if the archive flag is set. This attribute
634  * is only available for DOS file systems. Corresponding #GFileAttributeType
635  * is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
636  **/
637 #define G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE "dos::is-archive"         /* boolean */
638
639 /**
640  * G_FILE_ATTRIBUTE_DOS_IS_SYSTEM:
641  *
642  * A key in the "dos" namespace for checking if the file's backup flag
643  * is set. This attribute is %TRUE if the backup flag is set. This attribute
644  * is only available for DOS file systems. Corresponding #GFileAttributeType
645  * is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
646  **/
647 #define G_FILE_ATTRIBUTE_DOS_IS_SYSTEM "dos::is-system"           /* boolean */
648
649 /* Owner attributes */
650
651 /**
652  * G_FILE_ATTRIBUTE_OWNER_USER:
653  *
654  * A key in the "owner" namespace for getting the user name of the
655  * file's owner. Corresponding #GFileAttributeType is
656  * %G_FILE_ATTRIBUTE_TYPE_STRING.
657  **/
658 #define G_FILE_ATTRIBUTE_OWNER_USER "owner::user"                 /* string */
659
660 /**
661  * G_FILE_ATTRIBUTE_OWNER_USER_REAL:
662  *
663  * A key in the "owner" namespace for getting the real name of the
664  * user that owns the file. Corresponding #GFileAttributeType is
665  * %G_FILE_ATTRIBUTE_TYPE_STRING.
666  **/
667 #define G_FILE_ATTRIBUTE_OWNER_USER_REAL "owner::user-real"       /* string */
668
669 /**
670  * G_FILE_ATTRIBUTE_OWNER_GROUP:
671  *
672  * A key in the "owner" namespace for getting the file owner's group.
673  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
674  **/
675 #define G_FILE_ATTRIBUTE_OWNER_GROUP "owner::group"               /* string */
676
677 /* Thumbnails */
678
679 /**
680  * G_FILE_ATTRIBUTE_THUMBNAIL_PATH:
681  *
682  * A key in the "thumbnail" namespace for getting the path to the thumbnail
683  * image. Corresponding #GFileAttributeType is
684  * %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
685  **/
686 #define G_FILE_ATTRIBUTE_THUMBNAIL_PATH "thumbnail::path"         /* bytestring */
687 /**
688  * G_FILE_ATTRIBUTE_THUMBNAILING_FAILED:
689  *
690  * A key in the "thumbnail" namespace for checking if thumbnailing failed.
691  * This attribute is %TRUE if thumbnailing failed. Corresponding
692  * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
693  **/
694 #define G_FILE_ATTRIBUTE_THUMBNAILING_FAILED "thumbnail::failed"         /* boolean */
695
696 /* Preview */
697
698 /**
699  * G_FILE_ATTRIBUTE_PREVIEW_ICON:
700  *
701  * A key in the "preview" namespace for getting a #GIcon that can be
702  * used to get preview of the file. For example, it may be a low
703  * resolution thumbnail without metadata. Corresponding
704  * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_OBJECT.  The value
705  * for this key should contain a #GIcon.
706  *
707  * Since: 2.20
708  **/
709 #define G_FILE_ATTRIBUTE_PREVIEW_ICON "preview::icon"         /* object (GIcon) */
710
711 /* File system info (for g_file_get_filesystem_info) */
712
713 /**
714  * G_FILE_ATTRIBUTE_FILESYSTEM_SIZE:
715  *
716  * A key in the "filesystem" namespace for getting the total size (in bytes) of the file system,
717  * used in g_file_query_filesystem_info(). Corresponding #GFileAttributeType
718  * is %G_FILE_ATTRIBUTE_TYPE_UINT64.
719  **/
720 #define G_FILE_ATTRIBUTE_FILESYSTEM_SIZE "filesystem::size"                       /* uint64 */
721
722 /**
723  * G_FILE_ATTRIBUTE_FILESYSTEM_FREE:
724  *
725  * A key in the "filesystem" namespace for getting the number of bytes of free space left on the
726  * file system. Corresponding #GFileAttributeType is
727  * %G_FILE_ATTRIBUTE_TYPE_UINT64.
728  **/
729 #define G_FILE_ATTRIBUTE_FILESYSTEM_FREE "filesystem::free"                       /* uint64 */
730
731 /**
732  * G_FILE_ATTRIBUTE_FILESYSTEM_TYPE:
733  *
734  * A key in the "filesystem" namespace for getting the file system's type.
735  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
736  **/
737 #define G_FILE_ATTRIBUTE_FILESYSTEM_TYPE "filesystem::type"                       /* string */
738
739 /**
740  * G_FILE_ATTRIBUTE_FILESYSTEM_READONLY:
741  *
742  * A key in the "filesystem" namespace for checking if the file system
743  * is read only. Is set to %TRUE if the file system is read only.
744  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
745  **/
746 #define G_FILE_ATTRIBUTE_FILESYSTEM_READONLY "filesystem::readonly"               /* boolean */
747
748 /**
749  * G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW:
750  *
751  * A key in the "filesystem" namespace for hinting a file manager
752  * application whether it should preview (e.g. thumbnail) files on the
753  * file system. The value for this key contain a
754  * #GFilesystemPreviewType.
755  **/
756 #define G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW "filesystem::use-preview"        /* uint32 (GFilesystemPreviewType) */
757
758 /**
759  * G_FILE_ATTRIBUTE_GVFS_BACKEND:
760  *
761  * A key in the "gvfs" namespace that gets the name of the current
762  * GVFS backend in use. Corresponding #GFileAttributeType is
763  * %G_FILE_ATTRIBUTE_TYPE_STRING.
764  **/
765 #define G_FILE_ATTRIBUTE_GVFS_BACKEND "gvfs::backend"             /* string */
766
767 /**
768  * G_FILE_ATTRIBUTE_SELINUX_CONTEXT:
769  *
770  * A key in the "selinux" namespace for getting the file's SELinux
771  * context. Corresponding #GFileAttributeType is
772  * %G_FILE_ATTRIBUTE_TYPE_STRING. Note that this attribute is only
773  * available if GLib has been built with SELinux support.
774  **/
775 #define G_FILE_ATTRIBUTE_SELINUX_CONTEXT "selinux::context"       /* string */
776
777 /**
778  * G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT:
779  *
780  * A key in the "trash" namespace.  When requested against
781  * "trash:///" returns the number of (toplevel) items in the trash folder.
782  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
783  **/
784 #define G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT "trash::item-count"     /* uint32 */
785
786 /**
787  * G_FILE_ATTRIBUTE_TRASH_ORIG_PATH:
788  *
789  * A key in the "trash" namespace.  When requested against
790  * items in "trash:///", will return the original path to the file before it
791  * was trashed. Corresponding #GFileAttributeType is
792  * %G_FILE_ATTRIBUTE_TYPE_STRING.
793  *
794  * Since: 2.24.
795  **/
796 #define G_FILE_ATTRIBUTE_TRASH_ORIG_PATH "trash::orig-path"     /* string */
797
798 /**
799  * G_FILE_ATTRIBUTE_TRASH_DELETION_DATE:
800  *
801  * A key in the "trash" namespace.  When requested against
802  * items in "trash:///", will return the date and time when the file
803  * was trashed. The format of the returned string is YYYY-MM-DDThh:mm:ss.
804  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
805  *
806  * Since: 2.24.
807  **/
808 #define G_FILE_ATTRIBUTE_TRASH_DELETION_DATE "trash::deletion-date"  /* string */
809
810 GType              g_file_info_get_type                  (void) G_GNUC_CONST;
811
812 GFileInfo *        g_file_info_new                       (void);
813 GFileInfo *        g_file_info_dup                       (GFileInfo  *other);
814 void               g_file_info_copy_into                 (GFileInfo  *src_info,
815                                                           GFileInfo  *dest_info);
816 gboolean           g_file_info_has_attribute             (GFileInfo  *info,
817                                                           const char *attribute);
818 gboolean           g_file_info_has_namespace             (GFileInfo  *info,
819                                                           const char *name_space);
820 char **            g_file_info_list_attributes           (GFileInfo  *info,
821                                                           const char *name_space);
822 gboolean           g_file_info_get_attribute_data        (GFileInfo  *info,
823                                                           const char *attribute,
824                                                           GFileAttributeType *type,
825                                                           gpointer   *value_pp,
826                                                           GFileAttributeStatus *status);
827 GFileAttributeType g_file_info_get_attribute_type        (GFileInfo  *info,
828                                                           const char *attribute);
829 void               g_file_info_remove_attribute          (GFileInfo  *info,
830                                                           const char *attribute);
831 GFileAttributeStatus g_file_info_get_attribute_status    (GFileInfo  *info,
832                                                           const char *attribute);
833 gboolean           g_file_info_set_attribute_status      (GFileInfo  *info,
834                                                           const char *attribute,
835                                                           GFileAttributeStatus status);
836 char *             g_file_info_get_attribute_as_string   (GFileInfo  *info,
837                                                           const char *attribute);
838 const char *       g_file_info_get_attribute_string      (GFileInfo  *info,
839                                                           const char *attribute);
840 const char *       g_file_info_get_attribute_byte_string (GFileInfo  *info,
841                                                           const char *attribute);
842 gboolean           g_file_info_get_attribute_boolean     (GFileInfo  *info,
843                                                           const char *attribute);
844 guint32            g_file_info_get_attribute_uint32      (GFileInfo  *info,
845                                                           const char *attribute);
846 gint32             g_file_info_get_attribute_int32       (GFileInfo  *info,
847                                                           const char *attribute);
848 guint64            g_file_info_get_attribute_uint64      (GFileInfo  *info,
849                                                           const char *attribute);
850 gint64             g_file_info_get_attribute_int64       (GFileInfo  *info,
851                                                           const char *attribute);
852 GObject *          g_file_info_get_attribute_object      (GFileInfo  *info,
853                                                           const char *attribute);
854 char **            g_file_info_get_attribute_stringv     (GFileInfo  *info,
855                                                           const char *attribute);
856
857 void               g_file_info_set_attribute             (GFileInfo  *info,
858                                                           const char *attribute,
859                                                           GFileAttributeType type,
860                                                           gpointer    value_p);
861 void               g_file_info_set_attribute_string      (GFileInfo  *info,
862                                                           const char *attribute,
863                                                           const char *attr_value);
864 void               g_file_info_set_attribute_byte_string (GFileInfo  *info,
865                                                           const char *attribute,
866                                                           const char *attr_value);
867 void               g_file_info_set_attribute_boolean     (GFileInfo  *info,
868                                                           const char *attribute,
869                                                           gboolean    attr_value);
870 void               g_file_info_set_attribute_uint32      (GFileInfo  *info,
871                                                           const char *attribute,
872                                                           guint32     attr_value);
873 void               g_file_info_set_attribute_int32       (GFileInfo  *info,
874                                                           const char *attribute,
875                                                           gint32      attr_value);
876 void               g_file_info_set_attribute_uint64      (GFileInfo  *info,
877                                                           const char *attribute,
878                                                           guint64     attr_value);
879 void               g_file_info_set_attribute_int64       (GFileInfo  *info,
880                                                           const char *attribute,
881                                                           gint64      attr_value);
882 void               g_file_info_set_attribute_object      (GFileInfo  *info,
883                                                           const char *attribute,
884                                                           GObject    *attr_value);
885 void               g_file_info_set_attribute_stringv     (GFileInfo  *info,
886                                                           const char *attribute,
887                                                           char      **attr_value);
888
889 void               g_file_info_clear_status              (GFileInfo  *info);
890
891 /* Helper getters: */
892 GFileType         g_file_info_get_file_type          (GFileInfo         *info);
893 gboolean          g_file_info_get_is_hidden          (GFileInfo         *info);
894 gboolean          g_file_info_get_is_backup          (GFileInfo         *info);
895 gboolean          g_file_info_get_is_symlink         (GFileInfo         *info);
896 const char *      g_file_info_get_name               (GFileInfo         *info);
897 const char *      g_file_info_get_display_name       (GFileInfo         *info);
898 const char *      g_file_info_get_edit_name          (GFileInfo         *info);
899 GIcon *           g_file_info_get_icon               (GFileInfo         *info);
900 const char *      g_file_info_get_content_type       (GFileInfo         *info);
901 goffset           g_file_info_get_size               (GFileInfo         *info);
902 void              g_file_info_get_modification_time  (GFileInfo         *info,
903                                                       GTimeVal          *result);
904 const char *      g_file_info_get_symlink_target     (GFileInfo         *info);
905 const char *      g_file_info_get_etag               (GFileInfo         *info);
906 gint32            g_file_info_get_sort_order         (GFileInfo         *info);
907
908 void              g_file_info_set_attribute_mask     (GFileInfo         *info,
909                                                       GFileAttributeMatcher *mask);
910 void              g_file_info_unset_attribute_mask   (GFileInfo         *info);
911
912 /* Helper setters: */
913 void              g_file_info_set_file_type          (GFileInfo         *info,
914                                                       GFileType          type);
915 void              g_file_info_set_is_hidden          (GFileInfo         *info,
916                                                       gboolean           is_hidden);
917 void              g_file_info_set_is_symlink         (GFileInfo         *info,
918                                                       gboolean           is_symlink);
919 void              g_file_info_set_name               (GFileInfo         *info,
920                                                       const char        *name);
921 void              g_file_info_set_display_name       (GFileInfo         *info,
922                                                       const char        *display_name);
923 void              g_file_info_set_edit_name          (GFileInfo         *info,
924                                                       const char        *edit_name);
925 void              g_file_info_set_icon               (GFileInfo         *info,
926                                                       GIcon             *icon);
927 void              g_file_info_set_content_type       (GFileInfo         *info,
928                                                       const char        *content_type);
929 void              g_file_info_set_size               (GFileInfo         *info,
930                                                       goffset            size);
931 void              g_file_info_set_modification_time  (GFileInfo         *info,
932                                                       GTimeVal          *mtime);
933 void              g_file_info_set_symlink_target     (GFileInfo         *info,
934                                                       const char        *symlink_target);
935 void              g_file_info_set_sort_order         (GFileInfo         *info,
936                                                       gint32             sort_order);
937
938 GFileAttributeMatcher *g_file_attribute_matcher_new            (const char            *attributes);
939 GFileAttributeMatcher *g_file_attribute_matcher_ref            (GFileAttributeMatcher *matcher);
940 void                   g_file_attribute_matcher_unref          (GFileAttributeMatcher *matcher);
941 gboolean               g_file_attribute_matcher_matches        (GFileAttributeMatcher *matcher,
942                                                                 const char            *attribute);
943 gboolean               g_file_attribute_matcher_matches_only   (GFileAttributeMatcher *matcher,
944                                                                 const char            *attribute);
945 gboolean               g_file_attribute_matcher_enumerate_namespace (GFileAttributeMatcher *matcher,
946                                                                      const char            *ns);
947 const char *           g_file_attribute_matcher_enumerate_next (GFileAttributeMatcher *matcher);
948
949 G_END_DECLS
950
951 #endif /* __G_FILE_INFO_H__ */