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