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

#include <albert/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 ()
 
bool supportsFuzzyMatching () const override
 Returns "True".
 
void setFuzzyMatching (bool) override
 Set the fuzzy mode of the internal index.
 
std::vector< RankItemhandleGlobalQuery (const Query *) override
 Uses the index to override GlobalQueryHandler::handleGlobalQuery.
 
virtual void updateIndexItems ()=0
 Update the index.
 
void setIndexItems (std::vector< IndexItem > &&)
 Set the items of the index.
 
- Public Member Functions inherited from albert::GlobalQueryHandler
virtual std::vector< std::shared_ptr< Item > > handleEmptyQuery (const Query *)
 The empty query handling function.
 
void applyUsageScore (std::vector< RankItem > *) const
 Takes rank items and modifies the score according to the users usage.
 
void handleTriggerQuery (Query *) override
 Implements pure virtual handleTriggerQuery(…).
 
- Public Member Functions inherited from albert::TriggerQueryHandler
virtual QString synopsis () const
 The synopsis, displayed on empty query.
 
virtual bool allowTriggerRemap () const
 Enable user remapping of the trigger.
 
virtual QString defaultTrigger () const
 The default (not user defined) trigger.
 
virtual void setTrigger (const QString &)
 Setter for the user defined trigger.
 
- Public Member Functions inherited from albert::Extension
virtual QString id () const =0
 The identifier of this extension.
 
virtual QString name () const =0
 Pretty, human readable name.
 
virtual QString description () const =0
 Brief description of this extension.
 

Protected Member Functions

 ~IndexQueryHandler () override
 
- Protected Member Functions inherited from albert::GlobalQueryHandler
 ~GlobalQueryHandler () override
 
- Protected Member Functions inherited from albert::TriggerQueryHandler
 ~TriggerQueryHandler () override
 
- Protected Member Functions inherited from albert::Extension
virtual ~Extension ()
 

Constructor & Destructor Documentation

◆ IndexQueryHandler()

albert::IndexQueryHandler::IndexQueryHandler ( )

◆ ~IndexQueryHandler()

albert::IndexQueryHandler::~IndexQueryHandler ( )
overrideprotected

Member Function Documentation

◆ handleGlobalQuery()

std::vector< RankItem > albert::IndexQueryHandler::handleGlobalQuery ( const Query )
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.

◆ updateIndexItems()

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

Update the index.

Called when the index needs to be updated, i.e. for initialization and on user changes to the index config (fuzzy, etc…) and probably by the client itself if the items changed. This function should call setIndexItems(std::vector<IndexItem>&&) to update the index.

Note
Don't call this method in the constructor. It will be called on plugin initialization.

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