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  * 	- gtk_source_completion_item_new
46  * 	- gtk_source_completion_item_new_with_markup
47  * omit signals:
48  * imports:
49  * 	- glib.Str
50  * 	- gdk.Pixbuf
51  * 	- gsv.SourceCompletionProposalIF
52  * 	- gsv.SourceCompletionProposalT
53  * structWrap:
54  * 	- GdkPixbuf* -> Pixbuf
55  * module aliases:
56  * local aliases:
57  * overrides:
58  */
59 
60 module gsv.SourceCompletionItem;
61 
62 public  import gsvc.gsvtypes;
63 
64 private import gsvc.gsv;
65 private import glib.ConstructionException;
66 private import gobject.ObjectG;
67 
68 
69 private import glib.Str;
70 private import gdk.Pixbuf;
71 private import gsv.SourceCompletionProposalIF;
72 private import gsv.SourceCompletionProposalT;
73 
74 
75 
76 private import gobject.ObjectG;
77 
78 /**
79  * The GtkSourceCompletionItem class is a simple implementation of the
80  * GtkSourceCompletionProposal interface.
81  */
82 public class SourceCompletionItem : ObjectG, SourceCompletionProposalIF
83 {
84 	
85 	/** the main Gtk struct */
86 	protected GtkSourceCompletionItem* gtkSourceCompletionItem;
87 	
88 	
89 	public GtkSourceCompletionItem* getSourceCompletionItemStruct()
90 	{
91 		return gtkSourceCompletionItem;
92 	}
93 	
94 	
95 	/** the main Gtk struct as a void* */
96 	protected override void* getStruct()
97 	{
98 		return cast(void*)gtkSourceCompletionItem;
99 	}
100 	
101 	/**
102 	 * Sets our main struct and passes it to the parent class
103 	 */
104 	public this (GtkSourceCompletionItem* gtkSourceCompletionItem)
105 	{
106 		super(cast(GObject*)gtkSourceCompletionItem);
107 		this.gtkSourceCompletionItem = gtkSourceCompletionItem;
108 	}
109 	
110 	protected override void setStruct(GObject* obj)
111 	{
112 		super.setStruct(obj);
113 		gtkSourceCompletionItem = cast(GtkSourceCompletionItem*)obj;
114 	}
115 	
116 	// add the SourceCompletionProposal capabilities
117 	mixin SourceCompletionProposalT!(GtkSourceCompletionItem);
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. [allow-none]
127 	 * info = The item extra information. [allow-none]
128 	 * markup = If true label will be treated as markup. using gtk_source_completion_item_new_with_markup.
129 	 * Throws: ConstructionException GTK+ fails to create the object.
130 	 */
131 	public this (string label, string text, Pixbuf icon, string info, bool markup = false)
132 	{
133 		GtkSourceCompletionItem* p;
134 		
135 		if ( markup )
136 		{
137 			// GtkSourceCompletionItem * gtk_source_completion_item_new_with_markup  (const gchar *markup,  const gchar *text,  GdkPixbuf *icon,  const gchar *info);
138 			p = gtk_source_completion_item_new_with_markup(Str.toStringz(label), Str.toStringz(text), (icon is null) ? null : icon.getPixbufStruct(), Str.toStringz(info));
139 		}
140 		else
141 		{
142 			// GtkSourceCompletionItem * gtk_source_completion_item_new  (const gchar *label,  const gchar *text,  GdkPixbuf *icon,  const gchar *info);
143 			p = gtk_source_completion_item_new(Str.toStringz(label), Str.toStringz(text), (icon is null) ? null : icon.getPixbufStruct(), Str.toStringz(info));
144 			
145 		}
146 		
147 		if(p is null)
148 		{
149 			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))");
150 		}
151 		this(cast(GtkSourceCompletionItem*) p);
152 	}
153 	
154 	/**
155 	 */
156 	
157 	/**
158 	 * Warning
159 	 * gtk_source_completion_item_new_from_stock has been deprecated since version 3.10 and should not be used in newly-written code. Use gtk_source_completion_item_new() instead.
160 	 * Creates a new GtkSourceCompletionItem from a stock item. If label is NULL,
161 	 * the stock label will be used.
162 	 * Params:
163 	 * label = The item label. [allow-none]
164 	 * text = The item text.
165 	 * stock = The stock icon.
166 	 * info = The item extra information. [allow-none]
167 	 * Throws: ConstructionException GTK+ fails to create the object.
168 	 */
169 	public this (string label, string text, string stock, string info)
170 	{
171 		// GtkSourceCompletionItem * gtk_source_completion_item_new_from_stock  (const gchar *label,  const gchar *text,  const gchar *stock,  const gchar *info);
172 		auto p = gtk_source_completion_item_new_from_stock(Str.toStringz(label), Str.toStringz(text), Str.toStringz(stock), Str.toStringz(info));
173 		if(p is null)
174 		{
175 			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))");
176 		}
177 		this(cast(GtkSourceCompletionItem*) p);
178 	}
179 }