Reverted Value interface since the new union was more complicated than necessary.
[platform/core/uifw/at-spi2-atk.git] / cspi / spi_value.c
1 #include <cspi/spi-private.h>
2
3 /**
4  * AccessibleValue_ref:
5  * @obj: a pointer to the #AccessibleValue implementor on which to operate.
6  *
7  * Increment the reference count for an #AccessibleValue object.
8  **/
9 void
10 AccessibleValue_ref (AccessibleValue *obj)
11 {
12   cspi_object_ref (obj);
13 }
14
15 /**
16  * AccessibleValue_unref:
17  * @obj: a pointer to the #AccessibleValue implementor on which to operate. 
18  *
19  * Decrement the reference count for an #AccessibleValue object.
20  **/
21 void
22 AccessibleValue_unref (AccessibleValue *obj)
23 {
24   cspi_object_unref (obj);
25 }
26
27 /**
28  * AccessibleValue_getMinimumValue:
29  * @obj: a pointer to the #AccessibleValue implementor on which to operate. 
30  *
31  * Get the minimum allowed value for an #AccessibleValue.
32  *
33  * Returns: the minimum allowed value for this object.
34  *
35  **/
36 double
37 AccessibleValue_getMinimumValue (AccessibleValue *obj)
38 {
39   double retval;
40
41   cspi_return_val_if_fail (obj != NULL, 0.0);
42
43   retval = 
44     Accessibility_Value__get_minimumValue (CSPI_OBJREF (obj), cspi_ev ());
45   
46   cspi_return_val_if_ev ("getMinimumValue", 0.0);
47
48   return retval;
49 }
50
51 /**
52  * AccessibleValue_getCurrentValue:
53  * @obj: a pointer to the #AccessibleValue implementor on which to operate. 
54  *
55  * Get the current value for an #AccessibleValue.
56  *
57  * Returns: the current value for this object.
58  **/
59 double
60 AccessibleValue_getCurrentValue (AccessibleValue *obj)
61 {
62   double retval;
63
64   cspi_return_val_if_fail (obj != NULL, 0.0);
65
66   retval =
67     Accessibility_Value__get_currentValue (CSPI_OBJREF (obj), cspi_ev ());
68
69   cspi_return_val_if_ev ("getCurrentValue", 0.0);
70
71   return retval;
72 }
73
74 /**
75  * AccessibleValue_getMaximumValue:
76  * @obj: a pointer to the #AccessibleValue implementor on which to operate. 
77  *
78  * Get the maximum allowed value for an #AccessibleValue.
79  *
80  * Returns: the maximum allowed value for this object.
81  **/
82 double
83 AccessibleValue_getMaximumValue (AccessibleValue *obj)
84 {
85   double retval;        
86   cspi_return_val_if_fail (obj != NULL, 0.0);
87
88   retval =
89     Accessibility_Value__get_maximumValue (CSPI_OBJREF (obj), cspi_ev ());
90
91   cspi_return_val_if_ev ("getMaximumValue", 0.0);
92
93   return retval;
94 }
95
96 /**
97  * AccessibleValue_setCurrentValue:
98  * @obj: a pointer to the #AccessibleValue implementor on which to operate.
99  * @newValue: a #float value which is the desired new value of the object.
100  *
101  * Set the current value of an #AccessibleValue.
102  *
103  * Returns: #TRUE if the value could be assigned the specified value,
104  *          #FALSE otherwise.
105  **/
106 SPIBoolean
107 AccessibleValue_setCurrentValue (AccessibleValue *obj,
108                                  double newValue)
109 {
110   cspi_return_val_if_fail (obj != NULL, FALSE);
111
112   Accessibility_Value__set_currentValue (
113     CSPI_OBJREF (obj), newValue, cspi_ev ());
114
115   cspi_return_val_if_ev ("setCurrentValue", FALSE);
116
117   return TRUE;
118 }
119
120