2 * AT-SPI - Assistive Technology Service Provider Interface
3 * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
5 * Copyright 2001, 2002 Sun Microsystems Inc.,
6 * Copyright 2001, 2002 Ximian, Inc.
7 * Copyright 2010, 2011 Novell, Inc.
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Library General Public License for more details.
19 * You should have received a copy of the GNU Library General Public
20 * License along with this library; if not, write to the
21 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 * Boston, MA 02111-1307, USA.
25 #include "atspi-private.h"
28 * atspi_value_get_minimum_value:
29 * @obj: a pointer to the #AtspiValue implementor on which to operate.
31 * Get the minimum allowed value for an #AtspiValue.
33 * Returns: the minimum allowed value for this object.
37 atspi_value_get_minimum_value (AtspiValue *obj, GError **error)
41 g_return_val_if_fail (obj != NULL, 0.0);
42 _atspi_dbus_get_property (obj, atspi_interface_value, "MinimumValue", error, "d", &retval);
48 * atspi_value_get_current_value:
49 * @obj: a pointer to the #AtspiValue implementor on which to operate.
51 * Get the current value for an #AtspiValue.
53 * Returns: the current value for this object.
56 atspi_value_get_current_value (AtspiValue *obj, GError **error)
60 g_return_val_if_fail (obj != NULL, 0.0);
62 _atspi_dbus_get_property (obj, atspi_interface_value, "CurrentValue", error, "d", &retval);
68 * atspi_value_get_maximum_value:
69 * @obj: a pointer to the #AtspiValue implementor on which to operate.
71 * Get the maximum allowed value for an #AtspiValue.
73 * Returns: the maximum allowed value for this object.
76 atspi_value_get_maximum_value (AtspiValue *obj, GError **error)
80 g_return_val_if_fail (obj != NULL, 0.0);
82 _atspi_dbus_get_property (obj, atspi_interface_value, "MaximumValue", error, "d", &retval);
88 * atspi_value_set_current_value:
89 * @obj: a pointer to the #AtspiValue implementor on which to operate.
90 * @new_value: a #float value which is the desired new value of the object.
92 * Set the current value of an #AtspiValue.
94 * Returns: #TRUE if the value could be assigned the specified value,
98 atspi_value_set_current_value (AtspiValue *obj, gdouble new_value, GError **error)
100 double d_new_value = new_value;
102 g_return_val_if_fail (obj != NULL, FALSE);
104 _atspi_dbus_call (obj, atspi_interface_value, "SetCurrentValue", error, "d", &d_new_value);
110 * atspi_value_get_minimum_increment:
111 * @obj: a pointer to the #AtspiValue implementor on which to operate.
113 * Get the minimum increment by which an #AtspiValue can be adjusted.
115 * Returns: the minimum increment by which the value may be changed, or
116 * zero if the minimum increment cannot be determined.
120 atspi_value_get_minimum_increment (AtspiValue *obj, GError **error)
124 g_return_val_if_fail (obj != NULL, 0.0);
126 _atspi_dbus_get_property (obj, atspi_interface_value, "MinimumIncrement", error, "d", &retval);
132 atspi_value_base_init (AtspiValue *klass)
137 atspi_value_get_type (void)
139 static GType type = 0;
142 static const GTypeInfo tinfo =
145 (GBaseInitFunc) atspi_value_base_init,
146 (GBaseFinalizeFunc) NULL,
149 type = g_type_register_static (G_TYPE_INTERFACE, "AtspiValue", &tinfo, 0);