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