Albert
|
#include <albert/globalqueryhandler.h>
Abstract global query handler.
A functional query handler returning scored items. Applicable for the global search. Use this if you want your results show up in the global search. Implements TriggeredQueryHandler.
Public Member Functions | |
virtual std::vector< RankItem > | handleGlobalQuery (const Query *)=0 |
The query handling function. | |
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. | |
virtual bool | supportsFuzzyMatching () const |
Fuzzy matching capability. | |
virtual void | setFuzzyMatching (bool enabled) |
Fuzzy matching behavior. | |
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 | |
~GlobalQueryHandler () override | |
Protected Member Functions inherited from albert::TriggerQueryHandler | |
~TriggerQueryHandler () override | |
Protected Member Functions inherited from albert::Extension | |
virtual | ~Extension () |
|
overrideprotected |
void albert::GlobalQueryHandler::applyUsageScore | ( | std::vector< RankItem > * | ) | const |
Takes rank items and modifies the score according to the users usage.
Use this if you want to reuse your global results in the trigger handler.
|
virtual |
The empty query handling function.
Empty patterns match everything. For triggered queries this is desired. For global queries it may quickly result in long running queries on show. Since a lot of global query handlers relay the handleTriggerQuery to handleGlobalQuery it is not possible to have both. This function allows extensions to handle empty global queries differently, while still yielding all items using the trigger handler.
|
pure virtual |
The query handling function.
The match score should make sense and often (if not always) be the fraction matched chars (legth of query string / length of item title).
Implemented in albert::IndexQueryHandler.
|
overridevirtual |
Implements pure virtual handleTriggerQuery(…).
Calls handleGlobalQuery, applyUsageScore, sort and adds the items.
Implements albert::TriggerQueryHandler.