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