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 * @action: a GObject instance that implements AtkActionIface
45 * @i: a %gint indicating the action to be performed
47 * This function would be called by an application with
48 * the argument being a AtkObject object cast to (AtkAction).
49 * The function will just check that * the corresponding
50 * function pointer is not NULL and will call it.
51 * The "real" implementation of the function for accessible will be
52 * provided in a support library
56 atk_action_do_action (AtkAction *obj,
59 AtkActionIface *iface;
61 g_return_if_fail (obj != NULL);
62 g_return_if_fail (ATK_IS_ACTION (obj));
64 iface = ATK_ACTION_GET_IFACE (obj);
67 (iface->do_action) (obj, i);
71 * atk_action_get_n_actions:
72 * @action: a GObject instance that implements AtkActionIface
75 * This function would be called by an application with
76 * the argument being a AtkObject object cast to (AtkAction).
77 * The function will just check that * the corresponding
78 * function pointer is not NULL and will call it.
79 * The "real" implementation of the function for accessible will be
80 * provided in a support library
82 * Returns a %gint representing the number of actions , or 0
83 * if value does not implement this interface.
86 atk_action_get_n_actions (AtkAction *obj)
88 AtkActionIface *iface;
90 g_return_val_if_fail (obj != NULL, 0);
91 g_return_val_if_fail (ATK_IS_ACTION (obj), 0);
93 iface = ATK_ACTION_GET_IFACE (obj);
95 if (iface->get_n_actions)
96 return (iface->get_n_actions) (obj);
102 * atk_action_get_description:
103 * @action: a GObject instance that implements AtkActionIface
104 * @i: a %gint indicating the action
107 * This function would be called by an application with
108 * the argument being a AtkObject object cast to (AtkAction).
109 * The function will just check that * the corresponding
110 * function pointer is not NULL and will call it.
111 * The "real" implementation of the function for accessible will be
112 * provided in a support library
114 * Returns a #gchar representing the description, or %NULL
115 * if value does not implement this interface.
117 G_CONST_RETURN gchar*
118 atk_action_get_description (AtkAction *obj,
121 AtkActionIface *iface;
123 g_return_val_if_fail (obj != NULL, NULL);
124 g_return_val_if_fail (ATK_IS_ACTION (obj), NULL);
126 iface = ATK_ACTION_GET_IFACE (obj);
128 if (iface->get_description)
129 return (iface->get_description) (obj, i);
135 * atk_action_get_keybinding:
136 * @action: a GObject instance that implements AtkActionIface
137 * @i: a %gint indicating the action
140 * This function would be called by an application with
141 * the argument being a AtkObject object cast to (AtkAction).
142 * The function will just check that * the corresponding
143 * function pointer is not NULL and will call it.
144 * The "real" implementation of the function for accessible will be
145 * provided in a support library
147 * Returns a #gchar representing the keybinding, or %NULL
148 * if there is no keybinding for this action.
151 G_CONST_RETURN gchar*
152 atk_action_get_keybinding (AtkAction *obj,
155 AtkActionIface *iface;
157 g_return_val_if_fail (obj != NULL, NULL);
158 g_return_val_if_fail (ATK_IS_ACTION (obj), NULL);
160 iface = ATK_ACTION_GET_IFACE (obj);
162 if (iface->get_keybinding)
163 return (iface->get_keybinding) (obj, i);