2001-12-10 Michael Meeks <michael@ximian.com>
[platform/core/uifw/at-spi2-atk.git] / cspi / spi_action.c
1 #include <cspi/spi-private.h>
2
3 /**
4  * AccessibleAction_ref:
5  * @obj: a pointer to the #AccessibleAction on which to operate.
6  *
7  * Increment the reference count for an #AccessibleAction.
8  *
9  * Returns: 0 (no return code implemented yet).
10  *
11  **/
12 void
13 AccessibleAction_ref (AccessibleAction *obj)
14 {
15   cspi_object_ref (obj);
16 }
17
18 /**
19  * AccessibleAction_unref:
20  * @obj: a pointer to the #AccessibleAction on which to operate.
21  *
22  * Decrement the reference count for an #AccessibleAction.
23  *
24  * Returns: 0 (no return code implemented yet).
25  *
26  **/
27 void
28 AccessibleAction_unref (AccessibleAction *obj)
29 {
30   cspi_object_unref (obj);
31 }
32
33 /**
34  * AccessibleAction_getNActions:
35  * @obj: a pointer to the #AccessibleAction to query.
36  *
37  * Get the number of actions invokable on an #AccessibleAction implementor.
38  *
39  * Returns: a #long integer indicatin the number of invokable actions.
40  **/
41 long
42 AccessibleAction_getNActions (AccessibleAction *obj)
43 {
44   long retval;
45
46   cspi_return_val_if_fail (obj != NULL, -1);
47
48   retval =
49     Accessibility_Action__get_nActions (CSPI_OBJREF (obj), cspi_ev ());
50
51   cspi_return_val_if_ev ("getNActions", -1);
52
53   return retval;
54 }
55
56 /**
57  * AccessibleAction_getDescription:
58  * @obj: a pointer to the #AccessibleAction implementor to query.
59  * @i: a long integer indicating which action to query.
60  *
61  * Get the description of '@i-th' action invokable on an
62  *      object implementing #AccessibleAction.
63  *
64  * Returns: a UTF-8 string describing the '@i-th' invokable action.
65  **/
66 char *
67 AccessibleAction_getDescription (AccessibleAction *obj,
68                                  long int          i)
69 {
70   char *retval;
71   cspi_return_val_if_fail (obj != NULL, NULL);
72
73   retval =
74     Accessibility_Action_getDescription (CSPI_OBJREF (obj),
75                                          (CORBA_long) i,
76                                          cspi_ev ());
77
78   cspi_return_val_if_ev ("getDescription", NULL);
79
80   return retval;
81 }
82
83 /**
84  * AccessibleAction_getKeyBinding:
85  * @obj: a pointer to the #AccessibleAction implementor to query.
86  * @i: a long integer indicating which action to query.
87  *
88  * Get the keybindings for the @i-th action invokable on an
89  *      object implementing #AccessibleAction, if any are defined.
90  *
91  * Returns: a UTF-8 string which can be parsed to determine the @i-th
92  *       invokable action's keybindings.
93  **/
94 char *
95 AccessibleAction_getKeyBinding (AccessibleAction *obj,
96                                 long int          i)
97 {
98   char *retval;
99
100   cspi_return_val_if_fail (obj != NULL, NULL);
101
102   retval =
103     Accessibility_Action_getKeyBinding (CSPI_OBJREF (obj),
104        (CORBA_long) i,
105        cspi_ev ());
106
107   cspi_return_val_if_ev ("getKeyBinding", NULL);
108
109   return retval;
110 }
111
112 /**
113  * AccessibleAction_getName:
114  * @obj: a pointer to the #AccessibleAction implementor to query.
115  * @i: a long integer indicating which action to query.
116  *
117  * Get the name of the '@i-th' action invokable on an
118  *      object implementing #AccessibleAction.
119  *
120  * Returns: the 'event type' name of the action, as a UTF-8 string.
121  **/
122 char *
123 AccessibleAction_getName (AccessibleAction *obj,
124                           long int          i)
125 {
126   char *retval;
127
128   cspi_return_val_if_fail (obj != NULL, NULL);
129
130   retval =
131    Accessibility_Action_getName (CSPI_OBJREF (obj),
132                                  (CORBA_long) i,
133                                  cspi_ev ());
134
135   cspi_return_val_if_ev ("getName", NULL);
136
137   return retval;
138 }
139
140 /**
141  * AccessibleAction_doAction:
142  * @obj: a pointer to the #AccessibleAction to query.
143  * @i: an integer specifying which action to invoke.
144  *
145  * Invoke the action indicated by #index.
146  *
147  * Returns: #TRUE if the action is successfully invoked, otherwise #FALSE.
148  **/
149 SPIBoolean
150 AccessibleAction_doAction (AccessibleAction *obj,
151                            long int i)
152 {
153   SPIBoolean retval;
154
155   cspi_return_val_if_fail (obj != NULL, FALSE);
156
157   retval = (SPIBoolean)
158     Accessibility_Action_doAction (CSPI_OBJREF (obj),
159                                    (CORBA_long) i,
160                                    cspi_ev ());
161
162   cspi_return_val_if_ev ("doAction", FALSE);
163
164   return retval;
165 }