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