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