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