Kodi Development  20.0
for Binary and Script based Add-Ons
2. GUI list item (kodi::gui::CListItem)

Detailed Description

Class: kodi::gui::CListItem

Selectable window list item
The list item control is used for creating item lists in Kodi.

The with #include <kodi/gui/ListItem.h> given class is used to create a item entry for a list on window and to support it's control.

Function Documentation

◆ CListItem()

CListItem ( const std::string &  label = "",
const std::string &  label2 = "",
const std::string &  path = "" 
)
inline

Class constructor with parameters.

Parameters
[in]label[opt] Item label
[in]label2[opt] Second Item label (if needed)
[in]path[opt] Path to where item is defined

◆ ~CListItem()

~CListItem ( )
inlineoverride

Class destructor.

◆ GetLabel()

std::string GetLabel ( )
inline

Returns the listitem label.

Returns
Label of item

◆ SetLabel()

void SetLabel ( const std::string &  label)
inline

Sets the listitem label.

Parameters
[in]labelstring or unicode - text string.

◆ GetLabel2()

std::string GetLabel2 ( )
inline

Returns the second listitem label.

Returns
Second label of item

◆ SetLabel2()

void SetLabel2 ( const std::string &  label)
inline

Sets the listitem's label2.

Parameters
[in]labelstring or unicode - text string.

◆ GetArt()

std::string GetArt ( const std::string &  type)
inline

Sets the listitem's art.

Parameters
[in]typeType of Art to set
  • Some default art values (any string possible):
    value (type) Type
    thumb string - image filename
    poster string - image filename
    banner string - image filename
    fanart string - image filename
    clearart string - image filename
    clearlogo string - image filename
    landscape string - image filename
    icon string - image filename
Returns
The url to use for Art

◆ SetArt()

void SetArt ( const std::string &  type,
const std::string &  url 
)
inline

Sets the listitem's art.

Parameters
[in]typeType of Art to set
[in]urlThe url to use for Art
  • Some default art values (any string possible):
    value (type) Type
    thumb string - image filename
    poster string - image filename
    banner string - image filename
    fanart string - image filename
    clearart string - image filename
    clearlogo string - image filename
    landscape string - image filename
    icon string - image filename

◆ GetPath()

std::string GetPath ( )
inline

Returns the path / filename of this listitem.

Returns
Path string

◆ SetPath()

void SetPath ( const std::string &  path)
inline

Sets the listitem's path.

Parameters
[in]pathstring or unicode - path, activated when item is clicked.
Note
You can use the above as keywords for arguments.

◆ SetProperty()

void SetProperty ( const std::string &  key,
const std::string &  value 
)
inline

Sets a listitem property, similar to an infolabel.

Parameters
[in]keystring - property name.
[in]valuestring or unicode - value of property.
Note
Key is NOT case sensitive. You can use the above as keywords for arguments and skip certain
optional arguments.
Once you use a keyword, all following arguments require the keyword.

Some of these are treated internally by Kodi, such as the 'StartOffset' property, which is the offset in seconds at which to start playback of an item. Others may be used in the skin to add extra information, such as 'WatchedCount' for tvshow items

◆ GetProperty()

std::string GetProperty ( const std::string &  key)
inline

Returns a listitem property as a string, similar to an infolabel.

Parameters
[in]keystring - property name.
Returns
string - List item property
Note
Key is NOT case sensitive.
You can use the above as keywords for arguments and skip certain optional arguments.
Once you use a keyword, all following arguments require the keyword.

◆ Select()

void Select ( bool  selected)
inline

To control selection of item in list (also multiple selection, in list on serveral items possible).

Parameters
[in]selectedif true becomes set as selected

◆ IsSelected()

bool IsSelected ( )
inline

Returns the listitem's selected status.

Returns
true if selected, otherwise false