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  = GtkSourceCompletionWords.html
27  * outPack = gsv
28  * outFile = SourceCompletionWords
29  * strct   = GtkSourceCompletionWords
30  * realStrct=
31  * ctorStrct=
32  * clss    = SourceCompletionWords
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_source_completion_words_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- glib.Str
47  * 	- gdk.Pixbuf
48  * 	- gtk.TextBuffer
49  * structWrap:
50  * 	- GdkPixbuf* -> Pixbuf
51  * 	- GtkTextBuffer* -> TextBuffer
52  * module aliases:
53  * local aliases:
54  * overrides:
55  */
56 
57 module gsv.SourceCompletionWords;
58 
59 public  import gsvc.gsvtypes;
60 
61 private import gsvc.gsv;
62 private import glib.ConstructionException;
63 private import gobject.ObjectG;
64 
65 
66 private import glib.Str;
67 private import gdk.Pixbuf;
68 private import gtk.TextBuffer;
69 
70 
71 
72 private import gobject.ObjectG;
73 
74 /**
75  * The GtkSourceCompletionWords is an example of an implementation of
76  * the GtkSourceCompletionProvider interface. The proposals are words
77  * appearing in the registered GtkTextBuffers.
78  */
79 public class SourceCompletionWords : ObjectG
80 {
81 	
82 	/** the main Gtk struct */
83 	protected GtkSourceCompletionWords* gtkSourceCompletionWords;
84 	
85 	
86 	public GtkSourceCompletionWords* getSourceCompletionWordsStruct()
87 	{
88 		return gtkSourceCompletionWords;
89 	}
90 	
91 	
92 	/** the main Gtk struct as a void* */
93 	protected override void* getStruct()
94 	{
95 		return cast(void*)gtkSourceCompletionWords;
96 	}
97 	
98 	/**
99 	 * Sets our main struct and passes it to the parent class
100 	 */
101 	public this (GtkSourceCompletionWords* gtkSourceCompletionWords)
102 	{
103 		super(cast(GObject*)gtkSourceCompletionWords);
104 		this.gtkSourceCompletionWords = gtkSourceCompletionWords;
105 	}
106 	
107 	protected override void setStruct(GObject* obj)
108 	{
109 		super.setStruct(obj);
110 		gtkSourceCompletionWords = cast(GtkSourceCompletionWords*)obj;
111 	}
112 	
113 	/**
114 	 */
115 	
116 	/**
117 	 * Params:
118 	 * name = The name for the provider. [allow-none]
119 	 * icon = A specific icon for the provider. [allow-none]
120 	 * Throws: ConstructionException GTK+ fails to create the object.
121 	 */
122 	public this (string name, Pixbuf icon)
123 	{
124 		// GtkSourceCompletionWords * gtk_source_completion_words_new  (const gchar *name,  GdkPixbuf *icon);
125 		auto p = gtk_source_completion_words_new(Str.toStringz(name), (icon is null) ? null : icon.getPixbufStruct());
126 		if(p is null)
127 		{
128 			throw new ConstructionException("null returned by gtk_source_completion_words_new(Str.toStringz(name), (icon is null) ? null : icon.getPixbufStruct())");
129 		}
130 		this(cast(GtkSourceCompletionWords*) p);
131 	}
132 	
133 	/**
134 	 * Registers buffer in the words provider.
135 	 * Params:
136 	 * buffer = a GtkTextBuffer
137 	 */
138 	public void register(TextBuffer buffer)
139 	{
140 		// void gtk_source_completion_words_register  (GtkSourceCompletionWords *words,  GtkTextBuffer *buffer);
141 		gtk_source_completion_words_register(gtkSourceCompletionWords, (buffer is null) ? null : buffer.getTextBufferStruct());
142 	}
143 	
144 	/**
145 	 * Unregisters buffer from the words provider.
146 	 * Params:
147 	 * buffer = a GtkTextBuffer
148 	 */
149 	public void unregister(TextBuffer buffer)
150 	{
151 		// void gtk_source_completion_words_unregister  (GtkSourceCompletionWords *words,  GtkTextBuffer *buffer);
152 		gtk_source_completion_words_unregister(gtkSourceCompletionWords, (buffer is null) ? null : buffer.getTextBufferStruct());
153 	}
154 }