Albert
|
#include <albert/triggerqueryhandler.h>
Abstract trigger query handler.
If the trigger matches, this handler is the only query handler chosen to process the user query. Inherit this class if you dont want your results to be reordered or if you want to display your items of a long running query as soon as they are available.
Public Member Functions | |
virtual QString | synopsis (const QString &query) const |
Returns the input hint for the given query. | |
virtual bool | allowTriggerRemap () const |
Returns true if the user is allowed to set a custom trigger, otherwise returns false . | |
virtual QString | defaultTrigger () const |
Returns the default trigger. | |
virtual void | setTrigger (const QString &trigger) |
Notifies that the user-defined trigger has changed to trigger. | |
virtual bool | supportsFuzzyMatching () const |
Returns true if the handler supports error tolerant matching, otherwise returns false . | |
virtual void | setFuzzyMatching (bool enabled) |
Sets the fuzzy matching mode to enabled. | |
virtual void | handleTriggerQuery (Query &query)=0 |
Handles the triggered query. | |
void | applyUsageScore (std::vector< RankItem > &rank_items) |
Modifies the score of rank_items to reflect the users usage history. | |
![]() | |
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 | |
~TriggerQueryHandler () override | |
![]() | |
virtual | ~Extension () |
|
overrideprotected |
|
virtual |
Returns true
if the user is allowed to set a custom trigger, otherwise returns false
.
The base class implementation returns true
.
void albert::TriggerQueryHandler::applyUsageScore | ( | std::vector< RankItem > & | rank_items | ) |
Modifies the score of rank_items to reflect the users usage history.
|
virtual |
Returns the default trigger.
The base class implementation returns Extension::id() with a space appended.
|
pure virtual |
Handles the triggered query.
Implemented in albert::GlobalQueryHandler.
|
virtual |
Sets the fuzzy matching mode to enabled.
The base class implementation does nothing.
Reimplemented in albert::util::IndexQueryHandler.
|
virtual |
Notifies that the user-defined trigger has changed to trigger.
The base class implementation does nothing.
|
virtual |
Returns true
if the handler supports error tolerant matching, otherwise returns false
.
The base class implementation returns false
.
Reimplemented in albert::util::IndexQueryHandler.
|
virtual |
Returns the input hint for the given query.
The returned string will be displayed in the input line if space permits. The base class implementation returns an empty string.