fix tyop
[platform/core/uifw/at-spi2-atk.git] / cspi / spi_action.c
1 /*
2  * AT-SPI - Assistive Technology Service Provider Interface
3  * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
4  *
5  * Copyright 2001 Sun Microsystems Inc.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public
18  * License along with this library; if not, write to the
19  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20  * Boston, MA 02111-1307, USA.
21  */
22
23 #include <cspi/spi-private.h>
24
25 /**
26  * AccessibleAction_ref:
27  * @obj: a pointer to the #AccessibleAction on which to operate.
28  *
29  * Increment the reference count for an #AccessibleAction.
30  **/
31 void
32 AccessibleAction_ref (AccessibleAction *obj)
33 {
34   cspi_object_ref (obj);
35 }
36
37 /**
38  * AccessibleAction_unref:
39  * @obj: a pointer to the #AccessibleAction on which to operate.
40  *
41  * Decrement the reference count for an #AccessibleAction.
42  **/
43 void
44 AccessibleAction_unref (AccessibleAction *obj)
45 {
46   cspi_object_unref (obj);
47 }
48
49 /**
50  * AccessibleAction_getNActions:
51  * @obj: a pointer to the #AccessibleAction to query.
52  *
53  * Get the number of actions invokable on an #AccessibleAction implementor.
54  *
55  * Returns: a #long integer indicatin the number of invokable actions.
56  **/
57 long
58 AccessibleAction_getNActions (AccessibleAction *obj)
59 {
60   long retval;
61
62   cspi_return_val_if_fail (obj != NULL, -1);
63
64   retval =
65     Accessibility_Action__get_nActions (CSPI_OBJREF (obj), cspi_ev ());
66
67   cspi_return_val_if_ev ("getNActions", -1);
68
69   return retval;
70 }
71
72 /**
73  * AccessibleAction_getDescription:
74  * @obj: a pointer to the #AccessibleAction implementor to query.
75  * @i: a long integer indicating which action to query.
76  *
77  * Get the description of '@i-th' action invokable on an
78  *      object implementing #AccessibleAction.
79  *
80  * Returns: a UTF-8 string describing the '@i-th' invokable action.
81  **/
82 char *
83 AccessibleAction_getDescription (AccessibleAction *obj,
84                                  long int          i)
85 {
86   char *retval;
87   cspi_return_val_if_fail (obj != NULL, NULL);
88
89   retval =
90     Accessibility_Action_getDescription (CSPI_OBJREF (obj),
91                                          (CORBA_long) i,
92                                          cspi_ev ());
93
94   cspi_return_val_if_ev ("getDescription", NULL);
95
96   return retval;
97 }
98
99 /**
100  * AccessibleAction_getKeyBinding:
101  * @obj: a pointer to the #AccessibleAction implementor to query.
102  * @i: a long integer indicating which action to query.
103  *
104  * Get the keybindings for the @i-th action invokable on an
105  *      object implementing #AccessibleAction, if any are defined.
106  *
107  * Returns: a UTF-8 string which can be parsed to determine the @i-th
108  *       invokable action's keybindings.
109  **/
110 char *
111 AccessibleAction_getKeyBinding (AccessibleAction *obj,
112                                 long int          i)
113 {
114   char *retval;
115
116   cspi_return_val_if_fail (obj != NULL, NULL);
117
118   retval =
119     Accessibility_Action_getKeyBinding (CSPI_OBJREF (obj),
120        (CORBA_long) i,
121        cspi_ev ());
122
123   cspi_return_val_if_ev ("getKeyBinding", NULL);
124
125   return retval;
126 }
127
128 /**
129  * AccessibleAction_getName:
130  * @obj: a pointer to the #AccessibleAction implementor to query.
131  * @i: a long integer indicating which action to query.
132  *
133  * Get the name of the '@i-th' action invokable on an
134  *      object implementing #AccessibleAction.
135  *
136  * Returns: the 'event type' name of the action, as a UTF-8 string.
137  **/
138 char *
139 AccessibleAction_getName (AccessibleAction *obj,
140                           long int          i)
141 {
142   char *retval;
143
144   cspi_return_val_if_fail (obj != NULL, NULL);
145
146   retval =
147    Accessibility_Action_getName (CSPI_OBJREF (obj),
148                                  (CORBA_long) i,
149                                  cspi_ev ());
150
151   cspi_return_val_if_ev ("getName", NULL);
152
153   return retval;
154 }
155
156 /**
157  * AccessibleAction_doAction:
158  * @obj: a pointer to the #AccessibleAction to query.
159  * @i: an integer specifying which action to invoke.
160  *
161  * Invoke the action indicated by #index.
162  *
163  * Returns: #TRUE if the action is successfully invoked, otherwise #FALSE.
164  **/
165 SPIBoolean
166 AccessibleAction_doAction (AccessibleAction *obj,
167                            long int i)
168 {
169   SPIBoolean retval;
170
171   cspi_return_val_if_fail (obj != NULL, FALSE);
172
173   retval = (SPIBoolean)
174     Accessibility_Action_doAction (CSPI_OBJREF (obj),
175                                    (CORBA_long) i,
176                                    cspi_ev ());
177
178   cspi_return_val_if_ev ("doAction", FALSE);
179
180   return retval;
181 }