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

#include <albert/item.h>

Description

Result items displayed in the query results list.

Inheritance diagram for albert::Item:
[legend]

Classes

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

Public Member Functions

virtual ~Item ()
 Destructs the 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 QString inputActionText () const
 Returns the item input action text.
 
virtual std::unique_ptr< Iconicon () const =0
 Returns the item icon.
 
virtual std::vector< Actionactions () const
 Returns the item actions.
 
virtual void addObserver (Observer *observer)
 Starts notifying observer about any changes.
 
virtual void removeObserver (Observer *observer)
 Stops notifying observer about any changes.
 

Constructor & Destructor Documentation

◆ ~Item()

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

Destructs the item.

Member Function Documentation

◆ actions()

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

Returns the item actions.

These are the actions a users can choose to activate. The base implementation returns an empty vector.

Reimplemented in albert::StandardItem.

◆ addObserver()

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

Starts notifying observer about any changes.

◆ icon()

virtual std::unique_ptr< Icon > albert::Item::icon ( ) const
pure virtual

Returns the item icon.

Do not clone a stored icon in this function. Icons can be a heavy resource. Instead return a new instance every time this function is called. The view will cache the icon instance.

See iconutil.h for the built-in icon factories. See albert::Icon if you want to create your own icon engine.

Implemented in albert::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::StandardItem.

◆ inputActionText()

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

Returns the item input action text.

Used as input text replacement (usually by pressing Tab).

The base implementation returns text().

Reimplemented in albert::StandardItem.

◆ removeObserver()

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

Stops notifying observer about any changes.

◆ subtext()

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

Returns the item subtext.

Secondary descriptive text displayed in a list item.x

Implemented in albert::StandardItem.

◆ text()

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

Returns the item text.

Primary text displayed emphasized in a list item. The string must not be empty, since the text length is used as divisor for scoring. Return as fast as possible. No checks are performed. If empty you get undefined behavior.

Implemented in albert::StandardItem.


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