1 /* ATK - Accessibility Toolkit
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 Lesser 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 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser 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 "atkselection.h"
23 atk_selection_get_type ()
25 static GType type = 0;
30 sizeof (AtkSelectionIface),
36 type = g_type_register_static (G_TYPE_INTERFACE, "AtkSelection", &tinfo, 0);
43 * atk_selection_add_selection:
44 * @value: a GObject instance that implements AtkSelectionIface
48 atk_selection_add_selection (AtkSelection *obj,
51 AtkSelectionIface *iface;
53 g_return_if_fail (obj != NULL);
54 g_return_if_fail (ATK_IS_SELECTION (obj));
56 iface = ATK_SELECTION_GET_IFACE (obj);
58 if (iface->add_selection)
59 (iface->add_selection) (obj, i);
63 * atk_selection_clear_selection:
64 * @value: a GObject instance that implements AtkSelectionIface
68 atk_selection_clear_selection (AtkSelection *obj)
70 AtkSelectionIface *iface;
72 g_return_if_fail (obj != NULL);
73 g_return_if_fail (ATK_IS_SELECTION (obj));
75 iface = ATK_SELECTION_GET_IFACE (obj);
77 if (iface->clear_selection)
78 (iface->clear_selection) (obj);
82 * atk_selection_ref_selection:
83 * @value: a GObject instance that implements AtkSelectionIface
84 * @return: a AtkObject* representing the selected accessible , or NULL
85 * if value does not implement this interface.
87 * WARNING: callers should not rely on %NULL or on a zero value for
88 * indication of whether AtkSelectionIface is implemented, they should
89 * use type checking/interface checking macros or the
90 * atk_get_accessible_value() convenience method.
93 atk_selection_ref_selection (AtkSelection *obj,
96 AtkSelectionIface *iface;
98 g_return_val_if_fail (obj != NULL, NULL);
99 g_return_val_if_fail (ATK_IS_SELECTION (obj), NULL);
101 iface = ATK_SELECTION_GET_IFACE (obj);
103 if (iface->ref_selection)
104 return (iface->ref_selection) (obj, i);
110 * atk_selection_get_selection_count:
111 * @value: a GObject instance that implements AtkSelectionIface
112 * @return: a gint representing the number of items selected, or 0
113 * if value does not implement this interface.
115 * WARNING: callers should not rely on %NULL or on a zero value for
116 * indication of whether AtkSelectionIface is implemented, they should
117 * use type checking/interface checking macros or the
118 * atk_get_accessible_value() convenience method.
121 atk_selection_get_selection_count (AtkSelection *obj)
123 AtkSelectionIface *iface;
125 g_return_val_if_fail (obj != NULL, 0);
126 g_return_val_if_fail (ATK_IS_SELECTION (obj), 0);
128 iface = ATK_SELECTION_GET_IFACE (obj);
130 if (iface->get_selection_count)
131 return (iface->get_selection_count) (obj);
137 * atk_selection_is_child_selected:
138 * @value: a GObject instance that implements AtkSelectionIface
139 * @return: a gboolean representing the specified child is selected, or 0
140 * if value does not implement this interface.
142 * WARNING: callers should not rely on %NULL or on a zero value for
143 * indication of whether AtkSelectionIface is implemented, they should
144 * use type checking/interface checking macros or the
145 * atk_get_accessible_value() convenience method.
148 atk_selection_is_child_selected (AtkSelection *obj,
151 AtkSelectionIface *iface;
153 g_return_val_if_fail (obj != NULL, FALSE);
154 g_return_val_if_fail (ATK_IS_SELECTION (obj), FALSE);
156 iface = ATK_SELECTION_GET_IFACE (obj);
158 if (iface->is_child_selected)
159 return (iface->is_child_selected) (obj, i);
165 * atk_selection_remove_selection:
166 * @value: a GObject instance that implements AtkSelectionIface
170 atk_selection_remove_selection (AtkSelection *obj,
173 AtkSelectionIface *iface;
175 g_return_if_fail (obj != NULL);
176 g_return_if_fail (ATK_IS_SELECTION (obj));
178 iface = ATK_SELECTION_GET_IFACE (obj);
180 if (iface->remove_selection)
181 (iface->remove_selection) (obj, i);
185 * atk_selection_select_all_selection:
186 * @value: a GObject instance that implements AtkSelectionIface
190 atk_selection_select_all_selection (AtkSelection *obj)
192 AtkSelectionIface *iface;
194 g_return_if_fail (obj != NULL);
195 g_return_if_fail (ATK_IS_SELECTION (obj));
197 iface = ATK_SELECTION_GET_IFACE (obj);
199 if (iface->select_all_selection)
200 (iface->select_all_selection) (obj);