Albert
Loading...
Searching...
No Matches
albert::IndexQueryHandler Class Referenceabstract

#include <indexqueryhandler.h>

Inheritance diagram for albert::IndexQueryHandler:
albert::GlobalQueryHandler albert::TriggerQueryHandler albert::Extension

Detailed Description

Index query handler class.

A GlobalQueryHandler providing implicit indexing and matching. You just have to provide your items with lookup strings.

Public Member Functions

 IndexQueryHandler ()
 
 ~IndexQueryHandler () override
 
QString synopsis () const override
 "<filter>" default synopsis More...
 
bool supportsFuzzyMatching () const override
 Returns "True". More...
 
bool fuzzyMatching () const override
 Return the fuzzy mode of the internal index. More...
 
void setFuzzyMatching (bool) override
 Set the fuzzy mode of the internal index. More...
 
std::vector< RankItemhandleGlobalQuery (const GlobalQuery *) const override
 Uses the index to override GlobalQueryHandler::handleGlobalQuery. More...
 
virtual void updateIndexItems ()=0
 Update the index. More...
 
void setIndexItems (std::vector< IndexItem > &&)
 Set the items of the index. Call this in updateIndexItems(). @threadsafe. More...
 
- Public Member Functions inherited from albert::GlobalQueryHandler
 GlobalQueryHandler ()
 
 ~GlobalQueryHandler () override
 
virtual std::vector< RankItemhandleGlobalQuery (const GlobalQuery *) const =0
 The query processing function. More...
 
void applyUsageScore (std::vector< RankItem > *) const
 Takes rank items and modifies the score according to the users usage. More...
 
void handleTriggerQuery (TriggerQuery *) const override
 Implements handleTriggerQuery(…). More...
 
- Public Member Functions inherited from albert::TriggerQueryHandler
 TriggerQueryHandler ()
 
 ~TriggerQueryHandler ()
 
QString trigger () const
 The user configured trigger of this handler. More...
 
virtual QString synopsis () const
 The synopsis, displayed on empty query. More...
 
virtual QString defaultTrigger () const
 The default (not user defined) trigger. Default Extension::id(). More...
 
virtual bool allowTriggerRemap () const
 Enable user remapping of the trigger. Default false. More...
 
virtual bool supportsFuzzyMatching () const
 Fuzzy matching capability. Default false. More...
 
virtual bool fuzzyMatching () const
 Fuzzy matching. Default false. More...
 
virtual void setFuzzyMatching (bool enabled)
 Fuzzy matching behavior. Default does nothing. More...
 
virtual void handleTriggerQuery (TriggerQuery *) const =0
 The trigger query processing function. More...
 
- Public Member Functions inherited from albert::Extension
 Extension ()=default
 
virtual QString id () const =0
 The identifier of this extension. More...
 
virtual QString name () const =0
 Pretty, human readable name. More...
 
virtual QString description () const =0
 Brief description of this extension. More...
 

Additional Inherited Members

- Protected Member Functions inherited from albert::Extension
virtual ~Extension ()=default
 

Constructor & Destructor Documentation

◆ IndexQueryHandler()

albert::IndexQueryHandler::IndexQueryHandler ( )

◆ ~IndexQueryHandler()

albert::IndexQueryHandler::~IndexQueryHandler ( )
override

Member Function Documentation

◆ fuzzyMatching()

bool albert::IndexQueryHandler::fuzzyMatching ( ) const
overridevirtual

Return the fuzzy mode of the internal index.

Reimplemented from albert::TriggerQueryHandler.

◆ handleGlobalQuery()

std::vector< RankItem > albert::IndexQueryHandler::handleGlobalQuery ( const GlobalQuery ) const
overridevirtual

Uses the index to override GlobalQueryHandler::handleGlobalQuery.

Implements albert::GlobalQueryHandler.

◆ setFuzzyMatching()

void albert::IndexQueryHandler::setFuzzyMatching ( bool  )
overridevirtual

Set the fuzzy mode of the internal index.

Triggers a rebuild by calling updateIndexItems.

Reimplemented from albert::TriggerQueryHandler.

◆ setIndexItems()

void albert::IndexQueryHandler::setIndexItems ( std::vector< IndexItem > &&  )

Set the items of the index. Call this in updateIndexItems(). @threadsafe.

◆ supportsFuzzyMatching()

bool albert::IndexQueryHandler::supportsFuzzyMatching ( ) const
overridevirtual

Returns "True".

Reimplemented from albert::TriggerQueryHandler.

◆ synopsis()

QString albert::IndexQueryHandler::synopsis ( ) const
overridevirtual

"<filter>" default synopsis

Reimplemented from albert::TriggerQueryHandler.

◆ updateIndexItems()

virtual void albert::IndexQueryHandler::updateIndexItems ( )
pure virtual

Update the index.

Called when the index needs to be updated (or probably by yourself if your items changed), i.e. whenever the user made changes to the index config or initially on creation. Don't call in the constructor. It will be called on plugin initialization.

See also
void IndexQueryHandler::setIndexItems(std::vector<IndexItem>&&)

The documentation for this class was generated from the following file: