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/. */
|
2010-04-29 13:11:23 -07:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
|
|
|
interface nsIVariant;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A callback function that webpages can implement to be notified when triggered
|
|
|
|
* installs complete.
|
|
|
|
*/
|
|
|
|
[scriptable, function, uuid(bb22f5c0-3ca1-48f6-873c-54e87987700f)]
|
|
|
|
interface amIInstallCallback : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Called when an install completes or fails.
|
2010-04-28 09:42:07 -07:00
|
|
|
*
|
|
|
|
* @param aUrl
|
|
|
|
* The url of the add-on being installed
|
|
|
|
* @param aStatus
|
|
|
|
* 0 if the install was successful or negative if not
|
2010-04-29 13:11:23 -07:00
|
|
|
*/
|
2012-08-22 08:56:38 -07:00
|
|
|
void onInstallEnded(in AString aUrl, in int32_t aStatus);
|
2010-04-29 13:11:23 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The interface for the InstallTrigger object available to all websites.
|
|
|
|
*/
|
|
|
|
[scriptable, uuid(14b4e84d-001c-4403-a608-52a67ffaab40)]
|
|
|
|
interface amIInstallTrigger : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Retained for backwards compatibility.
|
|
|
|
*/
|
2012-08-22 08:56:38 -07:00
|
|
|
const uint32_t SKIN = 1;
|
|
|
|
const uint32_t LOCALE = 2;
|
|
|
|
const uint32_t CONTENT = 4;
|
|
|
|
const uint32_t PACKAGE = 7;
|
2010-04-29 13:11:23 -07:00
|
|
|
|
|
|
|
/**
|
2010-12-08 02:02:39 -08:00
|
|
|
* Tests if installation is enabled.
|
|
|
|
*
|
|
|
|
* @deprecated Use "enabled" in the future.
|
2010-04-29 13:11:23 -07:00
|
|
|
*/
|
2010-12-08 02:02:39 -08:00
|
|
|
[deprecated] boolean updateEnabled();
|
2010-04-29 13:11:23 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Tests if installation is enabled.
|
|
|
|
*/
|
|
|
|
boolean enabled();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Starts a new installation of a set of add-ons.
|
|
|
|
*
|
2010-04-28 09:42:07 -07:00
|
|
|
* @param aArgs
|
|
|
|
* The add-ons to install. This should be a JS object, each property
|
|
|
|
* is the name of an add-on to be installed. The value of the
|
|
|
|
* property should either be a string URL, or an object with the
|
|
|
|
* following properties:
|
|
|
|
* * URL for the add-on's URL
|
|
|
|
* * IconURL for an icon for the add-on
|
|
|
|
* * Hash for a hash of the add-on
|
|
|
|
* @param aCallback
|
|
|
|
* A callback to call as each installation succeeds or fails
|
|
|
|
* @return true if the installations were successfully started
|
2010-04-29 13:11:23 -07:00
|
|
|
*/
|
2010-04-28 09:42:07 -07:00
|
|
|
boolean install(in nsIVariant aArgs, [optional] in amIInstallCallback aCallback);
|
2010-04-29 13:11:23 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Starts installing a new add-on. This method is deprecated, please use
|
|
|
|
* "install" in the future.
|
|
|
|
*
|
2010-04-28 09:42:07 -07:00
|
|
|
* @param aType
|
|
|
|
* Unused, retained for backwards compatibility
|
|
|
|
* @param aUrl
|
|
|
|
* The URL of the add-on
|
|
|
|
* @param aSkin
|
|
|
|
* Unused, retained for backwards compatibility
|
|
|
|
* @return true if the installation was successfully started
|
2010-04-29 13:11:23 -07:00
|
|
|
*/
|
2012-08-22 08:56:38 -07:00
|
|
|
boolean installChrome(in uint32_t aType, in AString aUrl, in AString aSkin);
|
2010-04-29 13:11:23 -07:00
|
|
|
|
|
|
|
/**
|
2010-12-08 02:02:39 -08:00
|
|
|
* Starts installing a new add-on.
|
|
|
|
*
|
|
|
|
* @deprecated use "install" in the future.
|
2010-04-29 13:11:23 -07:00
|
|
|
*
|
2010-04-28 09:42:07 -07:00
|
|
|
* @param aUrl
|
|
|
|
* The URL of the add-on
|
|
|
|
* @param aFlags
|
|
|
|
* Unused, retained for backwards compatibility
|
|
|
|
* @return true if the installation was successfully started
|
2010-04-29 13:11:23 -07:00
|
|
|
*/
|
2012-08-22 08:56:38 -07:00
|
|
|
[deprecated] boolean startSoftwareUpdate(in AString aUrl, [optional] in int32_t aFlags);
|
2010-04-29 13:11:23 -07:00
|
|
|
};
|