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 michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsIDOMWindow; michael@0: interface nsIURI; michael@0: interface nsIVariant; michael@0: michael@0: /** michael@0: * amIWebInstallInfo is used by the default implementation of michael@0: * amIWebInstallListener to communicate with the running application and allow michael@0: * it to warn the user about blocked installs and start the installs running. michael@0: */ michael@0: [scriptable, uuid(8710e692-3989-4dc7-b607-40d57610ae75)] michael@0: interface amIWebInstallInfo : nsISupports michael@0: { michael@0: readonly attribute nsIDOMWindow originatingWindow; michael@0: readonly attribute nsIURI originatingURI; michael@0: readonly attribute nsIVariant installs; michael@0: michael@0: /** michael@0: * Starts all installs. michael@0: */ michael@0: void install(); michael@0: }; michael@0: michael@0: /** michael@0: * The registered amIWebInstallListener is used to notify about new installs michael@0: * triggered by websites. The default implementation displays a confirmation michael@0: * dialog when add-ons are ready to install and uses the observer service to michael@0: * notify when installations are blocked. michael@0: */ michael@0: [scriptable, uuid(a5503979-89c8-441e-9e4a-321df379c172)] michael@0: interface amIWebInstallListener : nsISupports michael@0: { michael@0: /** michael@0: * Called when installation by websites is currently disabled. michael@0: * michael@0: * @param aWindow michael@0: * The window that triggered the installs michael@0: * @param aUri michael@0: * The URI of the site that triggered the installs michael@0: * @param aInstalls michael@0: * The AddonInstalls that were blocked michael@0: * @param aCount michael@0: * The number of AddonInstalls michael@0: */ michael@0: void onWebInstallDisabled(in nsIDOMWindow aWindow, in nsIURI aUri, michael@0: [array, size_is(aCount)] in nsIVariant aInstalls, michael@0: [optional] in uint32_t aCount); michael@0: michael@0: /** michael@0: * Called when the website is not allowed to directly prompt the user to michael@0: * install add-ons. michael@0: * michael@0: * @param aWindow michael@0: * The window that triggered the installs michael@0: * @param aUri michael@0: * The URI of the site that triggered the installs michael@0: * @param aInstalls michael@0: * The AddonInstalls that were blocked michael@0: * @param aCount michael@0: * The number of AddonInstalls michael@0: * @return true if the caller should start the installs michael@0: */ michael@0: boolean onWebInstallBlocked(in nsIDOMWindow aWindow, in nsIURI aUri, michael@0: [array, size_is(aCount)] in nsIVariant aInstalls, michael@0: [optional] in uint32_t aCount); michael@0: michael@0: /** michael@0: * Called when a website wants to ask the user to install add-ons. michael@0: * michael@0: * @param aWindow michael@0: * The window that triggered the installs michael@0: * @param aUri michael@0: * The URI of the site that triggered the installs michael@0: * @param aInstalls michael@0: * The AddonInstalls that were requested michael@0: * @param aCount michael@0: * The number of AddonInstalls michael@0: * @return true if the caller should start the installs michael@0: */ michael@0: boolean onWebInstallRequested(in nsIDOMWindow aWindow, in nsIURI aUri, michael@0: [array, size_is(aCount)] in nsIVariant aInstalls, michael@0: [optional] in uint32_t aCount); michael@0: }; michael@0: michael@0: /** michael@0: * amIWebInstallPrompt is used, if available, by the default implementation of michael@0: * amIWebInstallInfo to display a confirmation UI to the user before running michael@0: * installs. michael@0: */ michael@0: [scriptable, uuid(c5529918-4291-4b56-bd46-e9268900f2a3)] michael@0: interface amIWebInstallPrompt : nsISupports michael@0: { michael@0: /** michael@0: * Get a confirmation that the user wants to start the installs. michael@0: * michael@0: * @param aWindow michael@0: * The window that triggered the installs michael@0: * @param aUri michael@0: * The URI of the site that triggered the installs michael@0: * @param aInstalls michael@0: * The AddonInstalls that were requested michael@0: * @param aCount michael@0: * The number of AddonInstalls michael@0: */ michael@0: void confirm(in nsIDOMWindow aWindow, in nsIURI aUri, michael@0: [array, size_is(aCount)] in nsIVariant aInstalls, michael@0: [optional] in uint32_t aCount); michael@0: };