WARNING: Most of this content (with the exception of the Mozilla 1.9 XPCOM reference) is very old, and can be expected to be out of date and possibly obsolete. For better XUL documentation, please visit the XUL hub at the Mozilla Developer Center.

nsISearchEngine

IID:803e510b-4b27-4ba2-a16d-bb5fa953c166
Inherits From:nsISupports

Constants

Supported search engine types.
PRUint32 TYPE_MOZSEARCH = 1
PRUint32 TYPE_SHERLOCK = 2
PRUint32 TYPE_OPENSEARCH = 3
Supported search engine data types.
PRUint32 DATA_XML = 1
PRUint32 DATA_TEXT = 2

Properties

AString alias

The shortcut alias of the engine. This is a unique identifier.

readonly AString description

A text description describing the engine.

PRBool hidden

Whether the engine should be hidden from the user.

readonly nsIURI iconURI

A nsIURI corresponding to the engine's icon, stored locally. May be null.

readonly AString name

The display name of the search engine. This is a unique identifier.

readonly AString searchForm

A URL string pointing to the engine's search form.

readonly PRInt32 type

The search engine type.


Methods

void addParam ( AString name , AString value , AString responseType ) nsISearchSubmission getSubmission ( AString data , AString responseType ) PRBool supportsResponseType ( AString responseType )

void addParam ( AString name , AString value , AString responseType )

Adds a parameter to the search engine's submission data. This should only be called on engines created via addEngineWithDetails.

Arguments:
name: The parameter's name. Must not be null.
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.
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"

nsISearchSubmission getSubmission ( AString data , AString responseType )

Gets a nsISearchSubmission object that contains information about what to send to the search engine, including the URI and postData, if applicable.

Arguments:
data: Data to add to the submission object. i.e. the search terms.
responseType: The MIME type that we'd like to receive in response to this submission. If null, will default to "text/html".

PRBool supportsResponseType ( 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.

Arguments:
responseType: The MIME type to check for

References

This interface is the type of the following properties:

nsIBrowserSearchService.currentEngine, nsIBrowserSearchService.defaultEngine

This interface is passed as an argument to the following methods:

nsIBrowserSearchService.moveEngine, nsIBrowserSearchService.removeEngine

This interface is returned from the following methods:

nsIBrowserSearchService.getEngineByAlias, nsIBrowserSearchService.getEngineByName

Reference documentation is generated from Mozilla's source.

Copyright © 1999-2006 XULPlanet.com