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