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 module gsv.SourceCompletionItem;
26 
27 private import gdkpixbuf.Pixbuf;
28 private import gio.IconIF;
29 private import glib.ConstructionException;
30 private import glib.Str;
31 private import gobject.ObjectG;
32 private import gsv.SourceCompletionProposalIF;
33 private import gsv.SourceCompletionProposalT;
34 private import gsv.c.functions;
35 public  import gsv.c.types;
36 public  import gsvc.gsvtypes;
37 
38 
39 /** */
40 public class SourceCompletionItem : ObjectG, SourceCompletionProposalIF
41 {
42 	/** the main Gtk struct */
43 	protected GtkSourceCompletionItem* gtkSourceCompletionItem;
44 
45 	/** Get the main Gtk struct */
46 	public GtkSourceCompletionItem* getSourceCompletionItemStruct(bool transferOwnership = false)
47 	{
48 		if (transferOwnership)
49 			ownedRef = false;
50 		return gtkSourceCompletionItem;
51 	}
52 
53 	/** the main Gtk struct as a void* */
54 	protected override void* getStruct()
55 	{
56 		return cast(void*)gtkSourceCompletionItem;
57 	}
58 
59 	/**
60 	 * Sets our main struct and passes it to the parent class.
61 	 */
62 	public this (GtkSourceCompletionItem* gtkSourceCompletionItem, bool ownedRef = false)
63 	{
64 		this.gtkSourceCompletionItem = gtkSourceCompletionItem;
65 		super(cast(GObject*)gtkSourceCompletionItem, ownedRef);
66 	}
67 
68 	// add the SourceCompletionProposal capabilities
69 	mixin SourceCompletionProposalT!(GtkSourceCompletionItem);
70 
71 
72 	/** */
73 	public static GType getType()
74 	{
75 		return gtk_source_completion_item_get_type();
76 	}
77 
78 	/**
79 	 * Creates a new #GtkSourceCompletionItem. The desired properties need to be set
80 	 * afterwards.
81 	 *
82 	 * Returns: a new #GtkSourceCompletionItem.
83 	 *
84 	 * Since: 4.0
85 	 *
86 	 * Throws: ConstructionException GTK+ fails to create the object.
87 	 */
88 	public this()
89 	{
90 		auto p = gtk_source_completion_item_new();
91 
92 		if(p is null)
93 		{
94 			throw new ConstructionException("null returned by new");
95 		}
96 
97 		this(cast(GtkSourceCompletionItem*) p, true);
98 	}
99 
100 	/** */
101 	public void setGicon(IconIF gicon)
102 	{
103 		gtk_source_completion_item_set_gicon(gtkSourceCompletionItem, (gicon is null) ? null : gicon.getIconStruct());
104 	}
105 
106 	/** */
107 	public void setIcon(Pixbuf icon)
108 	{
109 		gtk_source_completion_item_set_icon(gtkSourceCompletionItem, (icon is null) ? null : icon.getPixbufStruct());
110 	}
111 
112 	/** */
113 	public void setIconName(string iconName)
114 	{
115 		gtk_source_completion_item_set_icon_name(gtkSourceCompletionItem, Str.toStringz(iconName));
116 	}
117 
118 	/** */
119 	public void setInfo(string info)
120 	{
121 		gtk_source_completion_item_set_info(gtkSourceCompletionItem, Str.toStringz(info));
122 	}
123 
124 	/** */
125 	public void setLabel(string label)
126 	{
127 		gtk_source_completion_item_set_label(gtkSourceCompletionItem, Str.toStringz(label));
128 	}
129 
130 	/** */
131 	public void setMarkup(string markup)
132 	{
133 		gtk_source_completion_item_set_markup(gtkSourceCompletionItem, Str.toStringz(markup));
134 	}
135 
136 	/** */
137 	public void setText(string text)
138 	{
139 		gtk_source_completion_item_set_text(gtkSourceCompletionItem, Str.toStringz(text));
140 	}
141 }