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 public import gdk.Event;
66 
67 
68 
69 /**
70  * The GtkCellEditable interface must be implemented for widgets to be usable
71  * when editing the contents of a GtkTreeView cell.
72  */
73 public template CellEditableT(TStruct)
74 {
75 	
76 	/** the main Gtk struct */
77 	protected GtkCellEditable* gtkCellEditable;
78 	
79 	
80 	/** Get the main Gtk struct */
81 	public GtkCellEditable* getCellEditableTStruct()
82 	{
83 		return cast(GtkCellEditable*)getStruct();
84 	}
85 	
86 	
87 	/**
88 	 */
89 	int[string] connectedSignals;
90 	
91 	void delegate(CellEditableIF)[] _onEditingDoneListeners;
92 	@property void delegate(CellEditableIF)[] onEditingDoneListeners()
93 	{
94 		return  _onEditingDoneListeners;
95 	}
96 	/**
97 	 * This signal is a sign for the cell renderer to update its
98 	 * value from the cell_editable.
99 	 * Implementations of GtkCellEditable are responsible for
100 	 * emitting this signal when they are done editing, e.g.
101 	 * GtkEntry is emitting it when the user presses Enter.
102 	 * gtk_cell_editable_editing_done() is a convenience method
103 	 * for emitting "editing-done".
104 	 */
105 	void addOnEditingDone(void delegate(CellEditableIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
106 	{
107 		if ( !("editing-done" in connectedSignals) )
108 		{
109 			Signals.connectData(
110 			getStruct(),
111 			"editing-done",
112 			cast(GCallback)&callBackEditingDone,
113 			cast(void*)cast(CellEditableIF)this,
114 			null,
115 			connectFlags);
116 			connectedSignals["editing-done"] = 1;
117 		}
118 		_onEditingDoneListeners ~= dlg;
119 	}
120 	extern(C) static void callBackEditingDone(GtkCellEditable* cellEditableStruct, CellEditableIF _cellEditableIF)
121 	{
122 		foreach ( void delegate(CellEditableIF) dlg ; _cellEditableIF.onEditingDoneListeners )
123 		{
124 			dlg(_cellEditableIF);
125 		}
126 	}
127 	
128 	void delegate(CellEditableIF)[] _onRemoveWidgetListeners;
129 	@property void delegate(CellEditableIF)[] onRemoveWidgetListeners()
130 	{
131 		return  _onRemoveWidgetListeners;
132 	}
133 	/**
134 	 * This signal is meant to indicate that the cell is finished
135 	 * editing, and the widget may now be destroyed.
136 	 * Implementations of GtkCellEditable are responsible for
137 	 * emitting this signal when they are done editing. It must
138 	 * be emitted after the "editing-done" signal,
139 	 * to give the cell renderer a chance to update the cell's value
140 	 * before the widget is removed.
141 	 * gtk_cell_editable_remove_widget() is a convenience method
142 	 * for emitting "remove-widget".
143 	 * See Also
144 	 * GtkEntry, GtkCellRenderer
145 	 */
146 	void addOnRemoveWidget(void delegate(CellEditableIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
147 	{
148 		if ( !("remove-widget" in connectedSignals) )
149 		{
150 			Signals.connectData(
151 			getStruct(),
152 			"remove-widget",
153 			cast(GCallback)&callBackRemoveWidget,
154 			cast(void*)cast(CellEditableIF)this,
155 			null,
156 			connectFlags);
157 			connectedSignals["remove-widget"] = 1;
158 		}
159 		_onRemoveWidgetListeners ~= dlg;
160 	}
161 	extern(C) static void callBackRemoveWidget(GtkCellEditable* cellEditableStruct, CellEditableIF _cellEditableIF)
162 	{
163 		foreach ( void delegate(CellEditableIF) dlg ; _cellEditableIF.onRemoveWidgetListeners )
164 		{
165 			dlg(_cellEditableIF);
166 		}
167 	}
168 	
169 	
170 	/**
171 	 * Begins editing on a cell_editable. event is the GdkEvent that began
172 	 * the editing process. It may be NULL, in the instance that editing was
173 	 * initiated through programatic means.
174 	 * Params:
175 	 * event = A GdkEvent, or NULL. [allow-none]
176 	 */
177 	public void startEditing(Event event)
178 	{
179 		// void gtk_cell_editable_start_editing (GtkCellEditable *cell_editable,  GdkEvent *event);
180 		gtk_cell_editable_start_editing(getCellEditableTStruct(), (event is null) ? null : event.getEventStruct());
181 	}
182 	
183 	/**
184 	 * Emits the "editing-done" signal.
185 	 */
186 	public void editingDone()
187 	{
188 		// void gtk_cell_editable_editing_done (GtkCellEditable *cell_editable);
189 		gtk_cell_editable_editing_done(getCellEditableTStruct());
190 	}
191 	
192 	/**
193 	 * Emits the "remove-widget" signal.
194 	 */
195 	public void removeWidget()
196 	{
197 		// void gtk_cell_editable_remove_widget (GtkCellEditable *cell_editable);
198 		gtk_cell_editable_remove_widget(getCellEditableTStruct());
199 	}
200 }