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  * omit structs:
43  * omit prefixes:
44  * omit code:
45  * omit signals:
46  * imports:
47  * 	- gdk.Event
48  * structWrap:
49  * 	- GdkEvent* -> Event
50  * module aliases:
51  * local aliases:
52  * overrides:
53  */
54 
55 module gtk.CellEditableT;
56 
57 public  import gtkc.gtktypes;
58 
59 public import gtkc.gtk;
60 public import glib.ConstructionException;
61 public import gobject.ObjectG;
62 
63 public import gobject.Signals;
64 public  import gtkc.gdktypes;
65 
66 public import gdk.Event;
67 
68 
69 
70 
71 /**
72  * The GtkCellEditable interface must be implemented for widgets to be usable
73  * when editing the contents of a GtkTreeView cell.
74  */
75 public template CellEditableT(TStruct)
76 {
77 	
78 	/** the main Gtk struct */
79 	protected GtkCellEditable* gtkCellEditable;
80 	
81 	
82 	public GtkCellEditable* getCellEditableTStruct()
83 	{
84 		return cast(GtkCellEditable*)getStruct();
85 	}
86 	
87 	
88 	/**
89 	 */
90 	int[string] connectedSignals;
91 	
92 	void delegate(CellEditableIF)[] _onEditingDoneListeners;
93 	@property void delegate(CellEditableIF)[] onEditingDoneListeners()
94 	{
95 		return  _onEditingDoneListeners;
96 	}
97 	/**
98 	 * This signal is a sign for the cell renderer to update its
99 	 * value from the cell_editable.
100 	 * Implementations of GtkCellEditable are responsible for
101 	 * emitting this signal when they are done editing, e.g.
102 	 * GtkEntry is emitting it when the user presses Enter.
103 	 * gtk_cell_editable_editing_done() is a convenience method
104 	 * for emitting "editing-done".
105 	 */
106 	void addOnEditingDone(void delegate(CellEditableIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
107 	{
108 		if ( !("editing-done" in connectedSignals) )
109 		{
110 			Signals.connectData(
111 			getStruct(),
112 			"editing-done",
113 			cast(GCallback)&callBackEditingDone,
114 			cast(void*)cast(CellEditableIF)this,
115 			null,
116 			connectFlags);
117 			connectedSignals["editing-done"] = 1;
118 		}
119 		_onEditingDoneListeners ~= dlg;
120 	}
121 	extern(C) static void callBackEditingDone(GtkCellEditable* cellEditableStruct, CellEditableIF _cellEditableIF)
122 	{
123 		foreach ( void delegate(CellEditableIF) dlg ; _cellEditableIF.onEditingDoneListeners )
124 		{
125 			dlg(_cellEditableIF);
126 		}
127 	}
128 	
129 	void delegate(CellEditableIF)[] _onRemoveWidgetListeners;
130 	@property void delegate(CellEditableIF)[] onRemoveWidgetListeners()
131 	{
132 		return  _onRemoveWidgetListeners;
133 	}
134 	/**
135 	 * This signal is meant to indicate that the cell is finished
136 	 * editing, and the widget may now be destroyed.
137 	 * Implementations of GtkCellEditable are responsible for
138 	 * emitting this signal when they are done editing. It must
139 	 * be emitted after the "editing-done" signal,
140 	 * to give the cell renderer a chance to update the cell's value
141 	 * before the widget is removed.
142 	 * gtk_cell_editable_remove_widget() is a convenience method
143 	 * for emitting "remove-widget".
144 	 * See Also
145 	 * GtkEntry, GtkCellRenderer
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 }