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