Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
2. GUI list item (kodi::gui::CListItem)

Class: kodi::gui::CListItem

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

Functions

 kodi::gui::CListItem::CListItem (const std::string &label="", const std::string &label2="", const std::string &path="")
 Class constructor with parameters.
 
 kodi::gui::CListItem::~CListItem () override
 Class destructor.
 
std::string kodi::gui::CListItem::GetLabel ()
 Returns the listitem label.
 
void kodi::gui::CListItem::SetLabel (const std::string &label)
 Sets the listitem label.
 
std::string kodi::gui::CListItem::GetLabel2 ()
 Returns the second listitem label.
 
void kodi::gui::CListItem::SetLabel2 (const std::string &label)
 Sets the listitem's label2.
 
std::string kodi::gui::CListItem::GetArt (const std::string &type)
 Sets the listitem's art.
 
void kodi::gui::CListItem::SetArt (const std::string &type, const std::string &url)
 Sets the listitem's art.
 
std::string kodi::gui::CListItem::GetPath ()
 Returns the path / filename of this listitem.
 
void kodi::gui::CListItem::SetPath (const std::string &path)
 Sets the listitem's path.
 
void kodi::gui::CListItem::SetProperty (const std::string &key, const std::string &value)
 Sets a listitem property, similar to an infolabel.
 
std::string kodi::gui::CListItem::GetProperty (const std::string &key)
 Returns a listitem property as a string, similar to an infolabel.
 
void kodi::gui::CListItem::Select (bool selected)
 To control selection of item in list (also multiple selection, in list on several items possible).
 
bool kodi::gui::CListItem::IsSelected ()
 Returns the listitem's selected status.
 

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()

kodi::gui::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

◆ GetArt()

std::string kodi::gui::CListItem::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

◆ GetLabel()

std::string kodi::gui::CListItem::GetLabel ( )
inline

Returns the listitem label.

Returns
Label of item

◆ GetLabel2()

std::string kodi::gui::CListItem::GetLabel2 ( )
inline

Returns the second listitem label.

Returns
Second label of item

◆ GetPath()

std::string kodi::gui::CListItem::GetPath ( )
inline

Returns the path / filename of this listitem.

Returns
Path string

◆ GetProperty()

std::string kodi::gui::CListItem::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.

◆ IsSelected()

bool kodi::gui::CListItem::IsSelected ( )
inline

Returns the listitem's selected status.

Returns
true if selected, otherwise false

◆ Select()

void kodi::gui::CListItem::Select ( bool selected)
inline

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

Parameters
[in]selectedif true becomes set as selected

◆ SetArt()

void kodi::gui::CListItem::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

◆ SetLabel()

void kodi::gui::CListItem::SetLabel ( const std::string & label)
inline

Sets the listitem label.

Parameters
[in]labelstring or unicode - text string.

◆ SetLabel2()

void kodi::gui::CListItem::SetLabel2 ( const std::string & label)
inline

Sets the listitem's label2.

Parameters
[in]labelstring or unicode - text string.

◆ SetPath()

void kodi::gui::CListItem::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 kodi::gui::CListItem::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

◆ ~CListItem()

kodi::gui::CListItem::~CListItem ( )
inlineoverride

Class destructor.