Merge branch 'master' of git+ssh://git.codethink.co.uk/git/atspi-dbus
[platform/core/uifw/at-spi2-atk.git] / pyatspi / value.py
1 #Copyright (C) 2008 Codethink Ltd
2
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.
6
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.
14
15 import interfaces
16 from base import BaseProxy
17 from factory import add_accessible_class
18
19 __all__ = [
20            "Value",
21           ]
22
23 #------------------------------------------------------------------------------
24
25 class Value(BaseProxy):
26         """
27         An interface supporting controls which allow a one-dimensional,
28         scalar quantity to be modified or which reflect a scalar quantity.
29         (If STATE_EDITABLE is not present, the valuator is treated as
30         "read only".
31         """
32
33         def get_currentValue(self):
34                 return self._pgetter(self._dbus_interface, "currentValue")
35         def set_currentValue(self, value):
36                 self._psetter(self._dbus_interface, "currentValue", value)
37         _currentValueDoc = \
38                 """
39                 The current value of the valuator.
40                 """
41         currentValue = property(fget=get_currentValue, fset=set_currentValue, doc=_currentValueDoc)
42
43         def get_maximumValue(self):
44                 return self._pgetter(self._dbus_interface, "maximumValue")
45         def set_maximumValue(self, value):
46                 self._psetter(self._dbus_interface, "maximumValue", value)
47         _maximumValueDoc = \
48                 """
49                 The maximum value allowed by this valuator.
50                 """
51         maximumValue = property(fget=get_maximumValue, fset=set_maximumValue, doc=_maximumValueDoc)
52
53         def get_minimumIncrement(self):
54                 return self._pgetter(self._dbus_interface, "minimumIncrement")
55         def set_minimumIncrement(self, value):
56                 self._psetter(self._dbus_interface, "minimumIncrement", value)
57         _minimumIncrementDoc = \
58                 """
59                 The smallest incremental change which this valuator allows. If
60                 0, the incremental changes to the valuator are limited only by
61                 the precision of a double precision value on the platform.
62                 """
63         minimumIncrement = property(fget=get_minimumIncrement, fset=set_minimumIncrement, doc=_minimumIncrementDoc)
64
65         def get_minimumValue(self):
66                 return self._pgetter(self._dbus_interface, "minimumValue")
67         def set_minimumValue(self, value):
68                 self._psetter(self._dbus_interface, "minimumValue", value)
69         _minimumValueDoc = \
70                 """
71                 The minimum value allowed by this valuator.
72                 """
73         minimumValue = property(fget=get_minimumValue, fset=set_minimumValue, doc=_minimumValueDoc)
74
75 # ATTENTION - Register the Application class with the accessible factory.
76 add_accessible_class(interfaces.ATSPI_VALUE, Value)
77
78 #END----------------------------------------------------------------------------