Linux Mac OSX Windows

  
[scriptable, uuid(803e510b-4b27-4ba2-a16d-bb5fa953c166)]
interface nsISearchEngine : nsISupports

Constants

 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

Attributes

 The shortcut alias of the engine. This is a unique identifier.
attribute AString alias
 A text description describing the engine.
readonly attribute AString description
 Whether the engine should be hidden from the user.
attribute boolean hidden
 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
 A URL string pointing to the engine's search form.
readonly attribute AString searchForm
 The search engine type.
readonly attribute long type

Methods

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

 @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.

 @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"

 @throws NS_ERROR_FAILURE if the search engine is read-only.
 @throws NS_ERROR_INVALID_ARG if name or value are null.
void addParam(in AString name, in AString value, in AString responseType)
 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.

 @param  responseType
         The MIME type that we'd like to receive in response
         to this submission.  If null, will default to "text/html".

 @returns A nsISearchSubmission object that contains information about what
          to send to the search engine.  If no submission can be
          obtained for the given responseType, returns null.
nsISearchSubmission getSubmission(in AString data, 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)