|
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 () |
| Returns a list of special items that should show up on an emtpy query. | |
| void | handleTriggerQuery (Query &query) override |
| Calls handleGlobalQuery, applyUsageScore, sorts and adds the items to query. | |
Public Member Functions inherited from albert::TriggerQueryHandler | |
| 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. | |
| 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 | |
| ~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::util::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::util::IndexQueryHandler::setIndexItems | ( | std::vector< IndexItem > && | ) |
Set the items of the index.
This method is threadsafe. Call this in updateIndexItems().
|
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.