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

#include <albert/triggerqueryhandler.h>

Inheritance diagram for albert::TriggerQueryHandler:
[legend]

Detailed Description

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.
 
- 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

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

Constructor & Destructor Documentation

◆ ~TriggerQueryHandler()

albert::TriggerQueryHandler::~TriggerQueryHandler ( )
overrideprotected

Member Function Documentation

◆ allowTriggerRemap()

virtual bool albert::TriggerQueryHandler::allowTriggerRemap ( ) const
virtual

Returns true if the user is allowed to set a custom trigger, otherwise returns false.

The base class implementation returns true.

◆ applyUsageScore()

void albert::TriggerQueryHandler::applyUsageScore ( std::vector< RankItem > &  rank_items)

Modifies the score of rank_items to reflect the users usage history.

◆ defaultTrigger()

virtual QString albert::TriggerQueryHandler::defaultTrigger ( ) const
virtual

Returns the default trigger.

The base class implementation returns Extension::id() with a space appended.

◆ handleTriggerQuery()

virtual void albert::TriggerQueryHandler::handleTriggerQuery ( Query query)
pure virtual

Handles the triggered query.

Note
Executed in a worker thread.

Implemented in albert::GlobalQueryHandler.

◆ setFuzzyMatching()

virtual void albert::TriggerQueryHandler::setFuzzyMatching ( bool  enabled)
virtual

Sets the fuzzy matching mode to enabled.

The base class implementation does nothing.

Reimplemented in albert::util::IndexQueryHandler.

◆ setTrigger()

virtual void albert::TriggerQueryHandler::setTrigger ( const QString &  trigger)
virtual

Notifies that the user-defined trigger has changed to trigger.

The base class implementation does nothing.

◆ supportsFuzzyMatching()

virtual bool albert::TriggerQueryHandler::supportsFuzzyMatching ( ) const
virtual

Returns true if the handler supports error tolerant matching, otherwise returns false.

The base class implementation returns false.

Reimplemented in albert::util::IndexQueryHandler.

◆ synopsis()

virtual QString albert::TriggerQueryHandler::synopsis ( const QString &  query) const
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.


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