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