summaryrefslogtreecommitdiff
path: root/src/lib/ecore_imf
diff options
context:
space:
mode:
authorJihoon Kim <jihoon48.kim@samsung.com>2017-05-02 16:28:10 +0900
committerJihoon Kim <jihoon48.kim@samsung.com>2017-05-02 16:28:10 +0900
commitea8196e411c81db352e85800921fb621e151bb84 (patch)
tree49bf170dd806450c4575ff23cc0a68e0373baa4d /src/lib/ecore_imf
parent2c16e586135741535a0a886c1163903a140d8517 (diff)
ecore_imf: Add ecore_imf_context_prediction_hint_set API
Summary: Added a new api to send the prediction hint string to IME. Test Plan: Tested in Tizen device Reviewers: woohyun, id213sin, jihoon Reviewed By: jihoon Subscribers: cedric, jsuya, z-wony, jpeg Differential Revision: https://phab.enlightenment.org/D4805
Diffstat (limited to 'src/lib/ecore_imf')
-rw-r--r--src/lib/ecore_imf/Ecore_IMF.h17
-rw-r--r--src/lib/ecore_imf/ecore_imf_context.c14
2 files changed, 31 insertions, 0 deletions
diff --git a/src/lib/ecore_imf/Ecore_IMF.h b/src/lib/ecore_imf/Ecore_IMF.h
index e411728..6e8804e 100644
--- a/src/lib/ecore_imf/Ecore_IMF.h
+++ b/src/lib/ecore_imf/Ecore_IMF.h
@@ -712,6 +712,7 @@ struct _Ecore_IMF_Context_Class
712 void (*input_hint_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Hints input_hints); /**< Sets input hint to fine-tune input methods behavior */ 712 void (*input_hint_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Hints input_hints); /**< Sets input hint to fine-tune input methods behavior */
713 void (*bidi_direction_set) (Ecore_IMF_Context *ctx, Ecore_IMF_BiDi_Direction direction); /**< Set bidirectionality at the cursor position */ 713 void (*bidi_direction_set) (Ecore_IMF_Context *ctx, Ecore_IMF_BiDi_Direction direction); /**< Set bidirectionality at the cursor position */
714 Ecore_IMF_Input_Panel_Keyboard_Mode (*keyboard_mode_get) (Ecore_IMF_Context *ctx); /**< Return the current keyboard mode of the input panel */ 714 Ecore_IMF_Input_Panel_Keyboard_Mode (*keyboard_mode_get) (Ecore_IMF_Context *ctx); /**< Return the current keyboard mode of the input panel */
715 void (*prediction_hint_set) (Ecore_IMF_Context *ctx, const char *prediction_hint); /**< Set the prediction hint to the input panel */
715}; 716};
716 717
717/** 718/**
@@ -1884,6 +1885,22 @@ EAPI Ecore_IMF_BiDi_Direction ecore_imf_context_bidi_direction_get(Ecore_IM
1884 */ 1885 */
1885EAPI Ecore_IMF_Input_Panel_Keyboard_Mode ecore_imf_context_keyboard_mode_get(Ecore_IMF_Context *ctx); 1886EAPI Ecore_IMF_Input_Panel_Keyboard_Mode ecore_imf_context_keyboard_mode_get(Ecore_IMF_Context *ctx);
1886 1887
1888/**
1889 * @ingroup Ecore_IMF_Context_Group
1890 * @brief Set the prediction hint string to deliver to the input panel.
1891 *
1892 * This API can be used when you want to set prediction hint to use intelligent reply suggestion service.
1893 * The intelligent reply suggestion service generates reply candidates for given prediction hint.
1894 * Example
1895 * prediction hint: How are you? -> result: I'm fine, Not bad, I'm all right.
1896 *
1897 * @since 1.20.0
1898 *
1899 * @param[in] ctx An #Ecore_IMF_Context
1900 * @param[in] prediction_hint The prediction hint string.
1901 */
1902EAPI void ecore_imf_context_prediction_hint_set(Ecore_IMF_Context *ctx, const char *prediction_hint);
1903
1887/* The following entry points must be exported by each input method module 1904/* The following entry points must be exported by each input method module
1888 */ 1905 */
1889 1906
diff --git a/src/lib/ecore_imf/ecore_imf_context.c b/src/lib/ecore_imf/ecore_imf_context.c
index 961c4ae..e7f1f67 100644
--- a/src/lib/ecore_imf/ecore_imf_context.c
+++ b/src/lib/ecore_imf/ecore_imf_context.c
@@ -1406,4 +1406,18 @@ ecore_imf_context_keyboard_mode_get(Ecore_IMF_Context *ctx)
1406 mode = ctx->klass->keyboard_mode_get(ctx); 1406 mode = ctx->klass->keyboard_mode_get(ctx);
1407 1407
1408 return mode; 1408 return mode;
1409}
1410
1411EAPI void
1412ecore_imf_context_prediction_hint_set(Ecore_IMF_Context *ctx, const char *prediction_hint)
1413{
1414 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1415 {
1416 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1417 "ecore_imf_context_prediction_hint_set");
1418 return;
1419 }
1420
1421 if (ctx->klass->prediction_hint_set)
1422 ctx->klass->prediction_hint_set(ctx, prediction_hint);
1409} \ No newline at end of file 1423} \ No newline at end of file