1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD 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
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19  
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 /*
25  * Conversion parameters:
26  * inFile  = gio-GFileAttribute.html
27  * outPack = gio
28  * outFile = FileAttributeInfoList
29  * strct   = GFileAttributeInfoList
30  * realStrct=
31  * ctorStrct=
32  * clss    = FileAttributeInfoList
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- g_file_attribute_info_list_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- glib.Str
47  * structWrap:
48  * 	- GFileAttributeInfoList* -> FileAttributeInfoList
49  * module aliases:
50  * local aliases:
51  * overrides:
52  */
53 
54 module gio.FileAttributeInfoList;
55 
56 public  import gtkc.giotypes;
57 
58 private import gtkc.gio;
59 private import glib.ConstructionException;
60 private import gobject.ObjectG;
61 
62 
63 private import glib.Str;
64 
65 
66 
67 
68 /**
69  * Description
70  * File attributes in GIO consist of a list of key-value pairs.
71  * Keys are strings that contain a key namespace and a key name, separated
72  * by a colon, e.g. "namespace:keyname". Namespaces are included to sort
73  * key-value pairs by namespaces for relevance. Keys can be retrived
74  * using wildcards, e.g. "standard::*" will return all of the keys in the
75  * "standard" namespace.
76  * Values are stored within the list in GFileAttributeValue structures.
77  * Values can store different types, listed in the enum GFileAttributeType.
78  * Upon creation of a GFileAttributeValue, the type will be set to
79  * G_FILE_ATTRIBUTE_TYPE_INVALID.
80  * The list of possible attributes for a filesystem (pointed to by a GFile) is
81  * availible as a GFileAttributeInfoList. This list is queryable by key names
82  * as indicated earlier.
83  * Classes that implement GFileIface will create a GFileAttributeInfoList and
84  * install default keys and values for their given file system, architecture,
85  * and other possible implementation details (e.g., on a UNIX system, a file
86  * attribute key will be registered for the user id for a given file).
87  * Table 1. GFileAttributes Default Namespaces
88  * Namspace
89  * Description
90  * "standard"
91  * The "Standard" namespace. General file
92  * information that any application may need should be put in this namespace.
93  * Examples include the file's name, type, and size.
94  * "etag"
95  * The "Entity Tag"
96  * namespace. Currently, the only key in this namespace is "value", which contains
97  * the value of the current entity tag.
98  * "id"
99  * The "Identification" namespace. This
100  * namespace is used by file managers and applications that list directories
101  * to check for loops and to uniquely identify files.
102  * "access"
103  * The "Access" namespace. Used to check
104  * if a user has the proper privilidges to access files and perform
105  * file operations. Keys in this namespace are made to be generic
106  * and easily understood, e.g. the "can_read" key is TRUE if
107  * the current user has permission to read the file. UNIX permissions and
108  * NTFS ACLs in Windows should be mapped to these values.
109  * "mountable"
110  * The "Mountable" namespace. Includes
111  * simple boolean keys for checking if a file or path supports mount operations, e.g.
112  * mount, unmount, eject. These are used for files of type G_FILE_TYPE_MOUNTABLE.
113  * "time"
114  * The "Time" namespace. Includes file
115  * access, changed, created times.
116  * "unix"
117  * The "Unix" namespace. Includes UNIX-specific
118  * information and may not be available for all files. Examples include
119  * the UNIX "UID", "GID", etc.
120  * "dos"
121  * The "DOS" namespace. Includes DOS-specific
122  * information and may not be available for all files. Examples include
123  * "is_system" for checking if a file is marked as a system file, and "is_archive"
124  * for checking if a file is marked as an archive file.
125  * "owner"
126  * The "Owner" namespace. Includes information
127  * about who owns a file. May not be available for all file systems. Examples include
128  * "user" for getting the user name of the file owner. This information is often mapped from
129  * some backend specific data such as a unix UID.
130  * "thumbnail"
131  * The "Thumbnail" namespace. Includes
132  * information about file thumbnails and their location within the file system. Exaples of
133  * keys in this namespace include "path" to get the location of a thumbnail, and "failed"
134  * to check if thumbnailing of the file failed.
135  * "filesystem"
136  * The "Filesystem" namespace. Gets information
137  * about the file system where a file is located, such as its type, how much
138  * space is left available, and the overall size of the file system.
139  * "gvfs"
140  * The "GVFS" namespace. Keys in this namespace
141  * contain information about the current GVFS backend in use.
142  * "xattr"
143  * The "xattr" namespace. Gets information
144  * about extended user attributes. See attr(5). The "user." prefix of the
145  * extended user attribute name is stripped away when constructing keys in
146  * this namespace, e.g. "xattr::mime_type" for the extended attribute with
147  * the name "user.mime_type". Note that this information is only available
148  * if GLib has been built with extended attribute support.
149  * "xattr-sys"
150  * The "xattr-sys" namespace.
151  * Gets information about extended attributes which are not user-specific.
152  * See attr(5). Note that this information is only available if GLib
153  * has been built with extended attribute support.
154  * "selinux"
155  * The "SELinux" namespace. Includes
156  * information about the SELinux context of files. Note that this information
157  * is only available if GLib has been built with SELinux support.
158  * Please note that these are not all of the possible namespaces.
159  * More namespaces can be added from GIO modules or by individual applications.
160  * For more information about writing GIO modules, see GIOModule.
161  * Table 2. GFileAttributes Built-in Keys and Value Types
162  * Enum Value
163  * Namespace:Key
164  * Value Type
165  * G_FILE_ATTRIBUTE_STANDARD_TYPE
166  * standard::type
167  * uint32 (GFileType)
168  * G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN
169  * standard::is-hidden
170  * boolean
171  * G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP
172  * standard::is-backup
173  * boolean
174  * G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK
175  * standard::is-symlink
176  * boolean
177  * G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL
178  * standard::is-virtual
179  * boolean
180  * G_FILE_ATTRIBUTE_STANDARD_NAME
181  * standard::name
182  * byte string
183  * G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME
184  * standard::display-name
185  * string
186  * G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME
187  * standard::edit-name
188  * string
189  * G_FILE_ATTRIBUTE_STANDARD_ICON
190  * standard::icon
191  * object (GIcon)
192  * G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE
193  * standard::content-type
194  * string
195  * G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE
196  * standard::fast-content-type
197  * string
198  * G_FILE_ATTRIBUTE_STANDARD_SIZE
199  * standard::size
200  * uint64
201  * G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE
202  * standard::allocated-size
203  * uint64
204  * G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET
205  * standard::symlink-target
206  * byte string
207  * G_FILE_ATTRIBUTE_STANDARD_TARGET_URI
208  * standard::target-uri
209  * string
210  * G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER
211  * standard::sort-order
212  * int32
213  * G_FILE_ATTRIBUTE_ETAG_VALUE
214  * etag::value
215  * string
216  * G_FILE_ATTRIBUTE_ID_FILE
217  * id::file
218  * string
219  * G_FILE_ATTRIBUTE_ID_FILESYSTEM
220  * id::filesystem
221  * string
222  * G_FILE_ATTRIBUTE_ACCESS_CAN_READ
223  * access::can-read
224  * boolean
225  * G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE
226  * access::can-write
227  * boolean
228  * G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE
229  * access::can-execute
230  * boolean
231  * G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE
232  * access::can-delete
233  * boolean
234  * G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH
235  * access::can-trash
236  * boolean
237  * G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME
238  * access::can-rename
239  * boolean
240  * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT
241  * mountable::can-mount
242  * boolean
243  * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT
244  * mountable::can-unmount
245  * boolean
246  * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT
247  * mountable::can-eject
248  * boolean
249  * G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE
250  * mountable::unix-device
251  * uint32
252  * G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE
253  * mountable::unix-device-file
254  * string
255  * G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI
256  * mountable::hal-udi
257  * string
258  * G_FILE_ATTRIBUTE_TIME_MODIFIED
259  * time::modified
260  * uint64
261  * G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC
262  * time::modified-usec
263  * uint32
264  * G_FILE_ATTRIBUTE_TIME_ACCESS
265  * time::access
266  * uint64
267  * G_FILE_ATTRIBUTE_TIME_ACCESS_USEC
268  * time::access-usec
269  * uint32
270  * G_FILE_ATTRIBUTE_TIME_CHANGED
271  * time::changed
272  * uint64
273  * G_FILE_ATTRIBUTE_TIME_CHANGED_USEC
274  * time::changed-usec
275  * uint32
276  * G_FILE_ATTRIBUTE_TIME_CREATED
277  * time::created
278  * uint64
279  * G_FILE_ATTRIBUTE_TIME_CREATED_USEC
280  * time::created-usec
281  * uint32
282  * G_FILE_ATTRIBUTE_UNIX_DEVICE
283  * unix::device
284  * uint32
285  * G_FILE_ATTRIBUTE_UNIX_INODE
286  * unix::inode
287  * uint64
288  * G_FILE_ATTRIBUTE_UNIX_MODE
289  * unix::mode
290  * uint32
291  * G_FILE_ATTRIBUTE_UNIX_NLINK
292  * unix::nlink
293  * uint32
294  * G_FILE_ATTRIBUTE_UNIX_UID
295  * unix::uid
296  * uint32
297  * G_FILE_ATTRIBUTE_UNIX_GID
298  * unix::gid
299  * uint32
300  * G_FILE_ATTRIBUTE_UNIX_RDEV
301  * unix::rdev
302  * uint32
303  * G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE
304  * unix::block-size
305  * uint32
306  * G_FILE_ATTRIBUTE_UNIX_BLOCKS
307  * unix::blocks
308  * uint64
309  * G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT
310  * unix::is-mountpoint
311  * boolean
312  * G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE
313  * dos::is-archive
314  * boolean
315  * G_FILE_ATTRIBUTE_DOS_IS_SYSTEM
316  * dos::is-system
317  * boolean
318  * G_FILE_ATTRIBUTE_OWNER_USER
319  * owner::user
320  * string
321  * G_FILE_ATTRIBUTE_OWNER_USER_REAL
322  * owner::user-real
323  * string
324  * G_FILE_ATTRIBUTE_OWNER_GROUP
325  * owner::group
326  * string
327  * G_FILE_ATTRIBUTE_THUMBNAIL_PATH
328  * thumbnail::path
329  * bytestring
330  * G_FILE_ATTRIBUTE_THUMBNAILING_FAILED
331  * thumbnail::failed
332  * boolean
333  * G_FILE_ATTRIBUTE_PREVIEW_ICON
334  * preview::icon
335  * object (GIcon)
336  * G_FILE_ATTRIBUTE_FILESYSTEM_SIZE
337  * filesystem::size
338  * uint64
339  * G_FILE_ATTRIBUTE_FILESYSTEM_FREE
340  * filesystem::free
341  * uint64
342  * G_FILE_ATTRIBUTE_FILESYSTEM_TYPE
343  * filesystem::type
344  * string
345  * G_FILE_ATTRIBUTE_FILESYSTEM_READONLY
346  * filesystem::readonly
347  * boolean
348  * G_FILE_ATTRIBUTE_GVFS_BACKEND
349  * gvfs::backend
350  * string
351  * G_FILE_ATTRIBUTE_SELINUX_CONTEXT
352  * selinux::context
353  * string
354  * Note that there are no predefined keys in the "xattr" and "xattr-sys"
355  * namespaces. Keys for the "xattr" namespace are constructed by stripping
356  * away the "user." prefix from the extended user attribute, and prepending
357  * "xattr::". Keys for the "xattr-sys" namespace are constructed by
358  * concatenating "xattr-sys::" with the extended attribute name. All extended
359  * attribute values are returned as hex-encoded strings in which bytes outside
360  * the ASCII range are encoded as hexadecimal escape sequences of the form
361  * \xnn.
362  */
363 public class FileAttributeInfoList
364 {
365 	
366 	/** the main Gtk struct */
367 	protected GFileAttributeInfoList* gFileAttributeInfoList;
368 	
369 	
370 	public GFileAttributeInfoList* getFileAttributeInfoListStruct()
371 	{
372 		return gFileAttributeInfoList;
373 	}
374 	
375 	
376 	/** the main Gtk struct as a void* */
377 	protected void* getStruct()
378 	{
379 		return cast(void*)gFileAttributeInfoList;
380 	}
381 	
382 	/**
383 	 * Sets our main struct and passes it to the parent class
384 	 */
385 	public this (GFileAttributeInfoList* gFileAttributeInfoList)
386 	{
387 		this.gFileAttributeInfoList = gFileAttributeInfoList;
388 	}
389 	
390 	/**
391 	 */
392 	
393 	/**
394 	 * Creates a new file attribute info list.
395 	 * Throws: ConstructionException GTK+ fails to create the object.
396 	 */
397 	public this ()
398 	{
399 		// GFileAttributeInfoList * g_file_attribute_info_list_new  (void);
400 		auto p = g_file_attribute_info_list_new();
401 		if(p is null)
402 		{
403 			throw new ConstructionException("null returned by g_file_attribute_info_list_new()");
404 		}
405 		this(cast(GFileAttributeInfoList*) p);
406 	}
407 	
408 	/**
409 	 * References a file attribute info list.
410 	 * Returns: GFileAttributeInfoList or NULL on error.
411 	 */
412 	public FileAttributeInfoList doref()
413 	{
414 		// GFileAttributeInfoList * g_file_attribute_info_list_ref  (GFileAttributeInfoList *list);
415 		auto p = g_file_attribute_info_list_ref(gFileAttributeInfoList);
416 		
417 		if(p is null)
418 		{
419 			return null;
420 		}
421 		
422 		return ObjectG.getDObject!(FileAttributeInfoList)(cast(GFileAttributeInfoList*) p);
423 	}
424 	
425 	/**
426 	 * Removes a reference from the given list. If the reference count
427 	 * falls to zero, the list is deleted.
428 	 */
429 	public void unref()
430 	{
431 		// void g_file_attribute_info_list_unref (GFileAttributeInfoList *list);
432 		g_file_attribute_info_list_unref(gFileAttributeInfoList);
433 	}
434 	
435 	/**
436 	 * Makes a duplicate of a file attribute info list.
437 	 * Returns: a copy of the given list.
438 	 */
439 	public FileAttributeInfoList dup()
440 	{
441 		// GFileAttributeInfoList * g_file_attribute_info_list_dup  (GFileAttributeInfoList *list);
442 		auto p = g_file_attribute_info_list_dup(gFileAttributeInfoList);
443 		
444 		if(p is null)
445 		{
446 			return null;
447 		}
448 		
449 		return ObjectG.getDObject!(FileAttributeInfoList)(cast(GFileAttributeInfoList*) p);
450 	}
451 	
452 	/**
453 	 * Gets the file attribute with the name name from list.
454 	 * Params:
455 	 * name = the name of the attribute to lookup.
456 	 * Returns: a GFileAttributeInfo for the name, or NULL if an attribute isn't found.
457 	 */
458 	public GFileAttributeInfo* lookup(string name)
459 	{
460 		// const GFileAttributeInfo * g_file_attribute_info_list_lookup  (GFileAttributeInfoList *list,  const char *name);
461 		return g_file_attribute_info_list_lookup(gFileAttributeInfoList, Str.toStringz(name));
462 	}
463 	
464 	/**
465 	 * Adds a new attribute with name to the list, setting
466 	 * its type and flags.
467 	 * Params:
468 	 * name = the name of the attribute to add.
469 	 * type = the GFileAttributeType for the attribute.
470 	 * flags = GFileAttributeInfoFlags for the attribute.
471 	 */
472 	public void add(string name, GFileAttributeType type, GFileAttributeInfoFlags flags)
473 	{
474 		// void g_file_attribute_info_list_add (GFileAttributeInfoList *list,  const char *name,  GFileAttributeType type,  GFileAttributeInfoFlags flags);
475 		g_file_attribute_info_list_add(gFileAttributeInfoList, Str.toStringz(name), type, flags);
476 	}
477 }