1 /**
2  * @file lv_tileview.h
3  *
4  */
5 
6 #ifndef LV_TILEVIEW_H
7 #define LV_TILEVIEW_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_TILEVIEW
19 
20 /*********************
21  *      DEFINES
22  *********************/
23 
24 LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_tileview_class;
25 LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_tileview_tile_class;
26 
27 /**********************
28  * GLOBAL PROTOTYPES
29  **********************/
30 
31 /**
32  * Create a tileview object
33  * @param parent      pointer to an object, it will be the parent of the new tileview
34  * @return            pointer to the created tileview
35  */
36 lv_obj_t * lv_tileview_create(lv_obj_t * parent);
37 
38 /**
39  * Add a tile to the tileview
40  * @param tv          pointer to the tileview object
41  * @param col_id      column id of the tile
42  * @param row_id      row id of the tile
43  * @param dir         direction to move to the next tile
44  * @return            pointer to the added tile object
45  */
46 lv_obj_t * lv_tileview_add_tile(lv_obj_t * tv, uint8_t col_id, uint8_t row_id, lv_dir_t dir);
47 
48 /**
49  * Set the active tile in the tileview.
50  * @param parent      pointer to the tileview object
51  * @param tile_obj    pointer to the tile object to be set as active
52  * @param anim_en     animation enable flag (LV_ANIM_ON or LV_ANIM_OFF)
53  */
54 void lv_tileview_set_tile(lv_obj_t * tv, lv_obj_t * tile_obj, lv_anim_enable_t anim_en);
55 
56 /**
57  * Set the active tile by index in the tileview
58  * @param tv          pointer to the tileview object
59  * @param col_id      column id of the tile to be set as active
60  * @param row_id      row id of the tile to be set as active
61  * @param anim_en     animation enable flag (LV_ANIM_ON or LV_ANIM_OFF)
62  */
63 void lv_tileview_set_tile_by_index(lv_obj_t * tv, uint32_t col_id, uint32_t row_id, lv_anim_enable_t anim_en);
64 
65 /**
66  * Get the currently active tile in the tileview
67  * @param obj         pointer to the tileview object
68  * @return            pointer to the currently active tile object
69  */
70 lv_obj_t * lv_tileview_get_tile_active(lv_obj_t * obj);
71 
72 /*=====================
73  * Other functions
74  *====================*/
75 
76 /**********************
77  *      MACROS
78  **********************/
79 
80 #endif /*LV_USE_TILEVIEW*/
81 
82 #ifdef __cplusplus
83 } /*extern "C"*/
84 #endif
85 
86 #endif /*LV_TILEVIEW_H*/
87