1 /* ATK - The Accessibility Toolkit for GTK+
2 * Copyright 2001 Sun Microsystems Inc.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 #include "atkeditabletext.h"
23 struct _AtkEditableTextIfaceClass
28 typedef struct _AtkEditableTextIfaceClass AtkEditableTextIfaceClass;
31 atk_editable_text_get_type ()
33 static GType type = 0;
36 static const GTypeInfo tinfo =
38 sizeof (AtkEditableTextIface),
44 type = g_type_register_static (G_TYPE_INTERFACE, "AtkEditableText", &tinfo, 0);
52 *atk_editable_text_select_text:
53 *@text: an #AtkEditableText
54 *@start_pos: start position
55 *@end_pos: end position
57 *Select text between @start_pos and @end_pos
60 atk_editable_text_select_text (AtkEditableText *text,
64 AtkEditableTextIface *iface;
66 g_return_if_fail (text != NULL);
67 g_return_if_fail (ATK_IS_EDITABLE_TEXT (text));
69 iface = ATK_EDITABLE_TEXT_GET_IFACE (text);
71 if (iface->select_text)
72 (*(iface->select_text)) (text, start_pos, end_pos);
76 *atk_editable_text_set_attributes:
77 *@text: an #AtkEditableText
78 *@start_pos: start position
79 *@end_pos: end position
80 *@attributes: a #PangoAttrList to set for @text
82 *Set attributes for text between @start_pos and @end_pos
85 atk_editable_text_set_attributes (AtkEditableText *text,
88 PangoAttrList *attributes)
90 AtkEditableTextIface *iface;
92 g_return_if_fail (text != NULL);
93 g_return_if_fail (ATK_IS_EDITABLE_TEXT (text));
95 iface = ATK_EDITABLE_TEXT_GET_IFACE (text);
97 if (iface->set_attributes)
98 (*(iface->set_attributes)) (text, start_pos, end_pos, attributes);
102 *atk_editable_text_set_text_contents:
103 *@text: an #AtkEditableText
104 *@string: string to set for text contents of @text
106 *Set text contents of @text
109 atk_editable_text_set_text_contents (AtkEditableText *text,
112 AtkEditableTextIface *iface;
114 g_return_if_fail (text != NULL);
115 g_return_if_fail (ATK_IS_EDITABLE_TEXT (text));
117 iface = ATK_EDITABLE_TEXT_GET_IFACE (text);
119 if (iface->set_text_contents)
120 (*(iface->set_text_contents)) (text, string);
124 *atk_editable_text_insert_text:
125 *@text: an #AtkEditableText
126 *@string: a #gchar string to insert
127 *@length: number of characters to insert @string
128 *@position: position at which to insert @string
130 *Insert @length characters of @string into text contents
131 * of @text at position @position
134 atk_editable_text_insert_text (AtkEditableText *text,
139 AtkEditableTextIface *iface;
141 g_return_if_fail (text != NULL);
142 g_return_if_fail (ATK_IS_EDITABLE_TEXT (text));
144 iface = ATK_EDITABLE_TEXT_GET_IFACE (text);
146 if (iface->insert_text)
147 (*(iface->insert_text)) (text, string, length, position);
151 *atk_editable_text_copy_text:
152 *@text: an #AtkEditableText
153 *@start_pos: start position
154 *@end_pos: end position
156 * Copy text between @start_pos and @end_pos
159 atk_editable_text_copy_text (AtkEditableText *text,
163 AtkEditableTextIface *iface;
165 g_return_if_fail (text != NULL);
166 g_return_if_fail (ATK_IS_EDITABLE_TEXT (text));
168 iface = ATK_EDITABLE_TEXT_GET_IFACE (text);
170 if (iface->copy_text)
171 (*(iface->copy_text)) (text, start_pos, end_pos);
175 *atk_editable_text_cut_text:
176 *@text: an #AtkEditableText
177 *@start_pos: start position
178 *@end_pos: end position
180 * Cut text between @start_pos and @end_pos
183 atk_editable_text_cut_text (AtkEditableText *text,
187 AtkEditableTextIface *iface;
189 g_return_if_fail (text != NULL);
190 g_return_if_fail (ATK_IS_EDITABLE_TEXT (text));
192 iface = ATK_EDITABLE_TEXT_GET_IFACE (text);
195 (*(iface->cut_text)) (text, start_pos, end_pos);
199 *atk_editable_text_delete_text:
200 *@text: an #AtkEditableText
201 *@start_pos: start position
202 *@end_pos: end position
204 * Delete text between @start_pos and @end_pos
207 atk_editable_text_delete_text (AtkEditableText *text,
211 AtkEditableTextIface *iface;
213 g_return_if_fail (text != NULL);
214 g_return_if_fail (ATK_IS_EDITABLE_TEXT (text));
216 iface = ATK_EDITABLE_TEXT_GET_IFACE (text);
218 if (iface->delete_text)
219 (*(iface->delete_text)) (text, start_pos, end_pos);
223 *atk_editable_text_paste_text:
224 *@text: an #AtkEditableText
225 *@position: position to paste
227 * Paste text at @position
230 atk_editable_text_paste_text (AtkEditableText *text,
233 AtkEditableTextIface *iface;
235 g_return_if_fail (text != NULL);
236 g_return_if_fail (ATK_IS_EDITABLE_TEXT (text));
238 iface = ATK_EDITABLE_TEXT_GET_IFACE (text);
240 if (iface->paste_text)
241 (*(iface->paste_text)) (text, position);