summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/ListItem.h
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2017-07-23 16:59:43 +0200
committermanuel <manuel@mausz.at>2017-07-23 16:59:43 +0200
commit4c3251ec645c8b71820dab7e51e612e5919d4e75 (patch)
tree9533268a93e58fc2e16de1b8ee3fafe3784e5225 /xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/ListItem.h
parentf44ecaa4f27e7538ddcad66d40e543bffa2d2d86 (diff)
downloadkodi-pvr-build-4c3251ec645c8b71820dab7e51e612e5919d4e75.tar.gz
kodi-pvr-build-4c3251ec645c8b71820dab7e51e612e5919d4e75.tar.bz2
kodi-pvr-build-4c3251ec645c8b71820dab7e51e612e5919d4e75.zip
sync with upstream
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/ListItem.h')
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/ListItem.h86
1 files changed, 82 insertions, 4 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/ListItem.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/ListItem.h
index a473f28..944b1b9 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/ListItem.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/ListItem.h
@@ -91,20 +91,18 @@ namespace gui
91 /// @param[in] label Item label 91 /// @param[in] label Item label
92 /// @param[in] label2 Second Item label (if needed) 92 /// @param[in] label2 Second Item label (if needed)
93 /// @param[in] iconImage Item icon image (if needed) 93 /// @param[in] iconImage Item icon image (if needed)
94 /// @param[in] thumbnailImage Thumbnail Image of item (if needed)
95 /// @param[in] path Path to where item is defined 94 /// @param[in] path Path to where item is defined
96 /// 95 ///
97 CListItem( 96 CListItem(
98 const std::string& label = "", 97 const std::string& label = "",
99 const std::string& label2 = "", 98 const std::string& label2 = "",
100 const std::string& iconImage = "", 99 const std::string& iconImage = "",
101 const std::string& thumbnailImage = "",
102 const std::string& path = "") 100 const std::string& path = "")
103 : CAddonGUIControlBase(nullptr) 101 : CAddonGUIControlBase(nullptr)
104 { 102 {
105 m_controlHandle = m_interface->kodi_gui->listItem->create(m_interface->kodiBase, label.c_str(), 103 m_controlHandle = m_interface->kodi_gui->listItem->create(m_interface->kodiBase, label.c_str(),
106 label2.c_str(), iconImage.c_str(), 104 label2.c_str(), iconImage.c_str(),
107 thumbnailImage.c_str(), path.c_str()); 105 path.c_str());
108 } 106 }
109 107
110 /* 108 /*
@@ -124,7 +122,7 @@ namespace gui
124 /// \ingroup cpp_kodi_gui_CListItem 122 /// \ingroup cpp_kodi_gui_CListItem
125 /// @brief Class destructor 123 /// @brief Class destructor
126 /// 124 ///
127 virtual ~CListItem() 125 ~CListItem() override
128 { 126 {
129 m_interface->kodi_gui->listItem->destroy(m_interface->kodiBase, m_controlHandle); 127 m_interface->kodi_gui->listItem->destroy(m_interface->kodiBase, m_controlHandle);
130 } 128 }
@@ -330,6 +328,86 @@ namespace gui
330 } 328 }
331 //-------------------------------------------------------------------------- 329 //--------------------------------------------------------------------------
332 330
331 //==========================================================================
332 ///
333 /// \ingroup cpp_kodi_gui_CListItem
334 /// @brief Sets a listitem property, similar to an infolabel.
335 ///
336 /// @param[in] key string - property name.
337 /// @param[in] value string or unicode - value of property.
338 ///
339 /// @note Key is NOT case sensitive.
340 /// You can use the above as keywords for arguments and skip certain\n
341 /// optional arguments.\n
342 /// Once you use a keyword, all following arguments require the
343 /// keyword.
344 ///
345 /// Some of these are treated internally by Kodi, such as the
346 /// <b>'StartOffset'</b> property, which is the offset in seconds at which to
347 /// start playback of an item. Others may be used in the skin to add
348 /// extra information, such as <b>'WatchedCount'</b> for tvshow items
349 ///
350 void SetProperty(const std::string& key, const std::string& value)
351 {
352 m_interface->kodi_gui->listItem->set_property(m_interface->kodiBase, m_controlHandle, key.c_str(), value.c_str());
353 }
354 //--------------------------------------------------------------------------
355
356 //==========================================================================
357 ///
358 /// \ingroup cpp_kodi_gui_CListItem
359 /// @brief Returns a listitem property as a string, similar to an infolabel.
360 ///
361 /// @param[in] key string - property name.
362 /// @return string - List item property
363 ///
364 /// @note Key is NOT case sensitive.\n
365 /// You can use the above as keywords for arguments and skip certain
366 /// optional arguments.\n
367 /// Once you use a keyword, all following arguments require the
368 /// keyword.
369 ///
370 std::string GetProperty(const std::string& key)
371 {
372 std::string label;
373 char* ret = m_interface->kodi_gui->listItem->get_property(m_interface->kodiBase, m_controlHandle, key.c_str());
374 if (ret != nullptr)
375 {
376 if (std::strlen(ret))
377 label = ret;
378 m_interface->free_string(m_interface->kodiBase, ret);
379 }
380 return label;
381 }
382 //--------------------------------------------------------------------------
383
384 //==========================================================================
385 ///
386 /// \ingroup cpp_kodi_gui_CListItem
387 /// @brief To control selection of item in list (also multiple selection,
388 /// in list on serveral items possible).
389 ///
390 /// @param[in] selected if true becomes set as selected
391 ///
392 void Select(bool selected)
393 {
394 m_interface->kodi_gui->listItem->select(m_interface->kodiBase, m_controlHandle, selected);
395 }
396 //--------------------------------------------------------------------------
397
398 //==========================================================================
399 ///
400 /// \ingroup cpp_kodi_gui_CListItem
401 /// @brief Returns the listitem's selected status.
402 ///
403 /// @return true if selected, otherwise false
404 ///
405 bool IsSelected()
406 {
407 return m_interface->kodi_gui->listItem->is_selected(m_interface->kodiBase, m_controlHandle);
408 }
409 //--------------------------------------------------------------------------
410
333 }; 411 };
334 412
335} /* namespace gui */ 413} /* namespace gui */