mikroSDK Reference Manual
lv_group.h
Go to the documentation of this file.
1
6#ifndef LV_GROUP_H
7#define LV_GROUP_H
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13/*********************
14 * INCLUDES
15 *********************/
16
17#include "../lv_conf_internal.h"
18
19#include <stdint.h>
20#include <stdbool.h>
21#include "../misc/lv_ll.h"
22#include "../misc/lv_types.h"
23
24/*********************
25 * DEFINES
26 *********************/
27/*Predefined keys to control the focused object via lv_group_send(group, c)*/
28
29enum {
30 LV_KEY_UP = 17, /*0x11*/
31 LV_KEY_DOWN = 18, /*0x12*/
32 LV_KEY_RIGHT = 19, /*0x13*/
33 LV_KEY_LEFT = 20, /*0x14*/
34 LV_KEY_ESC = 27, /*0x1B*/
35 LV_KEY_DEL = 127, /*0x7F*/
36 LV_KEY_BACKSPACE = 8, /*0x08*/
37 LV_KEY_ENTER = 10, /*0x0A, '\n'*/
38 LV_KEY_NEXT = 9, /*0x09, '\t'*/
39 LV_KEY_PREV = 11, /*0x0B, '*/
40 LV_KEY_HOME = 2, /*0x02, STX*/
41 LV_KEY_END = 3, /*0x03, ETX*/
42};
43typedef uint8_t lv_key_t;
44
45/**********************
46 * TYPEDEFS
47 **********************/
48
49struct _lv_obj_t;
50struct _lv_group_t;
51
52typedef void (*lv_group_focus_cb_t)(struct _lv_group_t *);
53typedef void (*lv_group_edge_cb_t)(struct _lv_group_t *, bool);
54
59typedef struct _lv_group_t {
61 struct _lv_obj_t ** obj_focus;
63 lv_group_focus_cb_t focus_cb;
64 lv_group_edge_cb_t edge_cb;
68#if LV_USE_USER_DATA
69 void * user_data;
70#endif
71
72 uint8_t frozen : 1;
73 uint8_t editing : 1;
74 uint8_t refocus_policy : 1;
76 uint8_t wrap : 1;
79
80
81typedef enum {
82 LV_GROUP_REFOCUS_POLICY_NEXT = 0,
83 LV_GROUP_REFOCUS_POLICY_PREV = 1
84} lv_group_refocus_policy_t;
85
86/**********************
87 * GLOBAL PROTOTYPES
88 **********************/
89
94void _lv_group_init(void);
95
101
107
113
119
125void lv_group_add_obj(lv_group_t * group, struct _lv_obj_t * obj);
126
132void lv_group_swap_obj(struct _lv_obj_t * obj1, struct _lv_obj_t * obj2);
133
139
145
150void lv_group_focus_obj(struct _lv_obj_t * obj);
151
157
163
169void lv_group_focus_freeze(lv_group_t * group, bool en);
170
177lv_res_t lv_group_send_data(lv_group_t * group, uint32_t c);
178
184void lv_group_set_focus_cb(lv_group_t * group, lv_group_focus_cb_t focus_cb);
185
191void lv_group_set_edge_cb(lv_group_t * group, lv_group_edge_cb_t edge_cb);
192
193
200void lv_group_set_refocus_policy(lv_group_t * group, lv_group_refocus_policy_t policy);
201
207void lv_group_set_editing(lv_group_t * group, bool edit);
208
214void lv_group_set_wrap(lv_group_t * group, bool en);
215
222
228lv_group_focus_cb_t lv_group_get_focus_cb(const lv_group_t * group);
229
235lv_group_edge_cb_t lv_group_get_edge_cb(const lv_group_t * group);
236
243
250
257
258/**********************
259 * MACROS
260 **********************/
261
262#ifdef __cplusplus
263} /*extern "C"*/
264#endif
265
266#endif /*LV_GROUP_H*/
void _lv_group_init(void)
bool lv_group_get_editing(const lv_group_t *group)
struct _lv_group_t lv_group_t
void lv_group_set_wrap(lv_group_t *group, bool en)
void lv_group_remove_all_objs(lv_group_t *group)
bool lv_group_get_wrap(lv_group_t *group)
lv_group_t * lv_group_get_default(void)
lv_group_focus_cb_t lv_group_get_focus_cb(const lv_group_t *group)
void lv_group_focus_obj(struct _lv_obj_t *obj)
void lv_group_focus_prev(lv_group_t *group)
uint32_t lv_group_get_obj_count(lv_group_t *group)
void lv_group_set_editing(lv_group_t *group, bool edit)
void lv_group_add_obj(lv_group_t *group, struct _lv_obj_t *obj)
lv_res_t lv_group_send_data(lv_group_t *group, uint32_t c)
void lv_group_focus_freeze(lv_group_t *group, bool en)
void lv_group_set_refocus_policy(lv_group_t *group, lv_group_refocus_policy_t policy)
void lv_group_set_edge_cb(lv_group_t *group, lv_group_edge_cb_t edge_cb)
void lv_group_del(lv_group_t *group)
void lv_group_remove_obj(struct _lv_obj_t *obj)
lv_group_edge_cb_t lv_group_get_edge_cb(const lv_group_t *group)
void lv_group_set_default(lv_group_t *group)
void lv_group_focus_next(lv_group_t *group)
void lv_group_set_focus_cb(lv_group_t *group, lv_group_focus_cb_t focus_cb)
void lv_group_swap_obj(struct _lv_obj_t *obj1, struct _lv_obj_t *obj2)
struct _lv_obj_t * lv_group_get_focused(const lv_group_t *group)
lv_group_t * lv_group_create(void)
Definition lv_group.h:59
lv_group_focus_cb_t focus_cb
Definition lv_group.h:63
struct _lv_obj_t ** obj_focus
Definition lv_group.h:61
lv_ll_t obj_ll
Definition lv_group.h:60
uint8_t refocus_policy
Definition lv_group.h:74
uint8_t wrap
Definition lv_group.h:76
uint8_t frozen
Definition lv_group.h:72
uint8_t editing
Definition lv_group.h:73
lv_group_edge_cb_t edge_cb
Definition lv_group.h:64
Definition lv_obj.h:174
Definition lv_ll.h:32