atkimplementor: use the G_DEFINE_INTERFACE macro to declare it as interface in the...
[atk.git] / atk / atkaction.h
blob131407103e3fd8ad350443c52872b4d99e7e7a2f
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 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 #ifndef __ATK_ACTION_H__
21 #define __ATK_ACTION_H__
23 #if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
24 #error "Only <atk/atk.h> can be included directly."
25 #endif
27 #include <atk/atkobject.h>
29 G_BEGIN_DECLS
32 * The interface AtkAction should be supported by any object that can
33 * perform one or more actions. The interface provides the standard
34 * mechanism for an assistive technology to determine what those actions
35 * are as well as tell the object to perform them. Any object that can
36 * be manipulated should support this interface.
40 #define ATK_TYPE_ACTION (atk_action_get_type ())
41 #define ATK_IS_ACTION(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_ACTION)
42 #define ATK_ACTION(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_ACTION, AtkAction)
43 #define ATK_ACTION_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_ACTION, AtkActionIface))
45 #ifndef _TYPEDEF_ATK_ACTION_
46 #define _TYPEDEF_ATK_ACTION_
47 typedef struct _AtkAction AtkAction;
48 #endif
49 typedef struct _AtkActionIface AtkActionIface;
51 struct _AtkActionIface
53 GTypeInterface parent;
55 gboolean (*do_action) (AtkAction *action,
56 gint i);
57 gint (*get_n_actions) (AtkAction *action);
58 const gchar* (*get_description) (AtkAction *action,
59 gint i);
60 const gchar* (*get_name) (AtkAction *action,
61 gint i);
62 const gchar* (*get_keybinding) (AtkAction *action,
63 gint i);
64 gboolean (*set_description) (AtkAction *action,
65 gint i,
66 const gchar *desc);
67 const gchar* (*get_localized_name)(AtkAction *action,
68 gint i);
71 ATK_AVAILABLE_IN_ALL
72 GType atk_action_get_type (void);
75 * These are the function which would be called by an application with
76 * the argument being a AtkObject object cast to (AtkAction).
78 * The function will just check that * the corresponding
79 * function pointer is not NULL and will call it.
81 * The "real" implementation of the function for accessible will be
82 * provided in a support library
85 ATK_AVAILABLE_IN_ALL
86 gboolean atk_action_do_action (AtkAction *action,
87 gint i);
88 ATK_AVAILABLE_IN_ALL
89 gint atk_action_get_n_actions (AtkAction *action);
90 ATK_AVAILABLE_IN_ALL
91 const gchar* atk_action_get_description (AtkAction *action,
92 gint i);
93 ATK_AVAILABLE_IN_ALL
94 const gchar* atk_action_get_name (AtkAction *action,
95 gint i);
96 ATK_AVAILABLE_IN_ALL
97 const gchar* atk_action_get_keybinding (AtkAction *action,
98 gint i);
99 ATK_AVAILABLE_IN_ALL
100 gboolean atk_action_set_description (AtkAction *action,
101 gint i,
102 const gchar *desc);
104 /* NEW in ATK 1.1: */
105 ATK_AVAILABLE_IN_ALL
106 const gchar* atk_action_get_localized_name (AtkAction *action,
107 gint i);
110 * Additional GObject properties exported by AtkAction:
111 * "accessible_action"
112 * (an accessible action, or the list of actions, has changed)
115 G_END_DECLS
117 #endif /* __ATK_ACTION_H__ */