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 Send an Event to IMEngine
256 * @privilege %http://tizen.org/privilege/ime
258 * @return 0 on success, otherwise a negative error value
259 * @param[in] command The command to be sent.
260 * @param[in] value The value corresponding to the command.
262 int ime_send_imengine_event(int command, unsigned int value);
265 * @brief Sends the selected item index in the candidate list.
269 * @privilege %http://tizen.org/privilege/ime
271 * @param[in] index the selected index in the candidate list
273 * @return 0 on success, otherwise a negative error value
274 * @retval #IME_ERROR_NONE No error
275 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
276 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
278 int ime_select_candidate(unsigned int index);
281 * @brief Sends the input context event.
285 * @privilege %http://tizen.org/privilege/ime
287 * @param[in] type the event type
288 * @param[in] value the event value
290 * @return 0 on success, otherwise a negative error value
291 * @retval #IME_ERROR_NONE No error
292 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
293 * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
295 int ime_update_input_context(unsigned int type, unsigned int value);
298 * @brief Requests IME to initialize explicitly.
300 * @details When using ime_run() API, the initialize / prepare / finalize procedures
301 * are processed automatically inside the IME application loop.
302 * But in case of not using ime_run() API, which means the IME application has
303 * its own main loop, these procedures need to be requested explicitly.
307 * @privilege %http://tizen.org/privilege/ime
309 * @return 0 on success, otherwise a negative error value
310 * @retval #IME_ERROR_NONE No error
311 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
313 int ime_initialize(void);
316 * @brief Requests IME to prepare resources such as IME window and socket connection.
318 * @details Like ime_initialize() function, this procedure is automatically processed
319 * when using ime_run() API. Call this function only when ime_run() is not used and
320 * the IME application has to handle main loop by itself.
324 * @privilege %http://tizen.org/privilege/ime
326 * @return 0 on success, otherwise a negative error value
327 * @retval #IME_ERROR_NONE No error
328 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
329 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
331 int ime_prepare(void);
334 * @brief Requests IME to finalize explicitly.
338 * @privilege %http://tizen.org/privilege/ime
340 * @return 0 on success, otherwise a negative error value
341 * @retval #IME_ERROR_NONE No error
342 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
344 int ime_finalize(void);
347 * @brief Sets flag whether IME is called from dotnet.
351 * @privilege %http://tizen.org/privilege/ime
353 * @param[in] set Set with Dotnet mode
354 * @return 0 on success, otherwise a negative error value
355 * @retval #IME_ERROR_NONE No error
356 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
358 int ime_set_dotnet_flag(bool set);
361 * @brief Sets flag whether creating IME window should be deferred until there is a access request.
365 * @privilege %http://tizen.org/privilege/ime
367 * @param[in] flag true if deferring window creation is desired
368 * @return 0 on success, otherwise a negative error value
369 * @retval #IME_ERROR_NONE No error
370 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
372 int ime_set_window_creation_defer_flag(bool flag);
375 * @brief Sets @c ime_optimization_hint_set_cb() event callback function.
379 * @privilege %http://tizen.org/privilege/ime
381 * @remarks The ime_optimization_hint_set_cb() callback function is called when an optimization hint is set
383 * @param[in] callback_func @c ime_optimization_hint_set_cb() event callback function
384 * @param[in] user_data User data to be passed to the callback function
386 * @return 0 on success, otherwise a negative error value
387 * @retval #IME_ERROR_NONE No error
388 * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
389 * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
390 * @retval #IME_ERROR_OPERATION_FAILED Operation failed
392 * @post The ime_run() function should be called to start to run IME application's main loop.
396 int ime_event_set_optimization_hint_set_cb(ime_optimization_hint_set_cb callback_func, void *user_data);
402 #endif /* __TIZEN_UIX_INPUTMETHOD_INTERNAL_H__ */