1 /** 2 * @file lv_demo_smartwatch_settings.h 3 * 4 */ 5 6 #ifndef LV_DEMO_SMARTWATCH_SETTINGS_H 7 #define LV_DEMO_SMARTWATCH_SETTINGS_H 8 9 #ifdef __cplusplus 10 extern "C" { 11 #endif 12 13 /********************* 14 * INCLUDES 15 *********************/ 16 #include "lv_demo_smartwatch.h" 17 18 #if LV_USE_DEMO_SMARTWATCH 19 20 /********************* 21 * DEFINES 22 *********************/ 23 24 /********************** 25 * TYPEDEFS 26 **********************/ 27 28 /********************** 29 * GLOBAL PROTOTYPES 30 **********************/ 31 32 /** 33 * Create the settings page. Called only once. 34 */ 35 void lv_demo_smartwatch_settings_create(void); 36 37 /** 38 * Load the settings screen 39 * @param anim_type screen load animation to use 40 * @param time animation time 41 * @param delay delay time before loading the screen 42 */ 43 void lv_demo_smartwatch_settings_load(lv_screen_load_anim_t anim_type, uint32_t time, uint32_t delay); 44 45 /** 46 * Add a slider to the main settings list 47 * @param id unique id to track changes (recommended > 0x000F) 48 * @param name title for the setting 49 * @param img icon for the setting 50 * @param value default value for the slider 51 * @param min min value for the slider 52 * @param max max value for the slider 53 * @return pointer to slider object 54 */ 55 lv_obj_t * lv_demo_smartwatch_settings_add_slider(uint16_t id, const char * name, const lv_img_dsc_t * img, 56 int32_t value, 57 int32_t min, int32_t max); 58 59 /** 60 * Add a toggle switch to the main settings list 61 * @param id unique id to track changes (recommended > 0x000F) 62 * @param name title for the setting 63 * @param img icon for the setting 64 * @param state default state for the switch 65 * @return pointer to switch object 66 */ 67 lv_obj_t * lv_demo_smartwatch_settings_add_toggle(uint16_t id, const char * name, const lv_img_dsc_t * img, bool state); 68 69 /** 70 * Add a dropdowwn to the main settings list 71 * @param id unique id to track changes (recommended > 0x000F) 72 * @param name title for the setting 73 * @param img icon for the setting 74 * @param options the dropdown options 75 * @return pointer to dropdown object 76 */ 77 lv_obj_t * lv_demo_smartwatch_settings_add_dropdown(uint16_t id, const char * name, const lv_img_dsc_t * img, 78 const char * options); 79 80 /** 81 * Add a label to the main settings list 82 * @param id unique id to track changes (recommended > 0x000F) 83 * @param name text for the label 84 * @param img icon for the label 85 * @return pointer to label object 86 */ 87 lv_obj_t * lv_demo_smartwatch_settings_add_label(uint16_t id, const char * name, const lv_img_dsc_t * img); 88 89 /** 90 * Set the callback function for settings actions 91 * @param cb callback function 92 */ 93 void lv_demo_smartwatch_set_settings_actions_cb(lv_smartwatch_settings_change_cb_t cb); 94 95 /********************** 96 * MACROS 97 **********************/ 98 99 #endif /*LV_USE_DEMO_SMARTWATCH*/ 100 101 #ifdef __cplusplus 102 } /*extern "C"*/ 103 #endif 104 105 #endif /*LV_DEMO_SMARTWATCH_HOME_H*/ 106