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 * Conversion parameters: 26 * inFile = GtkSourceCompletionProvider.html 27 * outPack = gsv 28 * outFile = SourceCompletionProviderT 29 * strct = GtkSourceCompletionProvider 30 * realStrct= 31 * ctorStrct= 32 * clss = SourceCompletionProviderT 33 * interf = SourceCompletionProviderIF 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * - TStruct 38 * extend = 39 * implements: 40 * prefixes: 41 * - gtk_source_completion_proposal_ 42 * omit structs: 43 * omit prefixes: 44 * omit code: 45 * omit signals: 46 * imports: 47 * - glib.Str 48 * - gdk.Pixbuf 49 * - gsv.SourceCompletionContext 50 * - gsv.SourceCompletionInfo 51 * - gsv.SourceCompletionProposalIF 52 * - gtk.TextIter 53 * - gtk.Widget 54 * structWrap: 55 * - GdkPixbuf* -> Pixbuf 56 * - GtkSourceCompletionContext* -> SourceCompletionContext 57 * - GtkSourceCompletionInfo* -> SourceCompletionInfo 58 * - GtkSourceCompletionProposal* -> SourceCompletionProposalIF 59 * - GtkTextIter* -> TextIter 60 * - GtkWidget* -> Widget 61 * module aliases: 62 * local aliases: 63 * overrides: 64 */ 65 66 module gsv.SourceCompletionProviderT; 67 68 public import gsvc.gsvtypes; 69 70 public import gsvc.gsv; 71 public import glib.ConstructionException; 72 public import gobject.ObjectG; 73 74 75 public import glib.Str; 76 public import gdk.Pixbuf; 77 public import gsv.SourceCompletionContext; 78 public import gsv.SourceCompletionInfo; 79 public import gsv.SourceCompletionProposalIF; 80 public import gtk.TextIter; 81 public import gtk.Widget; 82 83 84 85 86 /** 87 * You must implement this interface to provide proposals to GtkSourceCompletion 88 */ 89 public template SourceCompletionProviderT(TStruct) 90 { 91 92 /** the main Gtk struct */ 93 protected GtkSourceCompletionProvider* gtkSourceCompletionProvider; 94 95 96 public GtkSourceCompletionProvider* getSourceCompletionProviderTStruct() 97 { 98 return cast(GtkSourceCompletionProvider*)getStruct(); 99 } 100 101 102 /** 103 */ 104 105 /** 106 * Get the name of the provider. This should be a translatable name for 107 * display to the user. For example: _("Document word completion provider"). The 108 * returned string must be freed with g_free(). 109 * Returns: a new string containing the name of the provider. 110 */ 111 public string gtkSourceCompletionProviderGetName() 112 { 113 // gchar * gtk_source_completion_provider_get_name (GtkSourceCompletionProvider *provider); 114 return Str.toString(gtk_source_completion_provider_get_name(getSourceCompletionProviderTStruct())); 115 } 116 117 /** 118 * Get the icon of the provider. 119 * Returns: The icon to be used for the provider, or NULL if the provider does not have a special icon. [transfer none] 120 */ 121 public Pixbuf gtkSourceCompletionProviderGetIcon() 122 { 123 // GdkPixbuf * gtk_source_completion_provider_get_icon (GtkSourceCompletionProvider *provider); 124 auto p = gtk_source_completion_provider_get_icon(getSourceCompletionProviderTStruct()); 125 126 if(p is null) 127 { 128 return null; 129 } 130 131 return ObjectG.getDObject!(Pixbuf)(cast(GdkPixbuf*) p); 132 } 133 134 /** 135 * Populate context with proposals from provider added with the 136 * gtk_source_completion_context_add_proposals() function. 137 * Params: 138 * context = a GtkSourceCompletionContext. 139 */ 140 public void gtkSourceCompletionProviderPopulate(SourceCompletionContext context) 141 { 142 // void gtk_source_completion_provider_populate (GtkSourceCompletionProvider *provider, GtkSourceCompletionContext *context); 143 gtk_source_completion_provider_populate(getSourceCompletionProviderTStruct(), (context is null) ? null : context.getSourceCompletionContextStruct()); 144 } 145 146 /** 147 * Get with what kind of activation the provider should be activated. 148 * Returns: a combination of GtkSourceCompletionActivation. 149 */ 150 public GtkSourceCompletionActivation gtkSourceCompletionProviderGetActivation() 151 { 152 // GtkSourceCompletionActivation gtk_source_completion_provider_get_activation (GtkSourceCompletionProvider *provider); 153 return gtk_source_completion_provider_get_activation(getSourceCompletionProviderTStruct()); 154 } 155 156 /** 157 * Get whether the provider match the context of completion detailed in 158 * context. 159 * Params: 160 * context = a GtkSourceCompletionContext. 161 * Returns: TRUE if provider matches the completion context, FALSE otherwise. 162 */ 163 public int gtkSourceCompletionProviderMatch(SourceCompletionContext context) 164 { 165 // gboolean gtk_source_completion_provider_match (GtkSourceCompletionProvider *provider, GtkSourceCompletionContext *context); 166 return gtk_source_completion_provider_match(getSourceCompletionProviderTStruct(), (context is null) ? null : context.getSourceCompletionContextStruct()); 167 } 168 169 /** 170 * Get a customized info widget to show extra information of a proposal. 171 * This allows for customized widgets on a proposal basis, although in general 172 * providers will have the same custom widget for all their proposals and 173 * proposal can be ignored. The implementation of this function is optional. 174 * If this function is not implemented, the default widget is a GtkLabel. The 175 * return value of gtk_source_completion_proposal_get_info() is used as the 176 * content of the GtkLabel. 177 * Note 178 * If implemented, gtk_source_completion_provider_update_info() 179 * must also be implemented. 180 * Params: 181 * proposal = a currently selected GtkSourceCompletionProposal. 182 * Returns: a custom GtkWidget to show extra information about proposal. [transfer none] 183 */ 184 public Widget gtkSourceCompletionProviderGetInfoWidget(SourceCompletionProposalIF proposal) 185 { 186 // GtkWidget * gtk_source_completion_provider_get_info_widget (GtkSourceCompletionProvider *provider, GtkSourceCompletionProposal *proposal); 187 auto p = gtk_source_completion_provider_get_info_widget(getSourceCompletionProviderTStruct(), (proposal is null) ? null : proposal.getSourceCompletionProposalTStruct()); 188 189 if(p is null) 190 { 191 return null; 192 } 193 194 return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p); 195 } 196 197 /** 198 * Update extra information shown in info for proposal. 199 * Note 200 * This function must be implemented when 201 * gtk_source_completion_provider_get_info_widget() is implemented. 202 * Params: 203 * proposal = a GtkSourceCompletionProposal. 204 * info = a GtkSourceCompletionInfo. 205 */ 206 public void gtkSourceCompletionProviderUpdateInfo(SourceCompletionProposalIF proposal, SourceCompletionInfo info) 207 { 208 // void gtk_source_completion_provider_update_info (GtkSourceCompletionProvider *provider, GtkSourceCompletionProposal *proposal, GtkSourceCompletionInfo *info); 209 gtk_source_completion_provider_update_info(getSourceCompletionProviderTStruct(), (proposal is null) ? null : proposal.getSourceCompletionProposalTStruct(), (info is null) ? null : info.getSourceCompletionInfoStruct()); 210 } 211 212 /** 213 * Get the GtkTextIter at which the completion for proposal starts. When 214 * implemented, this information is used to position the completion window 215 * accordingly when a proposal is selected in the completion window. The 216 * proposal text inside the completion window is aligned on iter. 217 * If this function is not implemented, the word boundary is taken to position 218 * the completion window. See gtk_source_completion_provider_activate_proposal() 219 * for an explanation on the word boundaries. 220 * When the proposal is activated, the default handler uses iter as the start 221 * of the word to replace. See 222 * gtk_source_completion_provider_activate_proposal() for more information. 223 * Params: 224 * context = a GtkSourceCompletionContext. 225 * proposal = a GtkSourceCompletionProposal. 226 * iter = a GtkTextIter. 227 * Returns: TRUE if iter was set for proposal, FALSE otherwise. 228 */ 229 public int gtkSourceCompletionProviderGetStartIter(SourceCompletionContext context, SourceCompletionProposalIF proposal, TextIter iter) 230 { 231 // gboolean gtk_source_completion_provider_get_start_iter (GtkSourceCompletionProvider *provider, GtkSourceCompletionContext *context, GtkSourceCompletionProposal *proposal, GtkTextIter *iter); 232 return gtk_source_completion_provider_get_start_iter(getSourceCompletionProviderTStruct(), (context is null) ? null : context.getSourceCompletionContextStruct(), (proposal is null) ? null : proposal.getSourceCompletionProposalTStruct(), (iter is null) ? null : iter.getTextIterStruct()); 233 } 234 235 /** 236 * Activate proposal at iter. When this functions returns FALSE, the default 237 * activation of proposal will take place which replaces the word at iter 238 * with the text of proposal (see gtk_source_completion_proposal_get_text()). 239 * Here is how the default activation selects the boundaries of the word to 240 * replace. The end of the word is iter. For the start of the word, it depends 241 * on whether a start iter is defined for proposal (see 242 * gtk_source_completion_provider_get_start_iter()). If a start iter is defined, 243 * the start of the word is the start iter. Else, the word (as long as possible) 244 * will contain only alphanumerical and the "_" characters. 245 * Params: 246 * proposal = a GtkSourceCompletionProposal. 247 * iter = a GtkTextIter. 248 * Returns: TRUE to indicate that the proposal activation has been handled, FALSE otherwise. 249 */ 250 public int gtkSourceCompletionProviderActivateProposal(SourceCompletionProposalIF proposal, TextIter iter) 251 { 252 // gboolean gtk_source_completion_provider_activate_proposal (GtkSourceCompletionProvider *provider, GtkSourceCompletionProposal *proposal, GtkTextIter *iter); 253 return gtk_source_completion_provider_activate_proposal(getSourceCompletionProviderTStruct(), (proposal is null) ? null : proposal.getSourceCompletionProposalTStruct(), (iter is null) ? null : iter.getTextIterStruct()); 254 } 255 256 /** 257 * Get the delay in milliseconds before starting interactive completion for 258 * this provider. A value of -1 indicates to use the default value as set 259 * by the "auto-complete-delay" property. 260 * Returns: the interactive delay in milliseconds. 261 */ 262 public int gtkSourceCompletionProviderGetInteractiveDelay() 263 { 264 // gint gtk_source_completion_provider_get_interactive_delay (GtkSourceCompletionProvider *provider); 265 return gtk_source_completion_provider_get_interactive_delay(getSourceCompletionProviderTStruct()); 266 } 267 268 /** 269 * Get the provider priority. The priority determines the order in which 270 * proposals appear in the completion popup. Higher priorities are sorted 271 * before lower priorities. The default priority is 0. 272 * Returns: the provider priority. 273 */ 274 public int gtkSourceCompletionProviderGetPriority() 275 { 276 // gint gtk_source_completion_provider_get_priority (GtkSourceCompletionProvider *provider); 277 return gtk_source_completion_provider_get_priority(getSourceCompletionProviderTStruct()); 278 } 279 }