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