2009-27-09 Mark Doffman <mark.doffman@codethink.co.uk>
[platform/core/uifw/at-spi2-atk.git] / pyatspi / application.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 from interfaces import *
16 from factory import accessible_factory
17 from accessible import Accessible
18
19 import dbus
20
21 __all__ = [
22                   "Application",
23           ]
24
25 #------------------------------------------------------------------------------
26
27 class Application(Accessible):
28         """
29         An interface identifying an object which is the root of the user
30         interface Accessible hierarchy associated with a running application.
31         Children of Application are typically, but not exclusively, top-level
32         windows.
33         """
34
35         def getLocale(self, locale_type):
36                 """
37                 Gets the locale in which the application is currently operating.
38                 For the current message locale, use lctype LOCALE_TYPE_MESSAGES.
39                 @param : lctype
40                 The LocaleType for which the locale is queried. 
41                 @return a string compliant with the POSIX standard for locale
42                 description.
43                 """
44                 func = self.get_dbus_method("getLocale", dbus_interface=ATSPI_APPLICATION)
45                 return func(local_type)
46
47         def get_toolkitName(self):
48                 return dbus.String(self._pgetter(self._dbus_interface, "toolkitName"))
49         _toolkitNameDoc = \
50                 """
51                 A string indicating the type of user interface toolkit which
52                 is used by the application.
53                 """
54         toolkitName = property(fget=get_toolkitName, doc=_toolkitNameDoc)
55
56         def get_version(self):
57                 return dbus.String(self._pgetter(self._dbus_interface, "version"))
58         _versionDoc = \
59                 """
60                 A string indicating the version number of the application's accessibility
61                 bridge implementation.
62                 """
63         version = property(fget=get_version, doc=_versionDoc)
64
65 # Register the accessible class with the factory.
66 accessible_factory.register_accessible_class(ATSPI_APPLICATION, Application)
67
68 #END----------------------------------------------------------------------------