Albert
|
#include <albert/indexqueryhandler.h>
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< RankItem > | handleGlobalQuery (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 () |
albert::IndexQueryHandler::IndexQueryHandler | ( | ) |
|
overrideprotected |
|
overridevirtual |
Uses the index to override GlobalQueryHandler::handleGlobalQuery.
Implements albert::GlobalQueryHandler.
|
overridevirtual |
Set the fuzzy mode of the internal index.
Triggers a rebuild by calling updateIndexItems.
Reimplemented from albert::TriggerQueryHandler.
void albert::IndexQueryHandler::setIndexItems | ( | std::vector< IndexItem > && | ) |
Set the items of the index.
Call this in updateIndexItems(). @threadsafe
|
overridevirtual |
Returns "True".
Reimplemented from albert::TriggerQueryHandler.
|
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.