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  * File attributes in GIO consist of a list of key-value pairs.
70  *
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  *
77  * The list of possible attributes for a filesystem (pointed to by a GFile) is
78  * available as a GFileAttributeInfoList. This list is queryable by key names
79  * as indicated earlier.
80  *
81  * Information is stored within the list in GFileAttributeInfo structures.
82  * The info structure can store different types, listed in the enum
83  * GFileAttributeType. Upon creation of a GFileAttributeInfo, the type will
84  * be set to G_FILE_ATTRIBUTE_TYPE_INVALID.
85  *
86  * Classes that implement GFileIface will create a GFileAttributeInfoList and
87  * install default keys and values for their given file system, architecture,
88  * and other possible implementation details (e.g., on a UNIX system, a file
89  * attribute key will be registered for the user id for a given file).
90  *
91  * Table 1. GFileAttributes Default Namespaces
92  *
93  * Namspace
94  * Description
95  *
96  * "standard"
97  * The "Standard" namespace. General file
98  * information that any application may need should be put in this namespace.
99  * Examples include the file's name, type, and size.
100  *
101  * "etag"
102  * The "Entity Tag"
103  * namespace. Currently, the only key in this namespace is "value", which contains
104  * the value of the current entity tag.
105  *
106  * "id"
107  * The "Identification" namespace. This
108  * namespace is used by file managers and applications that list directories
109  * to check for loops and to uniquely identify files.
110  *
111  * "access"
112  * The "Access" namespace. Used to check
113  * if a user has the proper privilidges to access files and perform
114  * file operations. Keys in this namespace are made to be generic
115  * and easily understood, e.g. the "can_read" key is TRUE if
116  * the current user has permission to read the file. UNIX permissions and
117  * NTFS ACLs in Windows should be mapped to these values.
118  *
119  * "mountable"
120  * The "Mountable" namespace. Includes
121  * simple boolean keys for checking if a file or path supports mount operations, e.g.
122  * mount, unmount, eject. These are used for files of type G_FILE_TYPE_MOUNTABLE.
123  *
124  * "time"
125  * The "Time" namespace. Includes file
126  * access, changed, created times.
127  *
128  * "unix"
129  * The "Unix" namespace. Includes UNIX-specific
130  * information and may not be available for all files. Examples include
131  * the UNIX "UID", "GID", etc.
132  *
133  * "dos"
134  * The "DOS" namespace. Includes DOS-specific
135  * information and may not be available for all files. Examples include
136  * "is_system" for checking if a file is marked as a system file, and "is_archive"
137  * for checking if a file is marked as an archive file.
138  *
139  * "owner"
140  * The "Owner" namespace. Includes information
141  * about who owns a file. May not be available for all file systems. Examples include
142  * "user" for getting the user name of the file owner. This information is often mapped from
143  * some backend specific data such as a unix UID.
144  *
145  * "thumbnail"
146  * The "Thumbnail" namespace. Includes
147  * information about file thumbnails and their location within the file system. Examples of
148  * keys in this namespace include "path" to get the location of a thumbnail, and "failed"
149  * to check if thumbnailing of the file failed.
150  *
151  * "filesystem"
152  * The "Filesystem" namespace. Gets information
153  * about the file system where a file is located, such as its type, how much
154  * space is left available, and the overall size of the file system.
155  *
156  * "gvfs"
157  * The "GVFS" namespace. Keys in this namespace
158  * contain information about the current GVFS backend in use.
159  *
160  * "xattr"
161  * The "xattr" namespace. Gets information
162  * about extended user attributes. See attr(5). The "user." prefix of the
163  * extended user attribute name is stripped away when constructing keys in
164  * this namespace, e.g. "xattr::mime_type" for the extended attribute with
165  * the name "user.mime_type". Note that this information is only available
166  * if GLib has been built with extended attribute support.
167  *
168  * "xattr-sys"
169  * The "xattr-sys" namespace.
170  * Gets information about extended attributes which are not user-specific.
171  * See attr(5). Note that this information is only available if GLib
172  * has been built with extended attribute support.
173  *
174  * "selinux"
175  * The "SELinux" namespace. Includes
176  * information about the SELinux context of files. Note that this information
177  * is only available if GLib has been built with SELinux support.
178  *
179  * Please note that these are not all of the possible namespaces.
180  * More namespaces can be added from GIO modules or by individual applications.
181  * For more information about writing GIO modules, see GIOModule.
182  *
183  * Table 2. GFileAttributes Built-in Keys and Value Types
184  *
185  * Enum Value
186  * Namespace::Key
187  * Value Type
188  *
189  * G_FILE_ATTRIBUTE_STANDARD_TYPE
190  * standard::type
191  * uint32 (GFileType)
192  *
193  * G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN
194  * standard::is-hidden
195  * boolean
196  *
197  * G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP
198  * standard::is-backup
199  * boolean
200  *
201  * G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK
202  * standard::is-symlink
203  * boolean
204  *
205  * G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL
206  * standard::is-virtual
207  * boolean
208  *
209  * G_FILE_ATTRIBUTE_STANDARD_NAME
210  * standard::name
211  * byte string
212  *
213  * G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME
214  * standard::display-name
215  * string
216  *
217  * G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME
218  * standard::edit-name
219  * string
220  *
221  * G_FILE_ATTRIBUTE_STANDARD_ICON
222  * standard::icon
223  * object (GIcon)
224  *
225  * G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE
226  * standard::content-type
227  * string
228  *
229  * G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE
230  * standard::fast-content-type
231  * string
232  *
233  * G_FILE_ATTRIBUTE_STANDARD_SIZE
234  * standard::size
235  * uint64
236  *
237  * G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE
238  * standard::allocated-size
239  * uint64
240  *
241  * G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET
242  * standard::symlink-target
243  * byte string
244  *
245  * G_FILE_ATTRIBUTE_STANDARD_TARGET_URI
246  * standard::target-uri
247  * string
248  *
249  * G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER
250  * standard::sort-order
251  * int32
252  *
253  * G_FILE_ATTRIBUTE_ETAG_VALUE
254  * etag::value
255  * string
256  *
257  * G_FILE_ATTRIBUTE_ID_FILE
258  * id::file
259  * string
260  *
261  * G_FILE_ATTRIBUTE_ID_FILESYSTEM
262  * id::filesystem
263  * string
264  *
265  * G_FILE_ATTRIBUTE_ACCESS_CAN_READ
266  * access::can-read
267  * boolean
268  *
269  * G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE
270  * access::can-write
271  * boolean
272  *
273  * G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE
274  * access::can-execute
275  * boolean
276  *
277  * G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE
278  * access::can-delete
279  * boolean
280  *
281  * G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH
282  * access::can-trash
283  * boolean
284  *
285  * G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME
286  * access::can-rename
287  * boolean
288  *
289  * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT
290  * mountable::can-mount
291  * boolean
292  *
293  * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT
294  * mountable::can-unmount
295  * boolean
296  *
297  * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT
298  * mountable::can-eject
299  * boolean
300  *
301  * G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE
302  * mountable::unix-device
303  * uint32
304  *
305  * G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE
306  * mountable::unix-device-file
307  * string
308  *
309  * G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI
310  * mountable::hal-udi
311  * string
312  *
313  * G_FILE_ATTRIBUTE_TIME_MODIFIED
314  * time::modified
315  * uint64
316  *
317  * G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC
318  * time::modified-usec
319  * uint32
320  *
321  * G_FILE_ATTRIBUTE_TIME_ACCESS
322  * time::access
323  * uint64
324  *
325  * G_FILE_ATTRIBUTE_TIME_ACCESS_USEC
326  * time::access-usec
327  * uint32
328  *
329  * G_FILE_ATTRIBUTE_TIME_CHANGED
330  * time::changed
331  * uint64
332  *
333  * G_FILE_ATTRIBUTE_TIME_CHANGED_USEC
334  * time::changed-usec
335  * uint32
336  *
337  * G_FILE_ATTRIBUTE_TIME_CREATED
338  * time::created
339  * uint64
340  *
341  * G_FILE_ATTRIBUTE_TIME_CREATED_USEC
342  * time::created-usec
343  * uint32
344  *
345  * G_FILE_ATTRIBUTE_UNIX_DEVICE
346  * unix::device
347  * uint32
348  *
349  * G_FILE_ATTRIBUTE_UNIX_INODE
350  * unix::inode
351  * uint64
352  *
353  * G_FILE_ATTRIBUTE_UNIX_MODE
354  * unix::mode
355  * uint32
356  *
357  * G_FILE_ATTRIBUTE_UNIX_NLINK
358  * unix::nlink
359  * uint32
360  *
361  * G_FILE_ATTRIBUTE_UNIX_UID
362  * unix::uid
363  * uint32
364  *
365  * G_FILE_ATTRIBUTE_UNIX_GID
366  * unix::gid
367  * uint32
368  *
369  * G_FILE_ATTRIBUTE_UNIX_RDEV
370  * unix::rdev
371  * uint32
372  *
373  * G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE
374  * unix::block-size
375  * uint32
376  *
377  * G_FILE_ATTRIBUTE_UNIX_BLOCKS
378  * unix::blocks
379  * uint64
380  *
381  * G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT
382  * unix::is-mountpoint
383  * boolean
384  *
385  * G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE
386  * dos::is-archive
387  * boolean
388  *
389  * G_FILE_ATTRIBUTE_DOS_IS_SYSTEM
390  * dos::is-system
391  * boolean
392  *
393  * G_FILE_ATTRIBUTE_OWNER_USER
394  * owner::user
395  * string
396  *
397  * G_FILE_ATTRIBUTE_OWNER_USER_REAL
398  * owner::user-real
399  * string
400  *
401  * G_FILE_ATTRIBUTE_OWNER_GROUP
402  * owner::group
403  * string
404  *
405  * G_FILE_ATTRIBUTE_THUMBNAIL_PATH
406  * thumbnail::path
407  * bytestring
408  *
409  * G_FILE_ATTRIBUTE_THUMBNAILING_FAILED
410  * thumbnail::failed
411  * boolean
412  *
413  * G_FILE_ATTRIBUTE_PREVIEW_ICON
414  * preview::icon
415  * object (GIcon)
416  *
417  * G_FILE_ATTRIBUTE_FILESYSTEM_SIZE
418  * filesystem::size
419  * uint64
420  *
421  * G_FILE_ATTRIBUTE_FILESYSTEM_FREE
422  * filesystem::free
423  * uint64
424  *
425  * G_FILE_ATTRIBUTE_FILESYSTEM_USED
426  * filesystem::used
427  * uint64
428  *
429  * G_FILE_ATTRIBUTE_FILESYSTEM_TYPE
430  * filesystem::type
431  * string
432  *
433  * G_FILE_ATTRIBUTE_FILESYSTEM_READONLY
434  * filesystem::readonly
435  * boolean
436  *
437  * G_FILE_ATTRIBUTE_GVFS_BACKEND
438  * gvfs::backend
439  * string
440  *
441  * G_FILE_ATTRIBUTE_SELINUX_CONTEXT
442  * selinux::context
443  * string
444  *
445  * Note that there are no predefined keys in the "xattr" and "xattr-sys"
446  * namespaces. Keys for the "xattr" namespace are constructed by stripping
447  * away the "user." prefix from the extended user attribute, and prepending
448  * "xattr::". Keys for the "xattr-sys" namespace are constructed by
449  * concatenating "xattr-sys::" with the extended attribute name. All extended
450  * attribute values are returned as hex-encoded strings in which bytes outside
451  * the ASCII range are encoded as hexadecimal escape sequences of the form
452  * \xnn.
453  */
454 public class FileAttributeInfoList
455 {
456 	
457 	/** the main Gtk struct */
458 	protected GFileAttributeInfoList* gFileAttributeInfoList;
459 	
460 	
461 	public GFileAttributeInfoList* getFileAttributeInfoListStruct()
462 	{
463 		return gFileAttributeInfoList;
464 	}
465 	
466 	
467 	/** the main Gtk struct as a void* */
468 	protected void* getStruct()
469 	{
470 		return cast(void*)gFileAttributeInfoList;
471 	}
472 	
473 	/**
474 	 * Sets our main struct and passes it to the parent class
475 	 */
476 	public this (GFileAttributeInfoList* gFileAttributeInfoList)
477 	{
478 		this.gFileAttributeInfoList = gFileAttributeInfoList;
479 	}
480 	
481 	/**
482 	 */
483 	
484 	/**
485 	 * Creates a new file attribute info list.
486 	 * Throws: ConstructionException GTK+ fails to create the object.
487 	 */
488 	public this ()
489 	{
490 		// GFileAttributeInfoList * g_file_attribute_info_list_new (void);
491 		auto p = g_file_attribute_info_list_new();
492 		if(p is null)
493 		{
494 			throw new ConstructionException("null returned by g_file_attribute_info_list_new()");
495 		}
496 		this(cast(GFileAttributeInfoList*) p);
497 	}
498 	
499 	/**
500 	 * References a file attribute info list.
501 	 * Returns: GFileAttributeInfoList or NULL on error.
502 	 */
503 	public FileAttributeInfoList doref()
504 	{
505 		// GFileAttributeInfoList * g_file_attribute_info_list_ref (GFileAttributeInfoList *list);
506 		auto p = g_file_attribute_info_list_ref(gFileAttributeInfoList);
507 		
508 		if(p is null)
509 		{
510 			return null;
511 		}
512 		
513 		return ObjectG.getDObject!(FileAttributeInfoList)(cast(GFileAttributeInfoList*) p);
514 	}
515 	
516 	/**
517 	 * Removes a reference from the given list. If the reference count
518 	 * falls to zero, the list is deleted.
519 	 */
520 	public void unref()
521 	{
522 		// void g_file_attribute_info_list_unref (GFileAttributeInfoList *list);
523 		g_file_attribute_info_list_unref(gFileAttributeInfoList);
524 	}
525 	
526 	/**
527 	 * Makes a duplicate of a file attribute info list.
528 	 * Returns: a copy of the given list.
529 	 */
530 	public FileAttributeInfoList dup()
531 	{
532 		// GFileAttributeInfoList * g_file_attribute_info_list_dup (GFileAttributeInfoList *list);
533 		auto p = g_file_attribute_info_list_dup(gFileAttributeInfoList);
534 		
535 		if(p is null)
536 		{
537 			return null;
538 		}
539 		
540 		return ObjectG.getDObject!(FileAttributeInfoList)(cast(GFileAttributeInfoList*) p);
541 	}
542 	
543 	/**
544 	 * Gets the file attribute with the name name from list.
545 	 * Params:
546 	 * name = the name of the attribute to lookup.
547 	 * Returns: a GFileAttributeInfo for the name, or NULL if an attribute isn't found.
548 	 */
549 	public GFileAttributeInfo* lookup(string name)
550 	{
551 		// const GFileAttributeInfo * g_file_attribute_info_list_lookup  (GFileAttributeInfoList *list,  const char *name);
552 		return g_file_attribute_info_list_lookup(gFileAttributeInfoList, Str.toStringz(name));
553 	}
554 	
555 	/**
556 	 * Adds a new attribute with name to the list, setting
557 	 * its type and flags.
558 	 * Params:
559 	 * name = the name of the attribute to add.
560 	 * type = the GFileAttributeType for the attribute.
561 	 * flags = GFileAttributeInfoFlags for the attribute.
562 	 */
563 	public void add(string name, GFileAttributeType type, GFileAttributeInfoFlags flags)
564 	{
565 		// void g_file_attribute_info_list_add (GFileAttributeInfoList *list,  const char *name,  GFileAttributeType type,  GFileAttributeInfoFlags flags);
566 		g_file_attribute_info_list_add(gFileAttributeInfoList, Str.toStringz(name), type, flags);
567 	}
568 }