Kodi Documentation 18.0
Kodi is an open source media player and entertainment hub.

\cpp_class{ kodi::gui::CListItem } Selectable window list item More...

Modules

 Definitions, structures and enumerators
 Library definition values
 

Functions

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

Detailed Description

\cpp_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 &  iconImage = "",
const std::string &  path = "" 
)
inline

Class constructor with parameters.

Parameters
[in]labelItem label
[in]label2Second Item label (if needed)
[in]iconImageItem icon image (if needed)
[in]pathPath 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

◆ GetIconImage()

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

To get current icon image of entry.

Returns
The current icon image path (if present)

◆ 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 serveral 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

◆ SetIconImage()

void kodi::gui::CListItem::SetIconImage ( const std::string &  image)
inline

To set icon image of entry.

Parameters
imageThe image to use for.
Note
Alternative can be SetArt used

◆ 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.