Loading...
Searching...
No Matches
variable_item_list.h File Reference

GUI: VariableItemList view module API. More...

#include <gui/view.h>

Go to the source code of this file.

Typedefs

typedef struct VariableItemList VariableItemList
 
typedef struct VariableItem VariableItem
 
typedef void(* VariableItemChangeCallback) (VariableItem *item)
 
typedef void(* VariableItemListEnterCallback) (void *context, uint32_t index)
 

Functions

VariableItemListvariable_item_list_alloc (void)
 Allocate and initialize VariableItemList.
 
void variable_item_list_free (VariableItemList *variable_item_list)
 Deinitialize and free VariableItemList.
 
void variable_item_list_reset (VariableItemList *variable_item_list)
 Clear all elements from list.
 
Viewvariable_item_list_get_view (VariableItemList *variable_item_list)
 Get VariableItemList View instance.
 
VariableItemvariable_item_list_add (VariableItemList *variable_item_list, const char *label, uint8_t values_count, VariableItemChangeCallback change_callback, void *context)
 Add item to VariableItemList.
 
void variable_item_list_set_enter_callback (VariableItemList *variable_item_list, VariableItemListEnterCallback callback, void *context)
 Set enter callback.
 
void variable_item_list_set_selected_item (VariableItemList *variable_item_list, uint8_t index)
 
uint8_t variable_item_list_get_selected_item_index (VariableItemList *variable_item_list)
 
void variable_item_set_current_value_index (VariableItem *item, uint8_t current_value_index)
 Set item current selected index.
 
void variable_item_set_values_count (VariableItem *item, uint8_t values_count)
 Set number of values for item.
 
void variable_item_set_current_value_text (VariableItem *item, const char *current_value_text)
 Set item current selected text.
 
uint8_t variable_item_get_current_value_index (VariableItem *item)
 Get item current selected index.
 
void * variable_item_get_context (VariableItem *item)
 Get item context.
 

Detailed Description

GUI: VariableItemList view module API.

Function Documentation

◆ variable_item_get_context()

void * variable_item_get_context ( VariableItem * item)

Get item context.

Parameters
itemVariableItem* instance
Returns
void* item context

◆ variable_item_get_current_value_index()

uint8_t variable_item_get_current_value_index ( VariableItem * item)

Get item current selected index.

Parameters
itemVariableItem* instance
Returns
uint8_t current selected index

◆ variable_item_list_add()

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.

Parameters
variable_item_listVariableItemList instance
labelitem name
values_countitem values count
change_callbackcalled on value change in gui
contextitem context
Returns
VariableItem* item instance

◆ variable_item_list_alloc()

VariableItemList * variable_item_list_alloc ( void )

Allocate and initialize VariableItemList.

Returns
VariableItemList*

◆ variable_item_list_free()

void variable_item_list_free ( VariableItemList * variable_item_list)

Deinitialize and free VariableItemList.

Parameters
variable_item_listVariableItemList instance

◆ variable_item_list_get_view()

View * variable_item_list_get_view ( VariableItemList * variable_item_list)

Get VariableItemList View instance.

Parameters
variable_item_listVariableItemList instance
Returns
View instance

◆ variable_item_list_reset()

void variable_item_list_reset ( VariableItemList * variable_item_list)

Clear all elements from list.

Parameters
variable_item_listVariableItemList instance

◆ variable_item_list_set_enter_callback()

void variable_item_list_set_enter_callback ( VariableItemList * variable_item_list,
VariableItemListEnterCallback callback,
void * context )

Set enter callback.

Parameters
variable_item_listVariableItemList instance
callbackVariableItemListEnterCallback instance
contextpointer to context

◆ variable_item_set_current_value_index()

void variable_item_set_current_value_index ( VariableItem * item,
uint8_t current_value_index )

Set item current selected index.

Parameters
itemVariableItem* instance
current_value_indexThe current value index

◆ variable_item_set_current_value_text()

void variable_item_set_current_value_text ( VariableItem * item,
const char * current_value_text )

Set item current selected text.

Parameters
itemVariableItem* instance
current_value_textThe current value text

◆ variable_item_set_values_count()

void variable_item_set_values_count ( VariableItem * item,
uint8_t values_count )

Set number of values for item.

Parameters
itemVariableItem* instance
values_countThe new values count