Backed out changeset 73fb44504b62
[mozilla-central.git] / xpcom / system / nsIBlocklistService.idl
blobf1a894bd44cf0f6e2318b0b6916258b8134e204b
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;
44 [scriptable, uuid(8439f9c0-da03-4260-8b21-dc635eed28fb)]
45 interface nsIBlocklistService : nsISupports
47 // Indicates that the item does not appear in the blocklist.
48 const unsigned long STATE_NOT_BLOCKED = 0;
49 // Indicates that the item is in the blocklist but the problem is not severe
50 // enough to warant forcibly blocking.
51 const unsigned long STATE_SOFTBLOCKED = 1;
52 // Indicates that the item should be blocked and never used.
53 const unsigned long STATE_BLOCKED = 2;
55 /**
56 * Determine if an item is blocklisted
57 * @param id
58 * The ID of the item.
59 * @param version
60 * The item's version.
61 * @param appVersion
62 * The version of the application we are checking in the blocklist.
63 * If this parameter is null, the version of the running application
64 * is used.
65 * @param toolkitVersion
66 * The version of the toolkit we are checking in the blocklist.
67 * If this parameter is null, the version of the running toolkit
68 * is used.
69 * @returns true if the item is compatible with this version of the
70 * application or this version of the toolkit, false, otherwise.
72 boolean isAddonBlocklisted(in AString id, in AString version,
73 [optional] in AString appVersion,
74 [optional] in AString toolkitVersion);
76 /**
77 * Determine the blocklist state of an add-on
78 * @param id
79 * The ID of the item.
80 * @param version
81 * The item's version.
82 * @param appVersion
83 * The version of the application we are checking in the blocklist.
84 * If this parameter is null, the version of the running application
85 * is used.
86 * @param toolkitVersion
87 * The version of the toolkit we are checking in the blocklist.
88 * If this parameter is null, the version of the running toolkit
89 * is used.
90 * @returns The STATE constant.
92 unsigned long getAddonBlocklistState(in AString id, in AString version,
93 [optional] in AString appVersion,
94 [optional] in AString toolkitVersion);
96 /**
97 * Determine the blocklist state of a plugin
98 * @param plugin
99 * The plugin to get the state for
100 * @param appVersion
101 * The version of the application we are checking in the blocklist.
102 * If this parameter is null, the version of the running application
103 * is used.
104 * @param toolkitVersion
105 * The version of the toolkit we are checking in the blocklist.
106 * If this parameter is null, the version of the running toolkit
107 * is used.
108 * @returns The STATE constant.
110 unsigned long getPluginBlocklistState(in nsIPluginTag plugin,
111 [optional] in AString appVersion,
112 [optional] in AString toolkitVersion);