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  = GtkSourceCompletionProvider.html
27  * outPack = gsv
28  * outFile = SourceCompletionProviderT
29  * strct   = GtkSourceCompletionProvider
30  * realStrct=
31  * ctorStrct=
32  * clss    = SourceCompletionProviderT
33  * interf  = SourceCompletionProviderIF
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * 	- TStruct
38  * extend  = 
39  * implements:
40  * prefixes:
41  * 	- gtk_source_completion_proposal_
42  * omit structs:
43  * omit prefixes:
44  * omit code:
45  * omit signals:
46  * imports:
47  * 	- glib.Str
48  * 	- gdk.Pixbuf
49  * 	- gtk.TextIter
50  * 	- gtk.Widget
51  * 	- gsv.SourceCompletionContext
52  * 	- gsv.SourceCompletionInfo
53  * 	- gsv.SourceCompletionProposalIF
54  * structWrap:
55  * 	- GdkPixbuf* -> Pixbuf
56  * 	- GtkSourceCompletionContext* -> SourceCompletionContext
57  * 	- GtkSourceCompletionInfo* -> SourceCompletionInfo
58  * 	- GtkSourceCompletionProposal* -> SourceCompletionProposalIF
59  * 	- GtkTextIter* -> TextIter
60  * 	- GtkWidget* -> Widget
61  * module aliases:
62  * local aliases:
63  * overrides:
64  */
65 
66 module gsv.SourceCompletionProviderT;
67 
68 public  import gsvc.gsvtypes;
69 
70 public import gsvc.gsv;
71 public import glib.ConstructionException;
72 public import gobject.ObjectG;
73 
74 
75 public import glib.Str;
76 public import gdk.Pixbuf;
77 public import gtk.TextIter;
78 public import gtk.Widget;
79 public import gsv.SourceCompletionContext;
80 public import gsv.SourceCompletionInfo;
81 public import gsv.SourceCompletionProposalIF;
82 
83 
84 
85 
86 /**
87  * Description
88  * You must implement this interface to provide proposals to GtkSourceCompletion
89  */
90 public template SourceCompletionProviderT(TStruct)
91 {
92 	
93 	/** the main Gtk struct */
94 	protected GtkSourceCompletionProvider* gtkSourceCompletionProvider;
95 	
96 	
97 	public GtkSourceCompletionProvider* getSourceCompletionProviderTStruct()
98 	{
99 		return cast(GtkSourceCompletionProvider*)getStruct();
100 	}
101 	
102 	
103 	/**
104 	 */
105 	
106 	/**
107 	 * Get the name of the provider. This should be a translatable name for
108 	 * display to the user. For example: _("Document word completion provider"). The
109 	 * returned string must be freed with g_free().
110 	 * Returns: A new string containing the name of the provider.
111 	 */
112 	public string gtkSourceCompletionProviderGetName()
113 	{
114 		// gchar * gtk_source_completion_provider_get_name  (GtkSourceCompletionProvider *provider);
115 		return Str.toString(gtk_source_completion_provider_get_name(getSourceCompletionProviderTStruct()));
116 	}
117 	
118 	/**
119 	 * Get the icon of the provider.
120 	 * Returns: The icon to be used for the provider, or NULL if the provider does not have a special icon.
121 	 */
122 	public Pixbuf gtkSourceCompletionProviderGetIcon()
123 	{
124 		// GdkPixbuf * gtk_source_completion_provider_get_icon  (GtkSourceCompletionProvider *provider);
125 		auto p = gtk_source_completion_provider_get_icon(getSourceCompletionProviderTStruct());
126 		
127 		if(p is null)
128 		{
129 			return null;
130 		}
131 		
132 		return ObjectG.getDObject!(Pixbuf)(cast(GdkPixbuf*) p);
133 	}
134 	
135 	/**
136 	 * Populate context with proposals from provider
137 	 * Params:
138 	 * context = The GtkSourceCompletionContext
139 	 */
140 	public void gtkSourceCompletionProviderPopulate(SourceCompletionContext context)
141 	{
142 		// void gtk_source_completion_provider_populate  (GtkSourceCompletionProvider *provider,  GtkSourceCompletionContext *context);
143 		gtk_source_completion_provider_populate(getSourceCompletionProviderTStruct(), (context is null) ? null : context.getSourceCompletionContextStruct());
144 	}
145 	
146 	/**
147 	 */
148 	public GtkSourceCompletionActivation gtkSourceCompletionProviderGetActivation()
149 	{
150 		// GtkSourceCompletionActivation gtk_source_completion_provider_get_activation  (GtkSourceCompletionProvider *provider);
151 		return gtk_source_completion_provider_get_activation(getSourceCompletionProviderTStruct());
152 	}
153 	
154 	/**
155 	 * Get whether the provider match the context of completion detailed in
156 	 * context.
157 	 * Params:
158 	 * context = The GtkSourceCompletionContext
159 	 * Returns: TRUE if provider matches the completion context, FALSE otherwise
160 	 */
161 	public int gtkSourceCompletionProviderMatch(SourceCompletionContext context)
162 	{
163 		// gboolean gtk_source_completion_provider_match  (GtkSourceCompletionProvider *provider,  GtkSourceCompletionContext *context);
164 		return gtk_source_completion_provider_match(getSourceCompletionProviderTStruct(), (context is null) ? null : context.getSourceCompletionContextStruct());
165 	}
166 	
167 	/**
168 	 * Get a customized info widget to show extra information of a proposal.
169 	 * This allows for customized widgets on a proposal basis, although in general
170 	 * providers will have the same custom widget for all their proposals and
171 	 * proposal can be ignored. The implementation of this function is optional.
172 	 * If implemented, gtk_source_completion_provider_update_info MUST also be
173 	 * implemented. If not implemented, the default
174 	 * gtk_source_completion_proposal_get_info will be used to display extra
175 	 * information about a GtkSourceCompletionProposal.
176 	 * Params:
177 	 * proposal = The currently selected GtkSourceCompletionProposal
178 	 * Returns: a custom GtkWidget to show extra information about proposal.
179 	 */
180 	public Widget gtkSourceCompletionProviderGetInfoWidget(SourceCompletionProposalIF proposal)
181 	{
182 		// GtkWidget * gtk_source_completion_provider_get_info_widget  (GtkSourceCompletionProvider *provider,  GtkSourceCompletionProposal *proposal);
183 		auto p = gtk_source_completion_provider_get_info_widget(getSourceCompletionProviderTStruct(), (proposal is null) ? null : proposal.getSourceCompletionProposalTStruct());
184 		
185 		if(p is null)
186 		{
187 			return null;
188 		}
189 		
190 		return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p);
191 	}
192 	
193 	/**
194 	 * Update extra information shown in info for proposal. This should be
195 	 * implemented if your provider sets a custom info widget for proposal.
196 	 * This function MUST be implemented when
197 	 * gtk_source_completion_provider_get_info_widget is implemented.
198 	 * Params:
199 	 * proposal = A GtkSourceCompletionProposal
200 	 * info = A GtkSourceCompletionInfo
201 	 */
202 	public void gtkSourceCompletionProviderUpdateInfo(SourceCompletionProposalIF proposal, SourceCompletionInfo info)
203 	{
204 		// void gtk_source_completion_provider_update_info  (GtkSourceCompletionProvider *provider,  GtkSourceCompletionProposal *proposal,  GtkSourceCompletionInfo *info);
205 		gtk_source_completion_provider_update_info(getSourceCompletionProviderTStruct(), (proposal is null) ? null : proposal.getSourceCompletionProposalTStruct(), (info is null) ? null : info.getSourceCompletionInfoStruct());
206 	}
207 	
208 	/**
209 	 * Get the GtkTextIter at which the completion for proposal starts. When
210 	 * implemented, the completion can use this information to position the
211 	 * completion window accordingly when a proposal is selected in the completion
212 	 * window.
213 	 * Params:
214 	 * context = A GtkSourceCompletionContext
215 	 * proposal = A GtkSourceCompletionProposal
216 	 * iter = A GtkTextIter
217 	 * Returns: TRUE if iter was set for proposal, FALSE otherwise
218 	 */
219 	public int gtkSourceCompletionProviderGetStartIter(SourceCompletionContext context, SourceCompletionProposalIF proposal, TextIter iter)
220 	{
221 		// gboolean gtk_source_completion_provider_get_start_iter  (GtkSourceCompletionProvider *provider,  GtkSourceCompletionContext *context,  GtkSourceCompletionProposal *proposal,  GtkTextIter *iter);
222 		return gtk_source_completion_provider_get_start_iter(getSourceCompletionProviderTStruct(), (context is null) ? null : context.getSourceCompletionContextStruct(), (proposal is null) ? null : proposal.getSourceCompletionProposalTStruct(), (iter is null) ? null : iter.getTextIterStruct());
223 	}
224 	
225 	/**
226 	 * Activate proposal at iter. When this functions returns FALSE, the default
227 	 * activation of proposal will take place which replaces the word at iter
228 	 * with the label of proposal.
229 	 * Params:
230 	 * proposal = A GtkSourceCompletionProposal
231 	 * iter = A GtkTextIter
232 	 * Returns: TRUE to indicate that the proposal activation has been handled, FALSE otherwise.
233 	 */
234 	public int gtkSourceCompletionProviderActivateProposal(SourceCompletionProposalIF proposal, TextIter iter)
235 	{
236 		// gboolean gtk_source_completion_provider_activate_proposal  (GtkSourceCompletionProvider *provider,  GtkSourceCompletionProposal *proposal,  GtkTextIter *iter);
237 		return gtk_source_completion_provider_activate_proposal(getSourceCompletionProviderTStruct(), (proposal is null) ? null : proposal.getSourceCompletionProposalTStruct(), (iter is null) ? null : iter.getTextIterStruct());
238 	}
239 	
240 	/**
241 	 */
242 	public int gtkSourceCompletionProviderGetInteractiveDelay()
243 	{
244 		// gint gtk_source_completion_provider_get_interactive_delay  (GtkSourceCompletionProvider *provider);
245 		return gtk_source_completion_provider_get_interactive_delay(getSourceCompletionProviderTStruct());
246 	}
247 	
248 	/**
249 	 */
250 	public int gtkSourceCompletionProviderGetPriority()
251 	{
252 		// gint gtk_source_completion_provider_get_priority  (GtkSourceCompletionProvider *provider);
253 		return gtk_source_completion_provider_get_priority(getSourceCompletionProviderTStruct());
254 	}
255 }