1 /**
2  * @file lv_list.h
3  *
4  */
5 
6 #ifndef LV_LIST_H
7 #define LV_LIST_H
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 /*********************
14  *      INCLUDES
15  *********************/
16 #include "../../core/lv_obj.h"
17 
18 #if LV_USE_LIST
19 
20 /*********************
21  *      DEFINES
22  *********************/
23 
24 /**********************
25  *      TYPEDEFS
26  **********************/
27 
28 LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_list_class;
29 LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_list_text_class;
30 LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_list_button_class;
31 /**********************
32  * GLOBAL PROTOTYPES
33  **********************/
34 
35 /**
36  * Create a list object
37  * @param parent    pointer to an object, it will be the parent of the new list
38  * @return          pointer to the created list
39  */
40 lv_obj_t * lv_list_create(lv_obj_t * parent);
41 
42 /**
43  * Add text to a list
44  * @param list      pointer to a list, it will be the parent of the new label
45  * @param txt       text of the new label
46  * @return          pointer to the created label
47  */
48 lv_obj_t * lv_list_add_text(lv_obj_t * list, const char * txt);
49 
50 /**
51  * Add button to a list
52  * @param list      pointer to a list, it will be the parent of the new button
53  * @param icon      icon for the button, when NULL it will have no icon
54  * @param txt       text of the new button, when NULL no text will be added
55  * @return          pointer to the created button
56  */
57 lv_obj_t * lv_list_add_button(lv_obj_t * list, const void * icon, const char * txt);
58 
59 /**
60  * Get text of a given list button
61  * @param list      pointer to a list
62  * @param btn       pointer to the button
63  * @return          text of btn, if btn doesn't have text "" will be returned
64  */
65 const char * lv_list_get_button_text(lv_obj_t * list, lv_obj_t * btn);
66 
67 /**
68  * Set text of a given list button
69  * @param list      pointer to a list
70  * @param btn       pointer to the button
71  * @param txt       pointer to the text
72  */
73 void lv_list_set_button_text(lv_obj_t * list, lv_obj_t * btn, const char * txt);
74 
75 /**********************
76  *      MACROS
77  **********************/
78 
79 #endif /*LV_USE_LIST*/
80 
81 #ifdef __cplusplus
82 } /*extern "C"*/
83 #endif
84 
85 #endif /*LV_LIST_H*/
86