Akonadi::AgentSearchInterface Class

Header: #include <Akonadi/AgentSearchInterface>
CMake: find_package(KPim6 REQUIRED COMPONENTS AkonadiAgentBase)
target_link_libraries(mytarget PRIVATE KPim6::AkonadiAgentBase)

Public Functions

AgentSearchInterface()
virtual ~AgentSearchInterface()
virtual void addSearch(const QString &query, const QString &queryLanguage, const Akonadi::Collection &resultCollection) = 0
virtual void removeSearch(const Akonadi::Collection &resultCollection) = 0
virtual void search(const QString &query, const Akonadi::Collection &collection) = 0

Detailed Description

\shortAn 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.

Member Function Documentation

AgentSearchInterface::AgentSearchInterface()

Creates a new agent search interface.

[virtual noexcept] AgentSearchInterface::~AgentSearchInterface()

Destroys the agent search interface.

[pure virtual] void AgentSearchInterface::addSearch(const QString &query, const QString &queryLanguage, const Akonadi::Collection &resultCollection)

Adds a new search.

query The query string, using the language specified in \p queryLanguage queryLanguage The query language used for \p 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.

[pure virtual] void AgentSearchInterface::removeSearch(const Akonadi::Collection &resultCollection)

Removes a previously added search. 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.

Perform a search on remote storage and return results using SearchResultJob.