# eric4.Helpviewer.OpenSearch.OpenSearchEngine

Module implementing the open search engine.

### Global Attributes

None

### Classes

OpenSearchEngine | Class implementing the open search engine.

### Functions

None

## OpenSearchEngine

Class implementing the open search engine.

#### Signals

imageChanged()
  emitted after the icon has been changed
suggestions(const QStringList&)
  emitted after the suggestions have been received

### Derived from

QObject

### Class Attributes

_language
loc

### Methods

OpenSearchEngine | Constructor
__eq__ | Public method implementing the == operator.
__imageObtained | Private slot to receive the image of the engine.
__lt__ | Public method implementing the < operator.
__suggestionsObtained | Private slot to receive the suggestions.
description | Public method to get the description of the engine.
image | Public method to get the image of the engine.
imageUrl | Public method to get the image URL of the engine.
isValid | Public method to check, if the engine is valid.
loadImage | Public method to load the image of the engine.
name | Public method to get the name of the engine.
networkAccessManager | Public method to get a reference to the network access manager object.
parseTemplate | Class method to parse a search template.
providesSuggestions | Public method to check, if the engine provides suggestions.
requestSuggestions | Public method to request suggestions.
searchMethod | Public method to get the HTTP request method used to perform search requests.
searchParameters | Public method to get the search parameters of the engine.
searchUrl | Public method to get a URL ready for searching.
searchUrlTemplate | Public method to get the search URL template of the engine.
setDescription | Public method to set the engine description.
setImage | Public method to set the image of the engine.
setImageUrl | Public method to set the engine image URL.
setImageUrlAndLoad | Public method to set the engine image URL.
setName | Public method to set the engine name.
setNetworkAccessManager | Public method to set the reference to the network access manager.
setSearchMethod | Public method to set the HTTP request method used to perform search requests.
setSearchParameters | Public method to set the engine search parameters.
setSearchUrlTemplate | Public method to set the engine search URL template.
setSuggestionsMethod | Public method to set the HTTP request method used to perform suggestions requests.
setSuggestionsParameters | Public method to set the engine suggestions parameters.
setSuggestionsUrlTemplate | Public method to set the engine suggestions URL template.
suggestionsMethod | Public method to get the HTTP request method used to perform suggestions requests.
suggestionsParameters | Public method to get the suggestions parameters of the engine.
suggestionsUrl | Public method to get a URL ready for suggestions.
suggestionsUrlTemplate | Public method to get the search URL template of the engine.

#### OpenSearchEngine (Constructor)

OpenSearchEngine(parent = None)

Constructor

parent
  reference to the parent object (QObject)

#### OpenSearchEngine.__eq__

__eq__(other)

Public method implementing the == operator.

other
  reference to an open search engine (OpenSearchEngine)

Returns:
  flag indicating equality (boolean)

#### OpenSearchEngine.__imageObtained

__imageObtained()

Private slot to receive the image of the engine.

#### OpenSearchEngine.__lt__

__lt__(other)

Public method implementing the < operator.

other
  reference to an open search engine (OpenSearchEngine)

Returns:
  flag indicating less than (boolean)

#### OpenSearchEngine.__suggestionsObtained

__suggestionsObtained()

Private slot to receive the suggestions.

#### OpenSearchEngine.description

description()

Public method to get the description of the engine.

Returns:
  description of the engine (QString)

#### OpenSearchEngine.image

image()

Public method to get the image of the engine.

Returns:
  image of the engine (QImage)

#### OpenSearchEngine.imageUrl

imageUrl()

Public method to get the image URL of the engine.

Returns:
  image URL of the engine (QString)

#### OpenSearchEngine.isValid

isValid()

Public method to check, if the engine is valid.

Returns:
  flag indicating validity (boolean)

#### OpenSearchEngine.loadImage

loadImage()

Public method to load the image of the engine.

#### OpenSearchEngine.name

name()

Public method to get the name of the engine.

Returns:
  name of the engine (QString)

#### OpenSearchEngine.networkAccessManager

networkAccessManager()

Public method to get a reference to the network access manager object.

Returns:
  reference to the network access manager object (QNetworkAccessManager)

#### OpenSearchEngine.parseTemplate

