mikroSDK Reference Manual
lv_ime_pinyin.h
Go to the documentation of this file.
1
5#ifndef LV_IME_PINYIN_H
6#define LV_IME_PINYIN_H
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12/*********************
13 * INCLUDES
14 *********************/
15#include "../../../lvgl.h"
16
17#if LV_USE_IME_PINYIN != 0
18
19/*********************
20 * DEFINES
21 *********************/
22#define LV_IME_PINYIN_K9_MAX_INPUT 7
23
24/**********************
25 * TYPEDEFS
26 **********************/
27
28typedef enum {
29 LV_IME_PINYIN_MODE_K26,
30 LV_IME_PINYIN_MODE_K9,
31} lv_ime_pinyin_mode_t;
32
33/*Data of pinyin_dict*/
34typedef struct {
35 const char * const py;
36 const char * const py_mb;
37} lv_pinyin_dict_t;
38
39/*Data of 9-key input(k9) mode*/
40typedef struct {
41 char py_str[7];
42} ime_pinyin_k9_py_str_t;
43
44/*Data of lv_ime_pinyin*/
45typedef struct {
46 lv_obj_t obj;
47 lv_obj_t * kb;
48 lv_obj_t * cand_panel;
49 lv_pinyin_dict_t * dict;
50 lv_ll_t k9_legal_py_ll;
51 char * cand_str; /* Candidate string */
52 char input_char[16]; /* Input box character */
53#if LV_IME_PINYIN_USE_K9_MODE
54 char k9_input_str[LV_IME_PINYIN_K9_MAX_INPUT]; /* 9-key input(k9) mode input string */
55 uint16_t k9_py_ll_pos; /* Current pinyin map pages(k9) */
56 uint16_t k9_legal_py_count; /* Count of legal Pinyin numbers(k9) */
57 uint16_t k9_input_str_len; /* 9-key input(k9) mode input string max len */
58#endif
59 uint16_t ta_count; /* The number of characters entered in the text box this time */
60 uint16_t cand_num; /* Number of candidates */
61 uint16_t py_page; /* Current pinyin map pages(k26) */
62 uint16_t py_num[26]; /* Number and length of Pinyin */
63 uint16_t py_pos[26]; /* Pinyin position */
64 uint8_t mode : 1; /* Set mode, 1: 26-key input(k26), 0: 9-key input(k9). Default: 1. */
65} lv_ime_pinyin_t;
66
67/***********************
68 * GLOBAL VARIABLES
69 ***********************/
70
71/**********************
72 * GLOBAL PROTOTYPES
73 **********************/
74lv_obj_t * lv_ime_pinyin_create(lv_obj_t * parent);
75
76/*=====================
77 * Setter functions
78 *====================*/
79
85void lv_ime_pinyin_set_keyboard(lv_obj_t * obj, lv_obj_t * kb);
86
92void lv_ime_pinyin_set_dict(lv_obj_t * obj, lv_pinyin_dict_t * dict);
93
99void lv_ime_pinyin_set_mode(lv_obj_t * obj, lv_ime_pinyin_mode_t mode);
100
101
102/*=====================
103 * Getter functions
104 *====================*/
105
111lv_obj_t * lv_ime_pinyin_get_kb(lv_obj_t * obj);
112
113
119lv_obj_t * lv_ime_pinyin_get_cand_panel(lv_obj_t * obj);
120
121
127lv_pinyin_dict_t * lv_ime_pinyin_get_dict(lv_obj_t * obj);
128
129/*=====================
130 * Other functions
131 *====================*/
132
133/**********************
134 * MACROS
135 **********************/
136
137#endif /*LV_IME_PINYIN*/
138
139#ifdef __cplusplus
140} /*extern "C"*/
141#endif
142
143#endif /*LV_USE_IME_PINYIN*/
144
145
Definition lv_obj.h:174
Definition lv_ll.h:32