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

#include <albert/query.h>

Inherits QObject.

Detailed Description

Common query object.

Signals

void matchesAboutToBeAdded (uint count)
 Emitted before count matches are added to the matches.
 
void matchesAdded ()
 Emitted after matches have been added to the matches.
 
void invalidated ()
 Emitted when the query has been invalidated.
 
void activeChanged (bool active)
 Emitted when query processing started or finished.
 

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 isActive () const =0
 True if the query is currently being processed.
 
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 const std::vector< ResultItem > & matches ()=0
 Returns the matches.
 
virtual Q_INVOKABLE const std::vector< ResultItem > & fallbacks ()=0
 Returns the fallbacks.
 
virtual Q_INVOKABLE bool activateMatch (uint item, uint action=0)=0
 Executes match a match action.
 
virtual Q_INVOKABLE bool 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 bool albert::Query::activateFallback ( uint  item,
uint  action = 0 
)
pure virtual

Executes match a fallback action.

◆ activateMatch()

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

Executes match a match action.

◆ activeChanged

void albert::Query::activeChanged ( bool  active)
signal

Emitted when query processing started or finished.

◆ 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 const std::vector< ResultItem > & albert::Query::fallbacks ( )
pure virtual

Returns the fallbacks.

◆ invalidated

void albert::Query::invalidated ( )
signal

Emitted when the query has been invalidated.

◆ isActive()

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

True if the query is currently being processed.

◆ 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 const std::vector< ResultItem > & albert::Query::matches ( )
pure virtual

Returns the matches.

◆ matchesAboutToBeAdded

void albert::Query::matchesAboutToBeAdded ( uint  count)
signal

Emitted before count matches are added to the matches.

◆ matchesAdded

void albert::Query::matchesAdded ( )
signal

Emitted after matches have been added to 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: