2 * Copyright (c) 2014-2017 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __TIZEN_UIX_INPUTMETHOD_INTERNAL_H__
18 #define __TIZEN_UIX_INPUTMETHOD_INTERNAL_H__
21 * @file inputmethod_internal.h
22 * @brief This file contains input method internal APIs and related enumeration.
33 * @brief Enumeration for input method optimization hint.
38 IME_OPTIMIZATION_HINT_NONE = 0, /**< No hint provided */
39 IME_OPTIMIZATION_HINT_SHOW_PREPARE, /**< This IME is going to be displayed on screen soon */
40 } ime_optimization_hint_e;
42 typedef struct _ime_context *ime_context_h;
45 * @brief Called when an caps mode is changed.
49 * @privilege %http://tizen.org/privilege/ime
51 * @param[in] mode caps mode
52 * @param[in] user_data User data to be passed from the callback registration function
54 typedef void (*ime_caps_mode_changed_cb)(int mode, void *user_data);
57 * @brief Called when a candidate list provided by IMEngine should be shown.
61 * @privilege %http://tizen.org/privilege/ime
63 * @param[in] context_id The input context identification value of an associated text input UI control
64 * @param[in] user_data User data to be passed from the callback registration function
66 typedef void (*ime_candidate_show_cb)(int context_id, void *user_data);
69 * @brief Called when a candidate list provided by IMEngine should be hidden.
73 * @privilege %http://tizen.org/privilege/ime
75 * @param[in] context_id The input context identification value of an associated text input UI control
76 * @param[in] user_data User data to be passed from the callback registration function
78 typedef void (*ime_candidate_hide_cb)(int context_id, void *user_data);
81 * @brief Called when a candidate list provided by IMEngine is changed.
85 * @privilege %http://tizen.org/privilege/ime
87 * @remarks @a list should not be released.
89 * @param[in] list candidate list
90 * @param[in] user_data User data to be passed from the callback registration function
92 typedef void (*ime_lookup_table_changed_cb)(Eina_List *list, void *user_data);
95 * @brief Called when a optimization hint value is set.
99 * @privilege %http://tizen.org/privilege/ime
101 * @param[in] hint The hint value used for optimization
102 * @param[in] user_data User data to be passed from the callback registration function
104 typedef void (*ime_optimization_hint_set_cb)(ime_optimization_hint_e hint, void *user_data);
107 * @brief Sets @c ime_caps_mode_changed_cb() event callback function.
111 * @privilege %http://tizen.org/privilege/ime
113 * @remarks The ime_caps_mode_changed_cb() callback function is called when an associated text input
114 * UI control sends the change of caps mode.
116 * @param[in] callback_func @c ime_caps_mode_changed_cb() event callback function
117 * @param[in] user_data User data to be passed to the callback function
119 * @return 0 on success, otherwise a negative error value
120 * @retval #IME_ERROR_NONE No error
121 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
122 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
123 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
125 * @post The ime_run() function should be called to start to run IME application's main loop.
129 int ime_event_set_caps_mode_changed_cb(ime_caps_mode_changed_cb callback_func, void *user_data);
132 * @brief Sets @c ime_candidate_show_cb() event callback function.
136 * @privilege %http://tizen.org/privilege/ime
138 * @param[in] callback_func @c ime_candidate_show_cb() event callback function
139 * @param[in] user_data User data to be passed to the callback function
141 * @return 0 on success, otherwise a negative error value
142 * @retval #IME_ERROR_NONE No error
143 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
144 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
145 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
147 * @post The ime_run() function should be called to start to run IME application's main loop.
151 int ime_event_set_candidate_show_cb(ime_candidate_show_cb callback_func, void *user_data);
153 int ime_event_set_candidate_hide_cb(ime_candidate_hide_cb callback_func, void *user_data);
156 * @brief Sets @c ime_lookup_table_changed_cb() event callback function.
160 * @privilege %http://tizen.org/privilege/ime
162 * @remarks The ime_lookup_table_changed_cb() callback function is called when an associated text input
163 * UI control sends the change of caps mode.
165 * @param[in] callback_func @c ime_lookup_table_changed_cb() event callback function
166 * @param[in] user_data User data to be passed to the callback function
168 * @return 0 on success, otherwise a negative error value
169 * @retval #IME_ERROR_NONE No error
170 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
171 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
172 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
174 * @post The ime_run() function should be called to start to run IME application's main loop.
178 int ime_event_set_lookup_table_changed_cb(ime_lookup_table_changed_cb callback_func, void *user_data);
181 * @brief Gets the caps mode information from the given input context.
183 * @details Each edit field has various attributes for input panel. This function can be
184 * called to get the caps mode information in ime_show_cb() callback function.
188 * @privilege %http://tizen.org/privilege/ime
190 * @param[in] context The input context information of an associated text input UI control
191 * @param[out] caps_mode Caps mode information \n @c true to turn on shift mode
192 * text feature if available, @c false to disable the predictive text feature
194 * @return 0 on success, otherwise a negative error value
195 * @retval #IME_ERROR_NONE No error
196 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
197 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
198 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
200 * @post Input panel UI should be drawn or operated by this information accordingly.
204 int ime_context_get_caps_mode(ime_context_h context, bool *caps_mode);
207 * @brief Sets keyboard engine.
211 * @privilege %http://tizen.org/privilege/ime
213 * @param[in] engine_id The engine UUID
215 * @return 0 on success, otherwise a negative error value
216 * @retval #IME_ERROR_NONE No error
217 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
218 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
219 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
221 int ime_set_imengine(const char *engine_id);
224 * @brief Flushes state in Input Method engine.
228 * @privilege %http://tizen.org/privilege/ime
230 * @return 0 on success, otherwise a negative error value
231 * @retval #IME_ERROR_NONE No error
232 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
233 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
235 int ime_flush_imengine(void);
238 * @brief Resets state in Input Method engine.
242 * @privilege %http://tizen.org/privilege/ime
244 * @return 0 on success, otherwise a negative error value
245 * @retval #IME_ERROR_NONE No error
246 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
247 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
249 int ime_reset_imengine(void);
252 * @brief Sends the selected item index in the candidate list.
256 * @privilege %http://tizen.org/privilege/ime
258 * @param[in] index the selected index in the candidate list
260 * @return 0 on success, otherwise a negative error value
261 * @retval #IME_ERROR_NONE No error
262 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
263 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
265 int ime_select_candidate(unsigned int index);
268 * @brief Sends the input context event.
272 * @privilege %http://tizen.org/privilege/ime
274 * @param[in] type the event type
275 * @param[in] value the event value
277 * @return 0 on success, otherwise a negative error value
278 * @retval #IME_ERROR_NONE No error
279 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
280 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
282 int ime_update_input_context(unsigned int type, unsigned int value);
285 * @brief Requests IME to initialize explicitly.
287 * @details When using ime_run API, the initialize / prepare / finalize procedures
288 * are processed automatically inside the IME application loop.
289 * But in case of not using ime_run API, which means the IME application has
290 * its own main loop, these procedures need to be requested explicitly.
294 * @privilege %http://tizen.org/privilege/ime
296 * @return 0 on success, otherwise a negative error value
297 * @retval #IME_ERROR_NONE No error
298 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
300 int ime_initialize(void);
303 * @brief Requests IME to prepare resources such as IME window and socket connection.
305 * @details Like ime_initialize() function, this procedure is automatically processed
306 * when using ime_run() API. Call this function only when ime_run() is not used and
307 * the IME application has to handle main loop by itself.
311 * @privilege %http://tizen.org/privilege/ime
313 * @return 0 on success, otherwise a negative error value
314 * @retval #IME_ERROR_NONE No error
315 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
316 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
318 int ime_prepare(void);
321 * @brief Requests IME to finalize explicitly.
325 * @privilege %http://tizen.org/privilege/ime
327 * @return 0 on success, otherwise a negative error value
328 * @retval #IME_ERROR_NONE No error
329 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
331 int ime_finalize(void);
334 * @brief Sets flag whether IME is called from dotnet.
338 * @privilege %http://tizen.org/privilege/ime
340 * @param[in] set Set with Dotnet mode
341 * @return 0 on success, otherwise a negative error value
342 * @retval #IME_ERROR_NONE No error
343 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
345 int ime_set_dotnet_flag(bool set);
348 * @brief Sets flag whether creating IME window should be defered until there is a access request.
352 * @privilege %http://tizen.org/privilege/ime
354 * @param[in] flag true if deferring window creation is desired
355 * @return 0 on success, otherwise a negative error value
356 * @retval #IME_ERROR_NONE No error
357 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
359 int ime_set_window_creation_defer_flag(bool flag);
362 * @brief Sets @c ime_optimization_hint_set_cb() event callback function.
366 * @privilege %http://tizen.org/privilege/ime
368 * @remarks The ime_optimization_hint_set_cb() callback function is called when an optimization hint is set
370 * @param[in] callback_func @c ime_optimization_hint_set_cb() event callback function
371 * @param[in] user_data User data to be passed to the callback function
373 * @return 0 on success, otherwise a negative error value
374 * @retval #IME_ERROR_NONE No error
375 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
376 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
377 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
379 * @post The ime_run() function should be called to start to run IME application's main loop.
383 int ime_event_set_optimization_hint_set_cb(ime_optimization_hint_set_cb callback_func, void *user_data);
389 #endif /* __TIZEN_UIX_INPUTMETHOD_INTERNAL_H__ */