mikroSDK Reference Manual
lv_calendar.h
Go to the documentation of this file.
1
6#ifndef LV_CALENDAR_H
7#define LV_CALENDAR_H
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13/*********************
14 * INCLUDES
15 *********************/
17
18#if LV_USE_CALENDAR
19
20/*********************
21 * DEFINES
22 *********************/
23
24/**********************
25 * TYPEDEFS
26 **********************/
27
31typedef struct {
32 uint16_t year;
33 int8_t month;
34 int8_t day;
35} lv_calendar_date_t;
36
37/*Data of calendar*/
38typedef struct {
39 lv_obj_t obj;
40 lv_obj_t * btnm;
41 /*New data for this type*/
42 lv_calendar_date_t today; /*Date of today*/
43 lv_calendar_date_t showed_date; /*Currently visible month (day is ignored)*/
44 lv_calendar_date_t *
45 highlighted_dates; /*Apply different style on these days (pointer to an array defined by the user)*/
46 uint16_t highlighted_dates_num; /*Number of elements in `highlighted_days`*/
47 const char * map[8 * 7];
48 char nums [7 * 6][4];
49} lv_calendar_t;
50
51extern const lv_obj_class_t lv_calendar_class;
52
53/**********************
54 * GLOBAL PROTOTYPES
55 **********************/
56
57lv_obj_t * lv_calendar_create(lv_obj_t * parent);
58
59/*======================
60 * Add/remove functions
61 *=====================*/
62
63/*=====================
64 * Setter functions
65 *====================*/
66
74void lv_calendar_set_today_date(lv_obj_t * obj, uint32_t year, uint32_t month, uint32_t day);
75
82void lv_calendar_set_showed_date(lv_obj_t * obj, uint32_t year, uint32_t month);
83
91void lv_calendar_set_highlighted_dates(lv_obj_t * obj, lv_calendar_date_t highlighted[], uint16_t date_num);
92
100void lv_calendar_set_day_names(lv_obj_t * obj, const char ** day_names);
101
102/*=====================
103 * Getter functions
104 *====================*/
105
112lv_obj_t * lv_calendar_get_btnmatrix(const lv_obj_t * obj);
113
119const lv_calendar_date_t * lv_calendar_get_today_date(const lv_obj_t * calendar);
120
126const lv_calendar_date_t * lv_calendar_get_showed_date(const lv_obj_t * calendar);
127
133lv_calendar_date_t * lv_calendar_get_highlighted_dates(const lv_obj_t * calendar);
134
140uint16_t lv_calendar_get_highlighted_dates_num(const lv_obj_t * calendar);
141
148lv_res_t lv_calendar_get_pressed_date(const lv_obj_t * calendar, lv_calendar_date_t * date);
149
150/*=====================
151 * Other functions
152 *====================*/
153
154/**********************
155 * MACROS
156 **********************/
157
158#endif /*LV_USE_CALENDAR*/
159
160#ifdef __cplusplus
161} /*extern "C"*/
162#endif
163
164#endif /*LV_CALENDAR_H*/
Definition lv_obj_class.h:49
Definition lv_obj.h:174