Loading...
Searching...
No Matches
variable_item_list.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <gui/view.h>
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
15typedef struct VariableItem VariableItem;
16typedef void (*VariableItemChangeCallback)(VariableItem* item);
17typedef void (*VariableItemListEnterCallback)(void* context, uint32_t index);
18
24
29void variable_item_list_free(VariableItemList* variable_item_list);
30
35void variable_item_list_reset(VariableItemList* variable_item_list);
36
44
56 VariableItemList* variable_item_list,
57 const char* label,
58 uint8_t values_count,
59 VariableItemChangeCallback change_callback,
60 void* context);
61
69 VariableItemList* variable_item_list,
70 VariableItemListEnterCallback callback,
71 void* context);
72
73void variable_item_list_set_selected_item(VariableItemList* variable_item_list, uint8_t index);
74
75uint8_t variable_item_list_get_selected_item_index(VariableItemList* variable_item_list);
76
82void variable_item_set_current_value_index(VariableItem* item, uint8_t current_value_index);
83
89void variable_item_set_values_count(VariableItem* item, uint8_t values_count);
90
96void variable_item_set_current_value_text(VariableItem* item, const char* current_value_text);
97
105
113
114#ifdef __cplusplus
115}
116#endif
Definition variable_item_list.c:8
Definition variable_item_list.c:19
Definition view_i.h:16
void variable_item_list_reset(VariableItemList *variable_item_list)
Clear all elements from list.
Definition variable_item_list.c:332
void variable_item_set_current_value_index(VariableItem *item, uint8_t current_value_index)
Set item current selected index.
Definition variable_item_list.c:397
void variable_item_set_current_value_text(VariableItem *item, const char *current_value_text)
Set item current selected text.
Definition variable_item_list.c:407
VariableItem * variable_item_list_add(VariableItemList *variable_item_list, const char *label, uint8_t values_count, VariableItemChangeCallback change_callback, void *context)
Add item to VariableItemList.
Definition variable_item_list.c:354
uint8_t variable_item_get_current_value_index(VariableItem *item)
Get item current selected index.
Definition variable_item_list.c:412
View * variable_item_list_get_view(VariableItemList *variable_item_list)
Get VariableItemList View instance.
Definition variable_item_list.c:349
void variable_item_list_free(VariableItemList *variable_item_list)
Deinitialize and free VariableItemList.
Definition variable_item_list.c:313
void * variable_item_get_context(VariableItem *item)
Get item context.
Definition variable_item_list.c:417
VariableItemList * variable_item_list_alloc(void)
Allocate and initialize VariableItemList.
Definition variable_item_list.c:291
void variable_item_set_values_count(VariableItem *item, uint8_t values_count)
Set number of values for item.
Definition variable_item_list.c:402
void variable_item_list_set_enter_callback(VariableItemList *variable_item_list, VariableItemListEnterCallback callback, void *context)
Set enter callback.
Definition variable_item_list.c:381
GUI: View API.