#include <albert/standarditem.h>
General purpose value type Item implememtation.
|
static std::shared_ptr< StandardItem > | make (QString id={}, QString text={}, QString subtext={}, QString input_action_text={}, QStringList icon_urls={}, std::vector< Action > actions={}) |
| Convenience shared pointer factory for standard items.
|
|
static std::shared_ptr< StandardItem > | make (QString id={}, QString text={}, QString subtext={}, QStringList icon_urls={}, std::vector< Action > actions={}) |
| Convenience shared pointer factory for standard items w/o inputAction.
|
|
◆ StandardItem() [1/3]
albert::StandardItem::StandardItem |
( |
QString |
id, |
|
|
QString |
text = {} , |
|
|
QString |
subtext = {} , |
|
|
QString |
input_action_text = {} , |
|
|
QStringList |
icon_urls = {} , |
|
|
std::vector< Action > |
actions = {} |
|
) |
| |
|
explicitnoexcept |
Constructs a StandardItem with the contents initialized with the data passed.
- Parameters
-
id | Getter for the item identifier. |
text | Getter for the item text. |
subtext | Getter for the item subtext. |
input_action_text | Getter for the input action text. |
icon_urls | Getter for the items iconUrls. |
actions | Getter for item actions. |
◆ StandardItem() [2/3]
◆ StandardItem() [3/3]
Constructs a StandardItem with the contents of other
using move semantics.
◆ actions()
std::vector< Action > albert::StandardItem::actions |
( |
| ) |
const |
|
overridevirtual |
Getter for item actions.
These are the actions a users can run.
Reimplemented from albert::Item.
◆ iconUrls()
QStringList albert::StandardItem::iconUrls |
( |
| ) |
const |
|
overridevirtual |
Getter for the items iconUrls.
Used to get the item icon using the IconProvider.
Implements albert::Item.
◆ id()
QString albert::StandardItem::id |
( |
| ) |
const |
|
overridevirtual |
Getter for 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.
Implements albert::Item.
◆ inputActionText()
QString albert::StandardItem::inputActionText |
( |
| ) |
const |
|
overridevirtual |
Getter for the input action text.
Used as input text replacement (usually by pressing Tab).
Reimplemented from albert::Item.
◆ make() [1/2]
static std::shared_ptr< StandardItem > albert::StandardItem::make |
( |
QString |
id = {} , |
|
|
QString |
text = {} , |
|
|
QString |
subtext = {} , |
|
|
QString |
input_action_text = {} , |
|
|
QStringList |
icon_urls = {} , |
|
|
std::vector< Action > |
actions = {} |
|
) |
| |
|
static |
Convenience shared pointer factory for standard items.
◆ make() [2/2]
static std::shared_ptr< StandardItem > albert::StandardItem::make |
( |
QString |
id = {} , |
|
|
QString |
text = {} , |
|
|
QString |
subtext = {} , |
|
|
QStringList |
icon_urls = {} , |
|
|
std::vector< Action > |
actions = {} |
|
) |
| |
|
static |
Convenience shared pointer factory for standard items w/o inputAction.
◆ operator=() [1/2]
◆ operator=() [2/2]
Replaces the contents with those of other
using move semantics.
◆ setActions()
void albert::StandardItem::setActions |
( |
std::vector< Action > |
actions | ) |
|
Sets the item actions to actions
.
◆ setIconUrls()
void albert::StandardItem::setIconUrls |
( |
QStringList |
urls | ) |
|
Sets the item icon urls to urls
.
◆ setId()
void albert::StandardItem::setId |
( |
QString |
id | ) |
|
Sets the item identifier to id
.
◆ setInputActionText()
void albert::StandardItem::setInputActionText |
( |
QString |
text | ) |
|
Sets the item input action text to text
.
◆ setSubtext()
void albert::StandardItem::setSubtext |
( |
QString |
text | ) |
|
Sets the item subtext to text
.
◆ setText()
void albert::StandardItem::setText |
( |
QString |
text | ) |
|
Sets the item text to text
.
◆ subtext()
QString albert::StandardItem::subtext |
( |
| ) |
const |
|
overridevirtual |
Getter for the item subtext.
Secondary descriptive text displayed in a list item.
Implements albert::Item.
◆ text()
QString albert::StandardItem::text |
( |
| ) |
const |
|
overridevirtual |
Getter for 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.
Implements albert::Item.
◆ actions_
std::vector<Action> albert::StandardItem::actions_ |
|
protected |
◆ icon_urls_
QStringList albert::StandardItem::icon_urls_ |
|
protected |
◆ id_
QString albert::StandardItem::id_ |
|
protected |
◆ input_action_text_
QString albert::StandardItem::input_action_text_ |
|
protected |
◆ subtext_
QString albert::StandardItem::subtext_ |
|
protected |
◆ text_
QString albert::StandardItem::text_ |
|
protected |
The documentation for this class was generated from the following file: