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