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