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  = GFileIcon.html
27  * outPack = gio
28  * outFile = FileIcon
29  * strct   = GFileIcon
30  * realStrct=
31  * ctorStrct=GIcon
32  * clss    = FileIcon
33  * interf  = 
34  * class Code: Yes
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * 	- IconIF
40  * 	- LoadableIconIF
41  * prefixes:
42  * 	- g_file_icon_
43  * omit structs:
44  * omit prefixes:
45  * omit code:
46  * omit signals:
47  * imports:
48  * 	- gio.IconT
49  * 	- gio.IconIF
50  * 	- gio.LoadableIconT
51  * 	- gio.LoadableIconIF
52  * structWrap:
53  * module aliases:
54  * local aliases:
55  * overrides:
56  */
57 
58 module gio.FileIcon;
59 
60 public  import gtkc.giotypes;
61 
62 private import gtkc.gio;
63 private import glib.ConstructionException;
64 private import gobject.ObjectG;
65 
66 
67 private import gio.IconT;
68 private import gio.IconIF;
69 private import gio.LoadableIconT;
70 private import gio.LoadableIconIF;
71 
72 
73 
74 private import gobject.ObjectG;
75 
76 /**
77  * Description
78  * GFileIcon specifies an icon by pointing to an image file
79  * to be used as icon.
80  */
81 public class FileIcon : ObjectG, IconIF, LoadableIconIF
82 {
83 	
84 	/** the main Gtk struct */
85 	protected GFileIcon* gFileIcon;
86 	
87 	
88 	public GFileIcon* getFileIconStruct()
89 	{
90 		return gFileIcon;
91 	}
92 	
93 	
94 	/** the main Gtk struct as a void* */
95 	protected override void* getStruct()
96 	{
97 		return cast(void*)gFileIcon;
98 	}
99 	
100 	/**
101 	 * Sets our main struct and passes it to the parent class
102 	 */
103 	public this (GFileIcon* gFileIcon)
104 	{
105 		super(cast(GObject*)gFileIcon);
106 		this.gFileIcon = gFileIcon;
107 	}
108 	
109 	protected override void setStruct(GObject* obj)
110 	{
111 		super.setStruct(obj);
112 		gFileIcon = cast(GFileIcon*)obj;
113 	}
114 	
115 	// add the Icon capabilities
116 	mixin IconT!(GFileIcon);
117 	
118 	// add the LoadableIcon capabilities
119 	mixin LoadableIconT!(GFileIcon);
120 	
121 	/**
122 	 */
123 	
124 	/**
125 	 * Creates a new icon for a file.
126 	 * Params:
127 	 * file = a GFile.
128 	 * Throws: ConstructionException GTK+ fails to create the object.
129 	 */
130 	public this (GFile* file)
131 	{
132 		// GIcon * g_file_icon_new (GFile *file);
133 		auto p = g_file_icon_new(file);
134 		if(p is null)
135 		{
136 			throw new ConstructionException("null returned by g_file_icon_new(file)");
137 		}
138 		this(cast(GFileIcon*) p);
139 	}
140 	
141 	/**
142 	 * Gets the GFile associated with the given icon.
143 	 * Returns: a GFile, or NULL. [transfer none]
144 	 */
145 	public GFile* getFile()
146 	{
147 		// GFile * g_file_icon_get_file (GFileIcon *icon);
148 		return g_file_icon_get_file(gFileIcon);
149 	}
150 }