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_ATTRIBUTE_H__
28 #define __G_FILE_ATTRIBUTE_H__
30 #include <glib-object.h>
36 * @G_FILE_ATTRIBUTE_TYPE_INVALID: indicates an invalid or uninitalized type.
37 * @G_FILE_ATTRIBUTE_TYPE_STRING: a null terminated UTF8 string.
38 * @G_FILE_ATTRIBUTE_TYPE_BYTE_STRING: a zero terminated string of non-zero bytes.
39 * @G_FILE_ATTRIBUTE_TYPE_BOOLEAN: a boolean value.
40 * @G_FILE_ATTRIBUTE_TYPE_UINT32: an unsigned 4-byte/32-bit integer.
41 * @G_FILE_ATTRIBUTE_TYPE_INT32: a signed 4-byte/32-bit integer.
42 * @G_FILE_ATTRIBUTE_TYPE_UINT64: an unsigned 8-byte/64-bit integer.
43 * @G_FILE_ATTRIBUTE_TYPE_INT64: a signed 8-byte/64-bit integer.
44 * @G_FILE_ATTRIBUTE_TYPE_OBJECT: a #GObject.
46 * The data types for file attributes.
49 G_FILE_ATTRIBUTE_TYPE_INVALID = 0,
50 G_FILE_ATTRIBUTE_TYPE_STRING,
51 G_FILE_ATTRIBUTE_TYPE_BYTE_STRING, /* zero terminated string of non-zero bytes */
52 G_FILE_ATTRIBUTE_TYPE_BOOLEAN,
53 G_FILE_ATTRIBUTE_TYPE_UINT32,
54 G_FILE_ATTRIBUTE_TYPE_INT32,
55 G_FILE_ATTRIBUTE_TYPE_UINT64,
56 G_FILE_ATTRIBUTE_TYPE_INT64,
57 G_FILE_ATTRIBUTE_TYPE_OBJECT
61 * GFileAttributeInfoFlags:
62 * @G_FILE_ATTRIBUTE_INFO_NONE: no flags set.
63 * @G_FILE_ATTRIBUTE_INFO_COPY_WITH_FILE: copy the attribute values when the file is copied.
64 * @G_FILE_ATTRIBUTE_INFO_COPY_WHEN_MOVED: copy the attribute values when the file is moved.
66 * Flags specifying the behaviour of an attribute.
69 G_FILE_ATTRIBUTE_INFO_NONE = 0,
70 G_FILE_ATTRIBUTE_INFO_COPY_WITH_FILE = 1 << 0,
71 G_FILE_ATTRIBUTE_INFO_COPY_WHEN_MOVED = 1 << 1
72 } GFileAttributeInfoFlags;
75 * GFileAttributeStatus:
76 * @G_FILE_ATTRIBUTE_STATUS_UNSET: Attribute value is unset (empty).
77 * @G_FILE_ATTRIBUTE_STATUS_SET: Attribute value is set.
78 * @G_FILE_ATTRIBUTE_STATUS_ERROR_SETTING: Indicates an error in setting the value.
80 * Used by g_file_set_attributes_from_info() when setting file attributes.
83 G_FILE_ATTRIBUTE_STATUS_UNSET = 0,
84 G_FILE_ATTRIBUTE_STATUS_SET,
85 G_FILE_ATTRIBUTE_STATUS_ERROR_SETTING
86 } GFileAttributeStatus;
90 * @name: the name of the attribute.
91 * @type: the #GFileAttributeType type of the attribute.
92 * @flags: a set of #GFileAttributeInfoFlags.
94 * Information about a specific attribute.
98 GFileAttributeType type;
99 GFileAttributeInfoFlags flags;
100 } GFileAttributeInfo;
103 * GFileAttributeInfoList:
104 * @infos: an array of #GFileAttributeInfo<!-- -->s.
105 * @n_infos: the number of values in the array.
107 * Acts as a lightweight registry for possible valid file attributes.
108 * The registry stores Key-Value pair formats as #GFileAttributeInfo<!-- -->s.
111 GFileAttributeInfo *infos;
113 } GFileAttributeInfoList;
115 GFileAttributeInfoList * g_file_attribute_info_list_new (void);
116 GFileAttributeInfoList * g_file_attribute_info_list_ref (GFileAttributeInfoList *list);
117 void g_file_attribute_info_list_unref (GFileAttributeInfoList *list);
118 GFileAttributeInfoList * g_file_attribute_info_list_dup (GFileAttributeInfoList *list);
119 const GFileAttributeInfo *g_file_attribute_info_list_lookup (GFileAttributeInfoList *list,
121 void g_file_attribute_info_list_add (GFileAttributeInfoList *list,
123 GFileAttributeType type,
124 GFileAttributeInfoFlags flags);
129 #endif /* __G_FILE_INFO_H__ */