michael@0: /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 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: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsIPluginTag; michael@0: interface nsIVariant; michael@0: michael@0: [scriptable, uuid(d463dfbb-89c4-4553-97af-b4fd8854e161)] michael@0: interface nsIBlocklistService : nsISupports michael@0: { michael@0: // Indicates that the item does not appear in the blocklist. michael@0: const unsigned long STATE_NOT_BLOCKED = 0; michael@0: // Indicates that the item is in the blocklist but the problem is not severe michael@0: // enough to warant forcibly blocking. michael@0: const unsigned long STATE_SOFTBLOCKED = 1; michael@0: // Indicates that the item should be blocked and never used. michael@0: const unsigned long STATE_BLOCKED = 2; michael@0: // Indicates that the item is considered outdated, and there is a known michael@0: // update available. michael@0: const unsigned long STATE_OUTDATED = 3; michael@0: // Indicates that the item is vulnerable and there is an update. michael@0: const unsigned long STATE_VULNERABLE_UPDATE_AVAILABLE = 4; michael@0: // Indicates that the item is vulnerable and there is no update. michael@0: const unsigned long STATE_VULNERABLE_NO_UPDATE = 5; michael@0: michael@0: /** michael@0: * Determine if an item is blocklisted michael@0: * @param addon michael@0: * The addon item to be checked. michael@0: * @param appVersion michael@0: * The version of the application we are checking in the blocklist. michael@0: * If this parameter is null, the version of the running application michael@0: * is used. michael@0: * @param toolkitVersion michael@0: * The version of the toolkit we are checking in the blocklist. michael@0: * If this parameter is null, the version of the running toolkit michael@0: * is used. michael@0: * @returns true if the item is compatible with this version of the michael@0: * application or this version of the toolkit, false, otherwise. michael@0: */ michael@0: boolean isAddonBlocklisted(in jsval addon, michael@0: [optional] in AString appVersion, michael@0: [optional] in AString toolkitVersion); michael@0: michael@0: /** michael@0: * Determine the blocklist state of an add-on michael@0: * @param id michael@0: * The addon item to be checked. michael@0: * @param appVersion michael@0: * The version of the application we are checking in the blocklist. michael@0: * If this parameter is null, the version of the running application michael@0: * is used. michael@0: * @param toolkitVersion michael@0: * The version of the toolkit we are checking in the blocklist. michael@0: * If this parameter is null, the version of the running toolkit michael@0: * is used. michael@0: * @returns The STATE constant. michael@0: */ michael@0: unsigned long getAddonBlocklistState(in jsval addon, michael@0: [optional] in AString appVersion, michael@0: [optional] in AString toolkitVersion); michael@0: michael@0: /** michael@0: * Determine the blocklist state of a plugin michael@0: * @param plugin michael@0: * The plugin to get the state for michael@0: * @param appVersion michael@0: * The version of the application we are checking in the blocklist. michael@0: * If this parameter is null, the version of the running application michael@0: * is used. michael@0: * @param toolkitVersion michael@0: * The version of the toolkit we are checking in the blocklist. michael@0: * If this parameter is null, the version of the running toolkit michael@0: * is used. michael@0: * @returns The STATE constant. michael@0: */ michael@0: unsigned long getPluginBlocklistState(in nsIPluginTag plugin, michael@0: [optional] in AString appVersion, michael@0: [optional] in AString toolkitVersion); michael@0: michael@0: /** michael@0: * Determine the blocklist web page of an add-on. michael@0: * @param addon michael@0: * The addon item whose url is required. michael@0: * @returns The URL of the description page. michael@0: */ michael@0: AString getAddonBlocklistURL(in jsval addon, michael@0: [optional] in AString appVersion, michael@0: [optional] in AString toolkitVersion); michael@0: michael@0: /** michael@0: * Determine the blocklist web page of a plugin. michael@0: * @param plugin michael@0: * The blocked plugin that we are determining the web page for. michael@0: * @returns The URL of the description page. michael@0: */ michael@0: AString getPluginBlocklistURL(in nsIPluginTag plugin); michael@0: }; michael@0: michael@0: /** michael@0: * nsIBlocklistPrompt is used, if available, by the default implementation of michael@0: * nsIBlocklistService to display a confirmation UI to the user before blocking michael@0: * extensions/plugins. michael@0: */ michael@0: [scriptable, uuid(ba915921-b9c0-400d-8e4f-ca1b80c5699a)] michael@0: interface nsIBlocklistPrompt : nsISupports michael@0: { michael@0: /** michael@0: * Prompt the user about newly blocked addons. The prompt is then resposible michael@0: * for soft-blocking any addons that need to be afterwards michael@0: * michael@0: * @param aAddons michael@0: * An array of addons and plugins that are blocked. These are javascript michael@0: * objects with properties: michael@0: * name - the plugin or extension name, michael@0: * version - the version of the extension or plugin, michael@0: * icon - the plugin or extension icon, michael@0: * disable - can be used by the nsIBlocklistPrompt to allows users to decide michael@0: * whether a soft-blocked add-on should be disabled, michael@0: * blocked - true if the item is hard-blocked, false otherwise, michael@0: * item - the nsIPluginTag or Addon object michael@0: * @param aCount michael@0: * The number of addons michael@0: */ michael@0: void prompt([array, size_is(aCount)] in nsIVariant aAddons, michael@0: [optional] in uint32_t aCount); michael@0: };