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 factory import accessible_factory
17 from accessible import Accessible
23 #------------------------------------------------------------------------------
25 class Application(Accessible):
27 An interface identifying an object which is the root of the user
28 interface Accessible hierarchy associated with a running application.
29 Children of Application are typically, but not exclusively, top-level
33 def getLocale(self, *args, **kwargs):
35 Gets the locale in which the application is currently operating.
36 For the current message locale, use lctype LOCALE_TYPE_MESSAGES.
38 The LocaleType for which the locale is queried.
39 @return a string compliant with the POSIX standard for locale
42 func = self.get_dbus_method("getLocale", dbus_interface=ATSPI_APPLICATION)
43 return func(*args, **kwargs)
45 def pause(self, *args, **kwargs):
47 Request that the application temporarily stop sending events.
48 In most cases this should pause the application's main event
50 @return : true if the request succeeded, false otherwise.
52 func = self.get_dbus_method("pause", dbus_interface=ATSPI_APPLICATION)
53 return func(*args, **kwargs)
55 def registerObjectEventListener(self, *args, **kwargs):
57 registerObjectEventListener:
59 an EventListener object which will receive the requested events
61 a UTF-8 string indicating the type of (toolkit-specific) event
62 being requested. Register with this application toolkit for "Accessibility::Accessible"
65 func = self.get_dbus_method("registerObjectEventListener", dbus_interface=ATSPI_APPLICATION)
66 return func(*args, **kwargs)
68 def registerToolkitEventListener(self, *args, **kwargs):
71 an EventListener object which will receive the requested events
72 from the application's toolkits via toolit 'bridges'
74 a UTF-8 string indicating the type of (toolkit-specific) event
75 being requested. Not all applications can generate toolkit events
77 Register with this application's toolkit for "toolkit-specific"
80 func = self.get_dbus_method("registerToolkitEventListener", dbus_interface=ATSPI_APPLICATION)
81 return func(*args, **kwargs)
83 def resume(self, *args, **kwargs):
85 Request that the application resume sending events.
86 @return : True if the request succeeded, False otherwise.
88 func = self.get_dbus_method("resume", dbus_interface=ATSPI_APPLICATION)
89 return func(*args, **kwargs)
92 return self._pgetter(self._dbus_interface, "id")
93 def set_id(self, value):
94 self._psetter(self._dbus_interface, "id", value)
97 The application instance's unique ID as assigned by the registry.
99 id = property(fget=get_id, fset=set_id, doc=_idDoc)
101 def get_toolkitName(self):
102 return self._pgetter(self._dbus_interface, "toolkitName")
103 def set_toolkitName(self, value):
104 self._psetter(self._dbus_interface, "toolkitName", value)
107 A string indicating the type of user interface toolkit which
108 is used by the application.
110 toolkitName = property(fget=get_toolkitName, fset=set_toolkitName, doc=_toolkitNameDoc)
112 def get_version(self):
113 return self._pgetter(self._dbus_interface, "version")
114 def set_version(self, value):
115 self._psetter(self._dbus_interface, "version", value)
118 A string indicating the version number of the application's accessibility
119 bridge implementation.
121 version = property(fget=get_version, fset=set_version, doc=_versionDoc)
123 # Register the accessible class with the factory.
124 accessible_factory.register_accessible_class(ATSPI_APPLICATION, Application)
126 #END----------------------------------------------------------------------------