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  = GtkCellEditable.html
27  * outPack = gtk
28  * outFile = CellEditableT
29  * strct   = GtkCellEditable
30  * realStrct=
31  * ctorStrct=
32  * clss    = CellEditableT
33  * interf  = CellEditableIF
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * 	- TStruct
38  * extend  = 
39  * implements:
40  * prefixes:
41  * 	- gtk_cell_editable_
42  * 	- gtk_
43  * omit structs:
44  * omit prefixes:
45  * omit code:
46  * omit signals:
47  * imports:
48  * 	- gdk.Event
49  * structWrap:
50  * 	- GdkEvent* -> Event
51  * module aliases:
52  * local aliases:
53  * overrides:
54  */
55 
56 module gtk.CellEditableT;
57 
58 public  import gtkc.gtktypes;
59 
60 public import gtkc.gtk;
61 public import glib.ConstructionException;
62 public import gobject.ObjectG;
63 
64 public import gobject.Signals;
65 public  import gtkc.gdktypes;
66 
67 public import gdk.Event;
68 
69 
70 
71 
72 /**
73  * Description
74  * The GtkCellEditable interface must be implemented for widgets
75  * to be usable when editing the contents of a GtkTreeView cell.
76  */
77 public template CellEditableT(TStruct)
78 {
79 	
80 	/** the main Gtk struct */
81 	protected GtkCellEditable* gtkCellEditable;
82 	
83 	
84 	public GtkCellEditable* getCellEditableTStruct()
85 	{
86 		return cast(GtkCellEditable*)getStruct();
87 	}
88 	
89 	
90 	/**
91 	 */
92 	int[string] connectedSignals;
93 	
94 	void delegate(CellEditableIF)[] _onEditingDoneListeners;
95 	void delegate(CellEditableIF)[] onEditingDoneListeners()
96 	{
97 		return  _onEditingDoneListeners;
98 	}
99 	/**
100 	 * This signal is a sign for the cell renderer to update its
101 	 * value from the cell_editable.
102 	 * Implementations of GtkCellEditable are responsible for
103 	 * emitting this signal when they are done editing, e.g.
104 	 * GtkEntry is emitting it when the user presses Enter.
105 	 * gtk_cell_editable_editing_done() is a convenience method
106 	 * for emitting GtkCellEditable::editing-done.
107 	 */
108 	void addOnEditingDone(void delegate(CellEditableIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
109 	{
110 		if ( !("editing-done" in connectedSignals) )
111 		{
112 			Signals.connectData(
113 			getStruct(),
114 			"editing-done",
115 			cast(GCallback)&callBackEditingDone,
116 			cast(void*)cast(CellEditableIF)this,
117 			null,
118 			connectFlags);
119 			connectedSignals["editing-done"] = 1;
120 		}
121 		_onEditingDoneListeners ~= dlg;
122 	}
123 	extern(C) static void callBackEditingDone(GtkCellEditable* cellEditableStruct, CellEditableIF _cellEditableIF)
124 	{
125 		foreach ( void delegate(CellEditableIF) dlg ; _cellEditableIF.onEditingDoneListeners )
126 		{
127 			dlg(_cellEditableIF);
128 		}
129 	}
130 	
131 	void delegate(CellEditableIF)[] _onRemoveWidgetListeners;
132 	void delegate(CellEditableIF)[] onRemoveWidgetListeners()
133 	{
134 		return  _onRemoveWidgetListeners;
135 	}
136 	/**
137 	 * This signal is meant to indicate that the cell is finished
138 	 * editing, and the widget may now be destroyed.
139 	 * Implementations of GtkCellEditable are responsible for
140 	 * emitting this signal when they are done editing. It must
141 	 * be emitted after the "editing-done" signal,
142 	 * to give the cell renderer a chance to update the cell's value
143 	 * before the widget is removed.
144 	 * gtk_cell_editable_remove_widget() is a convenience method
145 	 * for emitting GtkCellEditable::remove-widget.
146 	 */
147 	void addOnRemoveWidget(void delegate(CellEditableIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
148 	{
149 		if ( !("remove-widget" in connectedSignals) )
150 		{
151 			Signals.connectData(
152 			getStruct(),
153 			"remove-widget",
154 			cast(GCallback)&callBackRemoveWidget,
155 			cast(void*)cast(CellEditableIF)this,
156 			null,
157 			connectFlags);
158 			connectedSignals["remove-widget"] = 1;
159 		}
160 		_onRemoveWidgetListeners ~= dlg;
161 	}
162 	extern(C) static void callBackRemoveWidget(GtkCellEditable* cellEditableStruct, CellEditableIF _cellEditableIF)
163 	{
164 		foreach ( void delegate(CellEditableIF) dlg ; _cellEditableIF.onRemoveWidgetListeners )
165 		{
166 			dlg(_cellEditableIF);
167 		}
168 	}
169 	
170 	
171 	/**
172 	 * Begins editing on a cell_editable. event is the GdkEvent that began
173 	 * the editing process. It may be NULL, in the instance that editing was
174 	 * initiated through programatic means.
175 	 * Params:
176 	 * event = A GdkEvent, or NULL. [allow-none]
177 	 */
178 	public void startEditing(Event event)
179 	{
180 		// void gtk_cell_editable_start_editing (GtkCellEditable *cell_editable,  GdkEvent *event);
181 		gtk_cell_editable_start_editing(getCellEditableTStruct(), (event is null) ? null : event.getEventStruct());
182 	}
183 	
184 	/**
185 	 * Emits the "editing-done" signal.
186 	 */
187 	public void editingDone()
188 	{
189 		// void gtk_cell_editable_editing_done (GtkCellEditable *cell_editable);
190 		gtk_cell_editable_editing_done(getCellEditableTStruct());
191 	}
192 	
193 	/**
194 	 * Emits the "remove-widget" signal.
195 	 */
196 	public void removeWidget()
197 	{
198 		// void gtk_cell_editable_remove_widget (GtkCellEditable *cell_editable);
199 		gtk_cell_editable_remove_widget(getCellEditableTStruct());
200 	}
201 }