2012-05-21 15:12:37 +04: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-03-17 10:16:00 +03:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
|
|
|
interface nsIURI;
|
|
|
|
interface nsIInputStream;
|
|
|
|
|
2013-08-30 20:20:22 +04:00
|
|
|
[scriptable, uuid(5799251f-5b55-4df7-a9e7-0c27812c469a)]
|
2006-03-17 10:16:00 +03:00
|
|
|
interface nsISearchSubmission : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* The POST data associated with a search submission, wrapped in a MIME
|
|
|
|
* input stream. May be null.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIInputStream postData;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The URI to submit a search to.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIURI uri;
|
|
|
|
};
|
|
|
|
|
2014-05-06 20:47:22 +04:00
|
|
|
[scriptable, uuid(65fd517b-6bda-4bac-bbe1-42de1b3a7df6)]
|
2006-03-17 10:16:00 +03:00
|
|
|
interface nsISearchEngine : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Gets a nsISearchSubmission object that contains information about what to
|
|
|
|
* send to the search engine, including the URI and postData, if applicable.
|
|
|
|
*
|
|
|
|
* @param data
|
|
|
|
* Data to add to the submission object.
|
|
|
|
* i.e. the search terms.
|
|
|
|
*
|
2010-06-16 20:54:29 +04:00
|
|
|
* @param responseType [optional]
|
2006-06-16 23:31:40 +04:00
|
|
|
* The MIME type that we'd like to receive in response
|
|
|
|
* to this submission. If null, will default to "text/html".
|
|
|
|
*
|
2011-12-21 04:20:21 +04:00
|
|
|
* @param purpose [optional]
|
|
|
|
* A string meant to indicate the context of the search request. This
|
|
|
|
* allows the search service to provide a different nsISearchSubmission
|
|
|
|
* depending on e.g. where the search is triggered in the UI.
|
|
|
|
*
|
2006-03-17 10:16:00 +03:00
|
|
|
* @returns A nsISearchSubmission object that contains information about what
|
2006-06-16 23:31:40 +04:00
|
|
|
* to send to the search engine. If no submission can be
|
|
|
|
* obtained for the given responseType, returns null.
|
2006-03-17 10:16:00 +03:00
|
|
|
*/
|
2010-06-16 20:54:29 +04:00
|
|
|
nsISearchSubmission getSubmission(in AString data,
|
2011-12-21 04:20:21 +04:00
|
|
|
[optional] in AString responseType,
|
|
|
|
[optional] in AString purpose);
|
2006-03-17 10:16:00 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds a parameter to the search engine's submission data. This should only
|
2007-03-09 06:51:55 +03:00
|
|
|
* be called on engines created via addEngineWithDetails.
|
2006-03-17 10:16:00 +03:00
|
|
|
*
|
|
|
|
* @param name
|
|
|
|
* The parameter's name. Must not be null.
|
|
|
|
*
|
|
|
|
* @param value
|
|
|
|
* The value to pass. If value is "{searchTerms}", it will be
|
|
|
|
* substituted with the user-entered data when retrieving the
|
|
|
|
* submission. Must not be null.
|
|
|
|
*
|
2006-06-16 23:31:40 +04:00
|
|
|
* @param responseType
|
|
|
|
* Since an engine can have several different request URLs,
|
|
|
|
* differentiated by response types, this parameter selects
|
|
|
|
* a request to add parameters to. If null, will default
|
|
|
|
* to "text/html"
|
|
|
|
*
|
2006-03-17 10:16:00 +03:00
|
|
|
* @throws NS_ERROR_FAILURE if the search engine is read-only.
|
|
|
|
* @throws NS_ERROR_INVALID_ARG if name or value are null.
|
|
|
|
*/
|
2006-06-16 23:31:40 +04:00
|
|
|
void addParam(in AString name, in AString value, in AString responseType);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Determines whether the engine can return responses in the given
|
|
|
|
* MIME type. Returns true if the engine spec has a URL with the
|
|
|
|
* given responseType, false otherwise.
|
|
|
|
*
|
|
|
|
* @param responseType
|
|
|
|
* The MIME type to check for
|
|
|
|
*/
|
|
|
|
boolean supportsResponseType(in AString responseType);
|
2006-03-17 10:16:00 +03:00
|
|
|
|
2013-09-23 07:01:01 +04:00
|
|
|
/**
|
|
|
|
* Returns a string with the URL to an engine's icon matching both width and
|
|
|
|
* height. Returns null if icon with specified dimensions is not found.
|
|
|
|
*
|
|
|
|
* @param width
|
|
|
|
* Width of the requested icon.
|
|
|
|
* @param height
|
|
|
|
* Height of the requested icon.
|
|
|
|
*/
|
|
|
|
AString getIconURLBySize(in long width, in long height);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets an array of all available icons. Each entry is an object with
|
|
|
|
* width, height and url properties. width and height are numeric and
|
|
|
|
* represent the icon's dimensions. url is a string with the URL for
|
|
|
|
* the icon.
|
|
|
|
*/
|
|
|
|
jsval getIcons();
|
|
|
|
|
2014-05-06 20:47:22 +04:00
|
|
|
/**
|
|
|
|
* Opens a speculative connection to the engine's search URI
|
|
|
|
* (and suggest URI, if different) to reduce request latency
|
|
|
|
*
|
|
|
|
* @param options
|
|
|
|
* An object that must contain the following fields:
|
|
|
|
* {window} the content window for the window performing the search
|
|
|
|
*
|
|
|
|
* @throws NS_ERROR_INVALID_ARG if options is omitted or lacks required
|
|
|
|
* elemeents
|
|
|
|
*/
|
|
|
|
void speculativeConnect(in jsval options);
|
|
|
|
|
2006-03-17 10:16:00 +03:00
|
|
|
/**
|
|
|
|
* Supported search engine types.
|
|
|
|
*/
|
|
|
|
const unsigned long TYPE_MOZSEARCH = 1;
|
|
|
|
const unsigned long TYPE_SHERLOCK = 2;
|
|
|
|
const unsigned long TYPE_OPENSEARCH = 3;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Supported search engine data types.
|
|
|
|
*/
|
|
|
|
const unsigned long DATA_XML = 1;
|
|
|
|
const unsigned long DATA_TEXT = 2;
|
|
|
|
|
|
|
|
/**
|
2010-06-16 20:54:29 +04:00
|
|
|
* An optional shortcut alias for the engine.
|
|
|
|
* When non-null, this is a unique identifier.
|
2006-03-17 10:16:00 +03:00
|
|
|
*/
|
|
|
|
attribute AString alias;
|
|
|
|
|
|
|
|
/**
|
2006-05-29 21:20:31 +04:00
|
|
|
* A text description describing the engine.
|
2006-03-17 10:16:00 +03:00
|
|
|
*/
|
2006-05-29 21:20:31 +04:00
|
|
|
readonly attribute AString description;
|
2006-03-17 10:16:00 +03:00
|
|
|
|
2006-05-15 18:31:21 +04:00
|
|
|
/**
|
2006-05-29 21:20:31 +04:00
|
|
|
* Whether the engine should be hidden from the user.
|
2006-05-15 18:31:21 +04:00
|
|
|
*/
|
2006-05-29 21:20:31 +04:00
|
|
|
attribute boolean hidden;
|
2006-05-15 18:31:21 +04:00
|
|
|
|
2006-03-17 10:16:00 +03:00
|
|
|
/**
|
|
|
|
* A nsIURI corresponding to the engine's icon, stored locally. May be null.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIURI iconURI;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The display name of the search engine. This is a unique identifier.
|
|
|
|
*/
|
|
|
|
readonly attribute AString name;
|
|
|
|
|
|
|
|
/**
|
2006-05-29 21:20:31 +04:00
|
|
|
* A URL string pointing to the engine's search form.
|
2006-03-17 10:16:00 +03:00
|
|
|
*/
|
2006-05-29 21:20:31 +04:00
|
|
|
readonly attribute AString searchForm;
|
2006-03-17 10:16:00 +03:00
|
|
|
|
2006-05-29 21:20:31 +04:00
|
|
|
/**
|
|
|
|
* The search engine type.
|
|
|
|
*/
|
|
|
|
readonly attribute long type;
|
2006-03-17 10:16:00 +03:00
|
|
|
|
2013-03-25 18:53:40 +04:00
|
|
|
/**
|
|
|
|
* An optional unique identifier for this search engine within the context of
|
|
|
|
* the distribution, as provided by the distributing entity.
|
|
|
|
*/
|
|
|
|
readonly attribute AString identifier;
|
|
|
|
|
2014-03-22 17:24:36 +04:00
|
|
|
/**
|
|
|
|
* Gets a string representing the hostname from which search results for a
|
|
|
|
* given responseType are returned, minus the leading "www." (if present).
|
|
|
|
* This can be specified as an url attribute in the engine description file,
|
|
|
|
* but will default to host from the <Url>'s template otherwise.
|
|
|
|
*
|
|
|
|
* @param responseType [optional]
|
|
|
|
* The MIME type to get resultDomain for. Defaults to "text/html".
|
|
|
|
*
|
|
|
|
* @return the resultDomain for the given responseType.
|
|
|
|
*/
|
|
|
|
AString getResultDomain([optional] in AString responseType);
|
2006-03-17 10:16:00 +03:00
|
|
|
};
|
|
|
|
|
2014-08-06 22:36:35 +04:00
|
|
|
[scriptable, uuid(0dc93e51-a7bf-4a16-862d-4b3469ff6206)]
|
2014-07-31 18:57:02 +04:00
|
|
|
interface nsISearchParseSubmissionResult : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* The search engine associated with the URL passed in to
|
|
|
|
* nsISearchEngine::parseSubmissionURL, or null if the URL does not represent
|
|
|
|
* a search submission.
|
|
|
|
*/
|
|
|
|
readonly attribute nsISearchEngine engine;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* String containing the sought terms. This can be an empty string in case no
|
|
|
|
* terms were specified or the URL does not represent a search submission.
|
|
|
|
*/
|
|
|
|
readonly attribute AString terms;
|
2014-08-06 22:36:35 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The offset of the string |terms| in the URL passed in to
|
|
|
|
* nsISearchEngine::parseSubmissionURL, or -1 if the URL does not represent
|
|
|
|
* a search submission.
|
|
|
|
*/
|
|
|
|
readonly attribute long termsOffset;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The length of the |terms| in the original encoding of the URL passed in to
|
|
|
|
* nsISearchEngine::parseSubmissionURL. If the search term in the original
|
|
|
|
* URL is encoded then this will be bigger than |terms.length|.
|
|
|
|
*/
|
|
|
|
readonly attribute long termsLength;
|
2014-07-31 18:57:02 +04:00
|
|
|
};
|
|
|
|
|
2013-06-18 17:39:02 +04:00
|
|
|
[scriptable, uuid(9fc39136-f08b-46d3-b232-96f4b7b0e235)]
|
|
|
|
interface nsISearchInstallCallback : nsISupports
|
|
|
|
{
|
|
|
|
const unsigned long ERROR_UNKNOWN_FAILURE = 0x1;
|
|
|
|
const unsigned long ERROR_DUPLICATE_ENGINE = 0x2;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Called to indicate that the engine addition process succeeded.
|
|
|
|
*
|
|
|
|
* @param engine
|
|
|
|
* The nsISearchEngine object that was added (will not be null).
|
|
|
|
*/
|
|
|
|
void onSuccess(in nsISearchEngine engine);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Called to indicate that the engine addition process failed.
|
|
|
|
*
|
|
|
|
* @param errorCode
|
|
|
|
* One of the ERROR_* values described above indicating the cause of
|
|
|
|
* the failure.
|
|
|
|
*/
|
|
|
|
void onError(in unsigned long errorCode);
|
|
|
|
};
|
|
|
|
|
2012-06-11 03:44:50 +04:00
|
|
|
/**
|
|
|
|
* Callback for asynchronous initialization of nsIBrowserSearchService
|
|
|
|
*/
|
|
|
|
[scriptable, function, uuid(02256156-16e4-47f1-9979-76ff98ceb590)]
|
|
|
|
interface nsIBrowserSearchInitObserver : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Called once initialization of the browser search service is complete.
|
|
|
|
*
|
|
|
|
* @param aStatus The status of that service.
|
|
|
|
*/
|
|
|
|
void onInitComplete(in nsresult aStatus);
|
|
|
|
};
|
|
|
|
|
2015-06-10 12:18:08 +03:00
|
|
|
[scriptable, uuid(150ef720-bbe2-4169-b9f3-ef7ec0654ced)]
|
2006-03-17 10:16:00 +03:00
|
|
|
interface nsIBrowserSearchService : nsISupports
|
|
|
|
{
|
2012-06-11 03:44:50 +04:00
|
|
|
/**
|
|
|
|
* Start asynchronous initialization.
|
|
|
|
*
|
|
|
|
* The callback is triggered once initialization is complete, which may be
|
|
|
|
* immediately, if initialization has already been completed by some previous
|
|
|
|
* call to this method. The callback is always invoked asynchronously.
|
|
|
|
*
|
|
|
|
* @param aObserver An optional object observing the end of initialization.
|
|
|
|
*/
|
|
|
|
void init([optional] in nsIBrowserSearchInitObserver aObserver);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Determine whether initialization has been completed.
|
|
|
|
*
|
|
|
|
* Clients of the service can use this attribute to quickly determine whether
|
|
|
|
* initialization is complete, and decide to trigger some immediate treatment,
|
|
|
|
* to launch asynchronous initialization or to bailout.
|
|
|
|
*
|
|
|
|
* Note that this attribute does not indicate that initialization has succeeded.
|
|
|
|
*
|
|
|
|
* @return |true| if the search service is now initialized, |false| if
|
|
|
|
* initialization has not been triggered yet.
|
|
|
|
*/
|
|
|
|
readonly attribute bool isInitialized;
|
|
|
|
|
2015-04-24 18:57:52 +03:00
|
|
|
/**
|
|
|
|
* Resets the default engine to its original value.
|
|
|
|
*/
|
|
|
|
void resetToOriginalDefaultEngine();
|
|
|
|
|
2006-03-17 10:16:00 +03:00
|
|
|
/**
|
2006-07-14 20:31:27 +04:00
|
|
|
* Adds a new search engine from the file at the supplied URI, optionally
|
2006-08-11 01:16:13 +04:00
|
|
|
* asking the user for confirmation first. If a confirmation dialog is
|
|
|
|
* shown, it will offer the option to begin using the newly added engine
|
2013-06-18 17:39:02 +04:00
|
|
|
* right away.
|
2006-03-17 10:16:00 +03:00
|
|
|
*
|
|
|
|
* @param engineURL
|
|
|
|
* The URL to the search engine's description file.
|
|
|
|
*
|
2006-07-21 03:00:39 +04:00
|
|
|
* @param dataType
|
2006-03-17 10:16:00 +03:00
|
|
|
* An integer representing the plugin file format. Must be one
|
|
|
|
* of the supported search engine data types defined above.
|
|
|
|
*
|
2006-05-29 23:00:56 +04:00
|
|
|
* @param iconURL
|
|
|
|
* A URL string to an icon file to be used as the search engine's
|
|
|
|
* icon. This value may be overridden by an icon specified in the
|
|
|
|
* engine description file.
|
2006-03-17 10:16:00 +03:00
|
|
|
*
|
2006-07-14 20:31:27 +04:00
|
|
|
* @param confirm
|
|
|
|
* A boolean value indicating whether the user should be asked for
|
|
|
|
* confirmation before this engine is added to the list. If this
|
|
|
|
* value is false, the engine will be added to the list upon successful
|
|
|
|
* load, but it will not be selected as the current engine.
|
2006-06-21 01:41:47 +04:00
|
|
|
*
|
2013-06-18 17:39:02 +04:00
|
|
|
* @param callback
|
|
|
|
* A nsISearchInstallCallback that will be notified when the
|
|
|
|
* addition is complete, or if the addition fails. It will not be
|
|
|
|
* called if addEngine throws an exception.
|
|
|
|
*
|
2006-03-17 10:16:00 +03:00
|
|
|
* @throws NS_ERROR_FAILURE if the type is invalid, or if the description
|
|
|
|
* file cannot be successfully loaded.
|
|
|
|
*/
|
2006-07-21 03:00:39 +04:00
|
|
|
void addEngine(in AString engineURL, in long dataType, in AString iconURL,
|
2013-06-18 17:39:02 +04:00
|
|
|
in boolean confirm, [optional] in nsISearchInstallCallback callback);
|
2006-03-17 10:16:00 +03:00
|
|
|
|
|
|
|
/**
|
2006-08-11 01:16:13 +04:00
|
|
|
* Adds a new search engine, without asking the user for confirmation and
|
|
|
|
* without starting to use it right away.
|
2006-03-17 10:16:00 +03:00
|
|
|
*
|
|
|
|
* @param name
|
|
|
|
* The search engine's name. Must be unique. Must not be null.
|
|
|
|
*
|
|
|
|
* @param iconURL
|
|
|
|
* Optional: A URL string pointing to the icon to be used to represent
|
|
|
|
* the engine.
|
|
|
|
*
|
|
|
|
* @param alias
|
|
|
|
* Optional: A unique shortcut that can be used to retrieve the
|
|
|
|
* search engine.
|
|
|
|
*
|
|
|
|
* @param description
|
|
|
|
* Optional: a description of the search engine.
|
|
|
|
*
|
|
|
|
* @param method
|
|
|
|
* The HTTP request method used when submitting a search query.
|
|
|
|
* Must be a case insensitive value of either "get" or "post".
|
|
|
|
*
|
|
|
|
* @param url
|
|
|
|
* The URL to which search queries should be sent.
|
|
|
|
* Must not be null.
|
2014-08-27 18:38:20 +04:00
|
|
|
*
|
|
|
|
* @param extensionID [optional]
|
|
|
|
* Optional: The correct extensionID if called by an add-on.
|
2006-03-17 10:16:00 +03:00
|
|
|
*/
|
|
|
|
void addEngineWithDetails(in AString name,
|
|
|
|
in AString iconURL,
|
|
|
|
in AString alias,
|
|
|
|
in AString description,
|
|
|
|
in AString method,
|
2014-08-27 18:38:20 +04:00
|
|
|
in AString url,
|
|
|
|
[optional] in AString extensionID);
|
2006-03-17 10:16:00 +03:00
|
|
|
|
2006-07-05 23:09:38 +04:00
|
|
|
/**
|
|
|
|
* Un-hides all engines installed in the directory corresponding to
|
2006-08-08 03:26:27 +04:00
|
|
|
* the directory service's NS_APP_SEARCH_DIR key. (i.e. the set of
|
|
|
|
* engines returned by getDefaultEngines)
|
2006-07-05 23:09:38 +04:00
|
|
|
*/
|
|
|
|
void restoreDefaultEngines();
|
|
|
|
|
2006-03-17 10:16:00 +03:00
|
|
|
/**
|
|
|
|
* Returns an engine with the specified alias.
|
|
|
|
*
|
|
|
|
* @param alias
|
|
|
|
* The search engine's alias.
|
|
|
|
* @returns The corresponding nsISearchEngine object, or null if it doesn't
|
|
|
|
* exist.
|
|
|
|
*/
|
|
|
|
nsISearchEngine getEngineByAlias(in AString alias);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns an engine with the specified name.
|
|
|
|
*
|
|
|
|
* @param aEngineName
|
|
|
|
* The name of the engine.
|
|
|
|
* @returns The corresponding nsISearchEngine object, or null if it doesn't
|
|
|
|
* exist.
|
|
|
|
*/
|
|
|
|
nsISearchEngine getEngineByName(in AString aEngineName);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns an array of all installed search engines.
|
|
|
|
*
|
|
|
|
* @returns an array of nsISearchEngine objects.
|
|
|
|
*/
|
|
|
|
void getEngines(
|
2009-11-07 00:56:26 +03:00
|
|
|
[optional] out unsigned long engineCount,
|
2006-03-17 10:16:00 +03:00
|
|
|
[retval, array, size_is(engineCount)] out nsISearchEngine engines);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns an array of all installed search engines whose hidden attribute is
|
|
|
|
* false.
|
|
|
|
*
|
|
|
|
* @returns an array of nsISearchEngine objects.
|
|
|
|
*/
|
|
|
|
void getVisibleEngines(
|
2009-11-07 00:56:26 +03:00
|
|
|
[optional] out unsigned long engineCount,
|
2006-03-17 10:16:00 +03:00
|
|
|
[retval, array, size_is(engineCount)] out nsISearchEngine engines);
|
2006-08-08 03:26:27 +04:00
|
|
|
|
|
|
|
/**
|
2007-05-04 19:48:08 +04:00
|
|
|
* Returns an array of all default search engines. This includes all loaded
|
|
|
|
* engines that aren't in the user's profile directory
|
|
|
|
* (NS_APP_USER_SEARCH_DIR).
|
2006-08-08 03:26:27 +04:00
|
|
|
*
|
|
|
|
* @returns an array of nsISearchEngine objects.
|
|
|
|
*/
|
|
|
|
void getDefaultEngines(
|
2009-11-07 00:56:26 +03:00
|
|
|
[optional] out unsigned long engineCount,
|
2006-08-08 03:26:27 +04:00
|
|
|
[retval, array, size_is(engineCount)] out nsISearchEngine engines);
|
2006-03-17 10:16:00 +03:00
|
|
|
|
2006-04-28 06:18:58 +04:00
|
|
|
/**
|
2006-09-13 11:03:34 +04:00
|
|
|
* Moves a visible search engine.
|
2006-04-28 06:18:58 +04:00
|
|
|
*
|
|
|
|
* @param engine
|
2006-09-13 11:03:34 +04:00
|
|
|
* The engine to move.
|
2006-04-28 06:18:58 +04:00
|
|
|
* @param newIndex
|
2006-09-13 11:03:34 +04:00
|
|
|
* The engine's new index in the set of visible engines.
|
2006-04-28 06:18:58 +04:00
|
|
|
*
|
2006-09-13 11:03:34 +04:00
|
|
|
* @throws NS_ERROR_FAILURE if newIndex is out of bounds, or if engine is
|
|
|
|
* hidden.
|
2006-04-28 06:18:58 +04:00
|
|
|
*/
|
|
|
|
void moveEngine(in nsISearchEngine engine, in long newIndex);
|
|
|
|
|
2006-03-17 10:16:00 +03:00
|
|
|
/**
|
|
|
|
* Removes the search engine. If the search engine is installed in a global
|
|
|
|
* location, this will just hide the engine. If the engine is in the user's
|
|
|
|
* profile directory, it will be removed from disk.
|
|
|
|
*
|
|
|
|
* @param engine
|
|
|
|
* The engine to remove.
|
|
|
|
*/
|
|
|
|
void removeEngine(in nsISearchEngine engine);
|
|
|
|
|
|
|
|
/**
|
2010-08-21 01:40:16 +04:00
|
|
|
* The default search engine. Returns the first visible engine if the default
|
|
|
|
* engine is hidden. May be null if there are no visible search engines.
|
2006-03-17 10:16:00 +03:00
|
|
|
*/
|
2013-04-10 04:04:22 +04:00
|
|
|
attribute nsISearchEngine defaultEngine;
|
2006-03-17 10:16:00 +03:00
|
|
|
|
|
|
|
/**
|
2006-04-28 06:18:58 +04:00
|
|
|
* The currently active search engine. May be null if there are no visible
|
2010-08-21 01:40:16 +04:00
|
|
|
* search engines.
|
2006-03-17 10:16:00 +03:00
|
|
|
*/
|
2006-04-28 06:18:58 +04:00
|
|
|
attribute nsISearchEngine currentEngine;
|
2014-07-31 18:57:02 +04:00
|
|
|
|
2015-06-10 12:18:08 +03:00
|
|
|
/**
|
|
|
|
* Gets a representation of the default engine in an anonymized JSON
|
|
|
|
* string suitable for recording in the Telemetry environment.
|
|
|
|
*
|
|
|
|
* @return an object containing anonymized info about the default engine:
|
|
|
|
* name, loadPath, submissionURL (for default engines).
|
|
|
|
*/
|
|
|
|
jsval getDefaultEngineInfo();
|
|
|
|
|
2014-07-31 18:57:02 +04:00
|
|
|
/**
|
|
|
|
* Determines if the provided URL represents results from a search engine, and
|
|
|
|
* provides details about the match.
|
|
|
|
*
|
|
|
|
* The lookup mechanism checks whether the domain name and path of the
|
|
|
|
* provided HTTP or HTTPS URL matches one of the known values for the visible
|
|
|
|
* search engines. The match does not depend on which of the schemes is used.
|
|
|
|
* The expected URI parameter for the search terms must exist in the query
|
|
|
|
* string, but other parameters are ignored.
|
|
|
|
*
|
|
|
|
* @param url
|
|
|
|
* String containing the URL to parse, for example
|
|
|
|
* "https://www.google.com/search?q=terms".
|
|
|
|
*/
|
|
|
|
nsISearchParseSubmissionResult parseSubmissionURL(in AString url);
|
2006-03-17 10:16:00 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
%{ C++
|
|
|
|
/**
|
|
|
|
* The observer topic to listen to for actions performed on installed
|
|
|
|
* search engines.
|
|
|
|
*/
|
|
|
|
#define SEARCH_ENGINE_TOPIC "browser-search-engine-modified"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sent when an engine is removed from the data store.
|
|
|
|
*/
|
|
|
|
#define SEARCH_ENGINE_REMOVED "engine-removed"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sent when an engine is changed. This includes when the engine's "hidden"
|
|
|
|
* property is changed.
|
|
|
|
*/
|
|
|
|
#define SEARCH_ENGINE_CHANGED "engine-changed"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sent when an engine is added to the list of available engines.
|
|
|
|
*/
|
|
|
|
#define SEARCH_ENGINE_ADDED "engine-added"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sent when a search engine being installed from a remote plugin description
|
|
|
|
* file is completely loaded. This is used internally by the search service as
|
|
|
|
* an indication of when the engine can be added to the internal store, and
|
|
|
|
* therefore should not be used to detect engine availability. It is always
|
|
|
|
* followed by an "added" notification.
|
|
|
|
*/
|
|
|
|
#define SEARCH_ENGINE_LOADED "engine-loaded"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sent when the "current" engine is changed.
|
|
|
|
*/
|
|
|
|
#define SEARCH_ENGINE_CURRENT "engine-current";
|
|
|
|
|
2013-04-10 04:04:22 +04:00
|
|
|
/**
|
|
|
|
* Sent when the "default" engine is changed.
|
|
|
|
*/
|
|
|
|
#define SEARCH_ENGINE_DEFAULT "engine-default";
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-03-17 10:16:00 +03:00
|
|
|
%}
|