5#include <QAbstractListModel>
8#include <albert/export.h>
19class ALBERT_EXPORT
Query :
public QObject
26 Q_INVOKABLE
virtual QString
synopsis()
const = 0;
29 Q_INVOKABLE
virtual QString
trigger()
const = 0;
32 Q_INVOKABLE
virtual QString
string()
const = 0;
38 Q_INVOKABLE
virtual const bool &
isValid()
const = 0;
44 Q_INVOKABLE
virtual QAbstractListModel *
matches() = 0;
47 Q_INVOKABLE
virtual QAbstractListModel *
fallbacks() = 0;
58 virtual void add(
const std::shared_ptr<Item> &item) = 0;
63 virtual void add(std::shared_ptr<Item> &&item) = 0;
66 virtual void add(
const std::vector<std::shared_ptr<Item>> &items) = 0;
69 virtual void add(std::vector<std::shared_ptr<Item>> &&items) = 0;
74 inline operator QString()
const {
return string(); }
Common query object.
Definition query.h:20
virtual Q_INVOKABLE QString synopsis() const =0
The synopsis of this query.
virtual void add(std::vector< std::shared_ptr< Item > > &&items)=0
Move add multiple items.
virtual Q_INVOKABLE void activateMatch(uint item, uint action=0)=0
Executes match a match action.
virtual void add(std::shared_ptr< Item > &&item)=0
Move add single item.
virtual Q_INVOKABLE QAbstractListModel * fallbacks()=0
Returns the fallbacks.
virtual void add(const std::vector< std::shared_ptr< Item > > &items)=0
Copy add multiple items.
virtual Q_INVOKABLE bool isFinished() const =0
True if the query thread stopped.
virtual Q_INVOKABLE QAbstractListModel * matches()=0
Returns the matches.
virtual Q_INVOKABLE QString trigger() const =0
The trigger of this query.
virtual Q_INVOKABLE bool isTriggered() const =0
True if this query has a trigger.
void finished()
Emitted when the query finished processing.
virtual Q_INVOKABLE void activateFallback(uint item, uint action=0)=0
Executes match a fallback action.
virtual void add(const std::shared_ptr< Item > &item)=0
Copy add single item.
virtual Q_INVOKABLE const bool & isValid() const =0
True if query has not been cancelled.
virtual Q_INVOKABLE QString string() const =0
Query string excluding the trigger.