1 #Copyright (C) 2008 Codethink Ltd
3 #This library is free software; you can redistribute it and/or
4 #modify it under the terms of the GNU Lesser General Public
5 #License version 2 as published by the Free Software Foundation.
7 #This program is distributed in the hope that it will be useful,
8 #but WITHOUT ANY WARRANTY; without even the implied warranty of
9 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 #GNU General Public License for more details.
11 #You should have received a copy of the GNU Lesser General Public License
12 #along with this program; if not, write to the Free Software
13 #Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15 from interfaces import *
16 from accessible import Accessible
17 from factory import accessible_factory
25 #------------------------------------------------------------------------------
27 class Value(Accessible):
29 An interface supporting controls which allow a one-dimensional,
30 scalar quantity to be modified or which reflect a scalar quantity.
31 (If STATE_EDITABLE is not present, the valuator is treated as
35 def get_currentValue(self):
36 return dbus.Double(self._pgetter(self._dbus_interface, "currentValue"))
37 def set_currentValue(self, value):
38 self._psetter(self._dbus_interface, "currentValue", dbus.Double(value, variant_level=1))
41 The current value of the valuator.
43 currentValue = property(fget=get_currentValue, fset=set_currentValue, doc=_currentValueDoc)
45 def get_maximumValue(self):
46 return dbus.Double(self._pgetter(self._dbus_interface, "maximumValue"))
49 The maximum value allowed by this valuator.
51 maximumValue = property(fget=get_maximumValue, doc=_maximumValueDoc)
53 def get_minimumIncrement(self):
54 return dbus.Double(self._pgetter(self._dbus_interface, "minimumIncrement"))
55 _minimumIncrementDoc = \
57 The smallest incremental change which this valuator allows. If
58 0, the incremental changes to the valuator are limited only by
59 the precision of a double precision value on the platform.
61 minimumIncrement = property(fget=get_minimumIncrement, doc=_minimumIncrementDoc)
63 def get_minimumValue(self):
64 return dbus.Double(self._pgetter(self._dbus_interface, "minimumValue"))
67 The minimum value allowed by this valuator.
69 minimumValue = property(fget=get_minimumValue, doc=_minimumValueDoc)
71 # Register the accessible class with the factory.
72 accessible_factory.register_accessible_class(ATSPI_VALUE, Value)
74 #END----------------------------------------------------------------------------