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 Action(Accessible):
29 An interface through which a user-actionable user interface component
30 can be manipulated. Components which react to mouse or keyboard
31 input from the user, (with the exception of pure text entry fields
32 with no other function), should implement this interface. Typical
33 actions include "click", "press", "release" (for instance for
34 buttons), "menu" (for objects which have context menus invokable
35 from mouse or keyboard), "open" for icons representing files
42 Retrieves all the actions at once.
43 @return : an array of an array of strings in the form
44 [[name, description, keybinding], ...]
46 func = self.get_dbus_method("getActions", dbus_interface=ATSPI_ACTION)
49 def doAction(self, index):
53 the 0-based index of the action to perform.
54 Causes the object to perform the specified action.
55 @return : a boolean indicating success or failure.
57 func = self.get_dbus_method("doAction", dbus_interface=ATSPI_ACTION)
60 def getDescription(self, index):
64 the index of the action for which a description is desired.
65 Get the description of the specified action. The description
66 of an action may provide information about the result of action
67 invocation, unlike the action name.
68 @return : a string containing the description of the specified
71 func = self.get_dbus_method("getDescription", dbus_interface=ATSPI_ACTION)
74 def getKeyBinding(self, index):
78 the 0-based index of the action for which a key binding is requested.
79 Get the key binding associated with a specific action.
80 @return : a string containing the key binding for the specified
81 action, or an empty string ("") if none exists.
83 func = self.get_dbus_method("getKeyBinding", dbus_interface=ATSPI_ACTION)
86 def getName(self, index):
90 the index of the action whose name is requested.
91 Get the name of the specified action. Action names generally
92 describe the user action, i.e. "click" or "press", rather then
93 the result of invoking the action.
94 @return : a string containing the name of the specified action.
96 func = self.get_dbus_method("getName", dbus_interface=ATSPI_ACTION)
99 def get_nActions(self):
100 return dbus.Int32(self._pgetter(self._dbus_interface, "nActions"))
103 nActions: a long containing the number of actions this object
106 nActions = property(fget=get_nActions, doc=_nActionsDoc)
108 # Register the accessible class with the factory.
109 accessible_factory.register_accessible_class(ATSPI_ACTION, Action)
111 #END----------------------------------------------------------------------------