0b8002b2eb41451434f85b4ef0b73950f53a77dd
[platform/core/api/inputmethod.git] / inputmethod / include / inputmethod_internal.h
1 /*
2  * Copyright (c) 2014-2017 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 #ifndef __TIZEN_UIX_INPUTMETHOD_INTERNAL_H__
18 #define __TIZEN_UIX_INPUTMETHOD_INTERNAL_H__
19
20 /**
21  * @file inputmethod_internal.h
22  * @brief This file contains input method internal APIs and related enumeration.
23  */
24
25 #include <tizen.h>
26 #include <Eina.h>
27 #include <sclcore.h>
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 /**
34  * @brief Enumeration for input method optimization hint.
35  *
36  * @since_tizen 5.0
37  */
38 typedef enum {
39         IME_OPTIMIZATION_HINT_NONE = 0, /**< No hint provided */
40         IME_OPTIMIZATION_HINT_SHOW_PREPARE, /**< This IME is going to be displayed on screen soon */
41 } ime_optimization_hint_e;
42
43 typedef struct _ime_context *ime_context_h;
44
45 /**
46  * @brief Called when an caps mode is changed.
47  *
48  * @since_tizen 3.0
49  *
50  * @privilege %http://tizen.org/privilege/ime
51  *
52  * @param[in] mode caps mode
53  * @param[in] user_data User data to be passed from the callback registration function
54  */
55 typedef void (*ime_caps_mode_changed_cb)(int mode, void *user_data);
56
57 /**
58  * @brief Called when a candidate list provided by IMEngine should be shown.
59  *
60  * @since_tizen 3.0
61  *
62  * @privilege %http://tizen.org/privilege/ime
63  *
64  * @param[in] context_id The input context identification value of an associated text input UI control
65  * @param[in] user_data User data to be passed from the callback registration function
66  */
67 typedef void (*ime_candidate_show_cb)(int context_id, void *user_data);
68
69 /**
70  * @brief Called when a candidate list provided by IMEngine should be hidden.
71  *
72  * @since_tizen 3.0
73  *
74  * @privilege %http://tizen.org/privilege/ime
75  *
76  * @param[in] context_id The input context identification value of an associated text input UI control
77  * @param[in] user_data User data to be passed from the callback registration function
78  */
79 typedef void (*ime_candidate_hide_cb)(int context_id, void *user_data);
80
81 /**
82  * @brief Called when a candidate list provided by IMEngine is changed.
83  *
84  * @since_tizen 3.0
85  *
86  * @privilege %http://tizen.org/privilege/ime
87  *
88  * @remarks @a list should not be released.
89  *
90  * @param[in] list candidate list
91  * @param[in] user_data User data to be passed from the callback registration function
92  */
93 typedef void (*ime_lookup_table_changed_cb)(Eina_List *list, void *user_data);
94
95 /**
96  * @brief Called when a optimization hint value is set.
97  *
98  * @since_tizen 5.0
99  *
100  * @privilege %http://tizen.org/privilege/ime
101  *
102  * @param[in] hint The hint value used for optimization
103  * @param[in] user_data User data to be passed from the callback registration function
104  */
105 typedef void (*ime_optimization_hint_set_cb)(ime_optimization_hint_e hint, void *user_data);
106
107 /**
108  * @brief Called when a key event is received from external devices or ime_send_key_event().
109  *
110  * @since_tizen 5.5
111  *
112  * @privilege %http://tizen.org/privilege/ime
113  *
114  * @param[in] key The key event of the keyboard
115  * @param[in] user_data User data to be passed from the callback registration function
116  */
117 typedef void (*ime_process_key_event_with_imengine_cb)(scim::KeyEvent &key, uint32_t serial, void *user_data);
118
119 /**
120  * @brief Called when a autocapital type is set.
121  *
122  * @since_tizen 5.5
123  *
124  * @privilege %http://tizen.org/privilege/ime
125  *
126  * @param[in] type The autocapital type to be set to the input panel
127  * @param[in] user_data User data to be passed to the callback function
128  */
129 typedef void (*ime_autocapital_type_set_cb)(uint32_t type, void *user_data);
130
131 /**
132  * @brief Called when a prediction allow is set.
133  *
134  * @since_tizen 5.5
135  *
136  * @privilege %http://tizen.org/privilege/ime
137  *
138  * @param[in] prediction_allow The prediction allow to be set to the input panel
139  * @param[in] user_data User data to be passed to the callback function
140  */
141 typedef void (*ime_prediction_allow_set_cb)(uint32_t prediction_allow, void *user_data);
142
143 /**
144  * @brief Called when a trigger property value is set.
145  *
146  * @since_tizen 5.5
147  *
148  * @privilege %http://tizen.org/privilege/ime
149  *
150  * @param[in] property The trigger property
151  * @param[in] user_data User data to be passed to the callback function
152  */
153 typedef void (*ime_trigger_property_set_cb)(const char *property, void *user_data);
154
155 /**
156  * @brief Called when a candidate more window is shown.
157  *
158  * @since_tizen 5.5
159  *
160  * @privilege %http://tizen.org/privilege/ime
161  *
162  * @param[in] user_data User data to be passed to the callback function
163  */
164 typedef void (*ime_candidate_more_window_show_cb)(void *user_data);
165
166 /**
167  * @brief Called when a candidate more window is hidden.
168  *
169  * @since_tizen 5.5
170  *
171  * @privilege %http://tizen.org/privilege/ime
172  *
173  * @param[in] user_data User data to be passed to the callback function
174  */
175 typedef void (*ime_candidate_more_window_hide_cb)(void *user_data);
176
177 /**
178  * @brief Called when an AUX item is selected
179  *
180  * @since_tizen 5.5
181  *
182  * @privilege %http://tizen.org/privilege/ime
183  *
184  * @param[in] item The AUX item
185  * @param[in] user_data User data to be passed to the callback function
186  */
187 typedef void (*ime_aux_select_cb)(uint32_t item, void *user_data);
188
189 /**
190  * @brief Called when a candidate item is selected
191  *
192  * @since_tizen 5.5
193  *
194  * @privilege %http://tizen.org/privilege/ime
195  *
196  * @param[in] item The cadidate item
197  * @param[in] user_data User data to be passed to the callback function
198  */
199 typedef void (*ime_candidate_select_cb)(uint32_t item, void *user_data);
200
201 /**
202  * @brief Called when a candidate table page is up
203  *
204  * @since_tizen 5.5
205  *
206  * @privilege %http://tizen.org/privilege/ime
207  *
208  * @param[in] user_data User data to be passed to the callback function
209  */
210 typedef void (*ime_candidate_table_page_up_cb)(void *user_data);
211
212 /**
213  * @brief Called when a candidate table page is down
214  *
215  * @since_tizen 5.5
216  *
217  * @privilege %http://tizen.org/privilege/ime
218  *
219  * @param[in] user_data User data to be passed to the callback function
220  */
221 typedef void (*ime_candidate_table_page_down_cb)(void *user_data);
222
223 /**
224  * @brief Called when a page size of the candidate window is changed.
225  *
226  * @since_tizen 5.5
227  *
228  * @privilege %http://tizen.org/privilege/ime
229  *
230  * @param[in] size The page size of the candidate window
231  * @param[in] user_data User data to be passed from the callback registration function
232  */
233 typedef void (*ime_candidate_table_page_size_chaned_cb)(uint32_t size, void *user_data);
234
235 /**
236  * @brief Called when a candidate item layout is set.
237  *
238  * @since_tizen 5.5
239  *
240  * @privilege %http://tizen.org/privilege/ime
241  *
242  * @param[in] item The candidate item layout
243  * @param[in] user_data User data to be passed to the callback function
244  */
245 typedef void (*ime_candidate_item_layout_set_cb)(std::vector<uint32_t> item, void *user_data);
246
247 /**
248  * @brief Called when a displayed candidate number is changed.
249  *
250  * @since_tizen 5.5
251  *
252  * @privilege %http://tizen.org/privilege/ime
253  *
254  * @param[in] page_num The displayed candidate number
255  * @param[in] user_data User data to be passed from the callback registration function
256  */
257 typedef void (*ime_displayed_candidate_number_chaned_cb)(uint32_t page_num, void *user_data);
258
259 /**
260  * @brief Called when the candidate item is long pressed.
261  *
262  * @since_tizen 5.5
263  *
264  * @privilege %http://tizen.org/privilege/ime
265  *
266  * @param[in] index The index of the candidate item
267  * @param[in] user_data User data to be passed from the callback registration function
268  */
269 typedef void (*ime_candidate_item_long_pressed_cb)(uint32_t index, void *user_data);
270
271 /**
272  * @brief Sets @c ime_caps_mode_changed_cb() event callback function.
273  *
274  * @since_tizen 3.0
275  *
276  * @privilege %http://tizen.org/privilege/ime
277  *
278  * @remarks The ime_caps_mode_changed_cb() callback function is called when an associated text input
279  * UI control sends the change of caps mode.
280  *
281  * @param[in] callback_func @c ime_caps_mode_changed_cb() event callback function
282  * @param[in] user_data User data to be passed to the callback function
283  *
284  * @return 0 on success, otherwise a negative error value
285  * @retval #IME_ERROR_NONE No error
286  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
287  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
288  * @retval #IME_ERROR_OPERATION_FAILED Operation failed
289  *
290  * @post The ime_run() function should be called to start to run IME application's main loop.
291  *
292  * @see ime_run()
293  */
294 int ime_event_set_caps_mode_changed_cb(ime_caps_mode_changed_cb callback_func, void *user_data);
295
296 /**
297  * @brief Sets @c ime_candidate_show_cb() event callback function.
298  *
299  * @since_tizen 3.0
300  *
301  * @privilege %http://tizen.org/privilege/ime
302  *
303  * @param[in] callback_func @c ime_candidate_show_cb() event callback function
304  * @param[in] user_data User data to be passed to the callback function
305  *
306  * @return 0 on success, otherwise a negative error value
307  * @retval #IME_ERROR_NONE No error
308  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
309  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
310  * @retval #IME_ERROR_OPERATION_FAILED Operation failed
311  *
312  * @post The ime_run() function should be called to start to run IME application's main loop.
313  *
314  * @see ime_run()
315  */
316 int ime_event_set_candidate_show_cb(ime_candidate_show_cb callback_func, void *user_data);
317
318 int ime_event_set_candidate_hide_cb(ime_candidate_hide_cb callback_func, void *user_data);
319
320 /**
321  * @brief Sets @c ime_lookup_table_changed_cb() event callback function.
322  *
323  * @since_tizen 3.0
324  *
325  * @privilege %http://tizen.org/privilege/ime
326  *
327  * @remarks The ime_lookup_table_changed_cb() callback function is called when an associated text input
328  * UI control sends the change of caps mode.
329  *
330  * @param[in] callback_func @c ime_lookup_table_changed_cb() event callback function
331  * @param[in] user_data User data to be passed to the callback function
332  *
333  * @return 0 on success, otherwise a negative error value
334  * @retval #IME_ERROR_NONE No error
335  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
336  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
337  * @retval #IME_ERROR_OPERATION_FAILED Operation failed
338  *
339  * @post The ime_run() function should be called to start to run IME application's main loop.
340  *
341  * @see ime_run()
342  */
343 int ime_event_set_lookup_table_changed_cb(ime_lookup_table_changed_cb callback_func, void *user_data);
344
345 /**
346  * @brief Gets the caps mode information from the given input context.
347  *
348  * @details Each edit field has various attributes for input panel. This function can be
349  * called to get the caps mode information in ime_show_cb() callback function.
350  *
351  * @since_tizen 3.0
352  *
353  * @privilege %http://tizen.org/privilege/ime
354  *
355  * @param[in] context The input context information of an associated text input UI control
356  * @param[out] caps_mode Caps mode information \n @c true to turn on shift mode
357  * text feature if available, @c false to disable the predictive text feature
358  *
359  * @return 0 on success, otherwise a negative error value
360  * @retval #IME_ERROR_NONE No error
361  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
362  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
363  * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
364  *
365  * @post Input panel UI should be drawn or operated by this information accordingly.
366  *
367  * @see ime_show_cb()
368  */
369 int ime_context_get_caps_mode(ime_context_h context, bool *caps_mode);
370
371 /**
372  * @brief Sets keyboard engine.
373  *
374  * @since_tizen 3.0
375  *
376  * @privilege %http://tizen.org/privilege/ime
377  *
378  * @param[in] engine_id The engine UUID
379  *
380  * @return 0 on success, otherwise a negative error value
381  * @retval #IME_ERROR_NONE No error
382  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
383  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
384  * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
385  */
386 int ime_set_imengine(const char *engine_id);
387
388 /**
389  * @brief Flushes state in Input Method engine.
390  *
391  * @since_tizen 3.0
392  *
393  * @privilege %http://tizen.org/privilege/ime
394  *
395  * @return 0 on success, otherwise a negative error value
396  * @retval #IME_ERROR_NONE No error
397  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
398  * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
399  */
400 int ime_flush_imengine(void);
401
402 /**
403  * @brief Resets state in Input Method engine.
404  *
405  * @since_tizen 3.0
406  *
407  * @privilege %http://tizen.org/privilege/ime
408  *
409  * @return 0 on success, otherwise a negative error value
410  * @retval #IME_ERROR_NONE No error
411  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
412  * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
413  */
414 int ime_reset_imengine(void);
415
416 /**
417  * @brief Send an Event to IMEngine
418  *
419  * @since_tizen 5.0
420  *
421  * @privilege %http://tizen.org/privilege/ime
422  *
423  * @return 0 on success, otherwise a negative error value
424  * @param[in] command The command to be sent.
425  * @param[in] value The value corresponding to the command.
426  */
427 int ime_send_imengine_event(int command, unsigned int value);
428
429 /**
430  * @brief Sends the selected item index in the candidate list.
431  *
432  * @since_tizen 3.0
433  *
434  * @privilege %http://tizen.org/privilege/ime
435  *
436  * @param[in] index the selected index in the candidate list
437  *
438  * @return 0 on success, otherwise a negative error value
439  * @retval #IME_ERROR_NONE No error
440  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
441  * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
442  */
443 int ime_select_candidate(unsigned int index);
444
445 /**
446  * @brief Sends the input context event.
447  *
448  * @since_tizen 3.0
449  *
450  * @privilege %http://tizen.org/privilege/ime
451  *
452  * @param[in] type the event type
453  * @param[in] value the event value
454  *
455  * @return 0 on success, otherwise a negative error value
456  * @retval #IME_ERROR_NONE No error
457  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
458  * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
459  */
460 int ime_update_input_context(unsigned int type, unsigned int value);
461
462 /**
463  * @brief Requests IME to initialize explicitly.
464  *
465  * @details When using ime_run() API, the initialize / prepare / finalize procedures
466  * are processed automatically inside the IME application loop.
467  * But in case of not using ime_run() API, which means the IME application has
468  * its own main loop, these procedures need to be requested explicitly.
469  *
470  * @since_tizen 4.0
471  *
472  * @privilege %http://tizen.org/privilege/ime
473  *
474  * @return 0 on success, otherwise a negative error value
475  * @retval #IME_ERROR_NONE No error
476  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
477  */
478 int ime_initialize(void);
479
480 /**
481  * @brief Requests IME to prepare resources such as IME window and socket connection.
482  *
483  * @details Like ime_initialize() function, this procedure is automatically processed
484  * when using ime_run() API. Call this function only when ime_run() is not used and
485  * the IME application has to handle main loop by itself.
486  *
487  * @since_tizen 4.0
488  *
489  * @privilege %http://tizen.org/privilege/ime
490  *
491  * @return 0 on success, otherwise a negative error value
492  * @retval #IME_ERROR_NONE No error
493  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
494  * @retval #IME_ERROR_OPERATION_FAILED Operation failed
495  */
496 int ime_prepare(void);
497
498 /**
499  * @brief Requests IME to finalize explicitly.
500  *
501  * @since_tizen 4.0
502  *
503  * @privilege %http://tizen.org/privilege/ime
504  *
505  * @return 0 on success, otherwise a negative error value
506  * @retval #IME_ERROR_NONE No error
507  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
508  */
509 int ime_finalize(void);
510
511 /**
512  * @brief Sets flag whether IME is called from dotnet.
513  *
514  * @since_tizen 4.0
515  *
516  * @privilege %http://tizen.org/privilege/ime
517  *
518  * @param[in] set Set with Dotnet mode
519  * @return 0 on success, otherwise a negative error value
520  * @retval #IME_ERROR_NONE No error
521  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
522  */
523 int ime_set_dotnet_flag(bool set);
524
525 /**
526  * @brief Sets flag whether creating IME window should be deferred until there is a access request.
527  *
528  * @since_tizen 5.0
529  *
530  * @privilege %http://tizen.org/privilege/ime
531  *
532  * @param[in] flag true if deferring window creation is desired
533  * @return 0 on success, otherwise a negative error value
534  * @retval #IME_ERROR_NONE No error
535  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
536  */
537 int ime_set_window_creation_defer_flag(bool flag);
538
539 /**
540  * @brief Sets @c ime_optimization_hint_set_cb() event callback function.
541  *
542  * @since_tizen 5.0
543  *
544  * @privilege %http://tizen.org/privilege/ime
545  *
546  * @remarks The ime_optimization_hint_set_cb() callback function is called when an optimization hint is set
547  *
548  * @param[in] callback_func @c ime_optimization_hint_set_cb() event callback function
549  * @param[in] user_data User data to be passed to the callback function
550  *
551  * @return 0 on success, otherwise a negative error value
552  * @retval #IME_ERROR_NONE No error
553  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
554  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
555  * @retval #IME_ERROR_OPERATION_FAILED Operation failed
556  *
557  * @post The ime_run() function should be called to start to run IME application's main loop.
558  *
559  * @see ime_run()
560  */
561 int ime_event_set_optimization_hint_set_cb(ime_optimization_hint_set_cb callback_func, void *user_data);
562
563 /**
564  * @brief Sets @c ime_process_key_event_with_imengine_cb() event callback function.
565  *
566  * @since_tizen 5.5
567  *
568  * @privilege %http://tizen.org/privilege/ime
569  *
570  * @remarks The ime_process_key_event_cb() callback function is called when the key event
571  * is received from the external keyboard devices or ime_send_key_event() function.
572  *
573  * @param[in] callback_func @c ime_process_key_event_with_imengine_cb() event callback function
574  * @param[in] user_data User data to be passed to the callback function
575  *
576  * @return 0 on success, otherwise a negative error value
577  * @retval #IME_ERROR_NONE No error
578  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
579  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
580  *
581  * @post The ime_run() function should be called to start to run IME application's main loop.
582  *
583  * @see ime_run()
584  */
585 int ime_event_set_process_key_event_with_imengine_cb(ime_process_key_event_with_imengine_cb callback_func, void *user_data);
586
587 /**
588  * @brief Sets @c ime_autocapital_type_set_cb() event callback function.
589  *
590  * @since_tizen 5.5
591  *
592  * @privilege %http://tizen.org/privilege/ime
593  *
594  * @remarks The ime_autocapital_type_set_cb() callback function is called when an optimization hint is set
595  *
596  * @param[in] callback_func @c ime_autocapital_type_set_cb() event callback function
597  * @param[in] user_data User data to be passed to the callback function
598  *
599  * @return 0 on success, otherwise a negative error value
600  * @retval #IME_ERROR_NONE No error
601  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
602  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
603  *
604  * @post The ime_run() function should be called to start to run IME application's main loop.
605  *
606  * @see ime_run()
607  */
608 int ime_event_set_autocapital_type_set_cb(ime_autocapital_type_set_cb callback_func, void *user_data);
609
610 /**
611  * @brief Sets @c ime_prediction_allow_set_cb() event callback function.
612  *
613  * @since_tizen 5.5
614  *
615  * @privilege %http://tizen.org/privilege/ime
616  *
617  * @remarks The ime_prediction_allow_set_cb() callback function is called when an optimization hint is set
618  *
619  * @param[in] callback_func @c ime_prediction_allow_set_cb() event callback function
620  * @param[in] user_data User data to be passed to the callback function
621  *
622  * @return 0 on success, otherwise a negative error value
623  * @retval #IME_ERROR_NONE No error
624  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
625  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
626  *
627  * @post The ime_run() function should be called to start to run IME application's main loop.
628  *
629  * @see ime_run()
630  */
631 int ime_event_set_prediction_allow_set_cb(ime_prediction_allow_set_cb callback_func, void *user_data);
632
633 /**
634  * @brief Sets @c ime_trigger_property_set_cb() event callback function.
635  *
636  * @since_tizen 5.5
637  *
638  * @privilege %http://tizen.org/privilege/ime
639  *
640  * @param[in] callback_func @c ime_trigger_property_set_cb() event callback function
641  * @param[in] user_data User data to be passed to the callback function
642  *
643  * @return 0 on success, otherwise a negative error value
644  * @retval #IME_ERROR_NONE No error
645  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
646  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
647  *
648  * @post The ime_run() function should be called to start to run IME application's main loop.
649  *
650  * @see ime_run()
651  */
652 int ime_event_set_trigger_property_set_cb(ime_trigger_property_set_cb callback_func, void *user_data);
653
654 /**
655  * @brief Sets @c ime_candidate_more_window_show_cb() event callback function.
656  *
657  * @since_tizen 5.5
658  *
659  * @privilege %http://tizen.org/privilege/ime
660  *
661  * @param[in] callback_func @c ime_candidate_more_window_show_cb() event callback function
662  * @param[in] user_data User data to be passed to the callback function
663  *
664  * @return 0 on success, otherwise a negative error value
665  * @retval #IME_ERROR_NONE No error
666  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
667  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
668  *
669  * @post The ime_run() function should be called to start to run IME application's main loop.
670  *
671  * @see ime_run()
672  */
673 int ime_event_set_candidate_more_window_show_cb(ime_candidate_more_window_show_cb callback_func, void *user_data);
674
675 /**
676  * @brief Sets @c ime_candidate_more_window_hide_cb() event callback function.
677  *
678  * @since_tizen 5.5
679  *
680  * @privilege %http://tizen.org/privilege/ime
681  *
682  * @param[in] callback_func @c ime_candidate_more_window_hide_cb() event callback function
683  * @param[in] user_data User data to be passed to the callback function
684  *
685  * @return 0 on success, otherwise a negative error value
686  * @retval #IME_ERROR_NONE No error
687  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
688  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
689  *
690  * @post The ime_run() function should be called to start to run IME application's main loop.
691  *
692  * @see ime_run()
693  */
694 int ime_event_set_candidate_more_window_hide_cb(ime_candidate_more_window_hide_cb callback_func, void *user_data);
695
696 /**
697  * @brief Sets @c ime_aux_select_cb() event callback function.
698  *
699  * @since_tizen 5.5
700  *
701  * @privilege %http://tizen.org/privilege/ime
702  *
703  * @param[in] callback_func @c ime_aux_select_cb() event callback function
704  * @param[in] user_data User data to be passed to the callback function
705  *
706  * @return 0 on success, otherwise a negative error value
707  * @retval #IME_ERROR_NONE No error
708  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
709  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
710  *
711  * @post The ime_run() function should be called to start to run IME application's main loop.
712  *
713  * @see ime_run()
714  */
715 int ime_event_set_aux_select_cb(ime_aux_select_cb callback_func, void *user_data);
716
717 /**
718  * @brief Sets @c ime_candidate_select_cb() event callback function.
719  *
720  * @since_tizen 5.5
721  *
722  * @privilege %http://tizen.org/privilege/ime
723  *
724  * @param[in] callback_func @c ime_candidate_select_cb() event callback function
725  * @param[in] user_data User data to be passed to the callback function
726  *
727  * @return 0 on success, otherwise a negative error value
728  * @retval #IME_ERROR_NONE No error
729  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
730  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
731  *
732  * @post The ime_run() function should be called to start to run IME application's main loop.
733  *
734  * @see ime_run()
735  */
736 int ime_event_set_candidate_select_cb(ime_candidate_select_cb callback_func, void *user_data);
737
738 /**
739  * @brief Sets @c ime_candidate_table_page_up_cb() event callback function.
740  *
741  * @since_tizen 5.5
742  *
743  * @privilege %http://tizen.org/privilege/ime
744  *
745  * @param[in] callback_func @c ime_candidate_table_page_up_cb() event callback function
746  * @param[in] user_data User data to be passed to the callback function
747  *
748  * @return 0 on success, otherwise a negative error value
749  * @retval #IME_ERROR_NONE No error
750  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
751  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
752  *
753  * @post The ime_run() function should be called to start to run IME application's main loop.
754  *
755  * @see ime_run()
756  */
757 int ime_event_set_candidate_table_page_up_cb(ime_candidate_table_page_up_cb callback_func, void *user_data);
758
759 /**
760  * @brief Sets @c ime_candidate_table_page_down_cb() event callback function.
761  *
762  * @since_tizen 5.5
763  *
764  * @privilege %http://tizen.org/privilege/ime
765  *
766  * @param[in] callback_func @c ime_candidate_table_page_down_cb() event callback function
767  * @param[in] user_data User data to be passed to the callback function
768  *
769  * @return 0 on success, otherwise a negative error value
770  * @retval #IME_ERROR_NONE No error
771  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
772  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
773  *
774  * @post The ime_run() function should be called to start to run IME application's main loop.
775  *
776  * @see ime_run()
777  */
778 int ime_event_set_candidate_table_page_down_cb(ime_candidate_table_page_down_cb callback_func, void *user_data);
779
780 /**
781  * @brief Sets @c ime_candidate_table_page_size_chaned_cb() event callback function.
782  *
783  * @since_tizen 5.5
784  *
785  * @privilege %http://tizen.org/privilege/ime
786  *
787  * @param[in] callback_func @c ime_candidate_table_page_size_chaned_cb() event callback function
788  * @param[in] user_data User data to be passed to the callback function
789  *
790  * @return 0 on success, otherwise a negative error value
791  * @retval #IME_ERROR_NONE No error
792  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
793  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
794  *
795  * @post The ime_run() function should be called to start to run IME application's main loop.
796  *
797  * @see ime_run()
798  */
799 int ime_event_set_candidate_table_page_size_chaned_cb(ime_candidate_table_page_size_chaned_cb callback_func, void *user_data);
800
801 /**
802  * @brief Sets @c ime_candidate_item_layout_set_cb() event callback function.
803  *
804  * @since_tizen 5.5
805  *
806  * @privilege %http://tizen.org/privilege/ime
807  *
808  * @param[in] callback_func @c ime_candidate_item_layout_set_cb() event callback function
809  * @param[in] user_data User data to be passed to the callback function
810  *
811  * @return 0 on success, otherwise a negative error value
812  * @retval #IME_ERROR_NONE No error
813  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
814  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
815  *
816  * @post The ime_run() function should be called to start to run IME application's main loop.
817  *
818  * @see ime_run()
819  */
820 int ime_event_set_candidate_item_layout_set_cb(ime_candidate_item_layout_set_cb callback_func, void *user_data);
821
822 /**
823  * @brief Sets @c ime_displayed_candidate_number_chaned_cb() event callback function.
824  *
825  * @since_tizen 5.5
826  *
827  * @privilege %http://tizen.org/privilege/ime
828  *
829  * @param[in] callback_func @c ime_displayed_candidate_number_chaned_cb() event callback function
830  * @param[in] user_data User data to be passed to the callback function
831  *
832  * @return 0 on success, otherwise a negative error value
833  * @retval #IME_ERROR_NONE No error
834  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
835  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
836  *
837  * @post The ime_run() function should be called to start to run IME application's main loop.
838  *
839  * @see ime_run()
840  */
841 int ime_event_set_displayed_candidate_number_chaned_cb(ime_displayed_candidate_number_chaned_cb callback_func, void *user_data);
842
843 /**
844  * @brief Sets @c ime_candidate_item_long_pressed_cb() event callback function.
845  *
846  * @since_tizen 5.5
847  *
848  * @privilege %http://tizen.org/privilege/ime
849  *
850  * @param[in] callback_func @c ime_candidate_item_long_pressed_cb() event callback function
851  * @param[in] user_data User data to be passed to the callback function
852  *
853  * @return 0 on success, otherwise a negative error value
854  * @retval #IME_ERROR_NONE No error
855  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
856  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
857  *
858  * @post The ime_run() function should be called to start to run IME application's main loop.
859  *
860  * @see ime_run()
861  */
862 int ime_event_set_candidate_item_long_pressed_cb(ime_candidate_item_long_pressed_cb callback_func, void *user_data);
863
864 /**
865  * @brief Requests to show aux string.
866  *
867  * @since_tizen 5.5
868  *
869  * @privilege %http://tizen.org/privilege/ime
870  *
871  * @return 0 on success, otherwise a negative error value
872  * @retval #IME_ERROR_NONE No error
873  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
874  */
875 int ime_show_aux_string(void);
876
877 /**
878  * @brief Requests to hide aux string.
879  *
880  * @since_tizen 5.5
881  *
882  * @privilege %http://tizen.org/privilege/ime
883  *
884  * @return 0 on success, otherwise a negative error value
885  * @retval #IME_ERROR_NONE No error
886  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
887  */
888 int ime_hide_aux_string(void);
889
890 /**
891  * @brief Requests to show lookup table.
892  *
893  * @since_tizen 5.5
894  *
895  * @privilege %http://tizen.org/privilege/ime
896  *
897  * @return 0 on success, otherwise a negative error value
898  * @retval #IME_ERROR_NONE No error
899  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
900  */
901 int ime_show_lookup_table(void);
902
903 /**
904  * @brief Requests to hide lookup table.
905  *
906  * @since_tizen 5.5
907  *
908  * @privilege %http://tizen.org/privilege/ime
909  *
910  * @return 0 on success, otherwise a negative error value
911  * @retval #IME_ERROR_NONE No error
912  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
913  */
914 int ime_hide_lookup_table(void);
915
916 /**
917  * @brief Requests to update preedit caret.
918  *
919  * @since_tizen 5.5
920  *
921  * @privilege %http://tizen.org/privilege/ime
922  *
923  * @param[in] caret The preedit caret
924  *
925  * @return 0 on success, otherwise a negative error value
926  * @retval #IME_ERROR_NONE No error
927  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
928  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
929  */
930 int ime_update_preedit_caret(int caret);
931
932 /**
933  * @brief Requests to update preedit string with commit string.
934  *
935  * @since_tizen 5.5
936  *
937  * @privilege %http://tizen.org/privilege/ime
938  *
939  * @param[in] preedit The UTF-8 string to be updated in preedit
940  * @param[in] commit The UTF-8 string to be committed
941  * @param[in] attrs @a preedit can be composed of multiple string attributes: underline, highlight color and reversal color
942  * @param[in] caret The preedit caret
943  *
944  * @return 0 on success, otherwise a negative error value
945  * @retval #IME_ERROR_NONE No error
946  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
947  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
948  */
949 int ime_update_preedit_string_with_commit(const char *preedit, const char *commit, scim::AttributeList &attrs, int caret);
950
951 /**
952  * @brief Requests to update aux string.
953  *
954  * @since_tizen 5.5
955  *
956  * @privilege %http://tizen.org/privilege/ime
957  *
958  * @param[in] str The aux string
959  *
960  * @return 0 on success, otherwise a negative error value
961  * @retval #IME_ERROR_NONE No error
962  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
963  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
964  */
965 int ime_update_aux_string(const char *str);
966
967 /**
968  * @brief Requests to update recapture string.
969  *
970  * @since_tizen 5.5
971  *
972  * @privilege %http://tizen.org/privilege/ime
973  *
974  * @param[in] offset The offset value from the cursor position
975  * @param[in] len The length of the preedit
976  * @param[in] preedit The UTF-8 string to be updated in preedit
977  * @param[in] commit The UTF-8 string to be committed
978  * @param[in] attrs @a preedit can be composed of multiple string attributes: underline, highlight color and reversal color
979  *
980  * @return 0 on success, otherwise a negative error value
981  * @retval #IME_ERROR_NONE No error
982  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
983  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
984  */
985 int ime_recapture_string(int offset, int len, const char *preedit, const char *commit, scim::AttributeList &attrs);
986
987 /**
988  * @brief Requests to update lookup table.
989  *
990  * @since_tizen 5.5
991  *
992  * @privilege %http://tizen.org/privilege/ime
993  *
994  * @param[in] table The lookup table
995  *
996  * @return 0 on success, otherwise a negative error value
997  * @retval #IME_ERROR_NONE No error
998  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
999  */
1000 int ime_update_lookup_table(scim::LookupTable &table);
1001
1002 /**
1003  * @brief Requests to register properties.
1004  *
1005  * @since_tizen 5.5
1006  *
1007  * @privilege %http://tizen.org/privilege/ime
1008  *
1009  * @param[in] properties The property list
1010  *
1011  * @return 0 on success, otherwise a negative error value
1012  * @retval #IME_ERROR_NONE No error
1013  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1014  */
1015 int ime_register_properties(scim::PropertyList &properties);
1016
1017 /**
1018  * @brief Requests to update property.
1019  *
1020  * @since_tizen 5.5
1021  *
1022  * @privilege %http://tizen.org/privilege/ime
1023  *
1024  * @param[in] property The imengine property
1025  *
1026  * @return 0 on success, otherwise a negative error value
1027  * @retval #IME_ERROR_NONE No error
1028  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1029  */
1030 int ime_update_property(scim::Property &property);
1031
1032 /**
1033  * @brief Requests to expand candidate.
1034  *
1035  * @since_tizen 5.5
1036  *
1037  * @privilege %http://tizen.org/privilege/ime
1038  *
1039  * @return 0 on success, otherwise a negative error value
1040  * @retval #IME_ERROR_NONE No error
1041  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1042  */
1043 int ime_expand_candidate(void);
1044
1045 /**
1046  * @brief Requests to contract candidate.
1047  *
1048  * @since_tizen 5.5
1049  *
1050  * @privilege %http://tizen.org/privilege/ime
1051  *
1052  * @return 0 on success, otherwise a negative error value
1053  * @retval #IME_ERROR_NONE No error
1054  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1055  */
1056 int ime_contract_candidate(void);
1057
1058 /**
1059  * @brief Requests to set candidate style.
1060  *
1061  * @since_tizen 5.5
1062  *
1063  * @privilege %http://tizen.org/privilege/ime
1064  *
1065  * @param[in] portrait_line The candidate portrait line
1066  * @param[in] mode The candidate mode
1067  *
1068  * @return 0 on success, otherwise a negative error value
1069  * @retval #IME_ERROR_NONE No error
1070  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1071  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1072  */
1073 int ime_set_candidate_style(scim::ISF_CANDIDATE_PORTRAIT_LINE_T portrait_line, scim::ISF_CANDIDATE_MODE_T mode);
1074
1075 /**
1076  * @brief Sets flag whether IMEngine is loaded by engine_loader.
1077  *
1078  * @since_tizen 5.5
1079  *
1080  * @privilege %http://tizen.org/privilege/ime
1081  *
1082  * @param[in] flag Set with Engine Loader mode
1083  * @return 0 on success, otherwise a negative error value
1084  * @retval #IME_ERROR_NONE No error
1085  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1086  * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
1087  */
1088 int ime_set_engine_loader_flag(bool flag);
1089
1090 /**
1091  * @brief Sends the key event processing result.
1092  *
1093  * @since_tizen 6.0
1094  *
1095  * @privilege %http://tizen.org/privilege/ime
1096  *
1097  * @param[in] is_success The result value to be sent, indicating whether the key event processing succeeded or not
1098  * @return 0 on success, otherwise a negative error value
1099  * @retval #IME_ERROR_NONE No error
1100  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1101  * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
1102  */
1103 int ime_send_key_event_processing_result(scim::KeyEvent &key, uint32_t serial, bool is_success);
1104
1105 #ifdef __cplusplus
1106 }
1107 #endif
1108
1109 #endif /* __TIZEN_UIX_INPUTMETHOD_INTERNAL_H__ */
1110