|
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 #include "nsISupports.idl" |
|
7 |
|
8 interface nsIPrincipal; |
|
9 |
|
10 /** |
|
11 * Interface for a class that manages updates of the url classifier database. |
|
12 */ |
|
13 |
|
14 // Interface for JS function callbacks |
|
15 [scriptable, function, uuid(fa4caf12-d057-4e7e-81e9-ce066ceee90b)] |
|
16 interface nsIUrlListManagerCallback : nsISupports { |
|
17 void handleEvent(in ACString value); |
|
18 }; |
|
19 |
|
20 |
|
21 [scriptable, uuid(62484bb5-bf7e-4988-9055-8803b16b48a1)] |
|
22 interface nsIUrlListManager : nsISupports |
|
23 { |
|
24 /** |
|
25 * Set the URL we check for updates. |
|
26 */ |
|
27 void setUpdateUrl(in ACString url); |
|
28 |
|
29 /** |
|
30 * Set the URL that we will query for complete hashes after a partial |
|
31 * hash match. |
|
32 */ |
|
33 void setGethashUrl(in ACString url); |
|
34 |
|
35 /** |
|
36 * Add a table to the list of tables we are managing. The name is a |
|
37 * string of the format provider_name-semantic_type-table_type. For |
|
38 * example, goog-white-enchash or goog-black-url. |
|
39 */ |
|
40 boolean registerTable(in ACString tableName); |
|
41 |
|
42 /** |
|
43 * Turn on update checking for a table. I.e., during the next server |
|
44 * check, download updates for this table. |
|
45 */ |
|
46 void enableUpdate(in ACString tableName); |
|
47 |
|
48 /** |
|
49 * Turn off update checking for a table. |
|
50 */ |
|
51 void disableUpdate(in ACString tableName); |
|
52 |
|
53 /** |
|
54 * Lookup a key. Should not raise exceptions. Calls the callback |
|
55 * function with a comma-separated list of tables to which the key |
|
56 * belongs. |
|
57 */ |
|
58 void safeLookup(in nsIPrincipal key, |
|
59 in nsIUrlListManagerCallback cb); |
|
60 |
|
61 void checkForUpdates(); |
|
62 }; |