alternative to assert
[gtkD.git] / gtkD / src / atk / EditableText.d
blobc0054e4ceb8f2736b73000d486709b5cd211da00
1 /*
2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = AtkEditableText.html
26 * outPack = atk
27 * outFile = EditableText
28 * strct = AtkEditableText
29 * realStrct=
30 * ctorStrct=
31 * clss = EditableText
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - atk_editable_text
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * imports:
44 * - glib.Str
45 * structWrap:
46 * module aliases:
47 * local aliases:
50 module atk.EditableText;
52 version(noAssert)
54 version(Tango)
56 import tango.io.Stdout; // use the tango loging?
60 private import gtkc.atktypes;
62 private import gtkc.atk;
65 private import glib.Str;
70 /**
71 * Description
72 * AtkEditableText should be implemented by UI components which contain
73 * text which the user can edit, via the AtkObject corresponding to that
74 * component (see AtkObject).
75 * AtkEditableText is a subclass of AtkText, and as such, an object which
76 * implements AtkEditableText is by definition an AtkText implementor as well.
78 public class EditableText
81 /** the main Gtk struct */
82 protected AtkEditableText* atkEditableText;
85 public AtkEditableText* getEditableTextStruct()
87 return atkEditableText;
91 /** the main Gtk struct as a void* */
92 protected void* getStruct()
94 return cast(void*)atkEditableText;
97 /**
98 * Sets our main struct and passes it to the parent class
100 public this (AtkEditableText* atkEditableText)
102 version(noAssert)
104 if ( atkEditableText is null )
106 int zero = 0;
107 version(Tango)
109 Stdout("struct atkEditableText is null on constructor").newline;
111 else
113 printf("struct atkEditableText is null on constructor");
115 zero = zero / zero;
118 else
120 assert(atkEditableText !is null, "struct atkEditableText is null on constructor");
122 this.atkEditableText = atkEditableText;
130 * Sets the attributes for a specified range. See the ATK_ATTRIBUTE
131 * macros (such as ATK_ATTRIBUTE_LEFT_MARGIN) for examples of attributes
132 * that can be set. Note that other attributes that do not have corresponding
133 * ATK_ATTRIBUTE macros may also be set for certain text widgets.
134 * text:
135 * an AtkEditableText
136 * attrib_set:
137 * an AtkAttributeSet
138 * start_offset:
139 * start of range in which to set attributes
140 * end_offset:
141 * end of range in which to set attributes
142 * Returns:
143 * TRUE if attributes successfully set for the specified
144 * range, otherwise FALSE
146 public int _SetRunAttributes(AtkAttributeSet* attribSet, int startOffset, int endOffset)
148 // gboolean atk_editable_text_set_run_attributes (AtkEditableText *text, AtkAttributeSet *attrib_set, gint start_offset, gint end_offset);
149 return atk_editable_text_set_run_attributes(atkEditableText, attribSet, startOffset, endOffset);
153 * Set text contents of text.
154 * text:
155 * an AtkEditableText
156 * string:
157 * string to set for text contents of text
159 public void _SetTextContents(char[] string)
161 // void atk_editable_text_set_text_contents (AtkEditableText *text, const gchar *string);
162 atk_editable_text_set_text_contents(atkEditableText, Str.toStringz(string));
166 * Insert text at a given position.
167 * text:
168 * an AtkEditableText
169 * string:
170 * the text to insert
171 * length:
172 * the length of text to insert, in bytes
173 * position:
174 * The caller initializes this to
175 * the position at which to insert the text. After the call it
176 * points at the position after the newly inserted text.
178 public void _InsertText(char[] string, int length, int* position)
180 // void atk_editable_text_insert_text (AtkEditableText *text, const gchar *string, gint length, gint *position);
181 atk_editable_text_insert_text(atkEditableText, Str.toStringz(string), length, position);
185 * Copy text from start_pos up to, but not including end_pos
186 * to the clipboard.
187 * text:
188 * an AtkEditableText
189 * start_pos:
190 * start position
191 * end_pos:
192 * end position
194 public void _CopyText(int startPos, int endPos)
196 // void atk_editable_text_copy_text (AtkEditableText *text, gint start_pos, gint end_pos);
197 atk_editable_text_copy_text(atkEditableText, startPos, endPos);
201 * Copy text from start_pos up to, but not including end_pos
202 * to the clipboard and then delete from the widget.
203 * text:
204 * an AtkEditableText
205 * start_pos:
206 * start position
207 * end_pos:
208 * end position
210 public void _CutText(int startPos, int endPos)
212 // void atk_editable_text_cut_text (AtkEditableText *text, gint start_pos, gint end_pos);
213 atk_editable_text_cut_text(atkEditableText, startPos, endPos);
217 * Delete text start_pos up to, but not including end_pos.
218 * text:
219 * an AtkEditableText
220 * start_pos:
221 * start position
222 * end_pos:
223 * end position
225 public void _DeleteText(int startPos, int endPos)
227 // void atk_editable_text_delete_text (AtkEditableText *text, gint start_pos, gint end_pos);
228 atk_editable_text_delete_text(atkEditableText, startPos, endPos);
232 * Paste text from clipboard to specified position.
233 * text:
234 * an AtkEditableText
235 * position:
236 * position to paste
237 * See Also
238 * AtkText
240 public void _PasteText(int position)
242 // void atk_editable_text_paste_text (AtkEditableText *text, gint position);
243 atk_editable_text_paste_text(atkEditableText, position);