Bug 736903: nsHttpChannel wraps the aOffset value it passes to its stream listener...
[gecko.git] / xpcom / system / nsIBlocklistService.idl
blob43e6a5ad2498ecc9781e271871fa4852e1401cba
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is the Blocklist Service.
17 * The Initial Developer of the Original Code is
18 * Mozilla Corporation
19 * Portions created by the Initial Developer are Copyright (C) 2007
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s):
23 * Michael Wu <flamingice@sourmilk.net> (original author)
25 * Alternatively, the contents of this file may be used under the terms of
26 * either the GNU General Public License Version 2 or later (the "GPL"), or
27 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 * in which case the provisions of the GPL or the LGPL are applicable instead
29 * of those above. If you wish to allow use of your version of this file only
30 * under the terms of either the GPL or the LGPL, and not to allow others to
31 * use your version of this file under the terms of the MPL, indicate your
32 * decision by deleting the provisions above and replace them with the notice
33 * and other provisions required by the GPL or the LGPL. If you do not delete
34 * the provisions above, a recipient may use your version of this file under
35 * the terms of any one of the MPL, the GPL or the LGPL.
37 * ***** END LICENSE BLOCK ***** */
40 #include "nsISupports.idl"
42 interface nsIPluginTag;
43 interface nsIVariant;
45 [scriptable, uuid(31845f85-718a-4581-a672-a45c0327cb21)]
46 interface nsIBlocklistService : nsISupports
48 // Indicates that the item does not appear in the blocklist.
49 const unsigned long STATE_NOT_BLOCKED = 0;
50 // Indicates that the item is in the blocklist but the problem is not severe
51 // enough to warant forcibly blocking.
52 const unsigned long STATE_SOFTBLOCKED = 1;
53 // Indicates that the item should be blocked and never used.
54 const unsigned long STATE_BLOCKED = 2;
55 // Indicates that the item is considered outdated, and there is a known
56 // update available.
57 const unsigned long STATE_OUTDATED = 3;
59 /**
60 * Determine if an item is blocklisted
61 * @param id
62 * The ID of the item.
63 * @param version
64 * The item's version.
65 * @param appVersion
66 * The version of the application we are checking in the blocklist.
67 * If this parameter is null, the version of the running application
68 * is used.
69 * @param toolkitVersion
70 * The version of the toolkit we are checking in the blocklist.
71 * If this parameter is null, the version of the running toolkit
72 * is used.
73 * @returns true if the item is compatible with this version of the
74 * application or this version of the toolkit, false, otherwise.
76 boolean isAddonBlocklisted(in AString id, in AString version,
77 [optional] in AString appVersion,
78 [optional] in AString toolkitVersion);
80 /**
81 * Determine the blocklist state of an add-on
82 * @param id
83 * The ID of the item.
84 * @param version
85 * The item's version.
86 * @param appVersion
87 * The version of the application we are checking in the blocklist.
88 * If this parameter is null, the version of the running application
89 * is used.
90 * @param toolkitVersion
91 * The version of the toolkit we are checking in the blocklist.
92 * If this parameter is null, the version of the running toolkit
93 * is used.
94 * @returns The STATE constant.
96 unsigned long getAddonBlocklistState(in AString id, in AString version,
97 [optional] in AString appVersion,
98 [optional] in AString toolkitVersion);
101 * Determine the blocklist state of a plugin
102 * @param plugin
103 * The plugin to get the state for
104 * @param appVersion
105 * The version of the application we are checking in the blocklist.
106 * If this parameter is null, the version of the running application
107 * is used.
108 * @param toolkitVersion
109 * The version of the toolkit we are checking in the blocklist.
110 * If this parameter is null, the version of the running toolkit
111 * is used.
112 * @returns The STATE constant.
114 unsigned long getPluginBlocklistState(in nsIPluginTag plugin,
115 [optional] in AString appVersion,
116 [optional] in AString toolkitVersion);
119 * Determine the blocklist web page of an add-on.
120 * @param id
121 * The ID of the blocked add-on.
122 * @returns The URL of the description page.
124 AString getAddonBlocklistURL(in AString id, in AString version,
125 [optional] in AString appVersion,
126 [optional] in AString toolkitVersion);
129 * Determine the blocklist web page of a plugin.
130 * @param plugin
131 * The blocked plugin that we are determining the web page for.
132 * @returns The URL of the description page.
134 AString getPluginBlocklistURL(in nsIPluginTag plugin);
138 * nsIBlocklistPrompt is used, if available, by the default implementation of
139 * nsIBlocklistService to display a confirmation UI to the user before blocking
140 * extensions/plugins.
142 [scriptable, uuid(36f97f40-b0c9-11df-94e2-0800200c9a66)]
143 interface nsIBlocklistPrompt : nsISupports
146 * Prompt the user about newly blocked addons. The prompt is then resposible
147 * for soft-blocking any addons that need to be afterwards
149 * @param aAddons
150 * An array of addons and plugins that are blocked. These are javascript
151 * objects with properties:
152 * name - the plugin or extension name,
153 * version - the version of the extension or plugin,
154 * icon - the plugin or extension icon,
155 * disable - can be used by the nsIBlocklistPrompt to allows users to decide
156 * whether a soft-blocked add-on should be disabled,
157 * blocked - true if the item is hard-blocked, false otherwise,
158 * item - the nsIPluginTag or Addon object
159 * @param aCount
160 * The number of addons
162 void prompt([array, size_is(aCount)] in nsIVariant aAddons,
163 [optional] in PRUint32 aCount);