michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: */ michael@0: michael@0: michael@0: /** michael@0: * A callback function that webpages can implement to be notified when triggered michael@0: * installs complete. michael@0: */ michael@0: callback InstallTriggerCallback = void(DOMString url, short status); michael@0: michael@0: dictionary InstallTriggerData { michael@0: DOMString URL; michael@0: DOMString? IconURL; michael@0: DOMString? Hash; michael@0: }; michael@0: michael@0: /** michael@0: * The interface for the InstallTrigger object available to all websites. michael@0: */ michael@0: [ChromeOnly, michael@0: JSImplementation="@mozilla.org/addons/installtrigger;1"] michael@0: interface InstallTriggerImpl { michael@0: /** michael@0: * Retained for backwards compatibility. michael@0: */ michael@0: const unsigned short SKIN = 1; michael@0: const unsigned short LOCALE = 2; michael@0: const unsigned short CONTENT = 4; michael@0: const unsigned short PACKAGE = 7; michael@0: michael@0: /** michael@0: * Tests if installation is enabled. michael@0: */ michael@0: boolean enabled(); michael@0: michael@0: /** michael@0: * Tests if installation is enabled. michael@0: * michael@0: * @deprecated Use "enabled" in the future. michael@0: */ michael@0: boolean updateEnabled(); michael@0: michael@0: /** michael@0: * Starts a new installation of a set of add-ons. michael@0: * michael@0: * @param aArgs michael@0: * The add-ons to install. This should be a JS object, each property michael@0: * is the name of an add-on to be installed. The value of the michael@0: * property should either be a string URL, or an object with the michael@0: * following properties: michael@0: * * URL for the add-on's URL michael@0: * * IconURL for an icon for the add-on michael@0: * * Hash for a hash of the add-on michael@0: * @param aCallback michael@0: * A callback to call as each installation succeeds or fails michael@0: * @return true if the installations were successfully started michael@0: */ michael@0: boolean install(MozMap<(DOMString or InstallTriggerData)> installs, michael@0: optional InstallTriggerCallback callback); michael@0: michael@0: /** michael@0: * Starts installing a new add-on. michael@0: * michael@0: * @deprecated use "install" in the future. michael@0: * michael@0: * @param aType michael@0: * Unused, retained for backwards compatibility michael@0: * @param aUrl michael@0: * The URL of the add-on michael@0: * @param aSkin michael@0: * Unused, retained for backwards compatibility michael@0: * @return true if the installation was successfully started michael@0: */ michael@0: boolean installChrome(unsigned short type, DOMString url, DOMString skin); michael@0: michael@0: /** michael@0: * Starts installing a new add-on. michael@0: * michael@0: * @deprecated use "install" in the future. michael@0: * michael@0: * @param aUrl michael@0: * The URL of the add-on michael@0: * @param aFlags michael@0: * Unused, retained for backwards compatibility michael@0: * @return true if the installation was successfully started michael@0: */ michael@0: boolean startSoftwareUpdate(DOMString url, optional unsigned short flags); michael@0: };