#include <standarditem.h>
General purpose value type Item implememtation.
◆ StandardItem() [1/3]
albert::StandardItem::StandardItem |
( |
QString |
id = {} , |
|
|
QString |
text = {} , |
|
|
QString |
subtext = {} , |
|
|
QString |
input_action_text = {} , |
|
|
QStringList |
icon_urls = {} , |
|
|
std::vector< Action > |
actions = {} |
|
) |
| |
|
explicit |
StandardItem constructor.
- Parameters
-
id | 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.
- Parameters
-
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.
- Parameters
-
subtext | Secondary descriptive text displayed in a list item. |
input_action_text | Used to get the item icon using the IconProvider. |
icon_urls | Used as input text replacement (usually by pressing Tab). |
actions | These are the actions a users can run. |
◆ StandardItem() [2/3]
◆ StandardItem() [3/3]
◆ 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 |
◆ 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]
◆ setActions()
void albert::StandardItem::setActions |
( |
std::vector< Action > |
actions | ) |
|
Setter for item actions.
These are the actions a users can run.
◆ setIconUrls()
void albert::StandardItem::setIconUrls |
( |
QStringList |
icon_urls | ) |
|
Setter for the input action text.
Used as input text replacement (usually by pressing Tab).
◆ setId()
void albert::StandardItem::setId |
( |
QString |
id | ) |
|
Setter 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.
◆ setInputActionText()
void albert::StandardItem::setInputActionText |
( |
QString |
input_action_text | ) |
|
Setter for the items iconUrls.
Used to get the item icon using the IconProvider.
◆ setSubtext()
void albert::StandardItem::setSubtext |
( |
QString |
subtext | ) |
|
Setter for the item subtext.
Secondary descriptive text displayed in a list item.
◆ setText()
void albert::StandardItem::setText |
( |
QString |
text | ) |
|
Setter 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.
◆ 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: