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