1 /* GIO - GLib Input, Output and Streaming Library
3 * Copyright (C) 2006-2007 Red Hat, Inc.
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.
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.
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.
20 * Author: Alexander Larsson <alexl@redhat.com>
23 #ifndef __G_FILE_INFO_H__
24 #define __G_FILE_INFO_H__
26 #include <glib-object.h>
27 #include <gio/gfileattribute.h>
28 #include <gio/gicon.h>
32 #define G_TYPE_FILE_INFO (g_file_info_get_type ())
33 #define G_FILE_INFO(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_FILE_INFO, GFileInfo))
34 #define G_FILE_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_FILE_INFO, GFileInfoClass))
35 #define G_IS_FILE_INFO(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_FILE_INFO))
36 #define G_IS_FILE_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_FILE_INFO))
37 #define G_FILE_INFO_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_FILE_INFO, GFileInfoClass))
42 * Stores information about a file system object referenced by a #GFile.
44 typedef struct _GFileInfo GFileInfo;
45 typedef struct _GFileInfoClass GFileInfoClass;
48 * GFileAttributeMatcher:
50 * Determines if a string matches a file attribute.
52 typedef struct _GFileAttributeMatcher GFileAttributeMatcher;
56 * @G_FILE_TYPE_UNKNOWN: File's type is unknown.
57 * @G_FILE_TYPE_REGULAR: File handle represents a regular file.
58 * @G_FILE_TYPE_DIRECTORY: File handle represents a directory.
59 * @G_FILE_TYPE_SYMBOLIC_LINK: File handle represents a symbolic link (Unix systems)
60 * @G_FILE_TYPE_SPECIAL: File is a "special" file, such as a socket, fifo, blockdev, or chardev.
61 * @G_FILE_TYPE_SHORTCUT: File is a shortcut (Windows systems)
62 * @G_FILE_TYPE_MOUNTABLE: File is a mountable location.
64 * Indicates the file's on-disk type.
67 G_FILE_TYPE_UNKNOWN = 0,
69 G_FILE_TYPE_DIRECTORY,
70 G_FILE_TYPE_SYMBOLIC_LINK,
71 G_FILE_TYPE_SPECIAL, /* socket, fifo, blockdev, chardev */
76 /* Common Attributes: */
78 * G_FILE_ATTRIBUTE_STD_TYPE:
80 * A key in the "std" namespace for storing file types.
81 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
82 * The value for this key should contain a #GFileType.
84 #define G_FILE_ATTRIBUTE_STD_TYPE "std:type" /* uint32 (GFileType) */
87 * G_FILE_ATTRIBUTE_STD_IS_HIDDEN:
89 * A key in the "std" namespace for checking if a file is hidden.
90 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
92 #define G_FILE_ATTRIBUTE_STD_IS_HIDDEN "std:is_hidden" /* boolean */
95 * G_FILE_ATTRIBUTE_STD_IS_BACKUP:
97 * A key in the "std" namespace for checking if a file is a backup file.
98 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
100 #define G_FILE_ATTRIBUTE_STD_IS_BACKUP "std:is_backup" /* boolean */
103 * G_FILE_ATTRIBUTE_STD_IS_SYMLINK:
105 * A key in the "std" namespace for checking if the file is a symlink.
106 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
108 #define G_FILE_ATTRIBUTE_STD_IS_SYMLINK "std:is_symlink" /* boolean */
111 * G_FILE_ATTRIBUTE_STD_IS_VIRTUAL:
113 * A key in the "std" namespace for checking if a file is virtual.
114 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
116 #define G_FILE_ATTRIBUTE_STD_IS_VIRTUAL "std:is_virtual" /* boolean */
119 * G_FILE_ATTRIBUTE_STD_NAME:
121 * A key in the "std" namespace for getting the name of the file.
122 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
124 #define G_FILE_ATTRIBUTE_STD_NAME "std:name" /* byte string */
127 * G_FILE_ATTRIBUTE_STD_DISPLAY_NAME:
129 * A key in the "std" namespace for getting the display name of the file.
130 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
132 #define G_FILE_ATTRIBUTE_STD_DISPLAY_NAME "std:display_name" /* string */
135 * G_FILE_ATTRIBUTE_STD_EDIT_NAME:
137 * A key in the "std" namespace for edit name of the file.
138 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
140 #define G_FILE_ATTRIBUTE_STD_EDIT_NAME "std:edit_name" /* string */
143 * G_FILE_ATTRIBUTE_STD_COPY_NAME:
145 * A key in the "std" namespace for getting the copy name of the file.
146 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
148 #define G_FILE_ATTRIBUTE_STD_COPY_NAME "std:copy_name" /* string */
151 * G_FILE_ATTRIBUTE_STD_ICON:
153 * A key in the "std" namespace for getting the icon for the file.
154 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_OBJECT.
155 * The value for this key should contain a #GIcon.
157 #define G_FILE_ATTRIBUTE_STD_ICON "std:icon" /* object (GIcon) */
160 * G_FILE_ATTRIBUTE_STD_CONTENT_TYPE:
162 * A key in the "std" namespace for getting the content type of the file.
163 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
164 * The value for this key should contain a valid content type.
166 #define G_FILE_ATTRIBUTE_STD_CONTENT_TYPE "std:content_type" /* string */
169 * G_FILE_ATTRIBUTE_STD_FAST_CONTENT_TYPE:
171 * A key in the "std" namespace for getting the fast content type.
172 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
175 #define G_FILE_ATTRIBUTE_STD_FAST_CONTENT_TYPE "std:fast_content_type" /* string */
178 * G_FILE_ATTRIBUTE_STD_SIZE:
180 * A key in the "std" namespace for getting the file's size.
181 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
183 #define G_FILE_ATTRIBUTE_STD_SIZE "std:size" /* uint64 */
186 * G_FILE_ATTRIBUTE_STD_SYMLINK_TARGET:
188 * A key in the "std" namespace for getting the symlink target, if the file
189 * is a symlink. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
191 #define G_FILE_ATTRIBUTE_STD_SYMLINK_TARGET "std:symlink_target" /* byte string */
194 * G_FILE_ATTRIBUTE_STD_TARGET_URI:
196 * A key in the "std" namespace for getting the target URI for the file.
197 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
199 #define G_FILE_ATTRIBUTE_STD_TARGET_URI "std:target_uri" /* string */
202 * G_FILE_ATTRIBUTE_STD_SORT_ORDER:
204 * A key in the "std" namespace for setting the sort order of a file.
205 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_INT32.
206 * An example use would be in file managers, which would use this key to set
207 * the order files are displayed.
209 #define G_FILE_ATTRIBUTE_STD_SORT_ORDER "std:sort_order" /* int32 */
211 /* Entity tags, used to avoid missing updates on save */
213 * G_FILE_ATTRIBUTE_ETAG_VALUE:
215 * A key in the "etag" namespace for getting the value of the file's
216 * entity tag. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
218 #define G_FILE_ATTRIBUTE_ETAG_VALUE "etag:value" /* string */
220 /* File identifier, for e.g. avoiding loops when doing recursive directory scanning */
222 * G_FILE_ATTRIBUTE_ID_FILE:
224 * A key in the "id" namespace for getting a file identifier.
225 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
226 * An example use would be during listing files, to avoid recursive
227 * directory scanning.
229 #define G_FILE_ATTRIBUTE_ID_FILE "id:file" /* string */
232 * G_FILE_ATTRIBUTE_ID_FS:
234 * A key in the "id" namespace for getting the file system identifier.
235 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
236 * An example use would be during listing files, to avoid recursive
237 * directory scanning.
239 #define G_FILE_ATTRIBUTE_ID_FS "id:fs" /* string */
241 /* Calculated Access Rights for current user */
244 * G_FILE_ATTRIBUTE_ACCESS_CAN_READ:
246 * A key in the "access" namespace for getting read privilidges.
247 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
248 * This key will be true if the user is able to read the file.
250 #define G_FILE_ATTRIBUTE_ACCESS_CAN_READ "access:can_read" /* boolean */
253 * G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE:
255 * A key in the "access" namespace for getting write privilidges.
256 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
257 * This key will be true if the user is able to write to the file.
259 #define G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE "access:can_write" /* boolean */
262 * G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE:
264 * A key in the "access" namespace for getting execution privilidges.
265 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
266 * This key will be true if the user is able to execute the file.
268 #define G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE "access:can_execute" /* boolean */
271 * G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE:
273 * A key in the "access" namespace for checking deletion privilidges.
274 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
275 * This key will be true if the user is able to delete the file.
277 #define G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE "access:can_delete" /* boolean */
280 * G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH:
282 * A key in the "access" namespace for checking trashing privilidges.
283 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
284 * This key will be true if the user is able to send the file to the
285 * virtual file system trash location.
287 #define G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH "access:can_trash" /* boolean */
290 * G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME:
292 * A key in the "access" namespace for checking renaming privilidges.
293 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
294 * This key will be true if the user is able to rename the file.
296 #define G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME "access:can_rename" /* boolean */
297 /* TODO: Should we have special version for directories? can_enumerate, etc */
299 /* Mountable attributes */
301 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT:
303 * A key in the "mountable" namespace for checking if a file is mountable.
304 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
306 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT "mountable:can_mount" /* boolean */
309 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT:
311 * A key in the "mountable" namespace for checking if a file is unmountable.
312 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
314 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT "mountable:can_unmount" /* boolean */
317 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT:
319 * A key in the "mountable" namespace for checking if a file can be ejected.
320 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
322 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT "mountable:can_eject" /* boolean */
325 * G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE:
327 * A key in the "mountable" namespace for getting the unix device.
328 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
330 #define G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE "mountable:unix_device" /* uint32 */
333 * G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI:
335 * A key in the "mountable" namespace for getting the HAL UDI for the mounted
336 * file. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
338 #define G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI "mountable:hal_udi" /* string */
340 /* Time attributes */
342 /* The last time the file content or an attribute was modified */
344 * G_FILE_ATTRIBUTE_TIME_MODIFIED:
346 * A key in the "time" namespace for getting the time the file was last
347 * modified. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64,
348 * and contains the UNIX time since the file was modified.
350 #define G_FILE_ATTRIBUTE_TIME_MODIFIED "time:modified" /* uint64 */
353 * G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC:
355 * A key in the "time" namespace for getting the milliseconds of the time
356 * the file was last modified. This should be used in conjunction with
357 * #G_FILE_ATTRIBUTE_TIME_MODIFIED. Corresponding #GFileAttributeType is
358 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
360 #define G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC "time:modified_usec" /* uint32 */
361 /* The last time the file was read */
363 * G_FILE_ATTRIBUTE_TIME_ACCESS:
365 * A key in the "time" namespace for getting the time the file was last
366 * accessed. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64,
367 * and contains the UNIX time since the file was last accessed.
369 #define G_FILE_ATTRIBUTE_TIME_ACCESS "time:access" /* uint64 */
371 * G_FILE_ATTRIBUTE_TIME_ACCESS_USEC:
373 * A key in the "time" namespace for getting the milliseconds of the time
374 * the file was last accessed. This should be used in conjunction with
375 * #G_FILE_ATTRIBUTE_TIME_ACCESS. Corresponding #GFileAttributeType is
376 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
378 #define G_FILE_ATTRIBUTE_TIME_ACCESS_USEC "time:access_usec" /* uint32 */
379 /* The last time a file attribute was changed (e.g. unix ctime) */
381 * G_FILE_ATTRIBUTE_TIME_CHANGED:
383 * A key in the "time" namespace for getting the time the file was last
384 * changed. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64,
385 * and contains the UNIX time since the file was last changed.
387 #define G_FILE_ATTRIBUTE_TIME_CHANGED "time:changed" /* uint64 */
389 * G_FILE_ATTRIBUTE_TIME_CHANGED_USEC:
391 * A key in the "time" namespace for getting the milliseconds of the time
392 * the file was last changed. This should be used in conjunction with
393 * #G_FILE_ATTRIBUTE_TIME_CHANGED. Corresponding #GFileAttributeType is
394 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
396 #define G_FILE_ATTRIBUTE_TIME_CHANGED_USEC "time:changed_usec" /* uint32 */
397 /* When the file was originally created (e.g. ntfs ctime) */
399 * G_FILE_ATTRIBUTE_TIME_CREATED:
401 * A key in the "time" namespace for getting the time the file was created.
402 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64,
403 * and contains the UNIX time since the file was created.
405 #define G_FILE_ATTRIBUTE_TIME_CREATED "time:created" /* uint64 */
408 * G_FILE_ATTRIBUTE_TIME_CREATED_USEC:
410 * A key in the "time" namespace for getting the milliseconds of the time
411 * the file was created. This should be used in conjunction with
412 * #G_FILE_ATTRIBUTE_TIME_CREATED. Corresponding #GFileAttributeType is
413 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
415 #define G_FILE_ATTRIBUTE_TIME_CREATED_USEC "time:created_usec" /* uint32 */
417 /* Unix specific attributes */
419 * G_FILE_ATTRIBUTE_UNIX_DEVICE:
421 * A key in the "unix" namespace for getting the device id of the device the
422 * file is located on (see man stat(2)). This attribute is only available
423 * for UNIX file systems. Corresponding #GFileAttributeType is
424 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
427 #define G_FILE_ATTRIBUTE_UNIX_DEVICE "unix:device" /* uint32 */
429 * G_FILE_ATTRIBUTE_UNIX_INODE:
431 * A key in the "unix" namespace for getting the inode of the file.
432 * This attribute is only available for UNIX file systems. Corresponding
433 * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
435 #define G_FILE_ATTRIBUTE_UNIX_INODE "unix:inode" /* uint64 */
437 * G_FILE_ATTRIBUTE_UNIX_MODE:
439 * A key in the "unix" namespace for getting the mode of the file (e.g. whether the file
440 * is a regular file, symlink, etc). See man lstat(2). This attribute is only available
441 * for UNIX file systems. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
443 #define G_FILE_ATTRIBUTE_UNIX_MODE "unix:mode" /* uint32 */
446 * G_FILE_ATTRIBUTE_UNIX_NLINK:
448 * A key in the "unix" namespace for getting the number of hard links for a
449 * file. See man lstat(2). This attribute is only available for UNIX file systems.
450 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
453 #define G_FILE_ATTRIBUTE_UNIX_NLINK "unix:nlink" /* uint32 */
455 * G_FILE_ATTRIBUTE_UNIX_UID:
457 * A key in the "unix" namespace for getting the user ID for the file.
458 * This attribute is only available for UNIX file systems.
459 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
461 #define G_FILE_ATTRIBUTE_UNIX_UID "unix:uid" /* uint32 */
463 * G_FILE_ATTRIBUTE_UNIX_GID:
465 * A key in the "unix" namespace for getting the group ID for the file.
466 * This attribute is only available for UNIX file systems.
467 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
469 #define G_FILE_ATTRIBUTE_UNIX_GID "unix:gid" /* uint32 */
471 * G_FILE_ATTRIBUTE_UNIX_RDEV:
473 * A key in the "unix" namespace for getting the device ID for the file (if it
474 * is a special file). See man lstat(2). This attribute is only available for
475 * UNIX file systems. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
477 #define G_FILE_ATTRIBUTE_UNIX_RDEV "unix:rdev" /* uint32 */
479 * G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE:
481 * A key in the "unix" namespace for getting the block size for the file system.
482 * This attribute is only available for UNIX file systems.
483 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
485 #define G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE "unix:block_size" /* uint32 */
487 * G_FILE_ATTRIBUTE_UNIX_BLOCKS:
489 * A key in the "unix" namespace for getting the number of blocks allocated for the file.
490 * This attribute is only available for UNIX file systems.
491 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
493 #define G_FILE_ATTRIBUTE_UNIX_BLOCKS "unix:blocks" /* uint64 */
496 * G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT:
498 * A key in the "unix" namespace for checking if the file represents a unix mount point.
499 * Returns %TRUE if the file is a unix mount point. This attribute is only available for
500 * UNIX file systems. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
502 #define G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT "unix:is_mountpoint" /* boolean */
504 /* DOS specific attributes */
506 * G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE:
508 * A key in the "dos" namespace for checking if the file's archive flag is set.
509 * Returns %TRUE if the archive flag is set. This attribute is only available for
510 * DOS file systems. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
512 #define G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE "dos:is_archive" /* boolean */
515 * G_FILE_ATTRIBUTE_DOS_IS_SYSTEM:
517 * A key in the "dos" namespace for checking if the file's backup flag is set.
518 * Returns %TRUE if the backup flag is set. This attribute is only available for
519 * DOS file systems. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
521 #define G_FILE_ATTRIBUTE_DOS_IS_SYSTEM "dos:is_system" /* boolean */
523 /* Owner attributes */
525 * G_FILE_ATTRIBUTE_OWNER_USER:
527 * A key in the "owner" namespace for getting the user name of the file's owner.
528 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
530 #define G_FILE_ATTRIBUTE_OWNER_USER "owner:user" /* string */
533 * G_FILE_ATTRIBUTE_OWNER_USER_REAL:
535 * A key in the "owner" namespace for getting the real name of the user that owns the file.
536 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
538 #define G_FILE_ATTRIBUTE_OWNER_USER_REAL "owner:user_real" /* string */
541 * G_FILE_ATTRIBUTE_OWNER_GROUP:
543 * A key in the "owner" namespace for getting the file owner's group.
544 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
546 #define G_FILE_ATTRIBUTE_OWNER_GROUP "owner:group" /* string */
551 * G_FILE_ATTRIBUTE_THUMBNAIL_PATH:
553 * A key in the "thumbnail" namespace for getting the path to the thumbnail image.
554 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
556 #define G_FILE_ATTRIBUTE_THUMBNAIL_PATH "thumbnail:path" /* bytestring */
558 * G_FILE_ATTRIBUTE_THUMBNAIL_THUMNAILING_FAILED:
560 * A key in the "thumbnail" namespace for checking if thumbnailing failed.
561 * Is set to %TRUE if thumbnailing failed. Corresponding #GFileAttributeType
562 * is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
564 #define G_FILE_ATTRIBUTE_THUMBNAILING_FAILED "thumbnail:failed" /* boolean */
566 /* File system info (for g_file_get_filesystem_info) */
569 * G_FILE_ATTRIBUTE_FS_SIZE:
571 * A key in the "fs" namespace for getting the size of the file system, used in
572 * g_file_get_filesystem_info(). Corresponding #GFileAttributeType is
573 * %G_FILE_ATTRIBUTE_TYPE_UINT64.
575 #define G_FILE_ATTRIBUTE_FS_SIZE "fs:size" /* uint64 */
578 * G_FILE_ATTRIBUTE_FS_FREE:
580 * A key in the "fs" namespace for getting the free space left on the file system.
581 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
583 #define G_FILE_ATTRIBUTE_FS_FREE "fs:free" /* uint64 */
586 * G_FILE_ATTRIBUTE_FS_TYPE:
588 * A key in the "fs" namespace for getting the file system's type.
589 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
591 #define G_FILE_ATTRIBUTE_FS_TYPE "fs:type" /* string */
594 * G_FILE_ATTRIBUTE_FS_READONLY:
596 * A key in the "fs" namespace for checking if the file system is read only.
597 * Is set to %TRUE if the file system is read only. Corresponding #GFileAttributeType is
598 * %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
600 #define G_FILE_ATTRIBUTE_FS_READONLY "fs:readonly" /* boolean */
603 * G_FILE_ATTRIBUTE_GVFS_BACKEND:
605 * A key in the "gvfs" namespace that gets the name of the current
606 * GVFS backend in use. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
608 #define G_FILE_ATTRIBUTE_GVFS_BACKEND "gvfs:backend" /* string */
610 GType g_file_info_get_type (void) G_GNUC_CONST;
612 GFileInfo * g_file_info_new (void);
613 GFileInfo * g_file_info_dup (GFileInfo *other);
614 void g_file_info_copy_into (GFileInfo *src_info,
615 GFileInfo *dest_info);
616 gboolean g_file_info_has_attribute (GFileInfo *info,
617 const char *attribute);
618 char ** g_file_info_list_attributes (GFileInfo *info,
619 const char *name_space);
620 GFileAttributeType g_file_info_get_attribute_type (GFileInfo *info,
621 const char *attribute);
622 void g_file_info_remove_attribute (GFileInfo *info,
623 const char *attribute);
624 GFileAttributeValue * g_file_info_get_attribute (GFileInfo *info,
625 const char *attribute);
626 const char * g_file_info_get_attribute_string (GFileInfo *info,
627 const char *attribute);
628 const char * g_file_info_get_attribute_byte_string (GFileInfo *info,
629 const char *attribute);
630 gboolean g_file_info_get_attribute_boolean (GFileInfo *info,
631 const char *attribute);
632 guint32 g_file_info_get_attribute_uint32 (GFileInfo *info,
633 const char *attribute);
634 gint32 g_file_info_get_attribute_int32 (GFileInfo *info,
635 const char *attribute);
636 guint64 g_file_info_get_attribute_uint64 (GFileInfo *info,
637 const char *attribute);
638 gint64 g_file_info_get_attribute_int64 (GFileInfo *info,
639 const char *attribute);
640 GObject * g_file_info_get_attribute_object (GFileInfo *info,
641 const char *attribute);
643 void g_file_info_set_attribute (GFileInfo *info,
644 const char *attribute,
645 const GFileAttributeValue *attr_value);
646 void g_file_info_set_attribute_string (GFileInfo *info,
647 const char *attribute,
648 const char *attr_value);
649 void g_file_info_set_attribute_byte_string (GFileInfo *info,
650 const char *attribute,
651 const char *attr_value);
652 void g_file_info_set_attribute_boolean (GFileInfo *info,
653 const char *attribute,
654 gboolean attr_value);
655 void g_file_info_set_attribute_uint32 (GFileInfo *info,
656 const char *attribute,
658 void g_file_info_set_attribute_int32 (GFileInfo *info,
659 const char *attribute,
661 void g_file_info_set_attribute_uint64 (GFileInfo *info,
662 const char *attribute,
664 void g_file_info_set_attribute_int64 (GFileInfo *info,
665 const char *attribute,
667 void g_file_info_set_attribute_object (GFileInfo *info,
668 const char *attribute,
669 GObject *attr_value);
671 void g_file_info_clear_status (GFileInfo *info);
673 /* Helper getters: */
674 GFileType g_file_info_get_file_type (GFileInfo *info);
675 gboolean g_file_info_get_is_hidden (GFileInfo *info);
676 gboolean g_file_info_get_is_backup (GFileInfo *info);
677 gboolean g_file_info_get_is_symlink (GFileInfo *info);
678 const char * g_file_info_get_name (GFileInfo *info);
679 const char * g_file_info_get_display_name (GFileInfo *info);
680 const char * g_file_info_get_edit_name (GFileInfo *info);
681 GIcon * g_file_info_get_icon (GFileInfo *info);
682 const char * g_file_info_get_content_type (GFileInfo *info);
683 goffset g_file_info_get_size (GFileInfo *info);
684 void g_file_info_get_modification_time (GFileInfo *info,
686 const char * g_file_info_get_symlink_target (GFileInfo *info);
687 const char * g_file_info_get_etag (GFileInfo *info);
688 gint32 g_file_info_get_sort_order (GFileInfo *info);
690 void g_file_info_set_attribute_mask (GFileInfo *info,
691 GFileAttributeMatcher *mask);
692 void g_file_info_unset_attribute_mask (GFileInfo *info);
694 /* Helper setters: */
695 void g_file_info_set_file_type (GFileInfo *info,
697 void g_file_info_set_is_hidden (GFileInfo *info,
699 void g_file_info_set_is_symlink (GFileInfo *info,
700 gboolean is_symlink);
701 void g_file_info_set_name (GFileInfo *info,
703 void g_file_info_set_display_name (GFileInfo *info,
704 const char *display_name);
705 void g_file_info_set_edit_name (GFileInfo *info,
706 const char *edit_name);
707 void g_file_info_set_icon (GFileInfo *info,
709 void g_file_info_set_content_type (GFileInfo *info,
710 const char *content_type);
711 void g_file_info_set_size (GFileInfo *info,
713 void g_file_info_set_modification_time (GFileInfo *info,
715 void g_file_info_set_symlink_target (GFileInfo *info,
716 const char *symlink_target);
717 void g_file_info_set_sort_order (GFileInfo *info,
720 /* Helper functions for attributes: */
721 /* TODO: Move this to glib when merging */
722 char *g_format_file_size_for_display (goffset size);
724 GFileAttributeMatcher *g_file_attribute_matcher_new (const char *attributes);
725 GFileAttributeMatcher *g_file_attribute_matcher_ref (GFileAttributeMatcher *matcher);
726 void g_file_attribute_matcher_unref (GFileAttributeMatcher *matcher);
727 gboolean g_file_attribute_matcher_matches (GFileAttributeMatcher *matcher,
728 const char *attribute);
729 gboolean g_file_attribute_matcher_matches_only (GFileAttributeMatcher *matcher,
730 const char *attribute);
731 gboolean g_file_attribute_matcher_enumerate_namespace (GFileAttributeMatcher *matcher,
733 const char * g_file_attribute_matcher_enumerate_next (GFileAttributeMatcher *matcher);
738 #endif /* __G_FILE_INFO_H__ */