X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=pyatspi%2Fapplication.py;h=a72693be3268b67e606f38a98a13ba71b7a7b177;hb=95ac4886d1b6649d54daffa7191be1b2bbaf2989;hp=12abe5a4263fc3fb9ba13958909cba616cce3df4;hpb=b93edf847d229f40394cb0b4f721c4c2a5897d84;p=platform%2Fcore%2Fuifw%2Fat-spi2-atk.git diff --git a/pyatspi/application.py b/pyatspi/application.py index 12abe5a..a72693b 100644 --- a/pyatspi/application.py +++ b/pyatspi/application.py @@ -12,116 +12,115 @@ #along with this program; if not, write to the Free Software #Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -import interfaces -from base import BaseProxy -from factory import add_accessible_class +from interfaces import * +from factory import accessible_factory from accessible import Accessible __all__ = [ - "Application", - ] + "Application", + ] #------------------------------------------------------------------------------ class Application(Accessible): - """ - An interface identifying an object which is the root of the user - interface Accessible hierarchy associated with a running application. - Children of Application are typically, but not exclusively, top-level - windows. - """ - - def getLocale(self, *args, **kwargs): """ - Gets the locale in which the application is currently operating. - For the current message locale, use lctype LOCALE_TYPE_MESSAGES. - @param : lctype - The LocaleType for which the locale is queried. - @return a string compliant with the POSIX standard for locale - description. + An interface identifying an object which is the root of the user + interface Accessible hierarchy associated with a running application. + Children of Application are typically, but not exclusively, top-level + windows. """ - func = self.get_dbus_method("getLocale") - return func(*args, **kwargs) - - def pause(self, *args, **kwargs): - """ - Request that the application temporarily stop sending events. - In most cases this should pause the application's main event - loop. - @return : true if the request succeeded, false otherwise. - """ - func = self.get_dbus_method("pause") - return func(*args, **kwargs) - - def registerObjectEventListener(self, *args, **kwargs): - """ - registerObjectEventListener: - @param : listener - an EventListener object which will receive the requested events - @param : eventName - a UTF-8 string indicating the type of (toolkit-specific) event - being requested. Register with this application toolkit for "Accessibility::Accessible" - event notifications. - """ - func = self.get_dbus_method("registerObjectEventListener") - return func(*args, **kwargs) - - def registerToolkitEventListener(self, *args, **kwargs): - """ - @param : listener - an EventListener object which will receive the requested events - from the application's toolkits via toolit 'bridges' - @param : eventName - a UTF-8 string indicating the type of (toolkit-specific) event - being requested. Not all applications can generate toolkit events - of a given type. - Register with this application's toolkit for "toolkit-specific" - event notifications. - """ - func = self.get_dbus_method("registerToolkitEventListener") - return func(*args, **kwargs) - - def resume(self, *args, **kwargs): - """ - Request that the application resume sending events. - @return : True if the request succeeded, False otherwise. - """ - func = self.get_dbus_method("resume") - return func(*args, **kwargs) - - def get_id(self): - return self._pgetter(self._dbus_interface, "id") - def set_id(self, value): - self._psetter(self._dbus_interface, "id", value) - _idDoc = \ - """ - The application instance's unique ID as assigned by the registry. - """ - id = property(fget=get_id, fset=set_id, doc=_idDoc) - - def get_toolkitName(self): - return self._pgetter(self._dbus_interface, "toolkitName") - def set_toolkitName(self, value): - self._psetter(self._dbus_interface, "toolkitName", value) - _toolkitNameDoc = \ - """ - A string indicating the type of user interface toolkit which - is used by the application. - """ - toolkitName = property(fget=get_toolkitName, fset=set_toolkitName, doc=_toolkitNameDoc) - - def get_version(self): - return self._pgetter(self._dbus_interface, "version") - def set_version(self, value): - self._psetter(self._dbus_interface, "version", value) - _versionDoc = \ - """ - A string indicating the version number of the application's accessibility - bridge implementation. - """ - version = property(fget=get_version, fset=set_version, doc=_versionDoc) -# ATTENTION - Register the Application class with the accessible factory. -add_accessible_class(interfaces.ATSPI_APPLICATION, Application) + def getLocale(self, *args, **kwargs): + """ + Gets the locale in which the application is currently operating. + For the current message locale, use lctype LOCALE_TYPE_MESSAGES. + @param : lctype + The LocaleType for which the locale is queried. + @return a string compliant with the POSIX standard for locale + description. + """ + func = self.get_dbus_method("getLocale", dbus_interface=ATSPI_APPLICATION) + return func(*args, **kwargs) + + def pause(self, *args, **kwargs): + """ + Request that the application temporarily stop sending events. + In most cases this should pause the application's main event + loop. + @return : true if the request succeeded, false otherwise. + """ + func = self.get_dbus_method("pause", dbus_interface=ATSPI_APPLICATION) + return func(*args, **kwargs) + + def registerObjectEventListener(self, *args, **kwargs): + """ + registerObjectEventListener: + @param : listener + an EventListener object which will receive the requested events + @param : eventName + a UTF-8 string indicating the type of (toolkit-specific) event + being requested. Register with this application toolkit for "Accessibility::Accessible" + event notifications. + """ + func = self.get_dbus_method("registerObjectEventListener", dbus_interface=ATSPI_APPLICATION) + return func(*args, **kwargs) + + def registerToolkitEventListener(self, *args, **kwargs): + """ + @param : listener + an EventListener object which will receive the requested events + from the application's toolkits via toolit 'bridges' + @param : eventName + a UTF-8 string indicating the type of (toolkit-specific) event + being requested. Not all applications can generate toolkit events + of a given type. + Register with this application's toolkit for "toolkit-specific" + event notifications. + """ + func = self.get_dbus_method("registerToolkitEventListener", dbus_interface=ATSPI_APPLICATION) + return func(*args, **kwargs) + + def resume(self, *args, **kwargs): + """ + Request that the application resume sending events. + @return : True if the request succeeded, False otherwise. + """ + func = self.get_dbus_method("resume", dbus_interface=ATSPI_APPLICATION) + return func(*args, **kwargs) + + def get_id(self): + return self._pgetter(self._dbus_interface, "id") + def set_id(self, value): + self._psetter(self._dbus_interface, "id", value) + _idDoc = \ + """ + The application instance's unique ID as assigned by the registry. + """ + id = property(fget=get_id, fset=set_id, doc=_idDoc) + + def get_toolkitName(self): + return self._pgetter(self._dbus_interface, "toolkitName") + def set_toolkitName(self, value): + self._psetter(self._dbus_interface, "toolkitName", value) + _toolkitNameDoc = \ + """ + A string indicating the type of user interface toolkit which + is used by the application. + """ + toolkitName = property(fget=get_toolkitName, fset=set_toolkitName, doc=_toolkitNameDoc) + + def get_version(self): + return self._pgetter(self._dbus_interface, "version") + def set_version(self, value): + self._psetter(self._dbus_interface, "version", value) + _versionDoc = \ + """ + A string indicating the version number of the application's accessibility + bridge implementation. + """ + version = property(fget=get_version, fset=set_version, doc=_versionDoc) + +# Register the accessible class with the factory. +accessible_factory.register_accessible_class(ATSPI_APPLICATION, Application) #END----------------------------------------------------------------------------