2001-12-10 Michael Meeks <michael@ximian.com>
[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 float
37 AccessibleValue_getMinimumValue (AccessibleValue *obj)
38 {
39   float 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 float
60 AccessibleValue_getCurrentValue (AccessibleValue *obj)
61 {
62   float 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 float
83 AccessibleValue_getMaximumValue (AccessibleValue *obj)
84 {
85   float retval;
86
87   cspi_return_val_if_fail (obj != NULL, 0.0);
88
89   retval =
90     Accessibility_Value__get_maximumValue (CSPI_OBJREF (obj), cspi_ev ());
91
92   cspi_return_val_if_ev ("getMaximumValue", 0.0);
93
94   return retval;
95 }
96
97 /**
98  * AccessibleValue_setCurrentValue:
99  * @obj: a pointer to the #AccessibleValue implementor on which to operate.
100  * @newValue: a #float value which is the desired new value of the object.
101  *
102  * Set the current value of an #AccessibleValue.
103  *
104  * Returns: #TRUE if the value could be assigned the specified value,
105  *          #FALSE otherwise.
106  **/
107 SPIBoolean
108 AccessibleValue_setCurrentValue (AccessibleValue *obj,
109                                  float newValue)
110 {
111   cspi_return_val_if_fail (obj != NULL, FALSE);
112
113   Accessibility_Value__set_currentValue (
114     CSPI_OBJREF (obj), (CORBA_float) newValue, cspi_ev ());
115
116   cspi_return_val_if_ev ("setCurrentValue", FALSE);
117
118   return TRUE;
119 }
120
121