michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 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 nsIPrincipal; michael@0: michael@0: /** michael@0: * Interface for a class that manages updates of the url classifier database. michael@0: */ michael@0: michael@0: // Interface for JS function callbacks michael@0: [scriptable, function, uuid(fa4caf12-d057-4e7e-81e9-ce066ceee90b)] michael@0: interface nsIUrlListManagerCallback : nsISupports { michael@0: void handleEvent(in ACString value); michael@0: }; michael@0: michael@0: michael@0: [scriptable, uuid(62484bb5-bf7e-4988-9055-8803b16b48a1)] michael@0: interface nsIUrlListManager : nsISupports michael@0: { michael@0: /** michael@0: * Set the URL we check for updates. michael@0: */ michael@0: void setUpdateUrl(in ACString url); michael@0: michael@0: /** michael@0: * Set the URL that we will query for complete hashes after a partial michael@0: * hash match. michael@0: */ michael@0: void setGethashUrl(in ACString url); michael@0: michael@0: /** michael@0: * Add a table to the list of tables we are managing. The name is a michael@0: * string of the format provider_name-semantic_type-table_type. For michael@0: * example, goog-white-enchash or goog-black-url. michael@0: */ michael@0: boolean registerTable(in ACString tableName); michael@0: michael@0: /** michael@0: * Turn on update checking for a table. I.e., during the next server michael@0: * check, download updates for this table. michael@0: */ michael@0: void enableUpdate(in ACString tableName); michael@0: michael@0: /** michael@0: * Turn off update checking for a table. michael@0: */ michael@0: void disableUpdate(in ACString tableName); michael@0: michael@0: /** michael@0: * Lookup a key. Should not raise exceptions. Calls the callback michael@0: * function with a comma-separated list of tables to which the key michael@0: * belongs. michael@0: */ michael@0: void safeLookup(in nsIPrincipal key, michael@0: in nsIUrlListManagerCallback cb); michael@0: michael@0: void checkForUpdates(); michael@0: };