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  = GtkEditable.html
27  * outPack = gtk
28  * outFile = EditableIF
29  * strct   = GtkEditable
30  * realStrct=
31  * ctorStrct=
32  * clss    = EditableT
33  * interf  = EditableIF
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_editable_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- glib.Str
47  * structWrap:
48  * module aliases:
49  * local aliases:
50  * overrides:
51  */
52 
53 module gtk.EditableIF;
54 
55 public  import gtkc.gtktypes;
56 
57 private import gtkc.gtk;
58 private import glib.ConstructionException;
59 private import gobject.ObjectG;
60 
61 private import gobject.Signals;
62 public  import gtkc.gdktypes;
63 
64 private import glib.Str;
65 
66 
67 
68 
69 /**
70  * The GtkEditable interface is an interface which should be implemented by
71  * text editing widgets, such as GtkEntry and GtkSpinButton. It contains functions
72  * for generically manipulating an editable widget, a large number of action
73  * signals used for key bindings, and several signals that an application can
74  * connect to to modify the behavior of a widget.
75  *
76  * As an example of the latter usage, by connecting
77  * the following handler to "insert-text", an application
78  * can convert all entry into a widget into uppercase.
79  *
80  * $(DDOC_COMMENT example)
81  */
82 public interface EditableIF
83 {
84 	
85 	
86 	public GtkEditable* getEditableTStruct();
87 	
88 	/** the main Gtk struct as a void* */
89 	protected void* getStruct();
90 	
91 	
92 	/**
93 	 */
94 	
95 	@property void delegate(EditableIF)[] onChangedListeners();
96 	/**
97 	 * The ::changed signal is emitted at the end of a single
98 	 * user-visible operation on the contents of the GtkEditable.
99 	 * E.g., a paste operation that replaces the contents of the
100 	 * selection will cause only one signal emission (even though it
101 	 * is implemented by first deleting the selection, then inserting
102 	 * the new content, and may cause multiple ::notify::text signals
103 	 * to be emitted).
104 	 */
105 	void addOnChanged(void delegate(EditableIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
106 	@property void delegate(gint, gint, EditableIF)[] onDeleteTextListeners();
107 	/**
108 	 * This signal is emitted when text is deleted from
109 	 * the widget by the user. The default handler for
110 	 * this signal will normally be responsible for deleting
111 	 * the text, so by connecting to this signal and then
112 	 * stopping the signal with g_signal_stop_emission(), it
113 	 * is possible to modify the range of deleted text, or
114 	 * prevent it from being deleted entirely. The start_pos
115 	 * and end_pos parameters are interpreted as for
116 	 * gtk_editable_delete_text().
117 	 */
118 	void addOnDeleteText(void delegate(gint, gint, EditableIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
119 	@property void delegate(string, gint, void*, EditableIF)[] onInsertTextListeners();
120 	/**
121 	 * This signal is emitted when text is inserted into
122 	 * the widget by the user. The default handler for
123 	 * this signal will normally be responsible for inserting
124 	 * the text, so by connecting to this signal and then
125 	 * stopping the signal with g_signal_stop_emission(), it
126 	 * is possible to modify the inserted text, or prevent
127 	 * it from being inserted entirely.
128 	 */
129 	void addOnInsertText(void delegate(string, gint, void*, EditableIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
130 	
131 	/**
132 	 * Selects a region of text. The characters that are selected are
133 	 * those characters at positions from start_pos up to, but not
134 	 * including end_pos. If end_pos is negative, then the
135 	 * characters selected are those characters from start_pos to
136 	 * the end of the text.
137 	 * Note that positions are specified in characters, not bytes.
138 	 * Virtual: set_selection_bounds
139 	 * Params:
140 	 * startPos = start of region
141 	 * endPos = end of region
142 	 */
143 	public void selectRegion(int startPos, int endPos);
144 	
145 	/**
146 	 * Retrieves the selection bound of the editable. start_pos will be filled
147 	 * with the start of the selection and end_pos with end. If no text was
148 	 * selected both will be identical and FALSE will be returned.
149 	 * Note that positions are specified in characters, not bytes.
150 	 * Params:
151 	 * startPos = location to store the starting position, or NULL. [out][allow-none]
152 	 * endPos = location to store the end position, or NULL. [out][allow-none]
153 	 * Returns: TRUE if an area is selected, FALSE otherwise
154 	 */
155 	public int getSelectionBounds(out int startPos, out int endPos);
156 	
157 	/**
158 	 * Inserts new_text_length bytes of new_text into the contents of the
159 	 * widget, at position position.
160 	 * Note that the position is in characters, not in bytes.
161 	 * The function updates position to point after the newly inserted text.
162 	 * Virtual: do_insert_text
163 	 * Params:
164 	 * newText = the text to append
165 	 * position = location of the position text will be inserted at. [inout]
166 	 */
167 	public void insertText(string newText, ref int position);
168 	
169 	/**
170 	 * Deletes a sequence of characters. The characters that are deleted are
171 	 * those characters at positions from start_pos up to, but not including
172 	 * end_pos. If end_pos is negative, then the characters deleted
173 	 * are those from start_pos to the end of the text.
174 	 * Note that the positions are specified in characters, not bytes.
175 	 * Virtual: do_delete_text
176 	 * Params:
177 	 * startPos = start position
178 	 * endPos = end position
179 	 */
180 	public void deleteText(int startPos, int endPos);
181 	
182 	/**
183 	 * Retrieves a sequence of characters. The characters that are retrieved
184 	 * are those characters at positions from start_pos up to, but not
185 	 * including end_pos. If end_pos is negative, then the characters
186 	 * retrieved are those characters from start_pos to the end of the text.
187 	 * Note that positions are specified in characters, not bytes.
188 	 * Params:
189 	 * startPos = start of text
190 	 * endPos = end of text
191 	 * Returns: a pointer to the contents of the widget as a string. This string is allocated by the GtkEditable implementation and should be freed by the caller.
192 	 */
193 	public string getChars(int startPos, int endPos);
194 	
195 	/**
196 	 * Removes the contents of the currently selected content in the editable and
197 	 * puts it on the clipboard.
198 	 */
199 	public void cutClipboard();
200 	
201 	/**
202 	 * Copies the contents of the currently selected content in the editable and
203 	 * puts it on the clipboard.
204 	 */
205 	public void copyClipboard();
206 	
207 	/**
208 	 * Pastes the content of the clipboard to the current position of the
209 	 * cursor in the editable.
210 	 */
211 	public void pasteClipboard();
212 	
213 	/**
214 	 * Deletes the currently selected text of the editable.
215 	 * This call doesn't do anything if there is no selected text.
216 	 */
217 	public void deleteSelection();
218 	
219 	/**
220 	 * Sets the cursor position in the editable to the given value.
221 	 * The cursor is displayed before the character with the given (base 0)
222 	 * index in the contents of the editable. The value must be less than or
223 	 * equal to the number of characters in the editable. A value of -1
224 	 * indicates that the position should be set after the last character
225 	 * of the editable. Note that position is in characters, not in bytes.
226 	 * Params:
227 	 * position = the position of the cursor
228 	 */
229 	public void setPosition(int position);
230 	
231 	/**
232 	 * Retrieves the current position of the cursor relative to the start
233 	 * of the content of the editable.
234 	 * Note that this position is in characters, not in bytes.
235 	 * Returns: the cursor position
236 	 */
237 	public int getPosition();
238 	
239 	/**
240 	 * Determines if the user can edit the text in the editable
241 	 * widget or not.
242 	 * Params:
243 	 * isEditable = TRUE if the user is allowed to edit the text
244 	 * in the widget
245 	 */
246 	public void setEditable(int isEditable);
247 	
248 	/**
249 	 * Retrieves whether editable is editable. See
250 	 * gtk_editable_set_editable().
251 	 * Returns: TRUE if editable is editable. Signal Details The "changed" signal void user_function (GtkEditable *editable, gpointer user_data) : Run Last The ::changed signal is emitted at the end of a single user-visible operation on the contents of the GtkEditable. E.g., a paste operation that replaces the contents of the selection will cause only one signal emission (even though it is implemented by first deleting the selection, then inserting the new content, and may cause multiple ::notify::text signals to be emitted).
252 	 */
253 	public int getEditable();
254 }