mikroSDK Reference Manual
lv_roller.h
Go to the documentation of this file.
1
6#ifndef LV_ROLLER_H
7#define LV_ROLLER_H
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13/*********************
14 * INCLUDES
15 *********************/
16#include "../lv_conf_internal.h"
17
18#if LV_USE_ROLLER != 0
19
20/*Testing of dependencies*/
21#if LV_USE_LABEL == 0
22#error "lv_roller: lv_label is required. Enable it in lv_conf.h (LV_USE_ROLLER 1)"
23#endif
24
25#include "../core/lv_obj.h"
26#include "lv_label.h"
27
28/*********************
29 * DEFINES
30 *********************/
31
32/**********************
33 * TYPEDEFS
34 **********************/
35
37enum {
38 LV_ROLLER_MODE_NORMAL,
39 LV_ROLLER_MODE_INFINITE,
40};
41
42typedef uint8_t lv_roller_mode_t;
43
44typedef struct {
45 lv_obj_t obj;
46 uint16_t option_cnt;
47 uint16_t sel_opt_id;
48 uint16_t sel_opt_id_ori;
49 lv_roller_mode_t mode : 1;
50 uint32_t moved : 1;
51} lv_roller_t;
52
53extern const lv_obj_class_t lv_roller_class;
54
55
56/**********************
57 * GLOBAL PROTOTYPES
58 **********************/
59
65lv_obj_t * lv_roller_create(lv_obj_t * parent);
66
67/*=====================
68 * Setter functions
69 *====================*/
70
77void lv_roller_set_options(lv_obj_t * obj, const char * options, lv_roller_mode_t mode);
78
85void lv_roller_set_selected(lv_obj_t * obj, uint16_t sel_opt, lv_anim_enable_t anim);
86
92void lv_roller_set_visible_row_count(lv_obj_t * obj, uint8_t row_cnt);
93
94/*=====================
95 * Getter functions
96 *====================*/
97
103uint16_t lv_roller_get_selected(const lv_obj_t * obj);
104
111void lv_roller_get_selected_str(const lv_obj_t * obj, char * buf, uint32_t buf_size);
112
113
119const char * lv_roller_get_options(const lv_obj_t * obj);
120
126uint16_t lv_roller_get_option_cnt(const lv_obj_t * obj);
127
128/**********************
129 * MACROS
130 **********************/
131
132#endif /*LV_USE_ROLLER*/
133
134#ifdef __cplusplus
135} /*extern "C"*/
136#endif
137
138#endif /*LV_ROLLER_H*/
lv_anim_enable_t
Definition lv_anim.h:37
Definition lv_obj_class.h:49
Definition lv_obj.h:174