From 4dd598991f3395b6158cd4dd12af51ef2f794ab2 Mon Sep 17 00:00:00 2001 From: mike_m Date: Thu, 7 Jul 2011 11:55:05 +0000 Subject: [PATCH] ecore-imf: Add APIs for virtual keyboard support Signed-off-by: Jihoon Kim git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@61114 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/ecore_imf/ecore_imf_context.c | 90 +++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/src/lib/ecore_imf/ecore_imf_context.c b/src/lib/ecore_imf/ecore_imf_context.c index 06210d3..e95523e 100644 --- a/src/lib/ecore_imf/ecore_imf_context.c +++ b/src/lib/ecore_imf/ecore_imf_context.c @@ -1055,6 +1055,96 @@ ecore_imf_context_control_panel_hide (Ecore_IMF_Context *ctx) } /** + * Ask the Input Method Context to show the input panel (virtual keyboard). + * + * @param ctx An #Ecore_IMF_Context. + * @ingroup Ecore_IMF_Context_IMControl_Group + * @since 1.1.0 + */ +EAPI void +ecore_imf_context_input_panel_show(Ecore_IMF_Context *ctx) +{ + if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) + { + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, + "ecore_imf_context_input_panel_show"); + return; + } + + if (ctx->klass->show) ctx->klass->show(ctx); +} + +/** + * Ask the Input Method Context to hide the input panel. + * + * @param ctx An #Ecore_IMF_Context. + * @ingroup Ecore_IMF_Context_IMControl_Group + * @since 1.1.0 + */ +EAPI void +ecore_imf_context_input_panel_hide(Ecore_IMF_Context *ctx) +{ + if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) + { + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, + "ecore_imf_context_input_panel_hide"); + return; + } + + if (ctx->klass->hide) ctx->klass->hide(ctx); +} + +/** + * Set the layout of the input panel. + * + * @param ctx An #Ecore_IMF_Context. + * @param layout see #ECORE_IMF_INPUT_PANEL_LAYOUT + * @ingroup Ecore_IMF_Context_IMControl_Group + * @since 1.1.0 + */ +EAPI void +ecore_imf_context_input_panel_layout_set (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout) +{ + if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) + { + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, + "ecore_imf_context_input_panel_layout_set"); + return; + } + + if (ctx->klass->input_panel_layout_set) + ctx->klass->input_panel_layout_set(ctx, layout); + + ctx->input_panel_layout = layout; +} + +/** + * Get the layout of the current active input panel. + * + * @param ctx An #Ecore_IMF_Context. + * @return layout see #Ecore_IMF_Input_Panel_Layout + * @ingroup Ecore_IMF_Context_IMControl_Group + * @since 1.1.0 + */ +EAPI Ecore_IMF_Input_Panel_Layout +ecore_imf_context_input_panel_layout_get (Ecore_IMF_Context *ctx) +{ + if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) + { + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, + "ecore_imf_context_input_panel_layout_get"); + return ECORE_IMF_INPUT_PANEL_LAYOUT_INVALID; + } + + if (ctx->klass->input_panel_layout_get) + { + return ctx->input_panel_layout; + } + else + return ECORE_IMF_INPUT_PANEL_LAYOUT_INVALID; +} + +/** * Set the language of the input panel. * This API can be used when you want to show the English keyboard. * -- 2.7.4