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 = SourceCompletionProviderIF
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  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_source_completion_proposal_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- glib.Str
47  * 	- gdk.Pixbuf
48  * 	- gsv.SourceCompletionContext
49  * 	- gsv.SourceCompletionInfo
50  * 	- gsv.SourceCompletionProposalIF
51  * 	- gtk.TextIter
52  * 	- gtk.Widget
53  * structWrap:
54  * 	- GdkPixbuf* -> Pixbuf
55  * 	- GtkSourceCompletionContext* -> SourceCompletionContext
56  * 	- GtkSourceCompletionInfo* -> SourceCompletionInfo
57  * 	- GtkSourceCompletionProposal* -> SourceCompletionProposalIF
58  * 	- GtkTextIter* -> TextIter
59  * 	- GtkWidget* -> Widget
60  * module aliases:
61  * local aliases:
62  * overrides:
63  */
64 
65 module gsv.SourceCompletionProviderIF;
66 
67 public  import gsvc.gsvtypes;
68 
69 private import gsvc.gsv;
70 private import glib.ConstructionException;
71 private import gobject.ObjectG;
72 
73 
74 private import glib.Str;
75 private import gdk.Pixbuf;
76 private import gsv.SourceCompletionContext;
77 private import gsv.SourceCompletionInfo;
78 private import gsv.SourceCompletionProposalIF;
79 private import gtk.TextIter;
80 private import gtk.Widget;
81 
82 
83 
84 
85 /**
86  * You must implement this interface to provide proposals to GtkSourceCompletion
87  */
88 public interface SourceCompletionProviderIF
89 {
90 	
91 	
92 	public GtkSourceCompletionProvider* getSourceCompletionProviderTStruct();
93 	
94 	/** the main Gtk struct as a void* */
95 	protected void* getStruct();
96 	
97 	
98 	/**
99 	 */
100 	
101 	/**
102 	 * Get the name of the provider. This should be a translatable name for
103 	 * display to the user. For example: _("Document word completion provider"). The
104 	 * returned string must be freed with g_free().
105 	 * Returns: a new string containing the name of the provider.
106 	 */
107 	public string gtkSourceCompletionProviderGetName();
108 	
109 	/**
110 	 * Get the icon of the provider.
111 	 * Returns: The icon to be used for the provider, or NULL if the provider does not have a special icon. [transfer none]
112 	 */
113 	public Pixbuf gtkSourceCompletionProviderGetIcon();
114 	
115 	/**
116 	 * Populate context with proposals from provider added with the
117 	 * gtk_source_completion_context_add_proposals() function.
118 	 * Params:
119 	 * context = a GtkSourceCompletionContext.
120 	 */
121 	public void gtkSourceCompletionProviderPopulate(SourceCompletionContext context);
122 	
123 	/**
124 	 * Get with what kind of activation the provider should be activated.
125 	 * Returns: a combination of GtkSourceCompletionActivation.
126 	 */
127 	public GtkSourceCompletionActivation gtkSourceCompletionProviderGetActivation();
128 	
129 	/**
130 	 * Get whether the provider match the context of completion detailed in
131 	 * context.
132 	 * Params:
133 	 * context = a GtkSourceCompletionContext.
134 	 * Returns: TRUE if provider matches the completion context, FALSE otherwise.
135 	 */
136 	public int gtkSourceCompletionProviderMatch(SourceCompletionContext context);
137 	
138 	/**
139 	 * Get a customized info widget to show extra information of a proposal.
140 	 * This allows for customized widgets on a proposal basis, although in general
141 	 * providers will have the same custom widget for all their proposals and
142 	 * proposal can be ignored. The implementation of this function is optional.
143 	 * If this function is not implemented, the default widget is a GtkLabel. The
144 	 * return value of gtk_source_completion_proposal_get_info() is used as the
145 	 * content of the GtkLabel.
146 	 * Note
147 	 *  If implemented, gtk_source_completion_provider_update_info()
148 	 *  must also be implemented.
149 	 * Params:
150 	 * proposal = a currently selected GtkSourceCompletionProposal.
151 	 * Returns: a custom GtkWidget to show extra information about proposal. [transfer none]
152 	 */
153 	public Widget gtkSourceCompletionProviderGetInfoWidget(SourceCompletionProposalIF proposal);
154 	
155 	/**
156 	 * Update extra information shown in info for proposal.
157 	 * Note
158 	 *  This function must be implemented when
159 	 *  gtk_source_completion_provider_get_info_widget() is implemented.
160 	 * Params:
161 	 * proposal = a GtkSourceCompletionProposal.
162 	 * info = a GtkSourceCompletionInfo.
163 	 */
164 	public void gtkSourceCompletionProviderUpdateInfo(SourceCompletionProposalIF proposal, SourceCompletionInfo info);
165 	
166 	/**
167 	 * Get the GtkTextIter at which the completion for proposal starts. When
168 	 * implemented, this information is used to position the completion window
169 	 * accordingly when a proposal is selected in the completion window. The
170 	 * proposal text inside the completion window is aligned on iter.
171 	 * If this function is not implemented, the word boundary is taken to position
172 	 * the completion window. See gtk_source_completion_provider_activate_proposal()
173 	 * for an explanation on the word boundaries.
174 	 * When the proposal is activated, the default handler uses iter as the start
175 	 * of the word to replace. See
176 	 * gtk_source_completion_provider_activate_proposal() for more information.
177 	 * Params:
178 	 * context = a GtkSourceCompletionContext.
179 	 * proposal = a GtkSourceCompletionProposal.
180 	 * iter = a GtkTextIter.
181 	 * Returns: TRUE if iter was set for proposal, FALSE otherwise.
182 	 */
183 	public int gtkSourceCompletionProviderGetStartIter(SourceCompletionContext context, SourceCompletionProposalIF proposal, TextIter iter);
184 	
185 	/**
186 	 * Activate proposal at iter. When this functions returns FALSE, the default
187 	 * activation of proposal will take place which replaces the word at iter
188 	 * with the text of proposal (see gtk_source_completion_proposal_get_text()).
189 	 * Here is how the default activation selects the boundaries of the word to
190 	 * replace. The end of the word is iter. For the start of the word, it depends
191 	 * on whether a start iter is defined for proposal (see
192 	 * gtk_source_completion_provider_get_start_iter()). If a start iter is defined,
193 	 * the start of the word is the start iter. Else, the word (as long as possible)
194 	 * will contain only alphanumerical and the "_" characters.
195 	 * Params:
196 	 * proposal = a GtkSourceCompletionProposal.
197 	 * iter = a GtkTextIter.
198 	 * Returns: TRUE to indicate that the proposal activation has been handled, FALSE otherwise.
199 	 */
200 	public int gtkSourceCompletionProviderActivateProposal(SourceCompletionProposalIF proposal, TextIter iter);
201 	
202 	/**
203 	 * Get the delay in milliseconds before starting interactive completion for
204 	 * this provider. A value of -1 indicates to use the default value as set
205 	 * by the "auto-complete-delay" property.
206 	 * Returns: the interactive delay in milliseconds.
207 	 */
208 	public int gtkSourceCompletionProviderGetInteractiveDelay();
209 	
210 	/**
211 	 * Get the provider priority. The priority determines the order in which
212 	 * proposals appear in the completion popup. Higher priorities are sorted
213 	 * before lower priorities. The default priority is 0.
214 	 * Returns: the provider priority.
215 	 */
216 	public int gtkSourceCompletionProviderGetPriority();
217 }