11 #include "../AddonBase.h"
12 #include "../c-api/gui/list_item.h"
28 KODI_GUI_LISTITEM_HANDLE GetControlHandle()
const {
return m_controlHandle; }
32 : m_controlHandle(
nullptr),
33 m_interface(::kodi::addon::CAddonBase::m_interface->toKodi),
42 KODI_GUI_LISTITEM_HANDLE m_controlHandle;
76 const std::string& label2 =
"",
77 const std::string& path =
"")
80 m_controlHandle = m_interface->kodi_gui->listItem->create(m_interface->kodiBase, label.c_str(),
81 label2.c_str(), path.c_str());
92 m_controlHandle = listItemHandle;
101 m_interface->kodi_gui->listItem->destroy(m_interface->kodiBase, m_controlHandle);
114 char* ret = m_interface->kodi_gui->listItem->get_label(m_interface->kodiBase, m_controlHandle);
117 if (std::strlen(ret))
119 m_interface->free_string(m_interface->kodiBase, ret);
133 m_interface->kodi_gui->listItem->set_label(m_interface->kodiBase, m_controlHandle,
147 char* ret = m_interface->kodi_gui->listItem->get_label2(m_interface->kodiBase, m_controlHandle);
150 if (std::strlen(ret))
152 m_interface->free_string(m_interface->kodiBase, ret);
166 m_interface->kodi_gui->listItem->set_label2(m_interface->kodiBase, m_controlHandle,
189 std::string
GetArt(
const std::string& type)
191 std::string strReturn;
192 char* ret = m_interface->kodi_gui->listItem->get_art(m_interface->kodiBase, m_controlHandle,
196 if (std::strlen(ret))
198 m_interface->free_string(m_interface->kodiBase, ret);
222 void SetArt(
const std::string& type,
const std::string& url)
224 m_interface->kodi_gui->listItem->set_art(m_interface->kodiBase, m_controlHandle, type.c_str(),
237 std::string strReturn;
238 char* ret = m_interface->kodi_gui->listItem->get_path(m_interface->kodiBase, m_controlHandle);
241 if (std::strlen(ret))
243 m_interface->free_string(m_interface->kodiBase, ret);
259 m_interface->kodi_gui->listItem->set_path(m_interface->kodiBase, m_controlHandle, path.c_str());
281 void SetProperty(
const std::string& key,
const std::string& value)
283 m_interface->kodi_gui->listItem->set_property(m_interface->kodiBase, m_controlHandle,
284 key.c_str(), value.c_str());
304 char* ret = m_interface->kodi_gui->listItem->get_property(m_interface->kodiBase,
305 m_controlHandle, key.c_str());
308 if (std::strlen(ret))
310 m_interface->free_string(m_interface->kodiBase, ret);
325 m_interface->kodi_gui->listItem->select(m_interface->kodiBase, m_controlHandle, selected);
337 return m_interface->kodi_gui->listItem->is_selected(m_interface->kodiBase, m_controlHandle);
Definition: ListItem.h:26
Definition: ListItem.h:65
std::string GetArt(const std::string &type)
Sets the listitem's art.
Definition: ListItem.h:189
void SetArt(const std::string &type, const std::string &url)
Sets the listitem's art.
Definition: ListItem.h:222
void SetPath(const std::string &path)
Sets the listitem's path.
Definition: ListItem.h:257
CListItem(const std::string &label="", const std::string &label2="", const std::string &path="")
Class constructor with parameters.
Definition: ListItem.h:75
void Select(bool selected)
To control selection of item in list (also multiple selection, in list on serveral items possible).
Definition: ListItem.h:323
void SetProperty(const std::string &key, const std::string &value)
Sets a listitem property, similar to an infolabel.
Definition: ListItem.h:281
bool IsSelected()
Returns the listitem's selected status.
Definition: ListItem.h:335
std::string GetPath()
Returns the path / filename of this listitem.
Definition: ListItem.h:235
~CListItem() override
Class destructor.
Definition: ListItem.h:99
void SetLabel(const std::string &label)
Sets the listitem label.
Definition: ListItem.h:131
std::string GetLabel2()
Returns the second listitem label.
Definition: ListItem.h:144
void SetLabel2(const std::string &label)
Sets the listitem's label2.
Definition: ListItem.h:164
std::string GetLabel()
Returns the listitem label.
Definition: ListItem.h:111
std::string GetProperty(const std::string &key)
Returns a listitem property as a string, similar to an infolabel.
Definition: ListItem.h:301
Definition: addon_base.h:216