KDE 4.9 PyKDE API Reference

- KDE's Python API

# AgentSearchInterface Class Reference

`from PyKDE4.akonadi import *`

Namespace: Akonadi

## Detailed Description

An interface for agents (or resources) that support searching in their backend.

Inherit from this additionally to Akonadi.AgentBase (or Akonadi.ResourceBase) and implement its two pure virtual methods.

Make sure to add the Search capability to the agent desktop file.

Since:
  4.5

## Methods

| __init__ (self)
| addSearch (self, QString query, QString queryLanguage, Akonadi.Collection resultCollection)
| removeSearch (self, Akonadi.Collection resultCollection)

## Method Documentation

__init__ | ( |  | self ) |

Creates a new agent search interface.

addSearch | ( | self, |
|  | QString | query,
|  | QString | queryLanguage,
|  | Akonadi.Collection | resultCollection
| ) |  |  |

Abstract method:
  This method is abstract and can be overridden but not called directly.

Adds a new search.

Parameters:

  | query | The query string, using the language specified in queryLanguage
  | queryLanguage | The query language used for query
  | resultCollection | The destination collection for the search results. It's a virtual collection, results can be added/removed using Akonadi.LinkJob and Akonadi.UnlinkJob respectively.

removeSearch | ( | self, |
|  | Akonadi.Collection | resultCollection
| ) |  |  |

Abstract method:
  This method is abstract and can be overridden but not called directly.

Removes a previously added search.

Parameters:

  | resultCollection | The result collection given in an previous addSearch() call. You do not need to take care of deleting results in there, the collection is just provided as a way to identify the search.