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  = GtkSourceCompletionItem.html
27  * outPack = gsv
28  * outFile = SourceCompletionItem
29  * strct   = GtkSourceCompletionItem
30  * realStrct=
31  * ctorStrct=
32  * clss    = SourceCompletionItem
33  * interf  = 
34  * class Code: Yes
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * 	- SourceCompletionProposalIF
40  * prefixes:
41  * 	- gtk_source_completion_item_
42  * omit structs:
43  * omit prefixes:
44  * omit code:
45  * omit signals:
46  * imports:
47  * 	- glib.Str
48  * 	- gdk.Pixbuf
49  * 	- gsv.SourceCompletionProposalIF
50  * 	- gsv.SourceCompletionProposalT
51  * structWrap:
52  * 	- GdkPixbuf* -> Pixbuf
53  * module aliases:
54  * local aliases:
55  * overrides:
56  */
57 
58 module gsv.SourceCompletionItem;
59 
60 public  import gsvc.gsvtypes;
61 
62 private import gsvc.gsv;
63 private import glib.ConstructionException;
64 private import gobject.ObjectG;
65 
66 
67 private import glib.Str;
68 private import gdk.Pixbuf;
69 private import gsv.SourceCompletionProposalIF;
70 private import gsv.SourceCompletionProposalT;
71 
72 
73 
74 private import gobject.ObjectG;
75 
76 /**
77  * Description
78  */
79 public class SourceCompletionItem : ObjectG, SourceCompletionProposalIF
80 {
81 	
82 	/** the main Gtk struct */
83 	protected GtkSourceCompletionItem* gtkSourceCompletionItem;
84 	
85 	
86 	public GtkSourceCompletionItem* getSourceCompletionItemStruct()
87 	{
88 		return gtkSourceCompletionItem;
89 	}
90 	
91 	
92 	/** the main Gtk struct as a void* */
93 	protected override void* getStruct()
94 	{
95 		return cast(void*)gtkSourceCompletionItem;
96 	}
97 	
98 	/**
99 	 * Sets our main struct and passes it to the parent class
100 	 */
101 	public this (GtkSourceCompletionItem* gtkSourceCompletionItem)
102 	{
103 		super(cast(GObject*)gtkSourceCompletionItem);
104 		this.gtkSourceCompletionItem = gtkSourceCompletionItem;
105 	}
106 	
107 	protected override void setStruct(GObject* obj)
108 	{
109 		super.setStruct(obj);
110 		gtkSourceCompletionItem = cast(GtkSourceCompletionItem*)obj;
111 	}
112 	
113 	// add the SourceCompletionProposal capabilities
114 	mixin SourceCompletionProposalT!(GtkSourceCompletionItem);
115 	
116 	/**
117 	 */
118 	
119 	/**
120 	 * Create a new GtkSourceCompletionItem with label label, icon icon and
121 	 * extra information info. Both icon and info can be NULL in which case
122 	 * there will be no icon shown and no extra information available.
123 	 * Params:
124 	 * label = The item label
125 	 * text = The item text
126 	 * icon = The item icon
127 	 * info = The item extra information
128 	 * Throws: ConstructionException GTK+ fails to create the object.
129 	 */
130 	public this (string label, string text, Pixbuf icon, string info)
131 	{
132 		// GtkSourceCompletionItem * gtk_source_completion_item_new  (const gchar *label,  const gchar *text,  GdkPixbuf *icon,  const gchar *info);
133 		auto p = gtk_source_completion_item_new(Str.toStringz(label), Str.toStringz(text), (icon is null) ? null : icon.getPixbufStruct(), Str.toStringz(info));
134 		if(p is null)
135 		{
136 			throw new ConstructionException("null returned by gtk_source_completion_item_new(Str.toStringz(label), Str.toStringz(text), (icon is null) ? null : icon.getPixbufStruct(), Str.toStringz(info))");
137 		}
138 		this(cast(GtkSourceCompletionItem*) p);
139 	}
140 	
141 	/**
142 	 * Creates a new GtkSourceCompletionItem from a stock item. If label is NULL,
143 	 * the stock label will be used.
144 	 * Params:
145 	 * label = The item label
146 	 * text = The item text
147 	 * stock = The stock icon
148 	 * info = The item extra information
149 	 * Throws: ConstructionException GTK+ fails to create the object.
150 	 */
151 	public this (string label, string text, string stock, string info)
152 	{
153 		// GtkSourceCompletionItem * gtk_source_completion_item_new_from_stock  (const gchar *label,  const gchar *text,  const gchar *stock,  const gchar *info);
154 		auto p = gtk_source_completion_item_new_from_stock(Str.toStringz(label), Str.toStringz(text), Str.toStringz(stock), Str.toStringz(info));
155 		if(p is null)
156 		{
157 			throw new ConstructionException("null returned by gtk_source_completion_item_new_from_stock(Str.toStringz(label), Str.toStringz(text), Str.toStringz(stock), Str.toStringz(info))");
158 		}
159 		this(cast(GtkSourceCompletionItem*) p);
160 	}
161 }