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 "atspi-private.h"
29 * atspi_editable_text_set_attributes:
30 * @obj: a pointer to the #AtspiEditableText object to modify.
31 * @attributes: a string indicating the attributes to apply to the range,
33 * @startOffset: a #gint indicating the start of the desired text range.
34 * @endOffset: a #gint indicating the first character past the desired range.
36 * Sets the attributes applied to a range of text from an #AtspiEditableText
37 * object, and the bounds of the range.
39 * Returns: #TRUE if the operation was successful, otherwise #FALSE.
42 atspi_editable_text_set_attributes (AtspiEditableText *obj,
43 const char *attributes,
48 dbus_int32_t d_start_pos = start_pos, d_end_pos = end_pos;
49 dbus_bool_t retval = FALSE;
51 cspi_return_val_if_fail (obj != NULL, FALSE);
53 _atspi_dbus_call (obj, atspi_interface_editable_text, "SetAttributes", error, "sii=>b", attributes, d_start_pos, d_end_pos, &retval);
60 * atspi_editable_text_set_text_contents:
61 * @obj: a pointer to the #AtspiEditableText object to modify.
62 * @new_contents: a character string, encoded in UTF-8, which is to
63 * become the new text contents of the #AtspiEditableText object.
65 * Replace the entire text contents of an #AtspiEditableText object.
67 * Returns: #TRUE if the operation was successful, otherwise #FALSE.
70 atspi_editable_text_set_text_contents (AtspiEditableText *obj,
71 const gchar *new_contents,
74 dbus_bool_t retval = FALSE;
76 g_return_val_if_fail (obj != NULL, FALSE);
78 _atspi_dbus_call (obj, atspi_interface_editable_text, "SetTextContents", error, "s=>b", new_contents, &retval);
84 * atspi_editable_text_insert_text:
85 * @obj: a pointer to the #AtspiEditableText object to modify.
86 * @position: a #gint indicating the character offset at which to insert
88 * @text: a string representing the text to insert, in UTF-8 encoding.
89 * @length: the number of characters of text to insert. If the character
90 * count of text is less than or equal to length, the entire contents
91 * of text will be inserted. Passing -1 indicates that the whole string
94 * Inserts text into an #AtspiEditableText object.
95 * As with all character offsets, the specified @position may not be the
96 * same as the resulting byte offset, since the text is in a
97 * variable-width encoding.
99 * Returns: #TRUE if the operation was successful, otherwise #FALSE.
102 atspi_editable_text_insert_text (AtspiEditableText *obj,
108 dbus_int32_t d_position = position, d_length = length;
109 dbus_bool_t retval = FALSE;
111 g_return_val_if_fail (obj != NULL, FALSE);
113 _atspi_dbus_call (obj, atspi_interface_editable_text, "InsertText", error, "isi=>b", d_position, text, d_length, &retval);
119 * atspi_editable_text_copy_text:
120 * @obj: a pointer to the #AtspiEditableText object to modify.
121 * @start_pos: a #gint indicating the starting character offset
122 * of the text to copy.
123 * @end_pos: a #gint indicating the offset of the first character
124 * past the end of the text section to be copied.
126 * Copies text from an #AtspiEditableText object into the system clipboard.
128 * see: #atspi_editable_text_paste_text
130 * Returns: #TRUE if the operation was successful, otherwise #FALSE.
133 atspi_editable_text_copy_text (AtspiEditableText *obj,
138 dbus_int32_t d_start_pos = start_pos, d_end_pos = end_pos;
140 g_return_val_if_fail (obj != NULL, FALSE);
142 _atspi_dbus_call (obj, atspi_interface_editable_text, "CopyText", error, "ii", d_start_pos, d_end_pos);
148 * atspi_editable_text_cut_text:
149 * @obj: a pointer to the #AtspiEditableText object to modify.
150 * @start_pos: a #gint indicating the starting character offset
151 * of the text to cut.
152 * @end_pos: a #gint indicating the offset of the first character
153 * past the end of the text section to be cut.
155 * Deletes text from an #AtspiEditableText object, copying the
156 * excised portion into the system clipboard.
158 * see: #atspi_editable_text_paste_text
160 * Returns: #TRUE if operation was successful, #FALSE otherwise.
163 atspi_editable_text_cut_text (AtspiEditableText *obj,
168 dbus_int32_t d_start_pos = start_pos, d_end_pos = end_pos;
169 dbus_bool_t retval = FALSE;
171 g_return_val_if_fail (obj != NULL, FALSE);
173 _atspi_dbus_call (obj, atspi_interface_editable_text, "CutText", error, "ii=>b", d_start_pos, d_end_pos, &retval);
179 * atspi_editable_text_delete_text:
180 * @obj: a pointer to the #AtspiEditableText object to modify.
181 * @start_pos: a #gint indicating the starting character offset
182 * of the text to delete.
183 * @end_pos: a #gint indicating the offset of the first character
184 * past the end of the text section to be deleted.
186 * Deletes text from an #AtspiEditableText object, without copying the
187 * excised portion into the system clipboard.
189 * see: #atspi_editable_text_cut_text
191 * Returns: #TRUE if the operation was successful, otherwise #FALSE.
194 atspi_editable_text_delete_text (AtspiEditableText *obj,
199 dbus_int32_t d_start_pos = start_pos, d_end_pos = end_pos;
200 dbus_bool_t retval = FALSE;
202 g_return_val_if_fail (obj != NULL, FALSE);
204 _atspi_dbus_call (obj, atspi_interface_editable_text, "DeleteText", error, "ii=>b", d_start_pos, d_end_pos, &retval);
210 * atspi_editable_text_paste_text:
211 * @obj: a pointer to the #AtspiEditableText object to modify.
212 * @position: a #gint indicating the character offset at which to insert
215 * Inserts text from the system clipboard into an #AtspiEditableText object.
216 * As with all character offsets, the specified @position may not be the
217 * same as the resulting byte offset, since the text is in a
218 * variable-width encoding.
220 * Returns: #TRUE if the operation was successful, otherwise #FALSE.
223 atspi_editable_text_paste_text (AtspiEditableText *obj,
227 dbus_int32_t d_position = position;
228 dbus_bool_t retval = FALSE;
230 g_return_val_if_fail (obj != NULL, FALSE);
232 _atspi_dbus_call (obj, atspi_interface_editable_text, "PasteText", error, "i=>b", d_position, &retval);
238 atspi_editable_text_base_init (AtspiEditableText *klass)
243 atspi_editable_text_get_type (void)
245 static GType type = 0;
248 static const GTypeInfo tinfo =
250 sizeof (AtspiEditableText),
251 (GBaseInitFunc) atspi_editable_text_base_init,
252 (GBaseFinalizeFunc) NULL,
255 type = g_type_register_static (G_TYPE_INTERFACE, "AtspiEditableText", &tinfo, 0);