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 nsIVariant; michael@0: interface nsIURI; michael@0: michael@0: /** michael@0: * A callback function used to notify webpages when a requested install has michael@0: * ended. michael@0: * michael@0: * NOTE: This is *not* the same as InstallListener. michael@0: */ michael@0: [scriptable, function, uuid(bb22f5c0-3ca1-48f6-873c-54e87987700f)] michael@0: interface amIInstallCallback : nsISupports michael@0: { michael@0: /** michael@0: * Called when an install completes or fails. michael@0: * michael@0: * @param aUrl michael@0: * The url of the add-on being installed michael@0: * @param aStatus michael@0: * 0 if the install was successful or negative if not michael@0: */ michael@0: void onInstallEnded(in AString aUrl, in int32_t aStatus); michael@0: }; michael@0: michael@0: michael@0: /** michael@0: * This interface is used to allow webpages to start installing add-ons. michael@0: */ michael@0: [scriptable, uuid(4fdf4f84-73dc-4857-9bbe-84895e8afd5d)] michael@0: interface amIWebInstaller : nsISupports michael@0: { michael@0: /** michael@0: * Checks if installation is enabled for a webpage. michael@0: * michael@0: * @param aMimetype michael@0: * The mimetype for the add-on to be installed michael@0: * @param referer michael@0: * The URL of the webpage trying to install an add-on michael@0: * @return true if installation is enabled michael@0: */ michael@0: boolean isInstallEnabled(in AString aMimetype, in nsIURI aReferer); michael@0: michael@0: /** michael@0: * Installs an array of add-ons at the request of a webpage michael@0: * michael@0: * @param aMimetype michael@0: * The mimetype for the add-ons michael@0: * @param aWindow michael@0: * The window installing the add-ons michael@0: * @param aReferer michael@0: * The URI for the webpage installing the add-ons michael@0: * @param aUris michael@0: * The URIs of add-ons to be installed michael@0: * @param aHashes michael@0: * The hashes for the add-ons to be installed michael@0: * @param aNames michael@0: * The names for the add-ons to be installed michael@0: * @param aIcons michael@0: * The icons for the add-ons to be installed michael@0: * @param aCallback michael@0: * An optional callback to notify about installation success and michael@0: * failure michael@0: * @param aInstallCount michael@0: * An optional argument including the number of add-ons to install michael@0: * @return true if the installation was successfully started michael@0: */ michael@0: boolean installAddonsFromWebpage(in AString aMimetype, michael@0: in nsIDOMWindow aWindow, michael@0: in nsIURI aReferer, michael@0: [array, size_is(aInstallCount)] in wstring aUris, michael@0: [array, size_is(aInstallCount)] in wstring aHashes, michael@0: [array, size_is(aInstallCount)] in wstring aNames, michael@0: [array, size_is(aInstallCount)] in wstring aIcons, michael@0: [optional] in amIInstallCallback aCallback, michael@0: [optional] in uint32_t aInstallCount); michael@0: };