• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 /**
16  * @addtogroup InputMethod
17  * @{
18  *
19  * @brief InputMethod provides functions to use input methods and develop input methods.
20  *
21  * @since 12
22  */
23 
24 /**
25  * @file inputmethod_types_capi.h
26  *
27  * @brief Provides the input method types.
28  *
29  * @library libohinputmethod.so
30  * @kit IMEKit
31  * @syscap SystemCapability.MiscServices.InputMethodFramework
32  * @since 12
33  * @version 1.0
34  */
35 #ifndef OHOS_INPUTMETHOD_TYPES_CAPI_H
36 #define OHOS_INPUTMETHOD_TYPES_CAPI_H
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     /**
219      * The text input type is ONE TIME CODE.
220      *
221      * @since 20
222      */
223     IME_TEXT_INPUT_TYPE_ONE_TIME_CODE = 13,
224 } InputMethod_TextInputType;
225 
226 /**
227  * @brief The value type of command data.
228  *
229  * @since 12
230  */
231 typedef enum InputMethod_CommandValueType {
232     /**
233      * Value type is NONE.
234      */
235     IME_COMMAND_VALUE_TYPE_NONE = 0,
236     /**
237      * Value type is STRING.
238      */
239     IME_COMMAND_VALUE_TYPE_STRING = 1,
240     /**
241      * Value type is BOOL.
242      */
243     IME_COMMAND_VALUE_TYPE_BOOL = 2,
244     /**
245      * Value type is INT32.
246      */
247     IME_COMMAND_VALUE_TYPE_INT32 = 3,
248 } InputMethod_CommandValueType;
249 
250 /**
251  * @brief The value type of command data.
252  *
253  * @since 12
254  */
255 typedef enum InputMethod_ErrorCode {
256     /**
257      * @error The error code in the correct case.
258      */
259     IME_ERR_OK = 0,
260 
261     /**
262      * @error The error code when error is undefined.
263      */
264     IME_ERR_UNDEFINED = 1,
265     /**
266      * @error The error code when parameter check failed.
267      */
268     IME_ERR_PARAMCHECK = 401,
269     /**
270      * @error The error code when the bundle manager error.
271      */
272     IME_ERR_PACKAGEMANAGER = 12800001,
273     /**
274      * @error The error code when input method engine error.
275      */
276     IME_ERR_IMENGINE = 12800002,
277     /**
278      * @error The error code when input method client error.
279      */
280     IME_ERR_IMCLIENT = 12800003,
281     /**
282      * @error The error code when configuration persistence error.
283      */
284     IME_ERR_CONFIG_PERSIST = 12800005,
285     /**
286      * @error The error code when input method controller error.
287      */
288     IME_ERR_CONTROLLER = 12800006,
289     /**
290      * @error The error code when input method setting error.
291      */
292     IME_ERR_SETTINGS = 12800007,
293     /**
294      * @error The error code when input method manager service error.
295      */
296     IME_ERR_IMMS = 12800008,
297     /**
298      * @error The error code when input method client detached.
299      */
300     IME_ERR_DETACHED = 12800009,
301     /**
302      * @error The error code when unexpected null pointer.
303      */
304     IME_ERR_NULL_POINTER = 12802000,
305     /**
306      * @error The error code when query failed.
307      */
308     IME_ERR_QUERY_FAILED = 12802001,
309 } InputMethod_ErrorCode;
310 
311 /**
312  * @brief The value type of request keyboard.
313  *
314  * @since 15
315  */
316 typedef enum InputMethod_RequestKeyboardReason {
317     /**
318      * The request keyboard reason is NONE.
319      */
320     IME_REQUEST_REASON_NONE = 0,
321     /**
322      * The request keyboard reason is MOUSE.
323      */
324     IME_REQUEST_REASON_MOUSE = 1,
325     /**
326      * The request keyboard reason is TOUCH.
327      */
328     IME_REQUEST_REASON_TOUCH = 2,
329     /**
330      * The request keyboard reason is OTHER.
331      */
332     IME_REQUEST_REASON_OTHER = 20
333 } InputMethod_RequestKeyboardReason;
334 #ifdef __cplusplus
335 }
336 #endif /* __cplusplus */
337 /** @} */
338 #endif // OHOS_INPUTMETHOD_TYPES_CAPI_H