2 * AT-SPI - Assistive Technology Service Provider Interface
3 * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
5 * Copyright 2001, 2002 Sun Microsystems Inc.,
6 * Copyright 2001, 2002 Ximian, Inc.
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
18 * You should have received a copy of the GNU Library General Public
19 * License along with this library; if not, write to the
20 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 * Boston, MA 02111-1307, USA.
24 #include <cspi/spi-private.h>
27 * AccessibleEditableText_ref:
28 * @obj: a pointer to the #AccessibleEditableText object on which to operate.
30 * Increment the reference count for an #AccessibleEditableText object.
31 * Since AccessibleEditableText is derived from AccessibleText,
32 * this is the same as AccessibleText_ref().
35 AccessibleEditableText_ref (AccessibleEditableText *obj)
37 cspi_object_ref (obj);
41 * AccessibleEditableText_unref:
42 * @obj: a pointer to the #AccessibleEditableText object on which to operate.
44 * Decrement the reference count for an #AccessibleEdiitableText object.
45 * Since AccessibleEditableText is derived from AccessibleText,
46 * this is the same as AccessibleText_unref().
49 AccessibleEditableText_unref (AccessibleEditableText *obj)
51 cspi_object_unref (obj);
55 * AccessibleEditableText_setAttributes:
56 * @obj: a pointer to the #AccessibleEditableText object to modify.
57 * @attributes: a character string indicating the attributes to apply to the range,
59 * @startOffset: a #long indicating the start of the desired text range.
60 * @endOffset: a #long indicating the first character past the desired range.
62 * Set the attributes applied to a range of text from an #AccessibleEditableText
63 * object, and the bounds of the range.
65 * Returns: #TRUE if the operation was successful, otherwise #FALSE.
68 AccessibleEditableText_setAttributes (AccessibleEditableText *obj,
69 const char *attributes,
75 cspi_return_val_if_fail (obj != NULL, FALSE);
78 Accessibility_EditableText_setAttributes (CSPI_OBJREF (obj),
83 cspi_return_val_if_ev ("setAttributes", FALSE);
89 * AccessibleEditableText_setTextContents:
90 * @obj: a pointer to the #AccessibleEditableText object to modify.
91 * @newContents: a character string, encoded in UTF-8, which is to
92 * become the new text contents of the #AccessibleEditableText object.
94 * Replace the entire text contents of an #AccessibleEditableText object.
96 * Returns: #TRUE if the operation was successful, otherwise #FALSE.
99 AccessibleEditableText_setTextContents (AccessibleEditableText *obj,
100 const char *newContents)
104 cspi_return_val_if_fail (obj != NULL, FALSE);
106 retval = Accessibility_EditableText_setTextContents (CSPI_OBJREF (obj),
107 newContents, cspi_ev ());
109 cspi_return_val_if_ev ("setTextContents", FALSE);
115 * AccessibleEditableText_insertText:
116 * @obj: a pointer to the #AccessibleEditableText object to modify.
117 * @position: an integer indicating the character offset at which to insert
119 * @text: a char* pointer to the text to insert, in UTF-8 encoding.
120 * @length: (frankly I'm not sure this parameter should be here)
122 * Insert text into an #AccessibleEditableText object.
123 * As with all character offsets, the specified @position may not be the
124 * same as the resulting byte offset, since the text is in a
125 * variable-width encoding.
127 * Returns: #TRUE if the operation was successful, otherwise #FALSE.
130 AccessibleEditableText_insertText (AccessibleEditableText *obj,
137 cspi_return_val_if_fail (obj != NULL, FALSE);
139 retval = Accessibility_EditableText_insertText (CSPI_OBJREF (obj),
143 cspi_return_val_if_ev ("insertText", FALSE);
149 * AccessibleEditableText_copyText:
150 * @obj: a pointer to the #AccessibleEditableText object to modify.
151 * @startPos: an integer indicating the starting character offset
152 * of the text to copy.
153 * @endPos: an integer indicating the offset of the first character
154 * past the end of the text section to be copied.
156 * Copy text from an #AccessibleEditableText object into the clipboard.
158 * @see: AccessibleEditableText_pasteText
160 * Returns: #TRUE if the operation was successful, otherwise #FALSE.
163 AccessibleEditableText_copyText (AccessibleText *obj,
167 cspi_return_val_if_fail (obj != NULL, FALSE);
169 Accessibility_EditableText_copyText (
170 CSPI_OBJREF (obj), startPos,
173 cspi_return_val_if_ev ("copyText", FALSE);
179 * AccessibleEditableText_cutText:
180 * @obj: a pointer to the #AccessibleEditableText object to modify.
181 * @startPos: an integer indicating the starting character offset
182 * of the text to cut.
183 * @endPos: an integer indicating the offset of the first character
184 * past the end of the text section to be cut.
186 * Delete text from an #AccessibleEditableText object, copying the
187 * excised portion into the clipboard.
189 * @see: AccessibleEditableText_pasteText
191 * Returns: #TRUE if operation was successful, #FALSE otherwise.
194 AccessibleEditableText_cutText (AccessibleEditableText *obj,
200 cspi_return_val_if_fail (obj != NULL, FALSE);
202 retval = Accessibility_EditableText_cutText (
204 startPos, endPos, cspi_ev ());
206 cspi_return_val_if_ev ("cutText", FALSE);
212 * AccessibleEditableText_deleteText:
213 * @obj: a pointer to the #AccessibleEditableText object to modify.
214 * @startPos: an integer indicating the starting character offset
215 * of the text to delete.
216 * @endPos: an integer indicating the offset of the first character
217 * past the end of the text section to be deleted.
219 * Delete text from an #AccessibleEditableText object, without copying the
220 * excised portion into the clipboard.
222 * @see: AccessibleEditableText_cutText
224 * Returns: #TRUE if the operation was successful, otherwise #FALSE.
227 AccessibleEditableText_deleteText (AccessibleEditableText *obj,
233 cspi_return_val_if_fail (obj != NULL, FALSE);
235 retval = Accessibility_EditableText_deleteText (
237 startPos, endPos, cspi_ev ());
239 cspi_return_val_if_ev ("deleteText", FALSE);
245 * AccessibleEditableText_pasteText:
246 * @obj: a pointer to the #AccessibleEditableText object to modify.
247 * @position: an integer indicating the character offset at which to insert
250 * Insert text from the clipboard into an #AccessibleEditableText object.
251 * As with all character offsets, the specified @position may not be the
252 * same as the resulting byte offset, since the text is in a
253 * variable-width encoding.
255 * Returns: #TRUE if the operation was successful, otherwise #FALSE.
258 AccessibleEditableText_pasteText (AccessibleEditableText *obj,
263 cspi_return_val_if_fail (obj != NULL, FALSE);
265 retval = Accessibility_EditableText_pasteText (
266 CSPI_OBJREF (obj), position, cspi_ev ());
268 cspi_return_val_if_ev ("pasteText", FALSE);