1 /**
2  * @file lv_calendar_chinese.h
3  *
4  */
5 
6 #ifndef LV_CALENDAR_CHINESE_H
7 #define LV_CALENDAR_CHINESE_H
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 /*********************
14  *      INCLUDES
15  *********************/
16 #include "../../core/lv_obj.h"
17 #include "lv_calendar.h"
18 #if LV_USE_CALENDAR && LV_USE_CALENDAR_CHINESE
19 
20 /*********************
21  *      DEFINES
22  *********************/
23 
24 /**********************
25  *      TYPEDEFS
26  **********************/
27 
28 typedef struct {
29     lv_calendar_date_t today;
30     bool leep_month;
31 } lv_calendar_chinese_t;
32 
33 /**********************
34  * GLOBAL PROTOTYPES
35  **********************/
36 
37 /**
38  * Enable the chinese calendar.
39  * @param obj   pointer to a calendar object.
40  * @param en    true: enable chinese calendar; false: disable
41  */
42 void lv_calendar_set_chinese_mode(lv_obj_t * obj, bool en);
43 
44 /**
45  * Get the name of the day
46  * @param gregorian   to obtain the gregorian time for the name
47  * @return            return the name of the day
48  */
49 const char * lv_calendar_get_day_name(lv_calendar_date_t * gregorian);
50 
51 /**
52  * Get the chinese time of the gregorian time (reference: https://www.cnblogs.com/liyang31tg/p/4123171.html)
53  * @param gregorian_time   need to convert to chinese time in gregorian time
54  * @param chinese_time     the chinese time convert from gregorian time
55  */
56 void lv_calendar_gregorian_to_chinese(lv_calendar_date_t * gregorian_time, lv_calendar_chinese_t * chinese_time);
57 
58 /**********************
59  *      MACROS
60  **********************/
61 
62 #endif /*LV_USE_CALENDAR_CHINESE*/
63 
64 #ifdef __cplusplus
65 } /*extern "C"*/
66 #endif
67 
68 #endif /*LV_CALENDAR_CHINESE_H*/
69