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 (AtkEditableText *text,
56 AtkEditableTextIface *iface;
58 g_return_if_fail (text != NULL);
59 g_return_if_fail (ATK_IS_EDITABLE_TEXT (text));
61 iface = ATK_EDITABLE_TEXT_GET_IFACE (text);
63 if (iface->select_text)
64 (*(iface->select_text)) (text, start_pos, end_pos);
68 atk_editable_text_set_attributes (AtkEditableText *text,
71 PangoAttrList *attributes)
73 AtkEditableTextIface *iface;
75 g_return_if_fail (text != NULL);
76 g_return_if_fail (ATK_IS_EDITABLE_TEXT (text));
78 iface = ATK_EDITABLE_TEXT_GET_IFACE (text);
80 if (iface->set_attributes)
81 (*(iface->set_attributes)) (text, start_pos, end_pos, attributes);
85 atk_editable_text_set_text_contents (AtkEditableText *text,
88 AtkEditableTextIface *iface;
90 g_return_if_fail (text != NULL);
91 g_return_if_fail (ATK_IS_EDITABLE_TEXT (text));
93 iface = ATK_EDITABLE_TEXT_GET_IFACE (text);
95 if (iface->set_text_contents)
96 (*(iface->set_text_contents)) (text, string);
100 atk_editable_text_insert_text (AtkEditableText *text,
105 AtkEditableTextIface *iface;
107 g_return_if_fail (text != NULL);
108 g_return_if_fail (ATK_IS_EDITABLE_TEXT (text));
110 iface = ATK_EDITABLE_TEXT_GET_IFACE (text);
112 if (iface->insert_text)
113 (*(iface->insert_text)) (text, string, length, position);
117 atk_editable_text_copy_text (AtkEditableText *text,
121 AtkEditableTextIface *iface;
123 g_return_if_fail (text != NULL);
124 g_return_if_fail (ATK_IS_EDITABLE_TEXT (text));
126 iface = ATK_EDITABLE_TEXT_GET_IFACE (text);
128 if (iface->copy_text)
129 (*(iface->copy_text)) (text, start_pos, end_pos);
133 atk_editable_text_cut_text (AtkEditableText *text,
137 AtkEditableTextIface *iface;
139 g_return_if_fail (text != NULL);
140 g_return_if_fail (ATK_IS_EDITABLE_TEXT (text));
142 iface = ATK_EDITABLE_TEXT_GET_IFACE (text);
145 (*(iface->cut_text)) (text, start_pos, end_pos);
149 atk_editable_text_delete_text (AtkEditableText *text,
153 AtkEditableTextIface *iface;
155 g_return_if_fail (text != NULL);
156 g_return_if_fail (ATK_IS_EDITABLE_TEXT (text));
158 iface = ATK_EDITABLE_TEXT_GET_IFACE (text);
160 if (iface->delete_text)
161 (*(iface->delete_text)) (text, start_pos, end_pos);
165 atk_editable_text_paste_text (AtkEditableText *text,
168 AtkEditableTextIface *iface;
170 g_return_if_fail (text != NULL);
171 g_return_if_fail (ATK_IS_EDITABLE_TEXT (text));
173 iface = ATK_EDITABLE_TEXT_GET_IFACE (text);
175 if (iface->paste_text)
176 (*(iface->paste_text)) (text, position);