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

#include <albert/item.h>

Inheritance diagram for albert::Item:
[legend]

Detailed Description

Result items displayed in the query results list.

Classes

class  Observer
 Interface class for item observers. More...
 

Public Member Functions

virtual ~Item ()
 
virtual QString id () const =0
 Returns the item identifier.
 
virtual QString text () const =0
 Returns the item text.
 
virtual QString subtext () const =0
 Returns the item subtext.
 
virtual QStringList iconUrls () const =0
 Returns the items icon urls.
 
virtual QString inputActionText () const
 Returns the input action text.
 
virtual std::vector< Actionactions () const
 Returns the item actions.
 
virtual void addObserver (Observer *observer)
 Start notifying observer about any changes.
 
virtual void removeObserver (Observer *observer)
 Stop notifying observer about any changes.
 

Constructor & Destructor Documentation

◆ ~Item()

virtual albert::Item::~Item ( )
virtual

Member Function Documentation

◆ actions()

virtual std::vector< Action > albert::Item::actions ( ) const
virtual

Returns the item actions.

These are the actions a users can run. The base implementation returns an empty vector.

Reimplemented in albert::util::StandardItem.

◆ addObserver()

virtual void albert::Item::addObserver ( Observer observer)
virtual

Start notifying observer about any changes.

Reimplemented in albert::detail::DynamicItem.

◆ iconUrls()

virtual QStringList albert::Item::iconUrls ( ) const
pure virtual

Returns the items icon urls.

Used to get the item icon using the icon provider functions.

Implemented in albert::util::StandardItem.

◆ id()

virtual QString albert::Item::id ( ) const
pure virtual

Returns the item identifier.

Has to be unique per extension. This function is involved in several time critical operartion such as indexing and sorting. It is therefore recommended to return a string that is as short as possible as fast as possible.

Implemented in albert::util::StandardItem.

◆ inputActionText()

virtual QString albert::Item::inputActionText ( ) const
virtual

Returns the input action text.

Used as input text replacement (usually by pressing Tab). The base implementation returns text().

Reimplemented in albert::util::StandardItem.

◆ removeObserver()

virtual void albert::Item::removeObserver ( Observer observer)
virtual

Stop notifying observer about any changes.

Reimplemented in albert::detail::DynamicItem.

◆ subtext()

virtual QString albert::Item::subtext ( ) const
pure virtual

Returns the item subtext.

Secondary descriptive text displayed in a list item.

Implemented in albert::util::StandardItem.

◆ text()

virtual QString albert::Item::text ( ) const
pure virtual

Returns the item text.

Primary text displayed emphasized in a list item. This string is used in scoring. It is therefore recommended to return as fast as possible. The text length is used as divisor for scoring, hence the string must not be empty, otherwise you get undefined behavior. For performance reasons text length is not checked.

Implemented in albert::util::StandardItem.


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