parseTemplate(searchTerm, searchTemplate)

Class method to parse a search template.

searchTerm
  term to search for (string or QString)
searchTemplate
  template to be parsed (string or QString)

Returns:
  parsed template (QString)

#### OpenSearchEngine.providesSuggestions

providesSuggestions()

Public method to check, if the engine provides suggestions.

Returns:
  flag indicating suggestions are provided (boolean)

#### OpenSearchEngine.requestSuggestions

requestSuggestions(searchTerm)

Public method to request suggestions.

searchTerm
  term to get suggestions for (string or QString)

#### OpenSearchEngine.searchMethod

searchMethod()

Public method to get the HTTP request method used to perform search requests.

Returns:
  HTTP request method (QString)

#### OpenSearchEngine.searchParameters

searchParameters()

Public method to get the search parameters of the engine.

Returns:
  search parameters of the engine (list of two tuples)

#### OpenSearchEngine.searchUrl

searchUrl(searchTerm)

Public method to get a URL ready for searching.

searchTerm
  term to search for (string or QString)

Returns:
  URL (QUrl)

#### OpenSearchEngine.searchUrlTemplate

searchUrlTemplate()

Public method to get the search URL template of the engine.

Returns:
  search URL template of the engine (QString)

#### OpenSearchEngine.setDescription

setDescription(description)

Public method to set the engine description.

description
  description of the engine (string or QString)

#### OpenSearchEngine.setImage

setImage(image)

Public method to set the image of the engine.

image
  image to be set (QImage)

#### OpenSearchEngine.setImageUrl

setImageUrl(imageUrl)

Public method to set the engine image URL.

description
  image URL of the engine (string or QString)

#### OpenSearchEngine.setImageUrlAndLoad

setImageUrlAndLoad(imageUrl)

Public method to set the engine image URL.

description
  image URL of the engine (string or QString)

#### OpenSearchEngine.setName

setName(name)

Public method to set the engine name.

name
  name of the engine (string or QString)

#### OpenSearchEngine.setNetworkAccessManager

setNetworkAccessManager(networkAccessManager)

Public method to set the reference to the network access manager.

networkAccessManager
  reference to the network access manager object (QNetworkAccessManager)

#### OpenSearchEngine.setSearchMethod

setSearchMethod(method)

Public method to set the HTTP request method used to perform search requests.

method
  HTTP request method (QString)

#### OpenSearchEngine.setSearchParameters

setSearchParameters(searchParameters)

Public method to set the engine search parameters.

searchParameters
  search parameters of the engine (list of two tuples)

#### OpenSearchEngine.setSearchUrlTemplate

setSearchUrlTemplate(searchUrlTemplate)

Public method to set the engine search URL template.

searchUrlTemplate
  search URL template of the engine (string or QString)

#### OpenSearchEngine.setSuggestionsMethod

setSuggestionsMethod(method)

Public method to set the HTTP request method used to perform suggestions requests.

method
  HTTP request method (QString)

#### OpenSearchEngine.setSuggestionsParameters

setSuggestionsParameters(suggestionsParameters)

Public method to set the engine suggestions parameters.

suggestionsParameters
  suggestions parameters of the engine (list of two tuples)

#### OpenSearchEngine.setSuggestionsUrlTemplate

setSuggestionsUrlTemplate(suggestionsUrlTemplate)

Public method to set the engine suggestions URL template.

suggestionsUrlTemplate
  suggestions URL template of the engine (string or QString)

#### OpenSearchEngine.suggestionsMethod

suggestionsMethod()

Public method to get the HTTP request method used to perform suggestions requests.

Returns:
  HTTP request method (QString)

#### OpenSearchEngine.suggestionsParameters

suggestionsParameters()

Public method to get the suggestions parameters of the engine.

Returns:
  suggestions parameters of the engine (list of two tuples)

#### OpenSearchEngine.suggestionsUrl

suggestionsUrl(searchTerm)

Public method to get a URL ready for suggestions.

searchTerm
  term to search for (string or QString)

Returns:
  URL (QUrl)

#### OpenSearchEngine.suggestionsUrlTemplate

suggestionsUrlTemplate()

Public method to get the search URL template of the engine.

Returns:
  search URL template of the engine (QString)

Up