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  = GtkEntryCompletion.html
27  * outPack = gtk
28  * outFile = EntryCompletion
29  * strct   = GtkEntryCompletion
30  * realStrct=
31  * ctorStrct=
32  * clss    = EntryCompletion
33  * interf  = 
34  * class Code: Yes
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * 	- BuildableIF
40  * 	- CellLayoutIF
41  * prefixes:
42  * 	- gtk_entry_completion_
43  * omit structs:
44  * omit prefixes:
45  * omit code:
46  * omit signals:
47  * imports:
48  * 	- glib.Str
49  * 	- gtk.CellArea
50  * 	- gtk.TreeIter
51  * 	- gtk.TreeModel
52  * 	- gtk.TreeModelIF
53  * 	- gtk.Widget
54  * 	- gtk.BuildableIF
55  * 	- gtk.BuildableT
56  * 	- gtk.CellLayoutIF
57  * 	- gtk.CellLayoutT
58  * structWrap:
59  * 	- GtkCellArea* -> CellArea
60  * 	- GtkTreeIter* -> TreeIter
61  * 	- GtkTreeModel* -> TreeModelIF
62  * 	- GtkWidget* -> Widget
63  * module aliases:
64  * local aliases:
65  * overrides:
66  */
67 
68 module gtk.EntryCompletion;
69 
70 public  import gtkc.gtktypes;
71 
72 private import gtkc.gtk;
73 private import glib.ConstructionException;
74 private import gobject.ObjectG;
75 
76 private import gobject.Signals;
77 public  import gtkc.gdktypes;
78 
79 private import glib.Str;
80 private import gtk.CellArea;
81 private import gtk.TreeIter;
82 private import gtk.TreeModel;
83 private import gtk.TreeModelIF;
84 private import gtk.Widget;
85 private import gtk.BuildableIF;
86 private import gtk.BuildableT;
87 private import gtk.CellLayoutIF;
88 private import gtk.CellLayoutT;
89 
90 
91 
92 private import gobject.ObjectG;
93 
94 /**
95  * GtkEntryCompletion is an auxiliary object to be used in conjunction with
96  * GtkEntry to provide the completion functionality. It implements the
97  * GtkCellLayout interface, to allow the user to add extra cells to the
98  * GtkTreeView with completion matches.
99  *
100  * "Completion functionality" means that when the user modifies the text
101  * in the entry, GtkEntryCompletion checks which rows in the model match
102  * the current content of the entry, and displays a list of matches.
103  * By default, the matching is done by comparing the entry text
104  * case-insensitively against the text column of the model (see
105  * gtk_entry_completion_set_text_column()), but this can be overridden
106  * with a custom match function (see gtk_entry_completion_set_match_func()).
107  *
108  * When the user selects a completion, the content of the entry is
109  * updated. By default, the content of the entry is replaced by the
110  * text column of the model, but this can be overridden by connecting
111  * to the "match-selected" signal and updating the
112  * entry in the signal handler. Note that you should return TRUE from
113  * the signal handler to suppress the default behaviour.
114  *
115  * To add completion functionality to an entry, use gtk_entry_set_completion().
116  *
117  * In addition to regular completion matches, which will be inserted into the
118  * entry when they are selected, GtkEntryCompletion also allows to display
119  * "actions" in the popup window. Their appearance is similar to menuitems,
120  * to differentiate them clearly from completion strings. When an action is
121  * selected, the "action-activated" signal is emitted.
122  *
123  * GtkEntryCompletion uses a GtkTreeModelFilter model to represent the
124  * subset of the entire model that is currently matching. While the
125  * GtkEntryCompletion signals "match-selected" and
126  * "cursor-on-match" take the original model and an
127  * iter pointing to that model as arguments, other callbacks and signals
128  * (such as GtkCellLayoutDataFuncs or "apply-attributes")
129  * will generally take the filter model as argument. As long as you are
130  * only calling gtk_tree_model_get(), this will make no difference to
131  * you. If for some reason, you need the original model, use
132  * gtk_tree_model_filter_get_model(). Don't forget to use
133  * gtk_tree_model_filter_convert_iter_to_child_iter() to obtain a
134  * matching iter.
135  */
136 public class EntryCompletion : ObjectG, BuildableIF, CellLayoutIF
137 {
138 	
139 	/** the main Gtk struct */
140 	protected GtkEntryCompletion* gtkEntryCompletion;
141 	
142 	
143 	public GtkEntryCompletion* getEntryCompletionStruct()
144 	{
145 		return gtkEntryCompletion;
146 	}
147 	
148 	
149 	/** the main Gtk struct as a void* */
150 	protected override void* getStruct()
151 	{
152 		return cast(void*)gtkEntryCompletion;
153 	}
154 	
155 	/**
156 	 * Sets our main struct and passes it to the parent class
157 	 */
158 	public this (GtkEntryCompletion* gtkEntryCompletion)
159 	{
160 		super(cast(GObject*)gtkEntryCompletion);
161 		this.gtkEntryCompletion = gtkEntryCompletion;
162 	}
163 	
164 	protected override void setStruct(GObject* obj)
165 	{
166 		super.setStruct(obj);
167 		gtkEntryCompletion = cast(GtkEntryCompletion*)obj;
168 	}
169 	
170 	// add the Buildable capabilities
171 	mixin BuildableT!(GtkEntryCompletion);
172 	
173 	// add the CellLayout capabilities
174 	mixin CellLayoutT!(GtkEntryCompletion);
175 	
176 	/**
177 	 */
178 	int[string] connectedSignals;
179 	
180 	void delegate(gint, EntryCompletion)[] onActionActivatedListeners;
181 	/**
182 	 * Gets emitted when an action is activated.
183 	 * Since 2.4
184 	 */
185 	void addOnActionActivated(void delegate(gint, EntryCompletion) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
186 	{
187 		if ( !("action-activated" in connectedSignals) )
188 		{
189 			Signals.connectData(
190 			getStruct(),
191 			"action-activated",
192 			cast(GCallback)&callBackActionActivated,
193 			cast(void*)this,
194 			null,
195 			connectFlags);
196 			connectedSignals["action-activated"] = 1;
197 		}
198 		onActionActivatedListeners ~= dlg;
199 	}
200 	extern(C) static void callBackActionActivated(GtkEntryCompletion* widgetStruct, gint index, EntryCompletion _entryCompletion)
201 	{
202 		foreach ( void delegate(gint, EntryCompletion) dlg ; _entryCompletion.onActionActivatedListeners )
203 		{
204 			dlg(index, _entryCompletion);
205 		}
206 	}
207 	
208 	bool delegate(TreeModelIF, TreeIter, EntryCompletion)[] onCursorOnMatchListeners;
209 	/**
210 	 * Gets emitted when a match from the cursor is on a match
211 	 * of the list. The default behaviour is to replace the contents
212 	 * of the entry with the contents of the text column in the row
213 	 * pointed to by iter.
214 	 * Note that model is the model that was passed to
215 	 * gtk_entry_completion_set_model().
216 	 * TRUE if the signal has been handled
217 	 * Since 2.12
218 	 */
219 	void addOnCursorOnMatch(bool delegate(TreeModelIF, TreeIter, EntryCompletion) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
220 	{
221 		if ( !("cursor-on-match" in connectedSignals) )
222 		{
223 			Signals.connectData(
224 			getStruct(),
225 			"cursor-on-match",
226 			cast(GCallback)&callBackCursorOnMatch,
227 			cast(void*)this,
228 			null,
229 			connectFlags);
230 			connectedSignals["cursor-on-match"] = 1;
231 		}
232 		onCursorOnMatchListeners ~= dlg;
233 	}
234 	extern(C) static gboolean callBackCursorOnMatch(GtkEntryCompletion* widgetStruct, GtkTreeModel* model, GtkTreeIter* iter, EntryCompletion _entryCompletion)
235 	{
236 		foreach ( bool delegate(TreeModelIF, TreeIter, EntryCompletion) dlg ; _entryCompletion.onCursorOnMatchListeners )
237 		{
238 			if ( dlg(ObjectG.getDObject!(TreeModel, TreeModelIF)(model), ObjectG.getDObject!(TreeIter)(iter), _entryCompletion) )
239 			{
240 				return 1;
241 			}
242 		}
243 		
244 		return 0;
245 	}
246 	
247 	bool delegate(string, EntryCompletion)[] onInsertPrefixListeners;
248 	/**
249 	 * Gets emitted when the inline autocompletion is triggered.
250 	 * The default behaviour is to make the entry display the
251 	 * whole prefix and select the newly inserted part.
252 	 * Applications may connect to this signal in order to insert only a
253 	 * smaller part of the prefix into the entry - e.g. the entry used in
254 	 * the GtkFileChooser inserts only the part of the prefix up to the
255 	 * next '/'.
256 	 * TRUE if the signal has been handled
257 	 * Since 2.6
258 	 */
259 	void addOnInsertPrefix(bool delegate(string, EntryCompletion) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
260 	{
261 		if ( !("insert-prefix" in connectedSignals) )
262 		{
263 			Signals.connectData(
264 			getStruct(),
265 			"insert-prefix",
266 			cast(GCallback)&callBackInsertPrefix,
267 			cast(void*)this,
268 			null,
269 			connectFlags);
270 			connectedSignals["insert-prefix"] = 1;
271 		}
272 		onInsertPrefixListeners ~= dlg;
273 	}
274 	extern(C) static gboolean callBackInsertPrefix(GtkEntryCompletion* widgetStruct, gchar* prefix, EntryCompletion _entryCompletion)
275 	{
276 		foreach ( bool delegate(string, EntryCompletion) dlg ; _entryCompletion.onInsertPrefixListeners )
277 		{
278 			if ( dlg(Str.toString(prefix), _entryCompletion) )
279 			{
280 				return 1;
281 			}
282 		}
283 		
284 		return 0;
285 	}
286 	
287 	bool delegate(TreeModelIF, TreeIter, EntryCompletion)[] onMatchSelectedListeners;
288 	/**
289 	 * Gets emitted when a match from the list is selected.
290 	 * The default behaviour is to replace the contents of the
291 	 * entry with the contents of the text column in the row
292 	 * pointed to by iter.
293 	 * Note that model is the model that was passed to
294 	 * gtk_entry_completion_set_model().
295 	 * TRUE if the signal has been handled
296 	 * Since 2.4
297 	 */
298 	void addOnMatchSelected(bool delegate(TreeModelIF, TreeIter, EntryCompletion) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
299 	{
300 		if ( !("match-selected" in connectedSignals) )
301 		{
302 			Signals.connectData(
303 			getStruct(),
304 			"match-selected",
305 			cast(GCallback)&callBackMatchSelected,
306 			cast(void*)this,
307 			null,
308 			connectFlags);
309 			connectedSignals["match-selected"] = 1;
310 		}
311 		onMatchSelectedListeners ~= dlg;
312 	}
313 	extern(C) static gboolean callBackMatchSelected(GtkEntryCompletion* widgetStruct, GtkTreeModel* model, GtkTreeIter* iter, EntryCompletion _entryCompletion)
314 	{
315 		foreach ( bool delegate(TreeModelIF, TreeIter, EntryCompletion) dlg ; _entryCompletion.onMatchSelectedListeners )
316 		{
317 			if ( dlg(ObjectG.getDObject!(TreeModel, TreeModelIF)(model), ObjectG.getDObject!(TreeIter)(iter), _entryCompletion) )
318 			{
319 				return 1;
320 			}
321 		}
322 		
323 		return 0;
324 	}
325 	
326 	
327 	/**
328 	 * Creates a new GtkEntryCompletion object.
329 	 * Since 2.4
330 	 * Throws: ConstructionException GTK+ fails to create the object.
331 	 */
332 	public this ()
333 	{
334 		// GtkEntryCompletion * gtk_entry_completion_new (void);
335 		auto p = gtk_entry_completion_new();
336 		if(p is null)
337 		{
338 			throw new ConstructionException("null returned by gtk_entry_completion_new()");
339 		}
340 		this(cast(GtkEntryCompletion*) p);
341 	}
342 	
343 	/**
344 	 * Creates a new GtkEntryCompletion object using the
345 	 * specified area to layout cells in the underlying
346 	 * GtkTreeViewColumn for the drop-down menu.
347 	 * Params:
348 	 * area = the GtkCellArea used to layout cells
349 	 * Throws: ConstructionException GTK+ fails to create the object.
350 	 */
351 	public this (CellArea area)
352 	{
353 		// GtkEntryCompletion * gtk_entry_completion_new_with_area (GtkCellArea *area);
354 		auto p = gtk_entry_completion_new_with_area((area is null) ? null : area.getCellAreaStruct());
355 		if(p is null)
356 		{
357 			throw new ConstructionException("null returned by gtk_entry_completion_new_with_area((area is null) ? null : area.getCellAreaStruct())");
358 		}
359 		this(cast(GtkEntryCompletion*) p);
360 	}
361 	
362 	/**
363 	 * Gets the entry completion has been attached to.
364 	 * Since 2.4
365 	 * Returns: The entry completion has been attached to. [transfer none]
366 	 */
367 	public Widget getEntry()
368 	{
369 		// GtkWidget * gtk_entry_completion_get_entry (GtkEntryCompletion *completion);
370 		auto p = gtk_entry_completion_get_entry(gtkEntryCompletion);
371 		
372 		if(p is null)
373 		{
374 			return null;
375 		}
376 		
377 		return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p);
378 	}
379 	
380 	/**
381 	 * Sets the model for a GtkEntryCompletion. If completion already has
382 	 * a model set, it will remove it before setting the new model.
383 	 * If model is NULL, then it will unset the model.
384 	 * Since 2.4
385 	 * Params:
386 	 * model = the GtkTreeModel. [allow-none]
387 	 */
388 	public void setModel(TreeModelIF model)
389 	{
390 		// void gtk_entry_completion_set_model (GtkEntryCompletion *completion,  GtkTreeModel *model);
391 		gtk_entry_completion_set_model(gtkEntryCompletion, (model is null) ? null : model.getTreeModelTStruct());
392 	}
393 	
394 	/**
395 	 * Returns NULL if the model is unset.
396 	 * Since 2.4
397 	 * Returns: A GtkTreeModel, or NULL if none is currently being used. [transfer none]
398 	 */
399 	public TreeModelIF getModel()
400 	{
401 		// GtkTreeModel * gtk_entry_completion_get_model (GtkEntryCompletion *completion);
402 		auto p = gtk_entry_completion_get_model(gtkEntryCompletion);
403 		
404 		if(p is null)
405 		{
406 			return null;
407 		}
408 		
409 		return ObjectG.getDObject!(TreeModel, TreeModelIF)(cast(GtkTreeModel*) p);
410 	}
411 	
412 	/**
413 	 * Sets the match function for completion to be func. The match function
414 	 * is used to determine if a row should or should not be in the completion
415 	 * list.
416 	 * Since 2.4
417 	 * Params:
418 	 * func = the GtkEntryCompletionMatchFunc to use
419 	 * funcData = user data for func
420 	 * funcNotify = destroy notify for func_data.
421 	 */
422 	public void setMatchFunc(GtkEntryCompletionMatchFunc func, void* funcData, GDestroyNotify funcNotify)
423 	{
424 		// void gtk_entry_completion_set_match_func (GtkEntryCompletion *completion,  GtkEntryCompletionMatchFunc func,  gpointer func_data,  GDestroyNotify func_notify);
425 		gtk_entry_completion_set_match_func(gtkEntryCompletion, func, funcData, funcNotify);
426 	}
427 	
428 	/**
429 	 * Requires the length of the search key for completion to be at least
430 	 * length. This is useful for long lists, where completing using a small
431 	 * key takes a lot of time and will come up with meaningless results anyway
432 	 * (ie, a too large dataset).
433 	 * Since 2.4
434 	 * Params:
435 	 * length = the minimum length of the key in order to start completing
436 	 */
437 	public void setMinimumKeyLength(int length)
438 	{
439 		// void gtk_entry_completion_set_minimum_key_length  (GtkEntryCompletion *completion,  gint length);
440 		gtk_entry_completion_set_minimum_key_length(gtkEntryCompletion, length);
441 	}
442 	
443 	/**
444 	 * Returns the minimum key length as set for completion.
445 	 * Since 2.4
446 	 * Returns: The currently used minimum key length
447 	 */
448 	public int getMinimumKeyLength()
449 	{
450 		// gint gtk_entry_completion_get_minimum_key_length  (GtkEntryCompletion *completion);
451 		return gtk_entry_completion_get_minimum_key_length(gtkEntryCompletion);
452 	}
453 	
454 	/**
455 	 * Computes the common prefix that is shared by all rows in completion
456 	 * that start with key. If no row matches key, NULL will be returned.
457 	 * Note that a text column must have been set for this function to work,
458 	 * see gtk_entry_completion_set_text_column() for details.
459 	 * Params:
460 	 * key = The text to complete for
461 	 * Returns: The common prefix all rows starting with key or NULL if no row matches key. [transfer full] Since 3.4
462 	 */
463 	public string computePrefix(string key)
464 	{
465 		// gchar * gtk_entry_completion_compute_prefix (GtkEntryCompletion *completion,  const char *key);
466 		return Str.toString(gtk_entry_completion_compute_prefix(gtkEntryCompletion, Str.toStringz(key)));
467 	}
468 	
469 	/**
470 	 * Requests a completion operation, or in other words a refiltering of the
471 	 * current list with completions, using the current key. The completion list
472 	 * view will be updated accordingly.
473 	 * Since 2.4
474 	 */
475 	public void complete()
476 	{
477 		// void gtk_entry_completion_complete (GtkEntryCompletion *completion);
478 		gtk_entry_completion_complete(gtkEntryCompletion);
479 	}
480 	
481 	/**
482 	 * Get the original text entered by the user that triggered
483 	 * the completion or NULL if there's no completion ongoing.
484 	 * Since 2.12
485 	 * Returns: the prefix for the current completion
486 	 */
487 	public string getCompletionPrefix()
488 	{
489 		// const gchar * gtk_entry_completion_get_completion_prefix  (GtkEntryCompletion *completion);
490 		return Str.toString(gtk_entry_completion_get_completion_prefix(gtkEntryCompletion));
491 	}
492 	
493 	/**
494 	 * Requests a prefix insertion.
495 	 * Since 2.6
496 	 */
497 	public void insertPrefix()
498 	{
499 		// void gtk_entry_completion_insert_prefix (GtkEntryCompletion *completion);
500 		gtk_entry_completion_insert_prefix(gtkEntryCompletion);
501 	}
502 	
503 	/**
504 	 * Inserts an action in completion's action item list at position index_
505 	 * with text text. If you want the action item to have markup, use
506 	 * gtk_entry_completion_insert_action_markup().
507 	 * Since 2.4
508 	 * Params:
509 	 * index = the index of the item to insert
510 	 * text = text of the item to insert
511 	 */
512 	public void insertActionText(int index, string text)
513 	{
514 		// void gtk_entry_completion_insert_action_text  (GtkEntryCompletion *completion,  gint index_,  const gchar *text);
515 		gtk_entry_completion_insert_action_text(gtkEntryCompletion, index, Str.toStringz(text));
516 	}
517 	
518 	/**
519 	 * Inserts an action in completion's action item list at position index_
520 	 * with markup markup.
521 	 * Since 2.4
522 	 * Params:
523 	 * index = the index of the item to insert
524 	 * markup = markup of the item to insert
525 	 */
526 	public void insertActionMarkup(int index, string markup)
527 	{
528 		// void gtk_entry_completion_insert_action_markup  (GtkEntryCompletion *completion,  gint index_,  const gchar *markup);
529 		gtk_entry_completion_insert_action_markup(gtkEntryCompletion, index, Str.toStringz(markup));
530 	}
531 	
532 	/**
533 	 * Deletes the action at index_ from completion's action list.
534 	 * Since 2.4
535 	 * Params:
536 	 * index = the index of the item to delete
537 	 */
538 	public void deleteAction(int index)
539 	{
540 		// void gtk_entry_completion_delete_action (GtkEntryCompletion *completion,  gint index_);
541 		gtk_entry_completion_delete_action(gtkEntryCompletion, index);
542 	}
543 	
544 	/**
545 	 * Convenience function for setting up the most used case of this code: a
546 	 * completion list with just strings. This function will set up completion
547 	 * to have a list displaying all (and just) strings in the completion list,
548 	 * and to get those strings from column in the model of completion.
549 	 * This functions creates and adds a GtkCellRendererText for the selected
550 	 * column. If you need to set the text column, but don't want the cell
551 	 * renderer, use g_object_set() to set the "text-column"
552 	 * property directly.
553 	 * Since 2.4
554 	 * Params:
555 	 * column = the column in the model of completion to get strings from
556 	 */
557 	public void setTextColumn(int column)
558 	{
559 		// void gtk_entry_completion_set_text_column  (GtkEntryCompletion *completion,  gint column);
560 		gtk_entry_completion_set_text_column(gtkEntryCompletion, column);
561 	}
562 	
563 	/**
564 	 * Returns the column in the model of completion to get strings from.
565 	 * Since 2.6
566 	 * Returns: the column containing the strings
567 	 */
568 	public int getTextColumn()
569 	{
570 		// gint gtk_entry_completion_get_text_column  (GtkEntryCompletion *completion);
571 		return gtk_entry_completion_get_text_column(gtkEntryCompletion);
572 	}
573 	
574 	/**
575 	 * Sets whether the common prefix of the possible completions should
576 	 * be automatically inserted in the entry.
577 	 * Since 2.6
578 	 * Params:
579 	 * inlineCompletion = TRUE to do inline completion
580 	 */
581 	public void setInlineCompletion(int inlineCompletion)
582 	{
583 		// void gtk_entry_completion_set_inline_completion  (GtkEntryCompletion *completion,  gboolean inline_completion);
584 		gtk_entry_completion_set_inline_completion(gtkEntryCompletion, inlineCompletion);
585 	}
586 	
587 	/**
588 	 * Returns whether the common prefix of the possible completions should
589 	 * be automatically inserted in the entry.
590 	 * Since 2.6
591 	 * Returns: TRUE if inline completion is turned on
592 	 */
593 	public int getInlineCompletion()
594 	{
595 		// gboolean gtk_entry_completion_get_inline_completion  (GtkEntryCompletion *completion);
596 		return gtk_entry_completion_get_inline_completion(gtkEntryCompletion);
597 	}
598 	
599 	/**
600 	 * Sets whether it is possible to cycle through the possible completions
601 	 * inside the entry.
602 	 * Since 2.12
603 	 * Params:
604 	 * inlineSelection = TRUE to do inline selection
605 	 */
606 	public void setInlineSelection(int inlineSelection)
607 	{
608 		// void gtk_entry_completion_set_inline_selection  (GtkEntryCompletion *completion,  gboolean inline_selection);
609 		gtk_entry_completion_set_inline_selection(gtkEntryCompletion, inlineSelection);
610 	}
611 	
612 	/**
613 	 * Returns TRUE if inline-selection mode is turned on.
614 	 * Since 2.12
615 	 * Returns: TRUE if inline-selection mode is on
616 	 */
617 	public int getInlineSelection()
618 	{
619 		// gboolean gtk_entry_completion_get_inline_selection  (GtkEntryCompletion *completion);
620 		return gtk_entry_completion_get_inline_selection(gtkEntryCompletion);
621 	}
622 	
623 	/**
624 	 * Sets whether the completions should be presented in a popup window.
625 	 * Since 2.6
626 	 * Params:
627 	 * popupCompletion = TRUE to do popup completion
628 	 */
629 	public void setPopupCompletion(int popupCompletion)
630 	{
631 		// void gtk_entry_completion_set_popup_completion  (GtkEntryCompletion *completion,  gboolean popup_completion);
632 		gtk_entry_completion_set_popup_completion(gtkEntryCompletion, popupCompletion);
633 	}
634 	
635 	/**
636 	 * Returns whether the completions should be presented in a popup window.
637 	 * Since 2.6
638 	 * Returns: TRUE if popup completion is turned on
639 	 */
640 	public int getPopupCompletion()
641 	{
642 		// gboolean gtk_entry_completion_get_popup_completion  (GtkEntryCompletion *completion);
643 		return gtk_entry_completion_get_popup_completion(gtkEntryCompletion);
644 	}
645 	
646 	/**
647 	 * Sets whether the completion popup window will be resized to be the same
648 	 * width as the entry.
649 	 * Since 2.8
650 	 * Params:
651 	 * popupSetWidth = TRUE to make the width of the popup the same as the entry
652 	 */
653 	public void setPopupSetWidth(int popupSetWidth)
654 	{
655 		// void gtk_entry_completion_set_popup_set_width  (GtkEntryCompletion *completion,  gboolean popup_set_width);
656 		gtk_entry_completion_set_popup_set_width(gtkEntryCompletion, popupSetWidth);
657 	}
658 	
659 	/**
660 	 * Returns whether the completion popup window will be resized to the
661 	 * width of the entry.
662 	 * Since 2.8
663 	 * Returns: TRUE if the popup window will be resized to the width of the entry
664 	 */
665 	public int getPopupSetWidth()
666 	{
667 		// gboolean gtk_entry_completion_get_popup_set_width  (GtkEntryCompletion *completion);
668 		return gtk_entry_completion_get_popup_set_width(gtkEntryCompletion);
669 	}
670 	
671 	/**
672 	 * Sets whether the completion popup window will appear even if there is
673 	 * only a single match. You may want to set this to FALSE if you
674 	 * are using inline
675 	 * completion.
676 	 * Since 2.8
677 	 * Params:
678 	 * popupSingleMatch = TRUE if the popup should appear even for a single
679 	 * match
680 	 */
681 	public void setPopupSingleMatch(int popupSingleMatch)
682 	{
683 		// void gtk_entry_completion_set_popup_single_match  (GtkEntryCompletion *completion,  gboolean popup_single_match);
684 		gtk_entry_completion_set_popup_single_match(gtkEntryCompletion, popupSingleMatch);
685 	}
686 	
687 	/**
688 	 * Returns whether the completion popup window will appear even if there is
689 	 * only a single match.
690 	 * Since 2.8
691 	 * Returns: TRUE if the popup window will appear regardless of the number of matches
692 	 */
693 	public int getPopupSingleMatch()
694 	{
695 		// gboolean gtk_entry_completion_get_popup_single_match  (GtkEntryCompletion *completion);
696 		return gtk_entry_completion_get_popup_single_match(gtkEntryCompletion);
697 	}
698 }