Albert
Loading...
Searching...
No Matches
globalqueryhandler.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2024 Manuel Schneider
2// SPDX-License-Identifier: MIT
3
4#pragma once
5#include <albert/rankitem.h>
7#include <memory>
8#include <vector>
9
10namespace albert
11{
12
27{
28public:
29
37 virtual std::vector<RankItem> handleGlobalQuery(const Query &query) = 0;
38
45 virtual std::vector<std::shared_ptr<Item>> handleEmptyQuery();
46
51 void handleTriggerQuery(Query &query) override;
52
53protected:
54
56
57};
58
59}
Abstract global query handler.
Definition globalqueryhandler.h:27
virtual std::vector< std::shared_ptr< Item > > handleEmptyQuery()
Returns a list of special items that should show up on an emtpy query.
virtual std::vector< RankItem > handleGlobalQuery(const Query &query)=0
Returns a list of items matching the query or all items if the query is empty.
void handleTriggerQuery(Query &query) override
Calls handleGlobalQuery, applyUsageScore, sorts and adds the items to query.
Common query object.
Definition query.h:28
Abstract trigger query handler.
Definition triggerqueryhandler.h:21
Albert core interface namespace.
Definition albert.h:14