2006-04-17 21:55:45 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2006-04-17 21:55:45 +00:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2012-11-19 12:25:48 +00:00
|
|
|
interface nsIPrincipal;
|
|
|
|
|
2006-04-17 21:55:45 +00:00
|
|
|
/**
|
2007-07-26 06:38:43 +00:00
|
|
|
* Interface for a class that manages updates of the url classifier database.
|
2006-04-17 21:55:45 +00:00
|
|
|
*/
|
|
|
|
|
2006-05-05 21:51:46 +00:00
|
|
|
// Interface for JS function callbacks
|
2007-07-26 06:38:43 +00:00
|
|
|
[scriptable, function, uuid(fa4caf12-d057-4e7e-81e9-ce066ceee90b)]
|
2006-05-05 21:51:46 +00:00
|
|
|
interface nsIUrlListManagerCallback : nsISupports {
|
2007-07-26 06:38:43 +00:00
|
|
|
void handleEvent(in ACString value);
|
2006-05-05 21:51:46 +00:00
|
|
|
};
|
2006-04-17 21:55:45 +00:00
|
|
|
|
2007-07-26 06:38:43 +00:00
|
|
|
|
2014-06-12 17:24:03 +00:00
|
|
|
[scriptable, uuid(653afdc4-ad4e-4ee0-8375-c576e85ebc40)]
|
2006-04-27 00:24:19 +00:00
|
|
|
interface nsIUrlListManager : nsISupports
|
2006-04-17 21:55:45 +00:00
|
|
|
{
|
2006-06-16 19:11:24 +00:00
|
|
|
/**
|
2014-06-12 17:24:03 +00:00
|
|
|
* Get the gethash url for this table
|
2006-06-16 19:11:24 +00:00
|
|
|
*/
|
2014-06-12 17:24:03 +00:00
|
|
|
ACString getGethashUrl(in ACString tableName);
|
2006-06-16 19:11:24 +00:00
|
|
|
|
2008-01-29 20:57:18 +00:00
|
|
|
/**
|
2014-06-12 17:24:03 +00:00
|
|
|
* Add a table to the list of tables we are managing. The name is a
|
2006-04-17 21:55:45 +00:00
|
|
|
* string of the format provider_name-semantic_type-table_type. For
|
2014-06-12 17:24:03 +00:00
|
|
|
* @param tableName A string of the format
|
|
|
|
* provider_name-semantic_type-table_type. For example,
|
|
|
|
* goog-white-enchash or goog-black-url.
|
|
|
|
* @param updateUrl The URL from which to fetch updates.
|
|
|
|
* @param gethashUrl The URL from which to fetch hash completions.
|
2006-04-17 21:55:45 +00:00
|
|
|
*/
|
2014-06-12 17:24:03 +00:00
|
|
|
boolean registerTable(in ACString tableName,
|
|
|
|
in ACString updateUrl,
|
|
|
|
in ACString gethashUrl);
|
2006-04-17 21:55:45 +00:00
|
|
|
|
|
|
|
/**
|
2014-06-12 17:24:03 +00:00
|
|
|
* Turn on update checking for a table. I.e., during the next server
|
2006-05-02 21:57:35 +00:00
|
|
|
* check, download updates for this table.
|
2006-04-17 21:55:45 +00:00
|
|
|
*/
|
2006-05-02 21:57:35 +00:00
|
|
|
void enableUpdate(in ACString tableName);
|
2006-04-17 21:55:45 +00:00
|
|
|
|
|
|
|
/**
|
2006-05-02 21:57:35 +00:00
|
|
|
* Turn off update checking for a table.
|
2006-04-17 21:55:45 +00:00
|
|
|
*/
|
2006-05-02 21:57:35 +00:00
|
|
|
void disableUpdate(in ACString tableName);
|
2006-04-17 21:55:45 +00:00
|
|
|
|
|
|
|
/**
|
2007-07-26 06:38:43 +00:00
|
|
|
* Lookup a key. Should not raise exceptions. Calls the callback
|
|
|
|
* function with a comma-separated list of tables to which the key
|
|
|
|
* belongs.
|
2006-04-17 21:55:45 +00:00
|
|
|
*/
|
2012-11-19 12:25:48 +00:00
|
|
|
void safeLookup(in nsIPrincipal key,
|
2006-05-05 21:51:46 +00:00
|
|
|
in nsIUrlListManagerCallback cb);
|
2006-04-17 21:55:45 +00:00
|
|
|
};
|