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 = AtkEditableText.html 27 * outPack = atk 28 * outFile = EditableText 29 * strct = AtkEditableText 30 * realStrct= 31 * ctorStrct= 32 * clss = EditableText 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - atk_editable_text_ 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 atk.EditableText; 54 55 public import gtkc.atktypes; 56 57 private import gtkc.atk; 58 private import glib.ConstructionException; 59 private import gobject.ObjectG; 60 61 62 private import glib.Str; 63 64 65 66 67 /** 68 * AtkEditableText should be implemented by UI components which 69 * contain text which the user can edit, via the AtkObject 70 * corresponding to that component (see AtkObject). 71 * 72 * AtkEditableText is a subclass of AtkText, and as such, an object 73 * which implements AtkEditableText is by definition an AtkText 74 * implementor as well. 75 * 76 * See also: AtkText 77 */ 78 public class EditableText 79 { 80 81 /** the main Gtk struct */ 82 protected AtkEditableText* atkEditableText; 83 84 85 public AtkEditableText* getEditableTextStruct() 86 { 87 return atkEditableText; 88 } 89 90 91 /** the main Gtk struct as a void* */ 92 protected void* getStruct() 93 { 94 return cast(void*)atkEditableText; 95 } 96 97 /** 98 * Sets our main struct and passes it to the parent class 99 */ 100 public this (AtkEditableText* atkEditableText) 101 { 102 this.atkEditableText = atkEditableText; 103 } 104 105 /** 106 */ 107 108 /** 109 * Sets the attributes for a specified range. See the ATK_ATTRIBUTE 110 * macros (such as ATK_ATTRIBUTE_LEFT_MARGIN) for examples of attributes 111 * that can be set. Note that other attributes that do not have corresponding 112 * ATK_ATTRIBUTE macros may also be set for certain text widgets. 113 * Params: 114 * attribSet = an AtkAttributeSet 115 * startOffset = start of range in which to set attributes 116 * endOffset = end of range in which to set attributes 117 * Returns: TRUE if attributes successfully set for the specified range, otherwise FALSE 118 */ 119 public int setRunAttributes(AtkAttributeSet* attribSet, int startOffset, int endOffset) 120 { 121 // gboolean atk_editable_text_set_run_attributes (AtkEditableText *text, AtkAttributeSet *attrib_set, gint start_offset, gint end_offset); 122 return atk_editable_text_set_run_attributes(atkEditableText, attribSet, startOffset, endOffset); 123 } 124 125 /** 126 * Set text contents of text. 127 * Params: 128 * string = string to set for text contents of text 129 */ 130 public void setTextContents(string string) 131 { 132 // void atk_editable_text_set_text_contents (AtkEditableText *text, const gchar *string); 133 atk_editable_text_set_text_contents(atkEditableText, Str.toStringz(string)); 134 } 135 136 /** 137 * Insert text at a given position. 138 * Params: 139 * string = the text to insert 140 * length = the length of text to insert, in bytes 141 * position = The caller initializes this to 142 * the position at which to insert the text. After the call it 143 * points at the position after the newly inserted text. 144 */ 145 public void insertText(string string, int length, ref int position) 146 { 147 // void atk_editable_text_insert_text (AtkEditableText *text, const gchar *string, gint length, gint *position); 148 atk_editable_text_insert_text(atkEditableText, Str.toStringz(string), length, &position); 149 } 150 151 /** 152 * Copy text from start_pos up to, but not including end_pos 153 * to the clipboard. 154 * Params: 155 * startPos = start position 156 * endPos = end position 157 */ 158 public void copyText(int startPos, int endPos) 159 { 160 // void atk_editable_text_copy_text (AtkEditableText *text, gint start_pos, gint end_pos); 161 atk_editable_text_copy_text(atkEditableText, startPos, endPos); 162 } 163 164 /** 165 * Copy text from start_pos up to, but not including end_pos 166 * to the clipboard and then delete from the widget. 167 * Params: 168 * startPos = start position 169 * endPos = end position 170 */ 171 public void cutText(int startPos, int endPos) 172 { 173 // void atk_editable_text_cut_text (AtkEditableText *text, gint start_pos, gint end_pos); 174 atk_editable_text_cut_text(atkEditableText, startPos, endPos); 175 } 176 177 /** 178 * Delete text start_pos up to, but not including end_pos. 179 * Params: 180 * startPos = start position 181 * endPos = end position 182 */ 183 public void deleteText(int startPos, int endPos) 184 { 185 // void atk_editable_text_delete_text (AtkEditableText *text, gint start_pos, gint end_pos); 186 atk_editable_text_delete_text(atkEditableText, startPos, endPos); 187 } 188 189 /** 190 * Paste text from clipboard to specified position. 191 * Params: 192 * position = position to paste 193 */ 194 public void pasteText(int position) 195 { 196 // void atk_editable_text_paste_text (AtkEditableText *text, gint position); 197 atk_editable_text_paste_text(atkEditableText, position); 198 } 199 }