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
18 from accessible import Accessible
24 #------------------------------------------------------------------------------
26 class Application(Accessible):
28 An interface identifying an object which is the root of the user
29 interface Accessible hierarchy associated with a running application.
30 Children of Application are typically, but not exclusively, top-level
34 def getLocale(self, *args, **kwargs):
36 Gets the locale in which the application is currently operating.
37 For the current message locale, use lctype LOCALE_TYPE_MESSAGES.
39 The LocaleType for which the locale is queried.
40 @return a string compliant with the POSIX standard for locale
43 func = self.get_dbus_method("getLocale")
44 return func(*args, **kwargs)
46 def pause(self, *args, **kwargs):
48 Request that the application temporarily stop sending events.
49 In most cases this should pause the application's main event
51 @return : true if the request succeeded, false otherwise.
53 func = self.get_dbus_method("pause")
54 return func(*args, **kwargs)
56 def registerObjectEventListener(self, *args, **kwargs):
58 registerObjectEventListener:
60 an EventListener object which will receive the requested events
62 a UTF-8 string indicating the type of (toolkit-specific) event
63 being requested. Register with this application toolkit for "Accessibility::Accessible"
66 func = self.get_dbus_method("registerObjectEventListener")
67 return func(*args, **kwargs)
69 def registerToolkitEventListener(self, *args, **kwargs):
72 an EventListener object which will receive the requested events
73 from the application's toolkits via toolit 'bridges'
75 a UTF-8 string indicating the type of (toolkit-specific) event
76 being requested. Not all applications can generate toolkit events
78 Register with this application's toolkit for "toolkit-specific"
81 func = self.get_dbus_method("registerToolkitEventListener")
82 return func(*args, **kwargs)
84 def resume(self, *args, **kwargs):
86 Request that the application resume sending events.
87 @return : True if the request succeeded, False otherwise.
89 func = self.get_dbus_method("resume")
90 return func(*args, **kwargs)
93 return self._pgetter(self._dbus_interface, "id")
94 def set_id(self, value):
95 self._psetter(self._dbus_interface, "id", value)
98 The application instance's unique ID as assigned by the registry.
100 id = property(fget=get_id, fset=set_id, doc=_idDoc)
102 def get_toolkitName(self):
103 return self._pgetter(self._dbus_interface, "toolkitName")
104 def set_toolkitName(self, value):
105 self._psetter(self._dbus_interface, "toolkitName", value)
108 A string indicating the type of user interface toolkit which
109 is used by the application.
111 toolkitName = property(fget=get_toolkitName, fset=set_toolkitName, doc=_toolkitNameDoc)
113 def get_version(self):
114 return self._pgetter(self._dbus_interface, "version")
115 def set_version(self, value):
116 self._psetter(self._dbus_interface, "version", value)
119 A string indicating the version number of the application's accessibility
120 bridge implementation.
122 version = property(fget=get_version, fset=set_version, doc=_versionDoc)
124 # Register the accessible class with the factory.
125 accessible_factory.register_accessible_class(interfaces.ATSPI_APPLICATION, Application)
127 #END----------------------------------------------------------------------------