1 /** 2 * @file lv_checkbox.h 3 * 4 */ 5 6 #ifndef LV_CHECKBOX_H 7 #define LV_CHECKBOX_H 8 9 #ifdef __cplusplus 10 extern "C" { 11 #endif 12 13 /********************* 14 * INCLUDES 15 *********************/ 16 #include "../../lv_conf_internal.h" 17 #include "../../core/lv_obj.h" 18 19 #if LV_USE_CHECKBOX != 0 20 21 /********************* 22 * DEFINES 23 *********************/ 24 25 LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_checkbox_class; 26 27 /********************** 28 * GLOBAL PROTOTYPES 29 **********************/ 30 31 /** 32 * Create a check box object 33 * @param parent pointer to an object, it will be the parent of the new button 34 * @return pointer to the created check box 35 */ 36 lv_obj_t * lv_checkbox_create(lv_obj_t * parent); 37 38 /*===================== 39 * Setter functions 40 *====================*/ 41 42 /** 43 * Set the text of a check box. `txt` will be copied and may be deallocated 44 * after this function returns. 45 * @param obj pointer to a check box 46 * @param txt the text of the check box. NULL to refresh with the current text. 47 */ 48 void lv_checkbox_set_text(lv_obj_t * obj, const char * txt); 49 50 /** 51 * Set the text of a check box. `txt` must not be deallocated during the life 52 * of this checkbox. 53 * @param obj pointer to a check box 54 * @param txt the text of the check box. 55 */ 56 void lv_checkbox_set_text_static(lv_obj_t * obj, const char * txt); 57 58 /*===================== 59 * Getter functions 60 *====================*/ 61 62 /** 63 * Get the text of a check box 64 * @param obj pointer to check box object 65 * @return pointer to the text of the check box 66 */ 67 const char * lv_checkbox_get_text(const lv_obj_t * obj); 68 69 /********************** 70 * MACROS 71 **********************/ 72 73 #endif /*LV_USE_CHECKBOX*/ 74 75 #ifdef __cplusplus 76 } /*extern "C"*/ 77 #endif 78 79 #endif /*LV_CHECKBOX_H*/ 80