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 gtk.CellEditableT; 26 27 public import gdk.Event; 28 public import gobject.Signals; 29 public import gtk.c.functions; 30 public import gtk.c.types; 31 public import gtkc.gtktypes; 32 public import std.algorithm; 33 34 35 /** 36 * The #GtkCellEditable interface must be implemented for widgets to be usable 37 * when editing the contents of a #GtkTreeView cell. 38 */ 39 public template CellEditableT(TStruct) 40 { 41 /** Get the main Gtk struct */ 42 public GtkCellEditable* getCellEditableStruct(bool transferOwnership = false) 43 { 44 if (transferOwnership) 45 ownedRef = false; 46 return cast(GtkCellEditable*)getStruct(); 47 } 48 49 50 /** 51 * Emits the #GtkCellEditable::editing-done signal. 52 */ 53 public void editingDone() 54 { 55 gtk_cell_editable_editing_done(getCellEditableStruct()); 56 } 57 58 /** 59 * Emits the #GtkCellEditable::remove-widget signal. 60 */ 61 public void removeWidget() 62 { 63 gtk_cell_editable_remove_widget(getCellEditableStruct()); 64 } 65 66 /** 67 * Begins editing on a @cell_editable. @event is the #GdkEvent that began 68 * the editing process. It may be %NULL, in the instance that editing was 69 * initiated through programatic means. 70 * 71 * Params: 72 * event = A #GdkEvent, or %NULL 73 */ 74 public void startEditing(Event event) 75 { 76 gtk_cell_editable_start_editing(getCellEditableStruct(), (event is null) ? null : event.getEventStruct()); 77 } 78 79 /** 80 * This signal is a sign for the cell renderer to update its 81 * value from the @cell_editable. 82 * 83 * Implementations of #GtkCellEditable are responsible for 84 * emitting this signal when they are done editing, e.g. 85 * #GtkEntry is emitting it when the user presses Enter. 86 * 87 * gtk_cell_editable_editing_done() is a convenience method 88 * for emitting #GtkCellEditable::editing-done. 89 */ 90 gulong addOnEditingDone(void delegate(CellEditableIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 91 { 92 return Signals.connect(this, "editing-done", dlg, connectFlags ^ ConnectFlags.SWAPPED); 93 } 94 95 /** 96 * This signal is meant to indicate that the cell is finished 97 * editing, and the widget may now be destroyed. 98 * 99 * Implementations of #GtkCellEditable are responsible for 100 * emitting this signal when they are done editing. It must 101 * be emitted after the #GtkCellEditable::editing-done signal, 102 * to give the cell renderer a chance to update the cell's value 103 * before the widget is removed. 104 * 105 * gtk_cell_editable_remove_widget() is a convenience method 106 * for emitting #GtkCellEditable::remove-widget. 107 */ 108 gulong addOnRemoveWidget(void delegate(CellEditableIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 109 { 110 return Signals.connect(this, "remove-widget", dlg, connectFlags ^ ConnectFlags.SWAPPED); 111 } 112 }