Move g_format_file_size_for_display from gio to glib
[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 #ifndef __G_FILE_INFO_H__
24 #define __G_FILE_INFO_H__
25
26 #include <glib-object.h>
27 #include <glib/gfileutils.h>
28 #include <gio/gfileattribute.h>
29 #include <gio/gicon.h>
30
31 G_BEGIN_DECLS
32
33 #define G_TYPE_FILE_INFO         (g_file_info_get_type ())
34 #define G_FILE_INFO(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_FILE_INFO, GFileInfo))
35 #define G_FILE_INFO_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_FILE_INFO, GFileInfoClass))
36 #define G_IS_FILE_INFO(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_FILE_INFO))
37 #define G_IS_FILE_INFO_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_FILE_INFO))
38 #define G_FILE_INFO_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_FILE_INFO, GFileInfoClass))
39
40 /**
41  * GFileInfo:
42  * 
43  * Stores information about a file system object referenced by a #GFile.
44  **/
45 typedef struct _GFileInfo        GFileInfo;
46 typedef struct _GFileInfoClass   GFileInfoClass;
47
48 /**
49  * GFileAttributeMatcher:
50  * 
51  * Determines if a string matches a file attribute.
52  **/
53 typedef struct _GFileAttributeMatcher GFileAttributeMatcher;
54
55 /**
56  * GFileType:
57  * @G_FILE_TYPE_UNKNOWN: File's type is unknown.
58  * @G_FILE_TYPE_REGULAR: File handle represents a regular file.
59  * @G_FILE_TYPE_DIRECTORY: File handle represents a directory.
60  * @G_FILE_TYPE_SYMBOLIC_LINK: File handle represents a symbolic link (Unix systems)
61  * @G_FILE_TYPE_SPECIAL: File is a "special" file, such as a socket, fifo, blockdev,  or chardev.
62  * @G_FILE_TYPE_SHORTCUT: File is a shortcut (Windows systems)
63  * @G_FILE_TYPE_MOUNTABLE: File is a mountable location.
64  * 
65  * Indicates the file's on-disk type.
66  **/
67 typedef enum {
68   G_FILE_TYPE_UNKNOWN = 0,
69   G_FILE_TYPE_REGULAR,
70   G_FILE_TYPE_DIRECTORY,
71   G_FILE_TYPE_SYMBOLIC_LINK,
72   G_FILE_TYPE_SPECIAL, /* socket, fifo, blockdev, chardev */
73   G_FILE_TYPE_SHORTCUT,
74   G_FILE_TYPE_MOUNTABLE
75 } GFileType;
76
77 /* Common Attributes:  */
78 /**
79  * G_FILE_ATTRIBUTE_STD_TYPE:
80  * 
81  * A key in the "std" namespace for storing file types. 
82  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
83  * The value for this key should contain a #GFileType.
84  **/
85 #define G_FILE_ATTRIBUTE_STD_TYPE "std:type"                     /* uint32 (GFileType) */
86
87 /**
88  * G_FILE_ATTRIBUTE_STD_IS_HIDDEN:
89  * 
90  * A key in the "std" namespace for checking if a file is hidden. 
91  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
92  **/
93 #define G_FILE_ATTRIBUTE_STD_IS_HIDDEN "std:is_hidden"           /* boolean */
94
95 /**
96  * G_FILE_ATTRIBUTE_STD_IS_BACKUP:
97  * 
98  * A key in the "std" namespace for checking if a file is a backup file.
99  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
100  **/
101 #define G_FILE_ATTRIBUTE_STD_IS_BACKUP "std:is_backup"           /* boolean */
102
103 /**
104  * G_FILE_ATTRIBUTE_STD_IS_SYMLINK:
105  * 
106  * A key in the "std" namespace for checking if the file is a symlink.
107  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
108  **/
109 #define G_FILE_ATTRIBUTE_STD_IS_SYMLINK "std:is_symlink"         /* boolean */
110
111 /**
112  * G_FILE_ATTRIBUTE_STD_IS_VIRTUAL:
113  * 
114  * A key in the "std" namespace for checking if a file is virtual.
115  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
116  **/
117 #define G_FILE_ATTRIBUTE_STD_IS_VIRTUAL "std:is_virtual"         /* boolean */
118
119 /**
120  * G_FILE_ATTRIBUTE_STD_NAME:
121  * 
122  * A key in the "std" namespace for getting the name of the file.
123  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
124  **/
125 #define G_FILE_ATTRIBUTE_STD_NAME "std:name"                     /* byte string */
126
127 /**
128  * G_FILE_ATTRIBUTE_STD_DISPLAY_NAME:
129  * 
130  * A key in the "std" namespace for getting the display name of the file.
131  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
132  **/
133 #define G_FILE_ATTRIBUTE_STD_DISPLAY_NAME "std:display_name"     /* string */
134
135 /**
136  * G_FILE_ATTRIBUTE_STD_EDIT_NAME:
137  * 
138  * A key in the "std" namespace for edit name of the file.
139  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
140  **/
141 #define G_FILE_ATTRIBUTE_STD_EDIT_NAME "std:edit_name"           /* string */
142
143 /**
144  * G_FILE_ATTRIBUTE_STD_COPY_NAME:
145  * 
146  * A key in the "std" namespace for getting the copy name of the file.
147  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
148  **/
149 #define G_FILE_ATTRIBUTE_STD_COPY_NAME "std:copy_name"           /* string */
150
151 /**
152  * G_FILE_ATTRIBUTE_STD_ICON:
153  * 
154  * A key in the "std" namespace for getting the icon for the file.
155  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_OBJECT.
156  * The value for this key should contain a #GIcon.
157  **/
158 #define G_FILE_ATTRIBUTE_STD_ICON "std:icon"                     /* object (GIcon) */
159
160 /**
161  * G_FILE_ATTRIBUTE_STD_CONTENT_TYPE:
162  * 
163  * A key in the "std" namespace for getting the content type of the file.
164  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
165  * The value for this key should contain a valid content type.
166  **/
167 #define G_FILE_ATTRIBUTE_STD_CONTENT_TYPE "std:content_type"     /* string */
168
169 /**
170  * G_FILE_ATTRIBUTE_STD_FAST_CONTENT_TYPE:
171  * 
172  * A key in the "std" namespace for getting the fast content type.
173  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
174  * 
175  **/
176 #define G_FILE_ATTRIBUTE_STD_FAST_CONTENT_TYPE "std:fast_content_type" /* string */
177
178 /**
179  * G_FILE_ATTRIBUTE_STD_SIZE:
180  * 
181  * A key in the "std" namespace for getting the file's size.
182  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
183  **/
184 #define G_FILE_ATTRIBUTE_STD_SIZE "std:size"                     /* uint64 */
185
186 /**
187  * G_FILE_ATTRIBUTE_STD_SYMLINK_TARGET:
188  * 
189  * A key in the "std" namespace for getting the symlink target, if the file
190  * is a symlink. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
191  **/
192 #define G_FILE_ATTRIBUTE_STD_SYMLINK_TARGET "std:symlink_target" /* byte string */
193
194 /**
195  * G_FILE_ATTRIBUTE_STD_TARGET_URI:
196  * 
197  * A key in the "std" namespace for getting the target URI for the file.
198  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
199  **/
200 #define G_FILE_ATTRIBUTE_STD_TARGET_URI "std:target_uri"         /* string */
201
202 /**
203  * G_FILE_ATTRIBUTE_STD_SORT_ORDER:
204  * 
205  * A key in the "std" namespace for setting the sort order of a file. 
206  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_INT32.
207  * An example use would be in file managers, which would use this key to set 
208  * the order files are displayed.
209  **/
210 #define G_FILE_ATTRIBUTE_STD_SORT_ORDER "std:sort_order"         /* int32  */
211
212 /* Entity tags, used to avoid missing updates on save */
213 /**
214  * G_FILE_ATTRIBUTE_ETAG_VALUE:
215  * 
216  * A key in the "etag" namespace for getting the value of the file's
217  * entity tag. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
218  **/
219 #define G_FILE_ATTRIBUTE_ETAG_VALUE "etag:value"                 /* string */
220
221 /* File identifier, for e.g. avoiding loops when doing recursive directory scanning */
222 /**
223  * G_FILE_ATTRIBUTE_ID_FILE:
224  * 
225  * A key in the "id" namespace for getting a file identifier.
226  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
227  * An example use would be during listing files, to avoid recursive
228  * directory scanning.
229  **/
230 #define G_FILE_ATTRIBUTE_ID_FILE "id:file"                     /* string */
231
232 /**
233  * G_FILE_ATTRIBUTE_ID_FS:
234  * 
235  * A key in the "id" namespace for getting the file system identifier.
236  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
237  * An example use would be during listing files, to avoid recursive
238  * directory scanning.
239  **/
240 #define G_FILE_ATTRIBUTE_ID_FS "id:fs"                         /* string */
241
242 /* Calculated Access Rights for current user */
243
244 /**
245  * G_FILE_ATTRIBUTE_ACCESS_CAN_READ:
246  * 
247  * A key in the "access" namespace for getting read privilidges. 
248  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
249  * This key will be true if the user is able to read the file.
250  **/
251 #define G_FILE_ATTRIBUTE_ACCESS_CAN_READ "access:can_read"       /* boolean */
252
253 /**
254  * G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE:
255  * 
256  * A key in the "access" namespace for getting write privilidges.
257  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
258  * This key will be true if the user is able to write to the file.
259  **/
260 #define G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE "access:can_write"     /* boolean */
261
262 /**
263  * G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE:
264  * 
265  * A key in the "access" namespace for getting execution privilidges.
266  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
267  * This key will be true if the user is able to execute the file.
268  **/
269 #define G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE "access:can_execute" /* boolean */
270
271 /**
272  * G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE:
273  * 
274  * A key in the "access" namespace for checking deletion privilidges.
275  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
276  * This key will be true if the user is able to delete the file.
277  **/
278 #define G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE "access:can_delete"   /* boolean */
279
280 /**
281  * G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH:
282  * 
283  * A key in the "access" namespace for checking trashing privilidges.
284  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
285  * This key will be true if the user is able to send the file to the 
286  * virtual file system trash location.
287  **/
288 #define G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH "access:can_trash"     /* boolean */
289
290 /**
291  * G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME:
292  * 
293  * A key in the "access" namespace for checking renaming privilidges.
294  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
295  * This key will be true if the user is able to rename the file.
296  **/
297 #define G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME "access:can_rename"   /* boolean */ 
298 /* TODO: Should we have special version for directories? can_enumerate, etc */
299
300 /* Mountable attributes */
301 /**
302  * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT:
303  * 
304  * A key in the "mountable" namespace for checking if a file is mountable.
305  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
306  **/
307 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT "mountable:can_mount"     /* boolean */
308
309 /**
310  * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT:
311  * 
312  * A key in the "mountable" namespace for checking if a file is unmountable.
313  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
314  **/
315 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT "mountable:can_unmount" /* boolean */
316
317 /**
318  * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT:
319  * 
320  * A key in the "mountable" namespace for checking if a file can be ejected.
321  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
322  **/
323 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT "mountable:can_eject"     /* boolean */
324
325 /**
326  * G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE:
327  * 
328  * A key in the "mountable" namespace for getting the unix device.
329  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
330  **/
331 #define G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE "mountable:unix_device" /* uint32 */
332
333 /**
334  * G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI:
335  * 
336  * A key in the "mountable" namespace for getting the HAL UDI for the mounted
337  * file. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
338  **/
339 #define G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI "mountable:hal_udi"         /* string */
340
341 /* Time attributes */
342
343   /* The last time the file content or an attribute was modified */
344 /**
345  * G_FILE_ATTRIBUTE_TIME_MODIFIED:
346  * 
347  * A key in the "time" namespace for getting the time the file was last
348  * modified. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64, 
349  * and contains the UNIX time since the file was modified.
350  **/
351 #define G_FILE_ATTRIBUTE_TIME_MODIFIED "time:modified"           /* uint64 */
352
353 /**
354  * G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC:
355  * 
356  * A key in the "time" namespace for getting the milliseconds of the time
357  * the file was last modified. This should be used in conjunction with 
358  * #G_FILE_ATTRIBUTE_TIME_MODIFIED. Corresponding #GFileAttributeType is 
359  * %G_FILE_ATTRIBUTE_TYPE_UINT32.
360  **/
361 #define G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC "time:modified_usec" /* uint32 */
362   /* The last time the file was read */
363 /**
364  * G_FILE_ATTRIBUTE_TIME_ACCESS:
365  * 
366  * A key in the "time" namespace for getting the time the file was last
367  * accessed. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64, 
368  * and contains the UNIX time since the file was last accessed.
369  **/
370 #define G_FILE_ATTRIBUTE_TIME_ACCESS "time:access"               /* uint64 */
371 /**
372  * G_FILE_ATTRIBUTE_TIME_ACCESS_USEC:
373  * 
374  * A key in the "time" namespace for getting the milliseconds of the time
375  * the file was last accessed. This should be used in conjunction with
376  * #G_FILE_ATTRIBUTE_TIME_ACCESS. Corresponding #GFileAttributeType is 
377  * %G_FILE_ATTRIBUTE_TYPE_UINT32.
378  **/
379 #define G_FILE_ATTRIBUTE_TIME_ACCESS_USEC "time:access_usec"     /* uint32 */
380   /* The last time a file attribute was changed (e.g. unix ctime) */
381 /**
382  * G_FILE_ATTRIBUTE_TIME_CHANGED:
383  * 
384  * A key in the "time" namespace for getting the time the file was last
385  * changed. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64, 
386  * and contains the UNIX time since the file was last changed.
387  **/
388 #define G_FILE_ATTRIBUTE_TIME_CHANGED "time:changed"             /* uint64 */
389 /**
390  * G_FILE_ATTRIBUTE_TIME_CHANGED_USEC:
391  * 
392  * A key in the "time" namespace for getting the milliseconds of the time
393  * the file was last changed. This should be used in conjunction with
394  * #G_FILE_ATTRIBUTE_TIME_CHANGED. Corresponding #GFileAttributeType is 
395  * %G_FILE_ATTRIBUTE_TYPE_UINT32. 
396  **/
397 #define G_FILE_ATTRIBUTE_TIME_CHANGED_USEC "time:changed_usec"   /* uint32 */
398   /* When the file was originally created (e.g. ntfs ctime) */
399 /**
400  * G_FILE_ATTRIBUTE_TIME_CREATED:
401  * 
402  * A key in the "time" namespace for getting the time the file was created.
403  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64, 
404  * and contains the UNIX time since the file was created.
405  **/
406 #define G_FILE_ATTRIBUTE_TIME_CREATED "time:created"             /* uint64 */
407
408 /**
409  * G_FILE_ATTRIBUTE_TIME_CREATED_USEC:
410  * 
411  * A key in the "time" namespace for getting the milliseconds of the time
412  * the file was created. This should be used in conjunction with
413  * #G_FILE_ATTRIBUTE_TIME_CREATED. Corresponding #GFileAttributeType is 
414  * %G_FILE_ATTRIBUTE_TYPE_UINT32. 
415  **/
416 #define G_FILE_ATTRIBUTE_TIME_CREATED_USEC "time:created_usec"   /* uint32 */
417
418 /* Unix specific attributes */
419 /**
420  * G_FILE_ATTRIBUTE_UNIX_DEVICE:
421  * 
422  * A key in the "unix" namespace for getting the device id of the device the 
423  * file is located on (see man stat(2)). This attribute is only available 
424  * for UNIX file systems. Corresponding #GFileAttributeType is 
425  * %G_FILE_ATTRIBUTE_TYPE_UINT32. 
426  * 
427  **/
428 #define G_FILE_ATTRIBUTE_UNIX_DEVICE "unix:device"               /* uint32 */
429 /**
430  * G_FILE_ATTRIBUTE_UNIX_INODE:
431  * 
432  * A key in the "unix" namespace for getting the inode of the file.
433  * This attribute is only available for UNIX file systems. Corresponding 
434  * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
435  **/
436 #define G_FILE_ATTRIBUTE_UNIX_INODE "unix:inode"                 /* uint64 */
437 /**
438  * G_FILE_ATTRIBUTE_UNIX_MODE:
439  * 
440  * A key in the "unix" namespace for getting the mode of the file (e.g. whether the file 
441  * is a regular file, symlink, etc). See man lstat(2). This attribute is only available 
442  * for UNIX file systems. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
443  **/
444 #define G_FILE_ATTRIBUTE_UNIX_MODE "unix:mode"                   /* uint32 */
445
446 /**
447  * G_FILE_ATTRIBUTE_UNIX_NLINK:
448  * 
449  * A key in the "unix" namespace for getting the number of hard links for a 
450  * file. See man lstat(2). This attribute is only available for UNIX file systems. 
451  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
452  * 
453  **/
454 #define G_FILE_ATTRIBUTE_UNIX_NLINK "unix:nlink"                 /* uint32 */
455 /**
456  * G_FILE_ATTRIBUTE_UNIX_UID:
457  * 
458  * A key in the "unix" namespace for getting the user ID for the file. 
459  * This attribute is only available for UNIX file systems. 
460  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
461  **/
462 #define G_FILE_ATTRIBUTE_UNIX_UID "unix:uid"                     /* uint32 */
463 /**
464  * G_FILE_ATTRIBUTE_UNIX_GID:
465  * 
466  * A key in the "unix" namespace for getting the group ID for the file.
467  * This attribute is only available for UNIX file systems. 
468  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
469  **/
470 #define G_FILE_ATTRIBUTE_UNIX_GID "unix:gid"                     /* uint32 */
471 /**
472  * G_FILE_ATTRIBUTE_UNIX_RDEV:
473  * 
474  * A key in the "unix" namespace for getting the device ID for the file (if it 
475  * is a special file). See man lstat(2). This attribute is only available for 
476  * UNIX file systems. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
477  **/
478 #define G_FILE_ATTRIBUTE_UNIX_RDEV "unix:rdev"                   /* uint32 */
479 /**
480  * G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE:
481  * 
482  * A key in the "unix" namespace for getting the block size for the file system.
483  * This attribute is only available for UNIX file systems. 
484  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
485  **/
486 #define G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE "unix:block_size"       /* uint32 */
487 /**
488  * G_FILE_ATTRIBUTE_UNIX_BLOCKS:
489  * 
490  * A key in the "unix" namespace for getting the number of blocks allocated for the file.
491  * This attribute is only available for UNIX file systems. 
492  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
493  **/
494 #define G_FILE_ATTRIBUTE_UNIX_BLOCKS "unix:blocks"               /* uint64 */
495
496 /**
497  * G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT:
498  * 
499  * A key in the "unix" namespace for checking if the file represents a unix mount point.
500  * Returns %TRUE if the file is a unix mount point. This attribute is only available for 
501  * UNIX file systems. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
502  **/
503 #define G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT "unix:is_mountpoint" /* boolean */
504
505 /* DOS specific attributes */
506 /**
507  * G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE:
508  * 
509  * A key in the "dos" namespace for checking if the file's archive flag is set.
510  * Returns %TRUE if the archive flag is set. This attribute is only available for 
511  * DOS file systems. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
512  **/
513 #define G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE "dos:is_archive"         /* boolean */
514
515 /**
516  * G_FILE_ATTRIBUTE_DOS_IS_SYSTEM:
517  * 
518  * A key in the "dos" namespace for checking if the file's backup flag is set.
519  * Returns %TRUE if the backup flag is set. This attribute is only available for 
520  * DOS file systems. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
521  **/
522 #define G_FILE_ATTRIBUTE_DOS_IS_SYSTEM "dos:is_system"           /* boolean */
523
524 /* Owner attributes */
525 /**
526  * G_FILE_ATTRIBUTE_OWNER_USER:
527  * 
528  * A key in the "owner" namespace for getting the user name of the file's owner.
529  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
530  **/
531 #define G_FILE_ATTRIBUTE_OWNER_USER "owner:user"                 /* string */
532
533 /**
534  * G_FILE_ATTRIBUTE_OWNER_USER_REAL:
535  * 
536  * A key in the "owner" namespace for getting the real name of the user that owns the file.
537  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
538  **/
539 #define G_FILE_ATTRIBUTE_OWNER_USER_REAL "owner:user_real"       /* string */
540
541 /**
542  * G_FILE_ATTRIBUTE_OWNER_GROUP:
543  * 
544  * A key in the "owner" namespace for getting the file owner's group.
545  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
546  **/
547 #define G_FILE_ATTRIBUTE_OWNER_GROUP "owner:group"               /* string */
548
549 /* Thumbnails */
550
551 /**
552  * G_FILE_ATTRIBUTE_THUMBNAIL_PATH:
553  * 
554  * A key in the "thumbnail" namespace for getting the path to the thumbnail image.
555  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
556  **/
557 #define G_FILE_ATTRIBUTE_THUMBNAIL_PATH "thumbnail:path"         /* bytestring */
558 /**
559  * G_FILE_ATTRIBUTE_THUMBNAIL_THUMNAILING_FAILED:
560  * 
561  * A key in the "thumbnail" namespace for checking if thumbnailing failed. 
562  * Is set to %TRUE if thumbnailing failed. Corresponding #GFileAttributeType 
563  * is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN. 
564  **/
565 #define G_FILE_ATTRIBUTE_THUMBNAILING_FAILED "thumbnail:failed"         /* boolean */
566
567 /* File system info (for g_file_get_filesystem_info) */
568
569 /**
570  * G_FILE_ATTRIBUTE_FS_SIZE:
571  * 
572  * A key in the "fs" namespace for getting the size of the file system, used in
573  * g_file_get_filesystem_info(). Corresponding #GFileAttributeType is 
574  * %G_FILE_ATTRIBUTE_TYPE_UINT64.
575  **/
576 #define G_FILE_ATTRIBUTE_FS_SIZE "fs:size"                       /* uint64 */
577
578 /**
579  * G_FILE_ATTRIBUTE_FS_FREE:
580  * 
581  * A key in the "fs" namespace for getting the free space left on the file system.
582  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
583  **/
584 #define G_FILE_ATTRIBUTE_FS_FREE "fs:free"                       /* uint64 */
585
586 /**
587  * G_FILE_ATTRIBUTE_FS_TYPE:
588  * 
589  * A key in the "fs" namespace for getting the file system's type.
590  * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
591  **/
592 #define G_FILE_ATTRIBUTE_FS_TYPE "fs:type"                       /* string */
593
594 /**
595  * G_FILE_ATTRIBUTE_FS_READONLY:
596  * 
597  * A key in the "fs" namespace for checking if the file system is read only.
598  * Is set to %TRUE if the file system is read only. Corresponding #GFileAttributeType is 
599  * %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
600  **/
601 #define G_FILE_ATTRIBUTE_FS_READONLY "fs:readonly"               /* boolean */
602
603 /**
604  * G_FILE_ATTRIBUTE_GVFS_BACKEND:
605  * 
606  * A key in the "gvfs" namespace that gets the name of the current
607  * GVFS backend in use. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
608  **/
609 #define G_FILE_ATTRIBUTE_GVFS_BACKEND "gvfs:backend"             /* string */
610
611 GType g_file_info_get_type (void) G_GNUC_CONST;
612
613 GFileInfo *        g_file_info_new                       (void);
614 GFileInfo *        g_file_info_dup                       (GFileInfo  *other);
615 void               g_file_info_copy_into                 (GFileInfo  *src_info,
616                                                           GFileInfo  *dest_info);
617 gboolean           g_file_info_has_attribute             (GFileInfo  *info,
618                                                           const char *attribute);
619 char **            g_file_info_list_attributes           (GFileInfo  *info,
620                                                           const char *name_space);
621 GFileAttributeType g_file_info_get_attribute_type        (GFileInfo  *info,
622                                                           const char *attribute);
623 void               g_file_info_remove_attribute          (GFileInfo  *info,
624                                                           const char *attribute);
625 GFileAttributeValue * g_file_info_get_attribute          (GFileInfo  *info,
626                                                           const char *attribute);
627 const char *       g_file_info_get_attribute_string      (GFileInfo  *info,
628                                                           const char *attribute);
629 const char *       g_file_info_get_attribute_byte_string (GFileInfo  *info,
630                                                           const char *attribute);
631 gboolean           g_file_info_get_attribute_boolean     (GFileInfo  *info,
632                                                           const char *attribute);
633 guint32            g_file_info_get_attribute_uint32      (GFileInfo  *info,
634                                                           const char *attribute);
635 gint32             g_file_info_get_attribute_int32       (GFileInfo  *info,
636                                                           const char *attribute);
637 guint64            g_file_info_get_attribute_uint64      (GFileInfo  *info,
638                                                           const char *attribute);
639 gint64             g_file_info_get_attribute_int64       (GFileInfo  *info,
640                                                           const char *attribute);
641 GObject *          g_file_info_get_attribute_object      (GFileInfo  *info,
642                                                           const char *attribute);
643
644 void               g_file_info_set_attribute             (GFileInfo  *info,
645                                                           const char *attribute,
646                                                           const GFileAttributeValue *attr_value);
647 void               g_file_info_set_attribute_string      (GFileInfo  *info,
648                                                           const char *attribute,
649                                                           const char *attr_value);
650 void               g_file_info_set_attribute_byte_string (GFileInfo  *info,
651                                                           const char *attribute,
652                                                           const char *attr_value);
653 void               g_file_info_set_attribute_boolean     (GFileInfo  *info,
654                                                           const char *attribute,
655                                                           gboolean    attr_value);
656 void               g_file_info_set_attribute_uint32      (GFileInfo  *info,
657                                                           const char *attribute,
658                                                           guint32     attr_value);
659 void               g_file_info_set_attribute_int32       (GFileInfo  *info,
660                                                           const char *attribute,
661                                                           gint32      attr_value);
662 void               g_file_info_set_attribute_uint64      (GFileInfo  *info,
663                                                           const char *attribute,
664                                                           guint64     attr_value);
665 void               g_file_info_set_attribute_int64       (GFileInfo  *info,
666                                                           const char *attribute,
667                                                           gint64      attr_value);
668 void               g_file_info_set_attribute_object      (GFileInfo  *info,
669                                                           const char *attribute,
670                                                           GObject    *attr_value);
671
672 void               g_file_info_clear_status              (GFileInfo  *info);
673
674 /* Helper getters: */
675 GFileType         g_file_info_get_file_type          (GFileInfo         *info);
676 gboolean          g_file_info_get_is_hidden          (GFileInfo         *info);
677 gboolean          g_file_info_get_is_backup          (GFileInfo         *info);
678 gboolean          g_file_info_get_is_symlink         (GFileInfo         *info);
679 const char *      g_file_info_get_name               (GFileInfo         *info);
680 const char *      g_file_info_get_display_name       (GFileInfo         *info);
681 const char *      g_file_info_get_edit_name          (GFileInfo         *info);
682 GIcon *           g_file_info_get_icon               (GFileInfo         *info);
683 const char *      g_file_info_get_content_type       (GFileInfo         *info);
684 goffset           g_file_info_get_size               (GFileInfo         *info);
685 void              g_file_info_get_modification_time  (GFileInfo         *info,
686                                                       GTimeVal          *result);
687 const char *      g_file_info_get_symlink_target     (GFileInfo         *info);
688 const char *      g_file_info_get_etag               (GFileInfo         *info);
689 gint32            g_file_info_get_sort_order         (GFileInfo         *info);
690
691 void              g_file_info_set_attribute_mask     (GFileInfo         *info,
692                                                       GFileAttributeMatcher *mask);
693 void              g_file_info_unset_attribute_mask   (GFileInfo         *info);
694
695 /* Helper setters: */
696 void              g_file_info_set_file_type          (GFileInfo         *info,
697                                                       GFileType          type);
698 void              g_file_info_set_is_hidden          (GFileInfo         *info,
699                                                       gboolean           is_hidden);
700 void              g_file_info_set_is_symlink         (GFileInfo         *info,
701                                                       gboolean           is_symlink);
702 void              g_file_info_set_name               (GFileInfo         *info,
703                                                       const char        *name);
704 void              g_file_info_set_display_name       (GFileInfo         *info,
705                                                       const char        *display_name);
706 void              g_file_info_set_edit_name          (GFileInfo         *info,
707                                                       const char        *edit_name);
708 void              g_file_info_set_icon               (GFileInfo         *info,
709                                                       GIcon             *icon);
710 void              g_file_info_set_content_type       (GFileInfo         *info,
711                                                       const char        *content_type);
712 void              g_file_info_set_size               (GFileInfo         *info,
713                                                       goffset            size);
714 void              g_file_info_set_modification_time  (GFileInfo         *info,
715                                                       GTimeVal          *mtime);
716 void              g_file_info_set_symlink_target     (GFileInfo         *info,
717                                                       const char        *symlink_target);
718 void              g_file_info_set_sort_order         (GFileInfo         *info,
719                                                       gint32             sort_order);
720
721 GFileAttributeMatcher *g_file_attribute_matcher_new            (const char            *attributes);
722 GFileAttributeMatcher *g_file_attribute_matcher_ref            (GFileAttributeMatcher *matcher);
723 void                   g_file_attribute_matcher_unref          (GFileAttributeMatcher *matcher);
724 gboolean               g_file_attribute_matcher_matches        (GFileAttributeMatcher *matcher,
725                                                                 const char            *attribute);
726 gboolean               g_file_attribute_matcher_matches_only   (GFileAttributeMatcher *matcher,
727                                                                 const char            *attribute);
728 gboolean               g_file_attribute_matcher_enumerate_namespace (GFileAttributeMatcher *matcher,
729                                                                      const char            *ns);
730 const char *           g_file_attribute_matcher_enumerate_next (GFileAttributeMatcher *matcher);
731
732 G_END_DECLS
733
734
735 #endif /* __G_FILE_INFO_H__ */