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 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
24 #error "Only <gio/gio.h> can be included directly."
27 #ifndef __G_FILE_INFO_H__
28 #define __G_FILE_INFO_H__
30 #include <glib-object.h>
31 #include <gio/gfileattribute.h>
32 #include <gio/gicon.h>
36 #define G_TYPE_FILE_INFO (g_file_info_get_type ())
37 #define G_FILE_INFO(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_FILE_INFO, GFileInfo))
38 #define G_FILE_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_FILE_INFO, GFileInfoClass))
39 #define G_IS_FILE_INFO(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_FILE_INFO))
40 #define G_IS_FILE_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_FILE_INFO))
41 #define G_FILE_INFO_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_FILE_INFO, GFileInfoClass))
46 * Stores information about a file system object referenced by a #GFile.
48 typedef struct _GFileInfo GFileInfo;
49 typedef struct _GFileInfoClass GFileInfoClass;
52 * GFileAttributeMatcher:
54 * Determines if a string matches a file attribute.
56 typedef struct _GFileAttributeMatcher GFileAttributeMatcher;
60 * @G_FILE_TYPE_UNKNOWN: File's type is unknown.
61 * @G_FILE_TYPE_REGULAR: File handle represents a regular file.
62 * @G_FILE_TYPE_DIRECTORY: File handle represents a directory.
63 * @G_FILE_TYPE_SYMBOLIC_LINK: File handle represents a symbolic link
65 * @G_FILE_TYPE_SPECIAL: File is a "special" file, such as a socket, fifo,
66 * block device, or character device.
67 * @G_FILE_TYPE_SHORTCUT: File is a shortcut (Windows systems).
68 * @G_FILE_TYPE_MOUNTABLE: File is a mountable location.
70 * Indicates the file's on-disk type.
73 G_FILE_TYPE_UNKNOWN = 0,
75 G_FILE_TYPE_DIRECTORY,
76 G_FILE_TYPE_SYMBOLIC_LINK,
77 G_FILE_TYPE_SPECIAL, /* socket, fifo, blockdev, chardev */
83 * GFilesystemPreviewType:
84 * @G_FILESYSTEM_PREVIEW_TYPE_IF_ALWAYS: Only preview files if user has explicitly requested it.
85 * @G_FILESYSTEM_PREVIEW_TYPE_IF_LOCAL: Preview files if user has requested preview of "local" files.
86 * @G_FILESYSTEM_PREVIEW_TYPE_NEVER: Never preview files.
88 * Indicates a hint from the file system whether files should be
89 * previewed in a file manager. Returned as the value of the key
90 * #G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW.
93 G_FILESYSTEM_PREVIEW_TYPE_IF_ALWAYS = 0,
94 G_FILESYSTEM_PREVIEW_TYPE_IF_LOCAL,
95 G_FILESYSTEM_PREVIEW_TYPE_NEVER
96 } GFilesystemPreviewType;
98 /* Common Attributes: */
100 * G_FILE_ATTRIBUTE_STANDARD_TYPE:
102 * A key in the "standard" namespace for storing file types.
103 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
104 * The value for this key should contain a #GFileType.
106 #define G_FILE_ATTRIBUTE_STANDARD_TYPE "standard::type" /* uint32 (GFileType) */
109 * G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN:
111 * A key in the "standard" namespace for checking if a file is hidden.
112 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
114 #define G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN "standard::is-hidden" /* boolean */
117 * G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP:
119 * A key in the "standard" namespace for checking if a file is a backup file.
120 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
122 #define G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP "standard::is-backup" /* boolean */
125 * G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK:
127 * A key in the "standard" namespace for checking if the file is a symlink.
128 * Typically the actual type is something else, if we followed the symlink
130 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
132 #define G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK "standard::is-symlink" /* boolean */
135 * G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL:
137 * A key in the "standard" namespace for checking if a file is virtual.
138 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
140 #define G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL "standard::is-virtual" /* boolean */
143 * G_FILE_ATTRIBUTE_STANDARD_NAME:
145 * A key in the "standard" namespace for getting the name of the file.
146 * The name is the on-disk filename which may not be in any known encoding,
147 * and can thus not be generally displayed as is.
148 * Use #G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME if you need to display the
149 * name in a user interface.
150 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
152 #define G_FILE_ATTRIBUTE_STANDARD_NAME "standard::name" /* byte string */
155 * G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME:
157 * A key in the "standard" namespace for getting the display name of the file.
158 * A display name is guaranteed to be in UTF8 and can thus be displayed in
160 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
162 #define G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME "standard::display-name" /* string */
165 * G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME:
167 * A key in the "standard" namespace for edit name of the file.
168 * An edit name is similar to the display name, but it is meant to be
169 * used when you want to rename the file in the UI. The display name
170 * might contain information you don't want in the new filename (such as
171 * "(invalid unicode)" if the filename was in an invalid encoding).
173 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
175 #define G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME "standard::edit-name" /* string */
178 * G_FILE_ATTRIBUTE_STANDARD_COPY_NAME:
180 * A key in the "standard" namespace for getting the copy name of the file.
181 * The copy name is an optional version of the name. If availible its always
182 * in UTF8, and corresponds directly to the original filename (only transcoded to
183 * UTF8). This is useful if you want to copy the file to another filesystem that
184 * might have a different encoding. If the filename is not a valid string in the
185 * encoding selected for the filesystem it is in then the copy name will not be set.
187 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
189 #define G_FILE_ATTRIBUTE_STANDARD_COPY_NAME "standard::copy-name" /* string */
192 * G_FILE_ATTRIBUTE_STANDARD_DESCRIPTION:
194 * A key in the "standard" namespace for getting the description of the file.
195 * The description is a utf8 string that describes the file, generally containing
196 * the filename, but can also contain furter information. Example descriptions
197 * could be "filename (on hostname)" for a remote file or "filename (in trash)"
198 * for a file in the trash. This is useful for instance as the window title
199 * when displaying a directory or for a bookmarks menu.
201 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
203 #define G_FILE_ATTRIBUTE_STANDARD_DESCRIPTION "standard::description" /* string */
206 * G_FILE_ATTRIBUTE_STANDARD_ICON:
208 * A key in the "standard" namespace for getting the icon for the file.
209 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_OBJECT.
210 * The value for this key should contain a #GIcon.
212 #define G_FILE_ATTRIBUTE_STANDARD_ICON "standard::icon" /* object (GIcon) */
215 * G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE:
217 * A key in the "standard" namespace for getting the content type of the file.
218 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
219 * The value for this key should contain a valid content type.
221 #define G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE "standard::content-type" /* string */
224 * G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE:
226 * A key in the "standard" namespace for getting the fast content type.
227 * The fast content type isn't as reliable as the regular one, as it
228 * only uses the filename to guess it, but it is faster to calculate than the
229 * regular content type.
230 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
233 #define G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE "standard::fast-content-type" /* string */
236 * G_FILE_ATTRIBUTE_STANDARD_SIZE:
238 * A key in the "standard" namespace for getting the file's size (in bytes).
239 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
241 #define G_FILE_ATTRIBUTE_STANDARD_SIZE "standard::size" /* uint64 */
244 * G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET:
246 * A key in the "standard" namespace for getting the symlink target, if the file
247 * is a symlink. Corresponding #GFileAttributeType is
248 * %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
250 #define G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET "standard::symlink-target" /* byte string */
253 * G_FILE_ATTRIBUTE_STANDARD_TARGET_URI:
255 * A key in the "standard" namespace for getting the target URI for the file, in
256 * the case of %G_FILE_TYPE_SHORTCUT or %G_FILE_TYPE_MOUNTABLE files.
257 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
259 #define G_FILE_ATTRIBUTE_STANDARD_TARGET_URI "standard::target-uri" /* string */
262 * G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER:
264 * A key in the "standard" namespace for setting the sort order of a file.
265 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_INT32.
266 * An example use would be in file managers, which would use this key
267 * to set the order files are displayed. Files with smaller sort order
268 * should be sorted first, and files without sort order as if sort order
271 #define G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER "standard::sort-order" /* int32 */
273 /* Entity tags, used to avoid missing updates on save */
276 * G_FILE_ATTRIBUTE_ETAG_VALUE:
278 * A key in the "etag" namespace for getting the value of the file's
279 * entity tag. Corresponding #GFileAttributeType is
280 * %G_FILE_ATTRIBUTE_TYPE_STRING.
282 #define G_FILE_ATTRIBUTE_ETAG_VALUE "etag::value" /* string */
284 /* File identifier, for e.g. avoiding loops when doing recursive
289 * G_FILE_ATTRIBUTE_ID_FILE:
291 * A key in the "id" namespace for getting a file identifier.
292 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
293 * An example use would be during listing files, to avoid recursive
294 * directory scanning.
296 #define G_FILE_ATTRIBUTE_ID_FILE "id::file" /* string */
299 * G_FILE_ATTRIBUTE_ID_FILESYSTEM:
301 * A key in the "id" namespace for getting the file system identifier.
302 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
303 * An example use would be during drag and drop to see if the source
304 * and target are on the same filesystem (default to move) or not (default
307 #define G_FILE_ATTRIBUTE_ID_FILESYSTEM "id::filesystem" /* string */
309 /* Calculated Access Rights for current user */
312 * G_FILE_ATTRIBUTE_ACCESS_CAN_READ:
314 * A key in the "access" namespace for getting read privileges.
315 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
316 * This attribute will be %TRUE if the user is able to read the file.
318 #define G_FILE_ATTRIBUTE_ACCESS_CAN_READ "access::can-read" /* boolean */
321 * G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE:
323 * A key in the "access" namespace for getting write privileges.
324 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
325 * This attribute will be %TRUE if the user is able to write to the file.
327 #define G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE "access::can-write" /* boolean */
330 * G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE:
332 * A key in the "access" namespace for getting execution privileges.
333 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
334 * This attribute will be %TRUE if the user is able to execute the file.
336 #define G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE "access::can-execute" /* boolean */
339 * G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE:
341 * A key in the "access" namespace for checking deletion privileges.
342 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
343 * This attribute will be %TRUE if the user is able to delete the file.
345 #define G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE "access::can-delete" /* boolean */
348 * G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH:
350 * A key in the "access" namespace for checking trashing privileges.
351 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
352 * This attribute will be %TRUE if the user is able to move the file to
355 #define G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH "access::can-trash" /* boolean */
358 * G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME:
360 * A key in the "access" namespace for checking renaming privileges.
361 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
362 * This attribute will be %TRUE if the user is able to rename the file.
364 #define G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME "access::can-rename" /* boolean */
366 /* TODO: Should we have special version for directories? can_enumerate, etc */
368 /* Mountable attributes */
371 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT:
373 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) is mountable.
374 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
376 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT "mountable::can-mount" /* boolean */
379 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT:
381 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) is unmountable.
382 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
384 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT "mountable::can-unmount" /* boolean */
387 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT:
389 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be ejected.
390 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
392 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT "mountable::can-eject" /* boolean */
395 * G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE:
397 * A key in the "mountable" namespace for getting the unix device.
398 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
400 #define G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE "mountable::unix-device" /* uint32 */
403 * G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI:
405 * A key in the "mountable" namespace for getting the HAL UDI for the mountable
406 * file. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
408 #define G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI "mountable::hal-udi" /* string */
410 /* Time attributes */
413 * G_FILE_ATTRIBUTE_TIME_MODIFIED:
415 * A key in the "time" namespace for getting the time the file was last
416 * modified. Corresponding #GFileAttributeType is
417 * %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the
420 #define G_FILE_ATTRIBUTE_TIME_MODIFIED "time::modified" /* uint64 */
423 * G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC:
425 * A key in the "time" namespace for getting the miliseconds of the time
426 * the file was last modified. This should be used in conjunction with
427 * #G_FILE_ATTRIBUTE_TIME_MODIFIED. Corresponding #GFileAttributeType is
428 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
430 #define G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC "time::modified-usec" /* uint32 */
433 * G_FILE_ATTRIBUTE_TIME_ACCESS:
435 * A key in the "time" namespace for getting the time the file was last
436 * accessed. Corresponding #GFileAttributeType is
437 * %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the
438 * file was last accessed.
440 #define G_FILE_ATTRIBUTE_TIME_ACCESS "time::access" /* uint64 */
443 * G_FILE_ATTRIBUTE_TIME_ACCESS_USEC:
445 * A key in the "time" namespace for getting the microseconds of the time
446 * the file was last accessed. This should be used in conjunction with
447 * #G_FILE_ATTRIBUTE_TIME_ACCESS. Corresponding #GFileAttributeType is
448 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
450 #define G_FILE_ATTRIBUTE_TIME_ACCESS_USEC "time::access-usec" /* uint32 */
453 * G_FILE_ATTRIBUTE_TIME_CHANGED:
455 * A key in the "time" namespace for getting the time the file was last
456 * changed. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64,
457 * and contains the UNIX time since the file was last changed.
459 * This corresponds to the traditional UNIX ctime.
461 #define G_FILE_ATTRIBUTE_TIME_CHANGED "time::changed" /* uint64 */
464 * G_FILE_ATTRIBUTE_TIME_CHANGED_USEC:
466 * A key in the "time" namespace for getting the microseconds of the time
467 * the file was last changed. This should be used in conjunction with
468 * #G_FILE_ATTRIBUTE_TIME_CHANGED. Corresponding #GFileAttributeType is
469 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
471 #define G_FILE_ATTRIBUTE_TIME_CHANGED_USEC "time::changed-usec" /* uint32 */
474 * G_FILE_ATTRIBUTE_TIME_CREATED:
476 * A key in the "time" namespace for getting the time the file was created.
477 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64,
478 * and contains the UNIX time since the file was created.
480 * This corresponds to the NTFS ctime.
482 #define G_FILE_ATTRIBUTE_TIME_CREATED "time::created" /* uint64 */
485 * G_FILE_ATTRIBUTE_TIME_CREATED_USEC:
487 * A key in the "time" namespace for getting the microseconds of the time
488 * the file was created. This should be used in conjunction with
489 * #G_FILE_ATTRIBUTE_TIME_CREATED. Corresponding #GFileAttributeType is
490 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
492 #define G_FILE_ATTRIBUTE_TIME_CREATED_USEC "time::created-usec" /* uint32 */
494 /* Unix specific attributes */
497 * G_FILE_ATTRIBUTE_UNIX_DEVICE:
499 * A key in the "unix" namespace for getting the device id of the device the
500 * file is located on (see stat() documentation). This attribute is only
501 * available for UNIX file systems. Corresponding #GFileAttributeType is
502 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
504 #define G_FILE_ATTRIBUTE_UNIX_DEVICE "unix::device" /* uint32 */
507 * G_FILE_ATTRIBUTE_UNIX_INODE:
509 * A key in the "unix" namespace for getting the inode of the file.
510 * This attribute is only available for UNIX file systems. Corresponding
511 * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
513 #define G_FILE_ATTRIBUTE_UNIX_INODE "unix::inode" /* uint64 */
516 * G_FILE_ATTRIBUTE_UNIX_MODE:
518 * A key in the "unix" namespace for getting the mode of the file
519 * (e.g. whether the file is a regular file, symlink, etc). See lstat()
520 * documentation. This attribute is only available for UNIX file systems.
521 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
523 #define G_FILE_ATTRIBUTE_UNIX_MODE "unix::mode" /* uint32 */
526 * G_FILE_ATTRIBUTE_UNIX_NLINK:
528 * A key in the "unix" namespace for getting the number of hard links
529 * for a file. See lstat() documentation. This attribute is only available
530 * for UNIX file systems. Corresponding #GFileAttributeType is
531 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
533 #define G_FILE_ATTRIBUTE_UNIX_NLINK "unix::nlink" /* uint32 */
536 * G_FILE_ATTRIBUTE_UNIX_UID:
538 * A key in the "unix" namespace for getting the user ID for the file.
539 * This attribute is only available for UNIX file systems.
540 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
542 #define G_FILE_ATTRIBUTE_UNIX_UID "unix::uid" /* uint32 */
545 * G_FILE_ATTRIBUTE_UNIX_GID:
547 * A key in the "unix" namespace for getting the group ID for the file.
548 * This attribute is only available for UNIX file systems.
549 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
551 #define G_FILE_ATTRIBUTE_UNIX_GID "unix::gid" /* uint32 */
554 * G_FILE_ATTRIBUTE_UNIX_RDEV:
556 * A key in the "unix" namespace for getting the device ID for the file
557 * (if it is a special file). See lstat() documentation. This attribute
558 * is only available for UNIX file systems. Corresponding #GFileAttributeType
559 * is %G_FILE_ATTRIBUTE_TYPE_UINT32.
561 #define G_FILE_ATTRIBUTE_UNIX_RDEV "unix::rdev" /* uint32 */
564 * G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE:
566 * A key in the "unix" namespace for getting the block size for the file
567 * system. This attribute is only available for UNIX file systems.
568 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
570 #define G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE "unix::block-size" /* uint32 */
573 * G_FILE_ATTRIBUTE_UNIX_BLOCKS:
575 * A key in the "unix" namespace for getting the number of blocks allocated
576 * for the file. This attribute is only available for UNIX file systems.
577 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
579 #define G_FILE_ATTRIBUTE_UNIX_BLOCKS "unix::blocks" /* uint64 */
582 * G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT:
584 * A key in the "unix" namespace for checking if the file represents a
585 * UNIX mount point. This attribute is %TRUE if the file is a UNIX mount
586 * point. This attribute is only available for UNIX file systems.
587 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
589 #define G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT "unix::is-mountpoint" /* boolean */
591 /* DOS specific attributes */
594 * G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE:
596 * A key in the "dos" namespace for checking if the file's archive flag
597 * is set. This attribute is %TRUE if the archive flag is set. This attribute
598 * is only available for DOS file systems. Corresponding #GFileAttributeType
599 * is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
601 #define G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE "dos::is-archive" /* boolean */
604 * G_FILE_ATTRIBUTE_DOS_IS_SYSTEM:
606 * A key in the "dos" namespace for checking if the file's backup flag
607 * is set. This attribute is %TRUE if the backup flag is set. This attribute
608 * is only available for DOS file systems. Corresponding #GFileAttributeType
609 * is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
611 #define G_FILE_ATTRIBUTE_DOS_IS_SYSTEM "dos::is-system" /* boolean */
613 /* Owner attributes */
616 * G_FILE_ATTRIBUTE_OWNER_USER:
618 * A key in the "owner" namespace for getting the user name of the
619 * file's owner. Corresponding #GFileAttributeType is
620 * %G_FILE_ATTRIBUTE_TYPE_STRING.
622 #define G_FILE_ATTRIBUTE_OWNER_USER "owner::user" /* string */
625 * G_FILE_ATTRIBUTE_OWNER_USER_REAL:
627 * A key in the "owner" namespace for getting the real name of the
628 * user that owns the file. Corresponding #GFileAttributeType is
629 * %G_FILE_ATTRIBUTE_TYPE_STRING.
631 #define G_FILE_ATTRIBUTE_OWNER_USER_REAL "owner::user-real" /* string */
634 * G_FILE_ATTRIBUTE_OWNER_GROUP:
636 * A key in the "owner" namespace for getting the file owner's group.
637 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
639 #define G_FILE_ATTRIBUTE_OWNER_GROUP "owner::group" /* string */
644 * G_FILE_ATTRIBUTE_THUMBNAIL_PATH:
646 * A key in the "thumbnail" namespace for getting the path to the thumbnail
647 * image. Corresponding #GFileAttributeType is
648 * %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
650 #define G_FILE_ATTRIBUTE_THUMBNAIL_PATH "thumbnail::path" /* bytestring */
652 * G_FILE_ATTRIBUTE_THUMBNAILING_FAILED:
654 * A key in the "thumbnail" namespace for checking if thumbnailing failed.
655 * This attribute is %TRUE if thumbnailing failed. Corresponding
656 * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
658 #define G_FILE_ATTRIBUTE_THUMBNAILING_FAILED "thumbnail::failed" /* boolean */
660 /* File system info (for g_file_get_filesystem_info) */
663 * G_FILE_ATTRIBUTE_FILESYSTEM_SIZE:
665 * A key in the "filesystem" namespace for getting the total size (in bytes) of the file system,
666 * used in g_file_query_filesystem_info(). Corresponding #GFileAttributeType
667 * is %G_FILE_ATTRIBUTE_TYPE_UINT64.
669 #define G_FILE_ATTRIBUTE_FILESYSTEM_SIZE "filesystem::size" /* uint64 */
672 * G_FILE_ATTRIBUTE_FILESYSTEM_FREE:
674 * A key in the "filesystem" namespace for getting the number of bytes of free space left on the
675 * file system. Corresponding #GFileAttributeType is
676 * %G_FILE_ATTRIBUTE_TYPE_UINT64.
678 #define G_FILE_ATTRIBUTE_FILESYSTEM_FREE "filesystem::free" /* uint64 */
681 * G_FILE_ATTRIBUTE_FILESYSTEM_TYPE:
683 * A key in the "filesystem" namespace for getting the file system's type.
684 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
686 #define G_FILE_ATTRIBUTE_FILESYSTEM_TYPE "filesystem::type" /* string */
689 * G_FILE_ATTRIBUTE_FILESYSTEM_READONLY:
691 * A key in the "filesystem" namespace for checking if the file system
692 * is read only. Is set to %TRUE if the file system is read only.
693 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
695 #define G_FILE_ATTRIBUTE_FILESYSTEM_READONLY "filesystem::readonly" /* boolean */
698 * G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW:
700 * A key in the "filesystem" namespace for hinting a file manager
701 * application whether it should preview (e.g. thumbnail) files on the
702 * file system. The value for this key contain a
703 * #GFilesystemPreviewType.
705 #define G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW "filesystem::use-preview" /* uint32 (GFilesystemPreviewType) */
708 * G_FILE_ATTRIBUTE_GVFS_BACKEND:
710 * A key in the "gvfs" namespace that gets the name of the current
711 * GVFS backend in use. Corresponding #GFileAttributeType is
712 * %G_FILE_ATTRIBUTE_TYPE_STRING.
714 #define G_FILE_ATTRIBUTE_GVFS_BACKEND "gvfs::backend" /* string */
717 * G_FILE_ATTRIBUTE_SELINUX_CONTEXT:
719 * A key in the "selinux" namespace for getting the file's SELinux
720 * context. Corresponding #GFileAttributeType is
721 * %G_FILE_ATTRIBUTE_TYPE_STRING. Note that this attribute is only
722 * available if GLib has been built with SELinux support.
724 #define G_FILE_ATTRIBUTE_SELINUX_CONTEXT "selinux::context" /* string */
727 * G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT:
729 * A key in the "trash" namespace. When requested against
730 * "trash:///" returns the number of (toplevel) items in the trash folder.
731 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
733 #define G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT "trash::item-count" /* uint32 */
735 GType g_file_info_get_type (void) G_GNUC_CONST;
737 GFileInfo * g_file_info_new (void);
738 GFileInfo * g_file_info_dup (GFileInfo *other);
739 void g_file_info_copy_into (GFileInfo *src_info,
740 GFileInfo *dest_info);
741 gboolean g_file_info_has_attribute (GFileInfo *info,
742 const char *attribute);
743 char ** g_file_info_list_attributes (GFileInfo *info,
744 const char *name_space);
745 gboolean g_file_info_get_attribute_data (GFileInfo *info,
746 const char *attribute,
747 GFileAttributeType *type,
749 GFileAttributeStatus *status);
750 GFileAttributeType g_file_info_get_attribute_type (GFileInfo *info,
751 const char *attribute);
752 void g_file_info_remove_attribute (GFileInfo *info,
753 const char *attribute);
754 GFileAttributeStatus g_file_info_get_attribute_status (GFileInfo *info,
755 const char *attribute);
756 char * g_file_info_get_attribute_as_string (GFileInfo *info,
757 const char *attribute);
758 const char * g_file_info_get_attribute_string (GFileInfo *info,
759 const char *attribute);
760 const char * g_file_info_get_attribute_byte_string (GFileInfo *info,
761 const char *attribute);
762 gboolean g_file_info_get_attribute_boolean (GFileInfo *info,
763 const char *attribute);
764 guint32 g_file_info_get_attribute_uint32 (GFileInfo *info,
765 const char *attribute);
766 gint32 g_file_info_get_attribute_int32 (GFileInfo *info,
767 const char *attribute);
768 guint64 g_file_info_get_attribute_uint64 (GFileInfo *info,
769 const char *attribute);
770 gint64 g_file_info_get_attribute_int64 (GFileInfo *info,
771 const char *attribute);
772 GObject * g_file_info_get_attribute_object (GFileInfo *info,
773 const char *attribute);
775 void g_file_info_set_attribute (GFileInfo *info,
776 const char *attribute,
777 GFileAttributeType type,
779 void g_file_info_set_attribute_string (GFileInfo *info,
780 const char *attribute,
781 const char *attr_value);
782 void g_file_info_set_attribute_byte_string (GFileInfo *info,
783 const char *attribute,
784 const char *attr_value);
785 void g_file_info_set_attribute_boolean (GFileInfo *info,
786 const char *attribute,
787 gboolean attr_value);
788 void g_file_info_set_attribute_uint32 (GFileInfo *info,
789 const char *attribute,
791 void g_file_info_set_attribute_int32 (GFileInfo *info,
792 const char *attribute,
794 void g_file_info_set_attribute_uint64 (GFileInfo *info,
795 const char *attribute,
797 void g_file_info_set_attribute_int64 (GFileInfo *info,
798 const char *attribute,
800 void g_file_info_set_attribute_object (GFileInfo *info,
801 const char *attribute,
802 GObject *attr_value);
804 void g_file_info_clear_status (GFileInfo *info);
806 /* Helper getters: */
807 GFileType g_file_info_get_file_type (GFileInfo *info);
808 gboolean g_file_info_get_is_hidden (GFileInfo *info);
809 gboolean g_file_info_get_is_backup (GFileInfo *info);
810 gboolean g_file_info_get_is_symlink (GFileInfo *info);
811 const char * g_file_info_get_name (GFileInfo *info);
812 const char * g_file_info_get_display_name (GFileInfo *info);
813 const char * g_file_info_get_edit_name (GFileInfo *info);
814 GIcon * g_file_info_get_icon (GFileInfo *info);
815 const char * g_file_info_get_content_type (GFileInfo *info);
816 goffset g_file_info_get_size (GFileInfo *info);
817 void g_file_info_get_modification_time (GFileInfo *info,
819 const char * g_file_info_get_symlink_target (GFileInfo *info);
820 const char * g_file_info_get_etag (GFileInfo *info);
821 gint32 g_file_info_get_sort_order (GFileInfo *info);
823 void g_file_info_set_attribute_mask (GFileInfo *info,
824 GFileAttributeMatcher *mask);
825 void g_file_info_unset_attribute_mask (GFileInfo *info);
827 /* Helper setters: */
828 void g_file_info_set_file_type (GFileInfo *info,
830 void g_file_info_set_is_hidden (GFileInfo *info,
832 void g_file_info_set_is_symlink (GFileInfo *info,
833 gboolean is_symlink);
834 void g_file_info_set_name (GFileInfo *info,
836 void g_file_info_set_display_name (GFileInfo *info,
837 const char *display_name);
838 void g_file_info_set_edit_name (GFileInfo *info,
839 const char *edit_name);
840 void g_file_info_set_icon (GFileInfo *info,
842 void g_file_info_set_content_type (GFileInfo *info,
843 const char *content_type);
844 void g_file_info_set_size (GFileInfo *info,
846 void g_file_info_set_modification_time (GFileInfo *info,
848 void g_file_info_set_symlink_target (GFileInfo *info,
849 const char *symlink_target);
850 void g_file_info_set_sort_order (GFileInfo *info,
853 GFileAttributeMatcher *g_file_attribute_matcher_new (const char *attributes);
854 GFileAttributeMatcher *g_file_attribute_matcher_ref (GFileAttributeMatcher *matcher);
855 void g_file_attribute_matcher_unref (GFileAttributeMatcher *matcher);
856 gboolean g_file_attribute_matcher_matches (GFileAttributeMatcher *matcher,
857 const char *attribute);
858 gboolean g_file_attribute_matcher_matches_only (GFileAttributeMatcher *matcher,
859 const char *attribute);
860 gboolean g_file_attribute_matcher_enumerate_namespace (GFileAttributeMatcher *matcher,
862 const char * g_file_attribute_matcher_enumerate_next (GFileAttributeMatcher *matcher);
867 #endif /* __G_FILE_INFO_H__ */