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

#include <albert/query.h>

Inherits QObject.

Detailed Description

Common query object.

Signals

void finished ()
 Emitted when the query finished processing.
 

Public Member Functions

virtual Q_INVOKABLE QString synopsis () const =0
 The synopsis of this query.
 
virtual Q_INVOKABLE QString trigger () const =0
 The trigger of this query.
 
virtual Q_INVOKABLE QString string () const =0
 Query string excluding the trigger.
 
virtual Q_INVOKABLE bool isFinished () const =0
 True if the query thread stopped.
 
virtual Q_INVOKABLE const bool & isValid () const =0
 True if query has not been cancelled.
 
virtual Q_INVOKABLE bool isTriggered () const =0
 True if this query has a trigger.
 
virtual Q_INVOKABLE QAbstractListModel * matches ()=0
 Returns the matches.
 
virtual Q_INVOKABLE QAbstractListModel * fallbacks ()=0
 Returns the fallbacks.
 
virtual Q_INVOKABLE void activateMatch (uint item, uint action=0)=0
 Executes match a match action.
 
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 void add (std::shared_ptr< Item > &&item)=0
 Move add single item.
 
virtual void add (const std::vector< std::shared_ptr< Item > > &items)=0
 Copy add multiple items.
 
virtual void add (std::vector< std::shared_ptr< Item > > &&items)=0
 Move add multiple items.
 
 operator QString () const
 Type conversion to QString Syntactic sugar for context conversions.
 

Protected Member Functions

 ~Query () override
 

Constructor & Destructor Documentation

◆ ~Query()

albert::Query::~Query ( )
overrideprotected

Member Function Documentation

◆ activateFallback()

virtual Q_INVOKABLE void albert::Query::activateFallback ( uint  item,
uint  action = 0 
)
pure virtual

Executes match a fallback action.

◆ activateMatch()

virtual Q_INVOKABLE void albert::Query::activateMatch ( uint  item,
uint  action = 0 
)
pure virtual

Executes match a match action.

◆ add() [1/4]

virtual void albert::Query::add ( const std::shared_ptr< Item > &  item)
pure virtual

Copy add single item.

Note
Use batch add if you can to avoid UI flicker.
See also
add(const std::vector<std::shared_ptr<Item>> &items)

◆ add() [2/4]

virtual void albert::Query::add ( const std::vector< std::shared_ptr< Item > > &  items)
pure virtual

Copy add multiple items.

◆ add() [3/4]

virtual void albert::Query::add ( std::shared_ptr< Item > &&  item)
pure virtual

Move add single item.

Note
Use batch add if you can to avoid UI flicker.
See also
add(std::vector<std::shared_ptr<Item>> &&items)

◆ add() [4/4]

virtual void albert::Query::add ( std::vector< std::shared_ptr< Item > > &&  items)
pure virtual

Move add multiple items.

◆ fallbacks()

virtual Q_INVOKABLE QAbstractListModel * albert::Query::fallbacks ( )
pure virtual

Returns the fallbacks.

◆ finished

void albert::Query::finished ( )
signal

Emitted when the query finished processing.

◆ isFinished()

virtual Q_INVOKABLE bool albert::Query::isFinished ( ) const
pure virtual

True if the query thread stopped.

◆ isTriggered()

virtual Q_INVOKABLE bool albert::Query::isTriggered ( ) const
pure virtual

True if this query has a trigger.

◆ isValid()

virtual Q_INVOKABLE const bool & albert::Query::isValid ( ) const
pure virtual

True if query has not been cancelled.

◆ matches()

virtual Q_INVOKABLE QAbstractListModel * albert::Query::matches ( )
pure virtual

Returns the matches.

◆ operator QString()

albert::Query::operator QString ( ) const
inline

Type conversion to QString Syntactic sugar for context conversions.

Since
0.24

◆ string()

virtual Q_INVOKABLE QString albert::Query::string ( ) const
pure virtual

Query string excluding the trigger.

◆ synopsis()

virtual Q_INVOKABLE QString albert::Query::synopsis ( ) const
pure virtual

The synopsis of this query.

◆ trigger()

virtual Q_INVOKABLE QString albert::Query::trigger ( ) const
pure virtual

The trigger of this query.


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