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.
16 from base import BaseProxy
17 from factory import accessible_factory
23 #------------------------------------------------------------------------------
25 class Action(BaseProxy):
27 An interface through which a user-actionable user interface component
28 can be manipulated. Components which react to mouse or keyboard
29 input from the user, (with the exception of pure text entry fields
30 with no other function), should implement this interface. Typical
31 actions include "click", "press", "release" (for instance for
32 buttons), "menu" (for objects which have context menus invokable
33 from mouse or keyboard), "open" for icons representing files
37 def doAction(self, index):
41 the 0-based index of the action to perform.
42 Causes the object to perform the specified action.
43 @return : a boolean indicating success or failure.
45 func = self.get_dbus_method("doAction")
48 def getDescription(self, index):
52 the index of the action for which a description is desired.
53 Get the description of the specified action. The description
54 of an action may provide information about the result of action
55 invocation, unlike the action name.
56 @return : a string containing the description of the specified
59 func = self.get_dbus_method("getDescription")
62 def getKeyBinding(self, index):
66 the 0-based index of the action for which a key binding is requested.
67 Get the key binding associated with a specific action.
68 @return : a string containing the key binding for the specified
69 action, or an empty string ("") if none exists.
71 func = self.get_dbus_method("getKeyBinding")
74 def getName(self, index):
78 the index of the action whose name is requested.
79 Get the name of the specified action. Action names generally
80 describe the user action, i.e. "click" or "press", rather then
81 the result of invoking the action.
82 @return : a string containing the name of the specified action.
84 func = self.get_dbus_method("getName")
87 def get_nActions(self):
88 return self._pgetter(self._dbus_interface, "nActions")
89 def set_nActions(self, value):
90 self._psetter(self._dbus_interface, "nActions", value)
93 nActions: a long containing the number of actions this object
96 nActions = property(fget=get_nActions, fset=set_nActions, doc=_nActionsDoc)
98 # Register the accessible class with the factory.
99 accessible_factory.register_accessible_class(interfaces.ATSPI_ACTION, Action)
101 #END----------------------------------------------------------------------------