Add new API function for varitemlist

by Willy-JL

466e1f989f
This commit is contained in:
MX 2023-12-01 04:47:17 +03:00
parent fdcfd5996b
commit e027d5c3e8
No known key found for this signature in database
GPG Key ID: 7CCC66B7DBDD1C83
3 changed files with 27 additions and 0 deletions

View File

@ -499,6 +499,23 @@ VariableItem* variable_item_list_add(
return item;
}
VariableItem* variable_item_list_get(VariableItemList* variable_item_list, uint8_t position) {
VariableItem* item = NULL;
furi_assert(variable_item_list);
with_view_model(
variable_item_list->view,
VariableItemListModel * model,
{
if(position < VariableItemArray_size(model->items)) {
item = VariableItemArray_get(model->items, position);
}
},
true);
return item;
}
void variable_item_list_set_enter_callback(
VariableItemList* variable_item_list,
VariableItemListEnterCallback callback,

View File

@ -59,6 +59,15 @@ VariableItem* variable_item_list_add(
VariableItemChangeCallback change_callback,
void* context);
/** Get item in VariableItemList
*
* @param variable_item_list VariableItemList instance
* @param position index of the item to get
*
* @return VariableItem* item instance
*/
VariableItem* variable_item_list_get(VariableItemList* variable_item_list, uint8_t position);
/** Set enter callback
*
* @param variable_item_list VariableItemList instance

View File

@ -3166,6 +3166,7 @@ Function,+,variable_item_get_current_value_index,uint8_t,VariableItem*
Function,+,variable_item_list_add,VariableItem*,"VariableItemList*, const char*, uint8_t, VariableItemChangeCallback, void*"
Function,+,variable_item_list_alloc,VariableItemList*,
Function,+,variable_item_list_free,void,VariableItemList*
Function,+,variable_item_list_get,VariableItem*,"VariableItemList*, uint8_t"
Function,+,variable_item_list_get_selected_item_index,uint8_t,VariableItemList*
Function,+,variable_item_list_get_view,View*,VariableItemList*
Function,+,variable_item_list_reset,void,VariableItemList*

1 entry status name type params
3166 Function + variable_item_list_add VariableItem* VariableItemList*, const char*, uint8_t, VariableItemChangeCallback, void*
3167 Function + variable_item_list_alloc VariableItemList*
3168 Function + variable_item_list_free void VariableItemList*
3169 Function + variable_item_list_get VariableItem* VariableItemList*, uint8_t
3170 Function + variable_item_list_get_selected_item_index uint8_t VariableItemList*
3171 Function + variable_item_list_get_view View* VariableItemList*
3172 Function + variable_item_list_reset void VariableItemList*