Author: ygrego Date: 2015-06-08 10:43:01 +0000 (Mon, 08 Jun 2015) New Revision: 1597 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1597 Log: Addition of getters and setters for the following properties: "onLowMemory", "onApplicationLoaded", "onApplicationUnloaded", "onApplicationLoadError", "onWidgetInstallation" and "onWidgetUninstallation". Modified: oipf/js/impl/ApplicationManagerObject.js Modified: oipf/js/impl/ApplicationManagerObject.js =================================================================== --- oipf/js/impl/ApplicationManagerObject.js 2015-06-08 10:16:14 UTC (rev 1596) +++ oipf/js/impl/ApplicationManagerObject.js 2015-06-08 10:43:01 UTC (rev 1597) @@ -33,6 +33,128 @@ } }, + /* + * Description: + * The function that is called when the OITF is running low on available + * memory for running DAE applications. + * The exact criteria determining when to generate such an event is + * implementation specific. + */ + get onLowMemory() { + return this._getCallback("LowMemory"); + }, + + set onLowMemory(callback) { + this._setCallback("LowMemory", callback); + }, + + /* + * Description: + * The function that is called immediately prior to a load event being + * generated in the affected application. The specified function is called + * with one argument appl , which provides a reference to the affected + * application. + */ + get onApplicationLoaded() { + return this._getCallback("ApplicationLoaded"); + }, + + set onApplicationLoaded(callback) { + this._setCallback("ApplicationLoaded", callback); + }, + + /* + * Description: + * The function that is called immediately prior to an unload event being + * generated in the affected application. The specified function is called + * with one argument appl , which provides a reference to the affected + * application. + */ + get onApplicationUnloaded() { + return this._getCallback("ApplicationUnloaded"); + }, + + set onApplicationUnloaded(callback) { + this._setCallback("ApplicationUnloaded", callback); + }, + + /* + * Description: + * The function that is called when the OITF fails to load either the file + * containing the initial HTML document of an application or an XML AIT file + * (e.g. due to an HTTP 404 error, an HTTP timeout, being unable to load the + * file from a DSM-CC object carousel or due to the file not being either an + * HTML file or a XML AIT file as appropriate), All properties of + * the Application object referred to by appl SHALL have the value undefined + * and calling any methods on that object SHALL fail. + */ + get onApplicationLoadError() { + return this._getCallback("ApplicationLoadError"); + }, + + set onApplicationLoadError(callback) { + this._setCallback("ApplicationLoadError", callback); + }, + + /* + * Description: + * The callback function that is called during the installation process of + * a Widget. The function is called with three arguments: + * + * WidgetDescriptor wd - the WidgetDescriptor for the installed Widget. + * Some attributes of this argument may not have been initialised and may be + * null when the function is called until the Widget is successfully + * installed. + * + * Integer state - the state of the installation; valid values are: + * WIDGET_INSTALLATION_STARTED + * WIDGET_INSTALLATION_COMPLETED + * WIDGET_INSTALLATION_FAILED + * as defined in section 7.2.1.1. + * + * Integer reason: indicates the reason for installation failure. + * This is only valid if the value of the state argument is + * WIDGET_INSTALLATION_FAILED otherwise this argument SHALL be null. + * Valid values for this field are: + * WIDGET_ERROR_STORAGE_AREA_FULL + * WIDGET_ERROR_DOWNLOAD + * WIDGET_ERROR_INVALID_ZIP_ARCHIVE + * WIDGET_ERROR_INVALID_SIGNATURE + * WIDGET_ERROR_GENERIC + * WIDGET_ERROR_SIZE_EXCEEDED + * WIDGET_ERROR_PERMISSION_DENIED + * as defined in section 7.2.1.1. + */ + get onWidgetInstallation() { + return this._getCallback("WidgetInstallation"); + }, + + set onWidgetInstallation(callback) { + this._setCallback("WidgetInstallation", callback); + }, + + /* + * Description: + * The function that is called during the uninstallation process of + * a Widget. The function is called with two arguments, defined below: + * + * WidgetDescriptor wd - the WidgetDescriptor of the Widget + * to be uninstalled. + * + * Integer state - the state of the installation; valid values are: + * WIDGET_UNINSTALLATION_STARTED + * WIDGET_UNINSTALLATION_COMPLETED + * WIDGET_UNINSTALLATION_FAILED + * as defined in section 7.2.1.1. + */ + get onWidgetUninstallation() { + return this._getCallback("WidgetInstallation"); + }, + + set onWidgetUninstallation(callback) { + this._setCallback("WidgetInstallation", callback); + }, + init : function() { this._listeners = {}; this._callbacks = {};