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 "atkaction.h"
23 atk_action_get_type ()
25 static GType type = 0;
30 sizeof (AtkActionIface),
36 type = g_type_register_static (G_TYPE_INTERFACE, "AtkAction", &tinfo, 0);
43 * atk_action_do_action:
44 * @value: a GObject instance that implements AtkActionIface
48 atk_action_do_action (AtkAction *obj,
51 AtkActionIface *iface;
53 g_return_if_fail (obj != NULL);
54 g_return_if_fail (ATK_IS_ACTION (obj));
56 iface = ATK_ACTION_GET_IFACE (obj);
59 (iface->do_action) (obj, i);
63 * atk_action_get_n_actions:
64 * @value: a GObject instance that implements AtkActionIface
65 * @return: a gint representing the number of actions , or 0
66 * if value does not implement this interface.
68 * WARNING: callers should not rely on %NULL or on a zero value for
69 * indication of whether GaccessibleActionValue is implemented, they should
70 * use type checking/interface checking macros or the
71 * atk_object_get_action_interface() convenience method.
74 atk_action_get_n_actions (AtkAction *obj)
76 AtkActionIface *iface;
78 g_return_val_if_fail (obj != NULL, 0);
79 g_return_val_if_fail (ATK_IS_ACTION (obj), 0);
81 iface = ATK_ACTION_GET_IFACE (obj);
83 if (iface->get_n_actions)
84 return (iface->get_n_actions) (obj);
90 * atk_action_get_description:
91 * @value: a GObject instance that implements AtkActionIface
92 * @return: a #gchar representing the description, or %NULL
93 * if value does not implement this interface.
95 * WARNING: callers should not rely on %NULL or on a zero value for
96 * indication of whether GaccessibleValue is implemented, they should
97 * use type checking/interface checking macros or the
98 * atk_object_get_action_interface() convenience method.
100 G_CONST_RETURN gchar*
101 atk_action_get_description (AtkAction *obj,
104 AtkActionIface *iface;
106 g_return_val_if_fail (obj != NULL, NULL);
107 g_return_val_if_fail (ATK_IS_ACTION (obj), NULL);
109 iface = ATK_ACTION_GET_IFACE (obj);
111 if (iface->get_description)
112 return (iface->get_description) (obj, i);
118 * atk_action_get_keybinding:
119 * @value: a GObject instance that implements AtkActionIface
120 * @return: a #gchar representing the keybinding, or %NULL
121 * if there is no keybinding for this action.
124 G_CONST_RETURN gchar*
125 atk_action_get_keybinding (AtkAction *obj,
128 AtkActionIface *iface;
130 g_return_val_if_fail (obj != NULL, NULL);
131 g_return_val_if_fail (ATK_IS_ACTION (obj), NULL);
133 iface = ATK_ACTION_GET_IFACE (obj);
135 if (iface->get_keybinding)
136 return (iface->get_keybinding) (obj, i);