mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-26 23:13:13 +02:00
CComponentsForm: add methods to get previous and next item
This commit is contained in:
@@ -257,6 +257,16 @@ CComponentsItem* CComponentsForm::getCCItem(const uint& cc_item_id)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CComponentsItem* CComponentsForm::getPrevCCItem(CComponentsItem* current_cc_item)
|
||||
{
|
||||
return getCCItem(getCCItemId(current_cc_item) - 1);
|
||||
}
|
||||
|
||||
CComponentsItem* CComponentsForm::getNextCCItem(CComponentsItem* current_cc_item)
|
||||
{
|
||||
return getCCItem(getCCItemId(current_cc_item) + 1);
|
||||
}
|
||||
|
||||
void CComponentsForm::replaceCCItem(const uint& cc_item_id, CComponentsItem* new_cc_Item)
|
||||
{
|
||||
if (!v_cc_items.empty()){
|
||||
|
@@ -106,8 +106,39 @@ class CComponentsForm : public CComponentsItem
|
||||
virtual void replaceCCItem(CComponentsItem* old_cc_Item, CComponentsItem* new_cc_Item);
|
||||
virtual void exchangeCCItem(const uint& item_id_a, const uint& item_id_b);
|
||||
virtual void exchangeCCItem(CComponentsItem* item_a, CComponentsItem* item_b);
|
||||
virtual int getCCItemId(CComponentsItem* cc_Item);
|
||||
virtual CComponentsItem* getCCItem(const uint& cc_item_id);
|
||||
|
||||
/**Function to get current item id from passed item.
|
||||
* @param[in] cc_Item
|
||||
* @li CComponentsItem*
|
||||
* @return
|
||||
* int, in case of not found item returns -1
|
||||
*/
|
||||
int getCCItemId(CComponentsItem* cc_Item);
|
||||
|
||||
/**Function to get current item from item collection.
|
||||
* @param[in] cc_item_id
|
||||
* @li item id as unsigned int
|
||||
* @return
|
||||
* CComponentsItem*, in case of not found item returns NULL
|
||||
*/
|
||||
CComponentsItem* getCCItem(const uint& cc_item_id);
|
||||
|
||||
/**Function to get previous item from item collection.
|
||||
* @param[in] current_cc_item
|
||||
* @li CComponentsItem*
|
||||
* @return
|
||||
* CComponentsItem*, in case of not found item returns NULL
|
||||
*/
|
||||
CComponentsItem* getPrevCCItem(CComponentsItem* current_cc_item);
|
||||
|
||||
/**Function to get next item from item collection.
|
||||
* @param[in] current_cc_item
|
||||
* @li CComponentsItem*
|
||||
* @return
|
||||
* CComponentsItem*, in case of not found item returns NULL
|
||||
*/
|
||||
CComponentsItem* getNextCCItem(CComponentsItem* current_cc_item);
|
||||
|
||||
virtual void paintCCItems();
|
||||
|
||||
///clean up and deallocate existant items from v_cc_items at once
|
||||
|
Reference in New Issue
Block a user