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