From a026fad7794dc7d900151cb4c11bde1bf1c69fce Mon Sep 17 00:00:00 2001 From: InHong Han Date: Mon, 5 Jun 2017 10:50:15 -0700 Subject: ecore_imf: add ecore_imf_context_mime_type_accept_set API Summary: Added a new api to send the mime type of entry to IME. Test Plan: Tested in Tizen device Reviewers: woohyun, id213sin, jihoon, cedric Reviewed By: cedric Subscribers: cedric, jihoon, jpeg Differential Revision: https://phab.enlightenment.org/D4929 Signed-off-by: Cedric BAIL --- src/lib/ecore_imf/Ecore_IMF.h | 21 +++++++++++++++++++++ src/lib/ecore_imf/ecore_imf_context.c | 16 ++++++++++++++++ 2 files changed, 37 insertions(+) (limited to 'src/lib/ecore_imf') diff --git a/src/lib/ecore_imf/Ecore_IMF.h b/src/lib/ecore_imf/Ecore_IMF.h index 08ae0e8dd6..9a27c20f52 100644 --- a/src/lib/ecore_imf/Ecore_IMF.h +++ b/src/lib/ecore_imf/Ecore_IMF.h @@ -728,6 +728,7 @@ struct _Ecore_IMF_Context_Class void (*bidi_direction_set) (Ecore_IMF_Context *ctx, Ecore_IMF_BiDi_Direction direction); /**< Set bidirectionality at the cursor position */ Ecore_IMF_Input_Panel_Keyboard_Mode (*keyboard_mode_get) (Ecore_IMF_Context *ctx); /**< Return the current keyboard mode of the input panel */ void (*prediction_hint_set) (Ecore_IMF_Context *ctx, const char *prediction_hint); /**< Set the prediction hint to the input panel */ + void (*mime_type_accept_set) (Ecore_IMF_Context *ctx, const char *mime_type); /**< Set the MIME type to the input panel */ }; /** @@ -1916,6 +1917,26 @@ EAPI Ecore_IMF_Input_Panel_Keyboard_Mode ecore_imf_context_keyboard_mode_get(Eco */ EAPI void ecore_imf_context_prediction_hint_set(Ecore_IMF_Context *ctx, const char *prediction_hint); +/** + * @ingroup Ecore_IMF_Context_Group + * @brief Sets the allowed MIME type to deliver to the input panel. + * + * @since 1.20.0 + * + * @param[in] ctx An #Ecore_IMF_Context + * @param[in] mime_type The allowed MIME type in entry + * + * Example + * @code + * const char *mime_type = "text/plain,image/png,application/pdf"; + * ecore_imf_context_mime_type_accept_set(imf_context, mime_type); + * @endcode + * + * @since_tizen 4.0 + * @endif + */ +EAPI void ecore_imf_context_mime_type_accept_set(Ecore_IMF_Context *ctx, const char *mime_type); + /* The following entry points must be exported by each input method module */ diff --git a/src/lib/ecore_imf/ecore_imf_context.c b/src/lib/ecore_imf/ecore_imf_context.c index e7f1f67d68..2ac7d59e7f 100644 --- a/src/lib/ecore_imf/ecore_imf_context.c +++ b/src/lib/ecore_imf/ecore_imf_context.c @@ -1420,4 +1420,20 @@ ecore_imf_context_prediction_hint_set(Ecore_IMF_Context *ctx, const char *predic if (ctx->klass->prediction_hint_set) ctx->klass->prediction_hint_set(ctx, prediction_hint); +} + +EAPI void +ecore_imf_context_mime_type_accept_set(Ecore_IMF_Context *ctx, const char *mime_type) +{ + if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) + { + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, + "ecore_imf_context_mime_type_accept_set"); + return; + } + + if (!mime_type) return; + + if (ctx->klass->mime_type_accept_set) + ctx->klass->mime_type_accept_set(ctx, mime_type); } \ No newline at end of file -- cgit v1.2.1