Latest rev (previous commit was out of date). Added README and NEWS.
[platform/upstream/atk.git] / atk / atkaction.h
1 /* ATK -  Accessibility Toolkit
2  * Copyright 2001 Sun Microsystems Inc.
3  *
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.
8  *
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.
13  *
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.
18  */
19
20 #ifndef __ATK_ACTION_H__
21 #define __ATK_ACTION_H__
22
23 #include <atk/atkobject.h>
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif /* __cplusplus */
28
29 /*
30  * The interface AtkAction should be supported by any object that can 
31  * perform one or more actions. The interface provides the standard 
32  * mechanism for an assitive technology to determine what those actions 
33  * are as well as tell the object to perform them. Any object that can 
34  * be manipulated should support this interface.
35  */
36
37
38 #define ATK_TYPE_ACTION                    (atk_action_get_type ())
39 #define ATK_IS_ACTION(obj)                 G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_ACTION)
40 #define ATK_ACTION(obj)                    G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_ACTION, AtkAction)
41 #define ATK_ACTION_GET_IFACE(obj)          (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_ACTION, AtkActionIface))
42
43 #ifndef _TYPEDEF_ATK_ACTION_
44 #define _TYPEDEF_ATK_ACTION_
45 typedef struct _AtkAction AtkAction;
46 #endif
47 typedef struct _AtkActionIface AtkActionIface;
48
49 struct _AtkActionIface
50 {
51   GTypeInterface parent;
52
53   /*
54    * Perform the specified action on the object
55    */
56   gboolean (*do_action)         (AtkAction         *action,
57                                  gint              i);
58   /*
59    * Returns the number of accessible actions available on the object.
60    * If there are more than one, the first one is considered the
61    * "default" action of the object.
62    */
63   gint     (*get_n_actions)     (AtkAction         *action);
64   /*
65    * Returns a description of the specified action of the object
66    */
67   G_CONST_RETURN gchar*   (*get_description)   (AtkAction         *action,
68                                                 gint              i);
69   /*
70    * Returns a keybinding associated with this action, if one exists.
71    */
72   G_CONST_RETURN gchar*   (*get_keybinding)    (AtkAction         *action,
73                                                 gint              i);
74
75 };
76 GType atk_action_get_type ();
77
78 /*
79  * These are the function which would be called by an application with
80  * the argument being a AtkObject object cast to (AtkAction).
81  *
82  * The function will just check that * the corresponding
83  * function pointer is not NULL and will call it.
84  *
85  * The "real" implementation of the function for accessible will be
86  * provided in a support library
87  */
88
89 void   atk_action_do_action                (AtkAction         *action,
90                                             gint              i);
91 gint   atk_action_get_n_actions            (AtkAction *action);
92 G_CONST_RETURN gchar* atk_action_get_description  (AtkAction         *action,
93                                                    gint              i);
94 G_CONST_RETURN gchar* atk_action_get_keybinding   (AtkAction         *action,
95                                                    gint              i);
96
97
98 /*
99  * Additional GObject properties exported by AtkAction:
100  *    "accessible_action"
101  *       (an accessible action, or the list of actions, has changed)
102  */
103
104 #ifdef __cplusplus
105 }
106 #endif /* __cplusplus */
107
108
109 #endif /* __ATK_ACTION_H__ */