acid-drop

- Hacking the planet from a LilyGo T-Deck using custom firmware
git clone git://git.acid.vegas/acid-drop.git
Log | Files | Refs | Archive | README | LICENSE

lv_checkbox.h (2144B)

      1 /**
      2  * @file lv_cb.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 /**********************
     26  *      TYPEDEFS
     27  **********************/
     28 
     29 typedef struct {
     30     lv_obj_t obj;
     31     char * txt;
     32     uint32_t static_txt : 1;
     33 } lv_checkbox_t;
     34 
     35 extern const lv_obj_class_t lv_checkbox_class;
     36 
     37 /**
     38  * `type` field in `lv_obj_draw_part_dsc_t` if `class_p = lv_checkbox_class`
     39  * Used in `LV_EVENT_DRAW_PART_BEGIN` and `LV_EVENT_DRAW_PART_END`
     40  */
     41 typedef enum {
     42     LV_CHECKBOX_DRAW_PART_BOX,    /**< The tick box*/
     43 } lv_checkbox_draw_part_type_t;
     44 
     45 /**********************
     46  * GLOBAL PROTOTYPES
     47  **********************/
     48 
     49 /**
     50  * Create a check box object
     51  * @param parent    pointer to an object, it will be the parent of the new button
     52  * @return          pointer to the created check box
     53  */
     54 lv_obj_t * lv_checkbox_create(lv_obj_t * parent);
     55 
     56 /*=====================
     57  * Setter functions
     58  *====================*/
     59 
     60 /**
     61  * Set the text of a check box. `txt` will be copied and may be deallocated
     62  * after this function returns.
     63  * @param cb    pointer to a check box
     64  * @param txt   the text of the check box. NULL to refresh with the current text.
     65  */
     66 void lv_checkbox_set_text(lv_obj_t * obj, const char * txt);
     67 
     68 /**
     69  * Set the text of a check box. `txt` must not be deallocated during the life
     70  * of this checkbox.
     71  * @param cb    pointer to a check box
     72  * @param txt   the text of the check box.
     73  */
     74 void lv_checkbox_set_text_static(lv_obj_t * obj, const char * txt);
     75 
     76 /*=====================
     77  * Getter functions
     78  *====================*/
     79 
     80 /**
     81  * Get the text of a check box
     82  * @param cb    pointer to check box object
     83  * @return      pointer to the text of the check box
     84  */
     85 const char * lv_checkbox_get_text(const lv_obj_t * obj);
     86 
     87 /**********************
     88  *      MACROS
     89  **********************/
     90 
     91 #endif /*LV_USE_CHECKBOX*/
     92 
     93 #ifdef __cplusplus
     94 } /*extern "C"*/
     95 #endif
     96 
     97 #endif /*LV_CHECKBOX_H*/