2012-05-21 04:12:37 -07: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-28 12:13:26 -08:00
|
|
|
|
|
|
|
#include "domstubs.idl"
|
2012-03-06 11:50:58 -08:00
|
|
|
#include "nsIDOMEventTarget.idl"
|
2011-11-28 12:13:26 -08:00
|
|
|
|
2012-03-06 11:50:58 -08:00
|
|
|
interface nsIDOMDOMRequest;
|
2012-06-14 16:03:55 -07:00
|
|
|
interface nsIArray;
|
2011-11-28 12:13:26 -08:00
|
|
|
|
2012-06-11 11:41:46 -07:00
|
|
|
[scriptable, uuid(9583b825-46b1-4e8f-bb48-9fed660a95e6)]
|
2012-03-06 11:50:58 -08:00
|
|
|
interface mozIDOMApplication : nsISupports
|
2011-11-28 12:13:26 -08:00
|
|
|
{
|
|
|
|
readonly attribute jsval manifest;
|
2012-03-06 11:50:58 -08:00
|
|
|
readonly attribute DOMString manifestURL;
|
2012-06-11 11:41:46 -07:00
|
|
|
readonly attribute jsval receipts; /* an array of strings */
|
2011-11-28 12:13:26 -08:00
|
|
|
readonly attribute DOMString origin;
|
|
|
|
readonly attribute DOMString installOrigin;
|
2012-06-11 11:41:46 -07:00
|
|
|
readonly attribute unsigned long long installTime;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The current progress when downloading an offline cache.
|
|
|
|
*/
|
|
|
|
readonly attribute double progress;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The application status :
|
|
|
|
* "installed" : The app is in the registry, but we have no offline cache.
|
|
|
|
* "downlading" : We are downloading the offline cache.
|
|
|
|
* "cached" : We are done with the offline cache download.
|
|
|
|
* "cache-error" : An error occured while downloading the offline-cache.
|
|
|
|
*/
|
|
|
|
readonly attribute DOMString status;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* fires a nsIDOMApplicationEvent when a change in appcache download or status happens
|
|
|
|
*/
|
|
|
|
attribute nsIDOMEventListener onprogress;
|
2012-06-14 16:03:55 -07:00
|
|
|
|
2012-03-06 11:50:58 -08:00
|
|
|
/* startPoint will be used when several launch_path exists for an app */
|
|
|
|
nsIDOMDOMRequest launch([optional] in DOMString startPoint);
|
2012-06-14 16:03:55 -07:00
|
|
|
nsIDOMDOMRequest uninstall();
|
2011-11-28 12:13:26 -08:00
|
|
|
};
|
|
|
|
|
2012-06-06 09:42:54 -07:00
|
|
|
[scriptable, uuid(bd304874-d532-4e13-8034-544211445583)]
|
|
|
|
interface mozIDOMApplicationMgmt : nsISupports
|
2011-11-28 12:13:26 -08:00
|
|
|
{
|
2011-12-15 09:20:57 -08:00
|
|
|
/**
|
2012-03-06 11:50:58 -08:00
|
|
|
* the request will return the all the applications installed. Only accessible
|
|
|
|
* to privileged callers.
|
2011-12-15 09:20:57 -08:00
|
|
|
*/
|
2012-03-06 11:50:58 -08:00
|
|
|
nsIDOMDOMRequest getAll();
|
2011-12-15 09:20:57 -08:00
|
|
|
|
2012-08-20 10:19:56 -07: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 09:20:57 -08:00
|
|
|
/**
|
2012-03-06 11:50:58 -08:00
|
|
|
* event listener to get notified of application installs. Only settable by
|
|
|
|
* privileged callers.
|
|
|
|
* the event will be a mozIDOMApplicationEvent
|
2011-12-15 09:20:57 -08:00
|
|
|
*/
|
2012-03-06 11:50:58 -08:00
|
|
|
attribute nsIDOMEventListener oninstall;
|
2011-12-15 09:20:57 -08:00
|
|
|
|
|
|
|
/**
|
2012-03-06 11:50:58 -08:00
|
|
|
* event listener to get notified of application uninstalls. Only settable by
|
|
|
|
* privileged callers.
|
|
|
|
* the event will be a mozIDOMApplicationEvent
|
2011-12-15 09:20:57 -08:00
|
|
|
*/
|
2012-03-06 11:50:58 -08:00
|
|
|
attribute nsIDOMEventListener onuninstall;
|
|
|
|
};
|
2011-12-15 09:20:57 -08:00
|
|
|
|
2012-07-11 08:38:33 -07:00
|
|
|
[scriptable, uuid(6e3d4cf8-ad45-4a8d-8f94-4527ec68673c)]
|
2012-03-06 11:50:58 -08:00
|
|
|
interface mozIDOMApplicationRegistry : nsISupports
|
|
|
|
{
|
2011-12-15 09:20:57 -08:00
|
|
|
/**
|
2012-07-11 08:38:33 -07:00
|
|
|
* Install a web app.
|
2011-12-15 09:20:57 -08:00
|
|
|
*
|
2012-03-06 11:50:58 -08:00
|
|
|
* @param manifestUrl : the URL of the webapps manifest.
|
2012-07-11 08:38:33 -07:00
|
|
|
* @param parameters : A structure with optional information.
|
2012-08-06 18:16:00 -07: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 08:38:33 -07:00
|
|
|
* @returns : A DOMRequest object, returning the app object in |result| if install succeeds.
|
2011-12-15 09:20:57 -08:00
|
|
|
*/
|
2012-03-06 11:50:58 -08:00
|
|
|
nsIDOMDOMRequest install(in DOMString manifestUrl, [optional] in jsval parameters);
|
2011-11-28 12:13:26 -08:00
|
|
|
|
2011-12-15 09:20:57 -08:00
|
|
|
/**
|
2012-03-06 11:50:58 -08:00
|
|
|
* the request will return the application currently installed, or null.
|
2011-12-15 09:20:57 -08:00
|
|
|
*/
|
2012-03-06 11:50:58 -08:00
|
|
|
nsIDOMDOMRequest getSelf();
|
2011-12-15 09:20:57 -08:00
|
|
|
|
|
|
|
/**
|
2012-03-06 11:50:58 -08:00
|
|
|
* the request will return the applications installed from this origin, or null.
|
2011-12-15 09:20:57 -08:00
|
|
|
*/
|
2012-03-06 11:50:58 -08:00
|
|
|
nsIDOMDOMRequest getInstalled();
|
2011-12-15 09:20:57 -08:00
|
|
|
|
2012-07-11 08:38:33 -07:00
|
|
|
/**
|
|
|
|
* Install a packaged web app.
|
|
|
|
*
|
|
|
|
* @param packageUrl : the URL of the webapps manifest.
|
|
|
|
* @param parameters : A structure with optional information.
|
2012-08-06 18:16:00 -07: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 08:38:33 -07:00
|
|
|
* @returns : A DOMRequest object, returning the app object in |result| if install succeeds.
|
|
|
|
*/
|
|
|
|
nsIDOMDOMRequest installPackage(in DOMString packageUrl, [optional] in jsval parameters);
|
|
|
|
|
2012-03-06 11:50:58 -08:00
|
|
|
readonly attribute mozIDOMApplicationMgmt mgmt;
|
2011-11-28 12:13:26 -08:00
|
|
|
};
|