2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2011-11-29 00:13:26 +04:00
|
|
|
|
|
|
|
#include "domstubs.idl"
|
2012-03-06 23:50:58 +04:00
|
|
|
#include "nsIDOMEventTarget.idl"
|
2011-11-29 00:13:26 +04:00
|
|
|
|
2012-03-06 23:50:58 +04:00
|
|
|
interface nsIDOMDOMRequest;
|
2012-09-27 05:01:18 +04:00
|
|
|
interface nsIDOMDOMError;
|
2011-11-29 00:13:26 +04:00
|
|
|
|
2013-01-11 16:50:46 +04:00
|
|
|
[scriptable, uuid(d89870fe-5ba3-11e2-a5d2-cfa1d3f6e5f4)]
|
2012-03-06 23:50:58 +04:00
|
|
|
interface mozIDOMApplication : nsISupports
|
2011-11-29 00:13:26 +04:00
|
|
|
{
|
|
|
|
readonly attribute jsval manifest;
|
2012-09-27 05:01:18 +04:00
|
|
|
readonly attribute jsval updateManifest;
|
2012-03-06 23:50:58 +04:00
|
|
|
readonly attribute DOMString manifestURL;
|
2012-06-11 22:41:46 +04:00
|
|
|
readonly attribute jsval receipts; /* an array of strings */
|
2011-11-29 00:13:26 +04:00
|
|
|
readonly attribute DOMString origin;
|
|
|
|
readonly attribute DOMString installOrigin;
|
2012-06-11 22:41:46 +04:00
|
|
|
readonly attribute unsigned long long installTime;
|
2012-08-30 01:20:03 +04:00
|
|
|
readonly attribute boolean removable;
|
2012-06-11 22:41:46 +04:00
|
|
|
|
2012-09-27 05:01:18 +04:00
|
|
|
/**
|
2012-06-11 22:41:46 +04:00
|
|
|
* The current progress when downloading an offline cache.
|
|
|
|
*/
|
|
|
|
readonly attribute double progress;
|
|
|
|
|
2012-09-27 05:01:18 +04:00
|
|
|
/**
|
|
|
|
* The application installation state :
|
|
|
|
* "pending" : The application is being installed (eg, we're downloading the
|
|
|
|
* offline cache or the package).
|
|
|
|
* "installed" : The application is installed and ready to be launched.
|
|
|
|
* "updating" : We are updating the offline-cache or the package.
|
2012-06-11 22:41:46 +04:00
|
|
|
*/
|
2012-09-27 05:01:18 +04:00
|
|
|
readonly attribute DOMString installState;
|
2012-06-11 22:41:46 +04:00
|
|
|
|
2012-09-27 05:01:18 +04:00
|
|
|
/**
|
|
|
|
* fires a nsIDOMApplicationEvent when a change in appcache download or
|
|
|
|
* package download happens.
|
2012-06-11 22:41:46 +04:00
|
|
|
*/
|
|
|
|
attribute nsIDOMEventListener onprogress;
|
2012-06-15 03:03:55 +04:00
|
|
|
|
2012-09-27 05:01:18 +04:00
|
|
|
/**
|
2012-11-17 07:37:41 +04:00
|
|
|
* The date of the last update check.
|
2012-09-27 05:01:18 +04:00
|
|
|
*/
|
|
|
|
readonly attribute unsigned long long lastUpdateCheck;
|
|
|
|
|
2012-11-17 07:37:41 +04:00
|
|
|
/**
|
|
|
|
* The date of the last updated manifest.
|
|
|
|
*/
|
|
|
|
readonly attribute unsigned long long updateTime;
|
|
|
|
|
2012-09-27 05:01:18 +04:00
|
|
|
/**
|
|
|
|
* Starts the process of looking for an update.
|
|
|
|
*/
|
|
|
|
nsIDOMDOMRequest checkForUpdate();
|
|
|
|
|
|
|
|
readonly attribute boolean downloadAvailable;
|
|
|
|
readonly attribute boolean downloading;
|
|
|
|
readonly attribute boolean readyToApplyDownload;
|
|
|
|
readonly attribute long downloadSize;
|
|
|
|
|
|
|
|
readonly attribute nsIDOMDOMError downloadError;
|
|
|
|
|
|
|
|
attribute nsIDOMEventListener ondownloadsuccess;
|
|
|
|
attribute nsIDOMEventListener ondownloaderror;
|
|
|
|
attribute nsIDOMEventListener ondownloadavailable;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Will fire once the mgmt.applyDownload() call succeeds.
|
|
|
|
*/
|
|
|
|
attribute nsIDOMEventListener ondownloadapplied;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Starts to download an update. If |downloading| is true, this
|
|
|
|
* is a no-op.
|
|
|
|
*/
|
|
|
|
void download();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Cancels an ongoing update download.
|
|
|
|
*/
|
|
|
|
void cancelDownload();
|
|
|
|
|
2012-03-06 23:50:58 +04:00
|
|
|
/* startPoint will be used when several launch_path exists for an app */
|
|
|
|
nsIDOMDOMRequest launch([optional] in DOMString startPoint);
|
2012-09-27 02:03:25 +04:00
|
|
|
|
|
|
|
/* Clear data that has been collected through mozbrowser elements. */
|
|
|
|
void clearBrowserData();
|
2011-11-29 00:13:26 +04:00
|
|
|
};
|
|
|
|
|
2013-01-11 16:50:46 +04:00
|
|
|
[scriptable, uuid(cf742022-5ba3-11e2-868f-03310341b006)]
|
2012-06-06 20:42:54 +04:00
|
|
|
interface mozIDOMApplicationMgmt : nsISupports
|
2011-11-29 00:13:26 +04:00
|
|
|
{
|
2011-12-15 21:20:57 +04:00
|
|
|
/**
|
2012-03-06 23:50:58 +04:00
|
|
|
* the request will return the all the applications installed. Only accessible
|
|
|
|
* to privileged callers.
|
2011-12-15 21:20:57 +04:00
|
|
|
*/
|
2012-03-06 23:50:58 +04:00
|
|
|
nsIDOMDOMRequest getAll();
|
2011-12-15 21:20:57 +04:00
|
|
|
|
2012-08-20 21:19:56 +04:00
|
|
|
/**
|
|
|
|
* the request will return the applications acquired from all origins but
|
|
|
|
* which are not launchable (e.g. by not being natively installed), or null.
|
|
|
|
*/
|
|
|
|
nsIDOMDOMRequest getNotInstalled();
|
|
|
|
|
2011-12-15 21:20:57 +04:00
|
|
|
/**
|
2012-03-06 23:50:58 +04:00
|
|
|
* event listener to get notified of application installs. Only settable by
|
|
|
|
* privileged callers.
|
|
|
|
* the event will be a mozIDOMApplicationEvent
|
2011-12-15 21:20:57 +04:00
|
|
|
*/
|
2012-03-06 23:50:58 +04:00
|
|
|
attribute nsIDOMEventListener oninstall;
|
2011-12-15 21:20:57 +04:00
|
|
|
|
|
|
|
/**
|
2012-03-06 23:50:58 +04:00
|
|
|
* event listener to get notified of application uninstalls. Only settable by
|
|
|
|
* privileged callers.
|
|
|
|
* the event will be a mozIDOMApplicationEvent
|
2011-12-15 21:20:57 +04:00
|
|
|
*/
|
2012-03-06 23:50:58 +04:00
|
|
|
attribute nsIDOMEventListener onuninstall;
|
2012-09-27 05:01:18 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Applies a downloaded update.
|
|
|
|
* This function is a no-op if it's passed an app object which doesn't have
|
|
|
|
* |readyToApplyDownload| set to true.
|
|
|
|
*/
|
|
|
|
void applyDownload(in mozIDOMApplication app);
|
2013-01-11 16:50:46 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Uninstall a web app.
|
|
|
|
*
|
|
|
|
* @param app : the app object of the web app to be uninstalled.
|
|
|
|
* @returns : A DOMRequest object, returning the app's origin in |result|
|
|
|
|
* if uninstall succeeds; returning "NOT_INSTALLED" error otherwise.
|
|
|
|
*/
|
|
|
|
nsIDOMDOMRequest uninstall(in mozIDOMApplication app);
|
2012-03-06 23:50:58 +04:00
|
|
|
};
|
2011-12-15 21:20:57 +04:00
|
|
|
|
2012-10-03 00:38:51 +04:00
|
|
|
[scriptable, uuid(abfc6c15-8b92-4b9a-b892-52e6ae76f379)]
|
2012-03-06 23:50:58 +04:00
|
|
|
interface mozIDOMApplicationRegistry : nsISupports
|
|
|
|
{
|
2011-12-15 21:20:57 +04:00
|
|
|
/**
|
2012-07-11 19:38:33 +04:00
|
|
|
* Install a web app.
|
2011-12-15 21:20:57 +04:00
|
|
|
*
|
2012-03-06 23:50:58 +04:00
|
|
|
* @param manifestUrl : the URL of the webapps manifest.
|
2012-07-11 19:38:33 +04:00
|
|
|
* @param parameters : A structure with optional information.
|
2012-08-07 05:16:00 +04:00
|
|
|
* {
|
|
|
|
* receipts: ... Will be used to specify the payment receipts for this installation.
|
|
|
|
* categories: ... Will be used to specify the categories of the webapp.
|
|
|
|
* }
|
2012-07-11 19:38:33 +04:00
|
|
|
* @returns : A DOMRequest object, returning the app object in |result| if install succeeds.
|
2011-12-15 21:20:57 +04:00
|
|
|
*/
|
2012-03-06 23:50:58 +04:00
|
|
|
nsIDOMDOMRequest install(in DOMString manifestUrl, [optional] in jsval parameters);
|
2011-11-29 00:13:26 +04:00
|
|
|
|
2011-12-15 21:20:57 +04:00
|
|
|
/**
|
2012-03-06 23:50:58 +04:00
|
|
|
* the request will return the application currently installed, or null.
|
2011-12-15 21:20:57 +04:00
|
|
|
*/
|
2012-03-06 23:50:58 +04:00
|
|
|
nsIDOMDOMRequest getSelf();
|
2011-12-15 21:20:57 +04:00
|
|
|
|
2012-09-25 19:04:24 +04:00
|
|
|
/**
|
2012-10-03 00:38:51 +04:00
|
|
|
* the request will return the application if the app from that origin is installed
|
2012-09-25 19:04:24 +04:00
|
|
|
*/
|
2012-10-03 00:38:51 +04:00
|
|
|
nsIDOMDOMRequest checkInstalled(in DOMString manifestUrl);
|
2012-09-25 19:04:24 +04:00
|
|
|
|
2011-12-15 21:20:57 +04:00
|
|
|
/**
|
2012-03-06 23:50:58 +04:00
|
|
|
* the request will return the applications installed from this origin, or null.
|
2011-12-15 21:20:57 +04:00
|
|
|
*/
|
2012-03-06 23:50:58 +04:00
|
|
|
nsIDOMDOMRequest getInstalled();
|
2011-12-15 21:20:57 +04:00
|
|
|
|
2012-03-06 23:50:58 +04:00
|
|
|
readonly attribute mozIDOMApplicationMgmt mgmt;
|
2011-11-29 00:13:26 +04:00
|
|
|
};
|