Merge branch 'tizen_6.0' into tizen
[platform/core/api/inputmethod.git] / inputmethod / include / inputmethod_internal.h
1 /*
2  * Copyright (c) 2014-2021 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  * @param[in] command The command to be sent.
424  * @param[in] value The value corresponding to the command.
425  *
426  * @return 0 on success, otherwise a negative error value
427  * @retval #IME_ERROR_NONE No error
428  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
429  */
430 int ime_send_imengine_event(int command, unsigned int value);
431
432 /**
433  * @brief Sends the selected item index in the candidate list.
434  *
435  * @since_tizen 3.0
436  *
437  * @privilege %http://tizen.org/privilege/ime
438  *
439  * @param[in] index the selected index in the candidate list
440  *
441  * @return 0 on success, otherwise a negative error value
442  * @retval #IME_ERROR_NONE No error
443  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
444  * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
445  */
446 int ime_select_candidate(unsigned int index);
447
448 /**
449  * @brief Sends the input context event.
450  *
451  * @since_tizen 3.0
452  *
453  * @privilege %http://tizen.org/privilege/ime
454  *
455  * @param[in] type the event type
456  * @param[in] value the event value
457  *
458  * @return 0 on success, otherwise a negative error value
459  * @retval #IME_ERROR_NONE No error
460  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
461  * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
462  */
463 int ime_update_input_context(unsigned int type, unsigned int value);
464
465 /**
466  * @brief Requests IME to initialize explicitly.
467  *
468  * @details When using ime_run() API, the initialize / prepare / finalize procedures
469  * are processed automatically inside the IME application loop.
470  * But in case of not using ime_run() API, which means the IME application has
471  * its own main loop, these procedures need to be requested explicitly.
472  *
473  * @since_tizen 4.0
474  *
475  * @privilege %http://tizen.org/privilege/ime
476  *
477  * @return 0 on success, otherwise a negative error value
478  * @retval #IME_ERROR_NONE No error
479  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
480  */
481 int ime_initialize(void);
482
483 /**
484  * @brief Requests IME to prepare resources such as IME window and socket connection.
485  *
486  * @details Like ime_initialize() function, this procedure is automatically processed
487  * when using ime_run() API. Call this function only when ime_run() is not used and
488  * the IME application has to handle main loop by itself.
489  *
490  * @since_tizen 4.0
491  *
492  * @privilege %http://tizen.org/privilege/ime
493  *
494  * @return 0 on success, otherwise a negative error value
495  * @retval #IME_ERROR_NONE No error
496  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
497  * @retval #IME_ERROR_OPERATION_FAILED Operation failed
498  */
499 int ime_prepare(void);
500
501 /**
502  * @brief Requests IME to finalize explicitly.
503  *
504  * @since_tizen 4.0
505  *
506  * @privilege %http://tizen.org/privilege/ime
507  *
508  * @return 0 on success, otherwise a negative error value
509  * @retval #IME_ERROR_NONE No error
510  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
511  */
512 int ime_finalize(void);
513
514 /**
515  * @brief Sets flag whether IME is called from dotnet.
516  *
517  * @since_tizen 4.0
518  *
519  * @privilege %http://tizen.org/privilege/ime
520  *
521  * @param[in] set Set with Dotnet mode
522  * @return 0 on success, otherwise a negative error value
523  * @retval #IME_ERROR_NONE No error
524  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
525  */
526 int ime_set_dotnet_flag(bool set);
527
528 /**
529  * @brief Sets flag whether creating IME window should be deferred until there is a access request.
530  *
531  * @since_tizen 5.0
532  *
533  * @privilege %http://tizen.org/privilege/ime
534  *
535  * @param[in] flag true if deferring window creation is desired
536  * @return 0 on success, otherwise a negative error value
537  * @retval #IME_ERROR_NONE No error
538  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
539  */
540 int ime_set_window_creation_defer_flag(bool flag);
541
542 /**
543  * @brief Sets @c ime_optimization_hint_set_cb() event callback function.
544  *
545  * @since_tizen 5.0
546  *
547  * @privilege %http://tizen.org/privilege/ime
548  *
549  * @remarks The ime_optimization_hint_set_cb() callback function is called when an optimization hint is set
550  *
551  * @param[in] callback_func @c ime_optimization_hint_set_cb() event callback function
552  * @param[in] user_data User data to be passed to the callback function
553  *
554  * @return 0 on success, otherwise a negative error value
555  * @retval #IME_ERROR_NONE No error
556  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
557  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
558  * @retval #IME_ERROR_OPERATION_FAILED Operation failed
559  *
560  * @post The ime_run() function should be called to start to run IME application's main loop.
561  *
562  * @see ime_run()
563  */
564 int ime_event_set_optimization_hint_set_cb(ime_optimization_hint_set_cb callback_func, void *user_data);
565
566 /**
567  * @brief Sets @c ime_process_key_event_with_imengine_cb() event callback function.
568  *
569  * @since_tizen 5.5
570  *
571  * @privilege %http://tizen.org/privilege/ime
572  *
573  * @remarks The ime_process_key_event_cb() callback function is called when the key event
574  * is received from the external keyboard devices or ime_send_key_event() function.
575  *
576  * @param[in] callback_func @c ime_process_key_event_with_imengine_cb() event callback function
577  * @param[in] user_data User data to be passed to the callback function
578  *
579  * @return 0 on success, otherwise a negative error value
580  * @retval #IME_ERROR_NONE No error
581  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
582  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
583  *
584  * @post The ime_run() function should be called to start to run IME application's main loop.
585  *
586  * @see ime_run()
587  */
588 int ime_event_set_process_key_event_with_imengine_cb(ime_process_key_event_with_imengine_cb callback_func, void *user_data);
589
590 /**
591  * @brief Sets @c ime_autocapital_type_set_cb() event callback function.
592  *
593  * @since_tizen 5.5
594  *
595  * @privilege %http://tizen.org/privilege/ime
596  *
597  * @remarks The ime_autocapital_type_set_cb() callback function is called when an optimization hint is set
598  *
599  * @param[in] callback_func @c ime_autocapital_type_set_cb() event callback function
600  * @param[in] user_data User data to be passed to the callback function
601  *
602  * @return 0 on success, otherwise a negative error value
603  * @retval #IME_ERROR_NONE No error
604  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
605  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
606  *
607  * @post The ime_run() function should be called to start to run IME application's main loop.
608  *
609  * @see ime_run()
610  */
611 int ime_event_set_autocapital_type_set_cb(ime_autocapital_type_set_cb callback_func, void *user_data);
612
613 /**
614  * @brief Sets @c ime_prediction_allow_set_cb() event callback function.
615  *
616  * @since_tizen 5.5
617  *
618  * @privilege %http://tizen.org/privilege/ime
619  *
620  * @remarks The ime_prediction_allow_set_cb() callback function is called when an optimization hint is set
621  *
622  * @param[in] callback_func @c ime_prediction_allow_set_cb() event callback function
623  * @param[in] user_data User data to be passed to the callback function
624  *
625  * @return 0 on success, otherwise a negative error value
626  * @retval #IME_ERROR_NONE No error
627  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
628  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
629  *
630  * @post The ime_run() function should be called to start to run IME application's main loop.
631  *
632  * @see ime_run()
633  */
634 int ime_event_set_prediction_allow_set_cb(ime_prediction_allow_set_cb callback_func, void *user_data);
635
636 /**
637  * @brief Sets @c ime_trigger_property_set_cb() event callback function.
638  *
639  * @since_tizen 5.5
640  *
641  * @privilege %http://tizen.org/privilege/ime
642  *
643  * @param[in] callback_func @c ime_trigger_property_set_cb() event callback function
644  * @param[in] user_data User data to be passed to the callback function
645  *
646  * @return 0 on success, otherwise a negative error value
647  * @retval #IME_ERROR_NONE No error
648  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
649  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
650  *
651  * @post The ime_run() function should be called to start to run IME application's main loop.
652  *
653  * @see ime_run()
654  */
655 int ime_event_set_trigger_property_set_cb(ime_trigger_property_set_cb callback_func, void *user_data);
656
657 /**
658  * @brief Sets @c ime_candidate_more_window_show_cb() event callback function.
659  *
660  * @since_tizen 5.5
661  *
662  * @privilege %http://tizen.org/privilege/ime
663  *
664  * @param[in] callback_func @c ime_candidate_more_window_show_cb() event callback function
665  * @param[in] user_data User data to be passed to the callback function
666  *
667  * @return 0 on success, otherwise a negative error value
668  * @retval #IME_ERROR_NONE No error
669  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
670  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
671  *
672  * @post The ime_run() function should be called to start to run IME application's main loop.
673  *
674  * @see ime_run()
675  */
676 int ime_event_set_candidate_more_window_show_cb(ime_candidate_more_window_show_cb callback_func, void *user_data);
677
678 /**
679  * @brief Sets @c ime_candidate_more_window_hide_cb() event callback function.
680  *
681  * @since_tizen 5.5
682  *
683  * @privilege %http://tizen.org/privilege/ime
684  *
685  * @param[in] callback_func @c ime_candidate_more_window_hide_cb() event callback function
686  * @param[in] user_data User data to be passed to the callback function
687  *
688  * @return 0 on success, otherwise a negative error value
689  * @retval #IME_ERROR_NONE No error
690  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
691  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
692  *
693  * @post The ime_run() function should be called to start to run IME application's main loop.
694  *
695  * @see ime_run()
696  */
697 int ime_event_set_candidate_more_window_hide_cb(ime_candidate_more_window_hide_cb callback_func, void *user_data);
698
699 /**
700  * @brief Sets @c ime_aux_select_cb() event callback function.
701  *
702  * @since_tizen 5.5
703  *
704  * @privilege %http://tizen.org/privilege/ime
705  *
706  * @param[in] callback_func @c ime_aux_select_cb() event callback function
707  * @param[in] user_data User data to be passed to the callback function
708  *
709  * @return 0 on success, otherwise a negative error value
710  * @retval #IME_ERROR_NONE No error
711  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
712  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
713  *
714  * @post The ime_run() function should be called to start to run IME application's main loop.
715  *
716  * @see ime_run()
717  */
718 int ime_event_set_aux_select_cb(ime_aux_select_cb callback_func, void *user_data);
719
720 /**
721  * @brief Sets @c ime_candidate_select_cb() event callback function.
722  *
723  * @since_tizen 5.5
724  *
725  * @privilege %http://tizen.org/privilege/ime
726  *
727  * @param[in] callback_func @c ime_candidate_select_cb() event callback function
728  * @param[in] user_data User data to be passed to the callback function
729  *
730  * @return 0 on success, otherwise a negative error value
731  * @retval #IME_ERROR_NONE No error
732  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
733  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
734  *
735  * @post The ime_run() function should be called to start to run IME application's main loop.
736  *
737  * @see ime_run()
738  */
739 int ime_event_set_candidate_select_cb(ime_candidate_select_cb callback_func, void *user_data);
740
741 /**
742  * @brief Sets @c ime_candidate_table_page_up_cb() event callback function.
743  *
744  * @since_tizen 5.5
745  *
746  * @privilege %http://tizen.org/privilege/ime
747  *
748  * @param[in] callback_func @c ime_candidate_table_page_up_cb() event callback function
749  * @param[in] user_data User data to be passed to the callback function
750  *
751  * @return 0 on success, otherwise a negative error value
752  * @retval #IME_ERROR_NONE No error
753  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
754  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
755  *
756  * @post The ime_run() function should be called to start to run IME application's main loop.
757  *
758  * @see ime_run()
759  */
760 int ime_event_set_candidate_table_page_up_cb(ime_candidate_table_page_up_cb callback_func, void *user_data);
761
762 /**
763  * @brief Sets @c ime_candidate_table_page_down_cb() event callback function.
764  *
765  * @since_tizen 5.5
766  *
767  * @privilege %http://tizen.org/privilege/ime
768  *
769  * @param[in] callback_func @c ime_candidate_table_page_down_cb() event callback function
770  * @param[in] user_data User data to be passed to the callback function
771  *
772  * @return 0 on success, otherwise a negative error value
773  * @retval #IME_ERROR_NONE No error
774  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
775  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
776  *
777  * @post The ime_run() function should be called to start to run IME application's main loop.
778  *
779  * @see ime_run()
780  */
781 int ime_event_set_candidate_table_page_down_cb(ime_candidate_table_page_down_cb callback_func, void *user_data);
782
783 /**
784  * @brief Sets @c ime_candidate_table_page_size_chaned_cb() event callback function.
785  *
786  * @since_tizen 5.5
787  *
788  * @privilege %http://tizen.org/privilege/ime
789  *
790  * @param[in] callback_func @c ime_candidate_table_page_size_chaned_cb() event callback function
791  * @param[in] user_data User data to be passed to the callback function
792  *
793  * @return 0 on success, otherwise a negative error value
794  * @retval #IME_ERROR_NONE No error
795  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
796  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
797  *
798  * @post The ime_run() function should be called to start to run IME application's main loop.
799  *
800  * @see ime_run()
801  */
802 int ime_event_set_candidate_table_page_size_chaned_cb(ime_candidate_table_page_size_chaned_cb callback_func, void *user_data);
803
804 /**
805  * @brief Sets @c ime_candidate_item_layout_set_cb() event callback function.
806  *
807  * @since_tizen 5.5
808  *
809  * @privilege %http://tizen.org/privilege/ime
810  *
811  * @param[in] callback_func @c ime_candidate_item_layout_set_cb() event callback function
812  * @param[in] user_data User data to be passed to the callback function
813  *
814  * @return 0 on success, otherwise a negative error value
815  * @retval #IME_ERROR_NONE No error
816  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
817  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
818  *
819  * @post The ime_run() function should be called to start to run IME application's main loop.
820  *
821  * @see ime_run()
822  */
823 int ime_event_set_candidate_item_layout_set_cb(ime_candidate_item_layout_set_cb callback_func, void *user_data);
824
825 /**
826  * @brief Sets @c ime_displayed_candidate_number_chaned_cb() event callback function.
827  *
828  * @since_tizen 5.5
829  *
830  * @privilege %http://tizen.org/privilege/ime
831  *
832  * @param[in] callback_func @c ime_displayed_candidate_number_chaned_cb() event callback function
833  * @param[in] user_data User data to be passed to the callback function
834  *
835  * @return 0 on success, otherwise a negative error value
836  * @retval #IME_ERROR_NONE No error
837  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
838  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
839  *
840  * @post The ime_run() function should be called to start to run IME application's main loop.
841  *
842  * @see ime_run()
843  */
844 int ime_event_set_displayed_candidate_number_chaned_cb(ime_displayed_candidate_number_chaned_cb callback_func, void *user_data);
845
846 /**
847  * @brief Sets @c ime_candidate_item_long_pressed_cb() event callback function.
848  *
849  * @since_tizen 5.5
850  *
851  * @privilege %http://tizen.org/privilege/ime
852  *
853  * @param[in] callback_func @c ime_candidate_item_long_pressed_cb() event callback function
854  * @param[in] user_data User data to be passed to the callback function
855  *
856  * @return 0 on success, otherwise a negative error value
857  * @retval #IME_ERROR_NONE No error
858  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
859  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
860  *
861  * @post The ime_run() function should be called to start to run IME application's main loop.
862  *
863  * @see ime_run()
864  */
865 int ime_event_set_candidate_item_long_pressed_cb(ime_candidate_item_long_pressed_cb callback_func, void *user_data);
866
867 /**
868  * @brief Requests to show aux string.
869  *
870  * @since_tizen 5.5
871  *
872  * @privilege %http://tizen.org/privilege/ime
873  *
874  * @return 0 on success, otherwise a negative error value
875  * @retval #IME_ERROR_NONE No error
876  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
877  */
878 int ime_show_aux_string(void);
879
880 /**
881  * @brief Requests to hide aux string.
882  *
883  * @since_tizen 5.5
884  *
885  * @privilege %http://tizen.org/privilege/ime
886  *
887  * @return 0 on success, otherwise a negative error value
888  * @retval #IME_ERROR_NONE No error
889  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
890  */
891 int ime_hide_aux_string(void);
892
893 /**
894  * @brief Requests to show lookup table.
895  *
896  * @since_tizen 5.5
897  *
898  * @privilege %http://tizen.org/privilege/ime
899  *
900  * @return 0 on success, otherwise a negative error value
901  * @retval #IME_ERROR_NONE No error
902  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
903  */
904 int ime_show_lookup_table(void);
905
906 /**
907  * @brief Requests to hide lookup table.
908  *
909  * @since_tizen 5.5
910  *
911  * @privilege %http://tizen.org/privilege/ime
912  *
913  * @return 0 on success, otherwise a negative error value
914  * @retval #IME_ERROR_NONE No error
915  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
916  */
917 int ime_hide_lookup_table(void);
918
919 /**
920  * @brief Requests to update preedit caret.
921  *
922  * @since_tizen 5.5
923  *
924  * @privilege %http://tizen.org/privilege/ime
925  *
926  * @param[in] caret The preedit caret
927  *
928  * @return 0 on success, otherwise a negative error value
929  * @retval #IME_ERROR_NONE No error
930  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
931  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
932  */
933 int ime_update_preedit_caret(int caret);
934
935 /**
936  * @brief Requests to update preedit string with commit string.
937  *
938  * @since_tizen 5.5
939  *
940  * @privilege %http://tizen.org/privilege/ime
941  *
942  * @param[in] preedit The UTF-8 string to be updated in preedit
943  * @param[in] commit The UTF-8 string to be committed
944  * @param[in] attrs @a preedit can be composed of multiple string attributes: underline, highlight color and reversal color
945  * @param[in] caret The preedit caret
946  *
947  * @return 0 on success, otherwise a negative error value
948  * @retval #IME_ERROR_NONE No error
949  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
950  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
951  */
952 int ime_update_preedit_string_with_commit(const char *preedit, const char *commit, scim::AttributeList &attrs, int caret);
953
954 /**
955  * @brief Requests to update aux string.
956  *
957  * @since_tizen 5.5
958  *
959  * @privilege %http://tizen.org/privilege/ime
960  *
961  * @param[in] str The aux string
962  *
963  * @return 0 on success, otherwise a negative error value
964  * @retval #IME_ERROR_NONE No error
965  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
966  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
967  */
968 int ime_update_aux_string(const char *str);
969
970 /**
971  * @brief Requests to update recapture string.
972  *
973  * @since_tizen 5.5
974  *
975  * @privilege %http://tizen.org/privilege/ime
976  *
977  * @param[in] offset The offset value from the cursor position
978  * @param[in] len The length of the preedit
979  * @param[in] preedit The UTF-8 string to be updated in preedit
980  * @param[in] commit The UTF-8 string to be committed
981  * @param[in] attrs @a preedit can be composed of multiple string attributes: underline, highlight color and reversal color
982  *
983  * @return 0 on success, otherwise a negative error value
984  * @retval #IME_ERROR_NONE No error
985  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
986  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
987  */
988 int ime_recapture_string(int offset, int len, const char *preedit, const char *commit, scim::AttributeList &attrs);
989
990 /**
991  * @brief Requests to update lookup table.
992  *
993  * @since_tizen 5.5
994  *
995  * @privilege %http://tizen.org/privilege/ime
996  *
997  * @param[in] table The lookup table
998  *
999  * @return 0 on success, otherwise a negative error value
1000  * @retval #IME_ERROR_NONE No error
1001  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1002  */
1003 int ime_update_lookup_table(scim::LookupTable &table);
1004
1005 /**
1006  * @brief Requests to register properties.
1007  *
1008  * @since_tizen 5.5
1009  *
1010  * @privilege %http://tizen.org/privilege/ime
1011  *
1012  * @param[in] properties The property list
1013  *
1014  * @return 0 on success, otherwise a negative error value
1015  * @retval #IME_ERROR_NONE No error
1016  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1017  */
1018 int ime_register_properties(scim::PropertyList &properties);
1019
1020 /**
1021  * @brief Requests to update property.
1022  *
1023  * @since_tizen 5.5
1024  *
1025  * @privilege %http://tizen.org/privilege/ime
1026  *
1027  * @param[in] property The imengine property
1028  *
1029  * @return 0 on success, otherwise a negative error value
1030  * @retval #IME_ERROR_NONE No error
1031  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1032  */
1033 int ime_update_property(scim::Property &property);
1034
1035 /**
1036  * @brief Requests to expand candidate.
1037  *
1038  * @since_tizen 5.5
1039  *
1040  * @privilege %http://tizen.org/privilege/ime
1041  *
1042  * @return 0 on success, otherwise a negative error value
1043  * @retval #IME_ERROR_NONE No error
1044  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1045  */
1046 int ime_expand_candidate(void);
1047
1048 /**
1049  * @brief Requests to contract candidate.
1050  *
1051  * @since_tizen 5.5
1052  *
1053  * @privilege %http://tizen.org/privilege/ime
1054  *
1055  * @return 0 on success, otherwise a negative error value
1056  * @retval #IME_ERROR_NONE No error
1057  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1058  */
1059 int ime_contract_candidate(void);
1060
1061 /**
1062  * @brief Requests to set candidate style.
1063  *
1064  * @since_tizen 5.5
1065  *
1066  * @privilege %http://tizen.org/privilege/ime
1067  *
1068  * @param[in] portrait_line The candidate portrait line
1069  * @param[in] mode The candidate mode
1070  *
1071  * @return 0 on success, otherwise a negative error value
1072  * @retval #IME_ERROR_NONE No error
1073  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1074  * @retval #IME_ERROR_INVALID_PARAMETER Invalid parameter
1075  */
1076 int ime_set_candidate_style(scim::ISF_CANDIDATE_PORTRAIT_LINE_T portrait_line, scim::ISF_CANDIDATE_MODE_T mode);
1077
1078 /**
1079  * @brief Sets flag whether IMEngine is loaded by engine_loader.
1080  *
1081  * @since_tizen 5.5
1082  *
1083  * @privilege %http://tizen.org/privilege/ime
1084  *
1085  * @param[in] flag Set with Engine Loader mode
1086  * @return 0 on success, otherwise a negative error value
1087  * @retval #IME_ERROR_NONE No error
1088  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1089  * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
1090  */
1091 int ime_set_engine_loader_flag(bool flag);
1092
1093 /**
1094  * @brief Sends the key event processing result.
1095  *
1096  * @since_tizen 6.0
1097  *
1098  * @privilege %http://tizen.org/privilege/ime
1099  *
1100  * @param[in] is_success The result value to be sent, indicating whether the key event processing succeeded or not
1101  * @return 0 on success, otherwise a negative error value
1102  * @retval #IME_ERROR_NONE No error
1103  * @retval #IME_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function
1104  * @retval #IME_ERROR_NOT_RUNNING IME main loop isn't started yet
1105  */
1106 int ime_send_key_event_processing_result(scim::KeyEvent &key, uint32_t serial, bool is_success);
1107
1108 #ifdef __cplusplus
1109 }
1110 #endif
1111
1112 #endif /* __TIZEN_UIX_INPUTMETHOD_INTERNAL_H__ */
1113