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,
73 dbus_int32_t d_startPos = startPos, d_endPos = endPos;
76 cspi_return_val_if_fail (obj != NULL, FALSE);
78 cspi_dbus_call (obj, spi_interface_editable_text, "setAttributes", NULL, "sii=>b", attributes, d_startPos, d_endPos, &retval);
80 cspi_return_val_if_ev ("setAttributes", FALSE);
86 * AccessibleEditableText_setTextContents:
87 * @obj: a pointer to the #AccessibleEditableText object to modify.
88 * @newContents: a character string, encoded in UTF-8, which is to
89 * become the new text contents of the #AccessibleEditableText object.
91 * Replace the entire text contents of an #AccessibleEditableText object.
93 * Returns: #TRUE if the operation was successful, otherwise #FALSE.
96 AccessibleEditableText_setTextContents (AccessibleEditableText *obj,
97 const char *newContents)
101 cspi_return_val_if_fail (obj != NULL, FALSE);
103 cspi_dbus_call (obj, spi_interface_editable_text, "setTextContents", NULL, "s=>b", newContents, &retval);
105 cspi_return_val_if_ev ("setTextContents", FALSE);
111 * AccessibleEditableText_insertText:
112 * @obj: a pointer to the #AccessibleEditableText object to modify.
113 * @position: an integer indicating the character offset at which to insert
115 * @text: a char* pointer to the text to insert, in UTF-8 encoding.
116 * @length: (frankly I'm not sure this parameter should be here)
118 * Insert text into an #AccessibleEditableText object.
119 * As with all character offsets, the specified @position may not be the
120 * same as the resulting byte offset, since the text is in a
121 * variable-width encoding.
123 * Returns: #TRUE if the operation was successful, otherwise #FALSE.
126 AccessibleEditableText_insertText (AccessibleEditableText *obj,
131 dbus_int32_t d_position = position, d_length = length;
134 cspi_return_val_if_fail (obj != NULL, FALSE);
136 cspi_dbus_call (obj, spi_interface_editable_text, "insertText", NULL, "isi=>b", d_position, text, d_length, &retval);
138 cspi_return_val_if_ev ("insertText", FALSE);
144 * AccessibleEditableText_copyText:
145 * @obj: a pointer to the #AccessibleEditableText object to modify.
146 * @startPos: an integer indicating the starting character offset
147 * of the text to copy.
148 * @endPos: an integer indicating the offset of the first character
149 * past the end of the text section to be copied.
151 * Copy text from an #AccessibleEditableText object into the clipboard.
153 * @see: AccessibleEditableText_pasteText
155 * Returns: #TRUE if the operation was successful, otherwise #FALSE.
158 AccessibleEditableText_copyText (AccessibleText *obj,
162 dbus_int32_t d_startPos = startPos, d_endPos = endPos;
164 cspi_return_val_if_fail (obj != NULL, FALSE);
166 cspi_dbus_call (obj, spi_interface_editable_text, "copyText", NULL, "ii", startPos, endPos);
168 cspi_return_val_if_ev ("copyText", FALSE);
174 * AccessibleEditableText_cutText:
175 * @obj: a pointer to the #AccessibleEditableText object to modify.
176 * @startPos: an integer indicating the starting character offset
177 * of the text to cut.
178 * @endPos: an integer indicating the offset of the first character
179 * past the end of the text section to be cut.
181 * Delete text from an #AccessibleEditableText object, copying the
182 * excised portion into the clipboard.
184 * @see: AccessibleEditableText_pasteText
186 * Returns: #TRUE if operation was successful, #FALSE otherwise.
189 AccessibleEditableText_cutText (AccessibleEditableText *obj,
193 dbus_int32_t d_startPos = startPos, d_endPos = endPos;
196 cspi_return_val_if_fail (obj != NULL, FALSE);
198 cspi_dbus_call (obj, spi_interface_editable_text, "cutText", NULL, "ii=>b", d_startPos, d_endPos, &retval);
200 cspi_return_val_if_ev ("cutText", FALSE);
206 * AccessibleEditableText_deleteText:
207 * @obj: a pointer to the #AccessibleEditableText object to modify.
208 * @startPos: an integer indicating the starting character offset
209 * of the text to delete.
210 * @endPos: an integer indicating the offset of the first character
211 * past the end of the text section to be deleted.
213 * Delete text from an #AccessibleEditableText object, without copying the
214 * excised portion into the clipboard.
216 * @see: AccessibleEditableText_cutText
218 * Returns: #TRUE if the operation was successful, otherwise #FALSE.
221 AccessibleEditableText_deleteText (AccessibleEditableText *obj,
225 dbus_int32_t d_startPos = startPos, d_endPos = endPos;
228 cspi_return_val_if_fail (obj != NULL, FALSE);
230 cspi_dbus_call (obj, spi_interface_editable_text, "deleteText", NULL, "ii=>b", d_startPos, d_endPos, &retval);
232 cspi_return_val_if_ev ("deleteText", FALSE);
238 * AccessibleEditableText_pasteText:
239 * @obj: a pointer to the #AccessibleEditableText object to modify.
240 * @position: an integer indicating the character offset at which to insert
243 * Insert text from the clipboard into an #AccessibleEditableText object.
244 * As with all character offsets, the specified @position may not be the
245 * same as the resulting byte offset, since the text is in a
246 * variable-width encoding.
248 * Returns: #TRUE if the operation was successful, otherwise #FALSE.
251 AccessibleEditableText_pasteText (AccessibleEditableText *obj,
254 dbus_int32_t d_position = position;
257 cspi_return_val_if_fail (obj != NULL, FALSE);
259 cspi_dbus_call (obj, spi_interface_editable_text, "pasteText", NULL, "i=>b", d_position, &retval);
261 cspi_return_val_if_ev ("pasteText", FALSE);