1 /*
2 * Copyright (c) 2024 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15 #ifndef OHOS_INPUTMETHOD_TYPES_CAPI_H
16 #define OHOS_INPUTMETHOD_TYPES_CAPI_H
17 /**
18  * @addtogroup InputMethod
19  * @{
20  *
21  * @brief InputMethod provides functions to use input methods and develop input methods.
22  *
23  * @since 12
24  */
25 
26 /**
27  * @file inputmethod_types_capi.h
28  *
29  * @brief Provides the input method types.
30  *
31  * @library libohinputmethod.so
32  * @kit IMEKit
33  * @syscap SystemCapability.MiscServices.InputMethodFramework
34  * @since 12
35  * @version 1.0
36  */
37 #ifdef __cplusplus
38 extern "C"{
39 #endif /* __cplusplus */
40 /**
41  * @brief Keyboard status.
42  *
43  * @since 12
44  */
45 typedef enum InputMethod_KeyboardStatus {
46     /**
47      * The keyboard status is none.
48      */
49     IME_KEYBOARD_STATUS_NONE = 0,
50     /**
51      * The keyboard status is hide.
52      */
53     IME_KEYBOARD_STATUS_HIDE = 1,
54     /**
55      * The keyboard status is show.
56      */
57     IME_KEYBOARD_STATUS_SHOW = 2,
58 } InputMethod_KeyboardStatus;
59 
60 /**
61  * @brief Enter key type.
62  *
63  * @since 12
64  */
65 typedef enum InputMethod_EnterKeyType {
66     /**
67      * The enter key type is UNSPECIFIED.
68      */
69     IME_ENTER_KEY_UNSPECIFIED = 0,
70     /**
71      * The enter key type is NONE.
72      */
73     IME_ENTER_KEY_NONE = 1,
74     /**
75      * The enter key type is GO.
76      */
77     IME_ENTER_KEY_GO = 2,
78     /**
79      * The enter key type is SEARCH.
80      */
81     IME_ENTER_KEY_SEARCH = 3,
82     /**
83      * The enter key type is SEND.
84      */
85     IME_ENTER_KEY_SEND = 4,
86     /**
87      * The enter key type is NEXT.
88      */
89     IME_ENTER_KEY_NEXT = 5,
90     /**
91      * The enter key type is DONE.
92      */
93     IME_ENTER_KEY_DONE = 6,
94     /**
95      * The enter key type is PREVIOUS.
96      */
97     IME_ENTER_KEY_PREVIOUS = 7,
98     /**
99      * The enter key type is NEWLINE.
100      */
101     IME_ENTER_KEY_NEWLINE = 8,
102 } InputMethod_EnterKeyType;
103 
104 /**
105  * @brief Direction.
106  *
107  * @since 12
108  */
109 typedef enum InputMethod_Direction {
110     /**
111      * The direction is NONE.
112      */
113     IME_DIRECTION_NONE = 0,
114     /**
115      * The direction is UP.
116      */
117     IME_DIRECTION_UP = 1,
118     /**
119      * The direction is DOWN.
120      */
121     IME_DIRECTION_DOWN = 2,
122     /**
123      * The direction is LEFT.
124      */
125     IME_DIRECTION_LEFT = 3,
126     /**
127      * The direction is RIGHT.
128      */
129     IME_DIRECTION_RIGHT = 4,
130 } InputMethod_Direction;
131 
132 /**
133  * @brief The extend action.
134  *
135  * @since 12
136  */
137 typedef enum InputMethod_ExtendAction {
138     /**
139      * Select all text.
140      */
141     IME_EXTEND_ACTION_SELECT_ALL = 0,
142     /**
143      * Cut selected text.
144      */
145     IME_EXTEND_ACTION_CUT = 3,
146     /**
147      * Copy selected text.
148      */
149     IME_EXTEND_ACTION_COPY = 4,
150     /**
151      * Paste from paste board.
152      */
153     IME_EXTEND_ACTION_PASTE = 5,
154 } InputMethod_ExtendAction;
155 
156 /**
157  * @brief The text input type.
158  *
159  * @since 12
160  */
161 typedef enum InputMethod_TextInputType {
162     /**
163      * The text input type is NONE.
164      */
165     IME_TEXT_INPUT_TYPE_NONE = -1,
166     /**
167      * The text input type is TEXT.
168      */
169     IME_TEXT_INPUT_TYPE_TEXT = 0,
170     /**
171      * The text input type is MULTILINE.
172      */
173     IME_TEXT_INPUT_TYPE_MULTILINE = 1,
174     /**
175      * The text input type is NUMBER.
176      */
177     IME_TEXT_INPUT_TYPE_NUMBER = 2,
178     /**
179      * The text input type is PHONE.
180      */
181     IME_TEXT_INPUT_TYPE_PHONE = 3,
182     /**
183      * The text input type is DATETIME.
184      */
185     IME_TEXT_INPUT_TYPE_DATETIME = 4,
186     /**
187      * The text input type is EMAIL ADDRESS.
188      */
189     IME_TEXT_INPUT_TYPE_EMAIL_ADDRESS = 5,
190     /**
191      * The text input type is URL.
192      */
193     IME_TEXT_INPUT_TYPE_URL = 6,
194     /**
195      * The text input type is VISIBLE PASSWORD.
196      */
197     IME_TEXT_INPUT_TYPE_VISIBLE_PASSWORD = 7,
198     /**
199      * The text input type is NUMBER PASSWORD.
200      */
201     IME_TEXT_INPUT_TYPE_NUMBER_PASSWORD = 8,
202     /**
203      * The text input type is SCREEN LOCK PASSWORD.
204      */
205     IME_TEXT_INPUT_TYPE_SCREEN_LOCK_PASSWORD = 9,
206     /**
207      * The text input type is USER NAME.
208      */
209     IME_TEXT_INPUT_TYPE_USER_NAME = 10,
210     /**
211      * The text input type is NEW PASSWORD.
212      */
213     IME_TEXT_INPUT_TYPE_NEW_PASSWORD = 11,
214     /**
215      * The text input type is NUMBER DECIMAL.
216      */
217     IME_TEXT_INPUT_TYPE_NUMBER_DECIMAL = 12,
218 } InputMethod_TextInputType;
219 
220 /**
221  * @brief The value type of command data.
222  *
223  * @since 12
224  */
225 typedef enum InputMethod_CommandValueType {
226     /**
227      * Value type is NONE.
228      */
229     IME_COMMAND_VALUE_TYPE_NONE = 0,
230     /**
231      * Value type is STRING.
232      */
233     IME_COMMAND_VALUE_TYPE_STRING = 1,
234     /**
235      * Value type is BOOL.
236      */
237     IME_COMMAND_VALUE_TYPE_BOOL = 2,
238     /**
239      * Value type is INT32.
240      */
241     IME_COMMAND_VALUE_TYPE_INT32 = 3,
242 } InputMethod_CommandValueType;
243 
244 /**
245  * @brief The value type of command data.
246  *
247  * @since 12
248  */
249 typedef enum InputMethod_ErrorCode {
250     /**
251      * @error The error code in the correct case.
252      */
253     IME_ERR_OK = 0,
254 
255     /**
256      * @error The error code when error is undefined.
257      */
258     IME_ERR_UNDEFINED = 1,
259     /**
260      * @error The error code when parameter check failed.
261      */
262     IME_ERR_PARAMCHECK = 401,
263     /**
264      * @error The error code when the package manager error.
265      */
266     IME_ERR_PACKAGEMANAGER = 12800001,
267     /**
268      * @error The error code when input method engine error.
269      */
270     IME_ERR_IMENGINE = 12800002,
271     /**
272      * @error The error code when input method client error.
273      */
274     IME_ERR_IMCLIENT = 12800003,
275     /**
276      * @error The error code when configuration persisting error.
277      */
278     IME_ERR_CONFIG_PERSIST = 12800005,
279     /**
280      * @error The error code when input method controller error.
281      */
282     IME_ERR_CONTROLLER = 12800006,
283     /**
284      * @error The error code when input method setting error.
285      */
286     IME_ERR_SETTINGS = 12800007,
287     /**
288      * @error The error code when input method manager service error.
289      */
290     IME_ERR_IMMS = 12800008,
291     /**
292      * @error The error code when input method client is detached.
293      */
294     IME_ERR_DETACHED = 12800009,
295     /**
296      * @error The error code when unexpected null pointer.
297      */
298     IME_ERR_NULL_POINTER = 12802000,
299     /**
300      * @error The error code when query failed.
301      */
302     IME_ERR_QUERY_FAILED = 12802001,
303 } InputMethod_ErrorCode;
304 #ifdef __cplusplus
305 }
306 #endif /* __cplusplus */
307 /** @} */
308 #endif // OHOS_INPUTMETHOD_TYPES_CAPI_H