Hi, EFL developers.
For supporting virtual keyboard, I'd like to add some APIs.
The detail description of each API is included in the patch file as doxygen
format.
In the attached patch, the reason why we add the subprefix 'input_panel_'
related to virtual keyboard is
that input method can be soft keyboard or voice input or image captured by
camera.
Would you please review this patch?
Index: ecore_imf_private.h
===================================================================
--- ecore_imf_private.h (revision 59796)
+++ ecore_imf_private.h (working copy)
@@ -48,6 +48,8 @@ struct _Ecore_IMF_Context
Eina_Bool (*retrieve_surrounding_func)(void *data,
Ecore_IMF_Context *ctx, char **text, int *cursor_pos);
void *retrieve_surrounding_data;
Ecore_IMF_Autocapital_Type autocapital_type;
+ Ecore_IMF_Input_Panel_Layout input_panel_layout;
+ Ecore_IMF_Input_Panel_Lang input_panel_lang;
Eina_Bool allow_prediction : 1;
};
Index: ecore_imf_context.c
===================================================================
--- ecore_imf_context.c (revision 59796)
+++ ecore_imf_context.c (working copy)
@@ -986,3 +986,90 @@ ecore_imf_context_delete_surrounding_event_add(Eco
ecore_event_add(ECORE_IMF_EVENT_DELETE_SURROUNDING,
ev, _ecore_imf_event_free_delete_surrounding, NULL);
}
+
+/**
+ * Ask the Input Method Context to show the control panel of using Input
Method.
+ *
+ * @param ctx An #Ecore_IMF_Context.
+ * @ingroup Ecore_IMF_Context_IMControl_Group
+ * @since 1.1.0
+ */
+EAPI void
+ecore_imf_context_control_panel_show (Ecore_IMF_Context *ctx)
+{
+ if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
+ {
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_control_panel_show");
+ return;
+ }
+
+ if (ctx->klass->control_panel_show) ctx->klass->control_panel_show(ctx);
+}
+
+/**
+ * Ask the Input Method Context to hide the control panel of using Input
Method.
+ *
+ * @param ctx An #Ecore_IMF_Context.
+ * @ingroup Ecore_IMF_Context_IMControl_Group
+ * @since 1.1.0
+ */
+EAPI void
+ecore_imf_context_control_panel_hide (Ecore_IMF_Context *ctx)
+{
+ if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
+ {
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_control_panel_hide");
+ return;
+ }
+
+ if (ctx->klass->control_panel_hide) ctx->klass->control_panel_hide(ctx);
+}
+
+/**
+ * Set the language of the input panel.
+ * This API can be used when you want to show the English keyboard.
+ *
+ * @param ctx An #Ecore_IMF_Context.
+ * @param lang the language to be set to the input panel.
+ * @ingroup Ecore_IMF_Context_IMControl_Group
+ * @since 1.1.0
+ */
+EAPI void
+ecore_imf_context_input_panel_language_set (Ecore_IMF_Context *ctx,
Ecore_IMF_Input_Panel_Lang lang)
+{
+ if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
+ {
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_input_panel_language_set");
+ return;
+ }
+
+ if (ctx->klass->input_panel_language_set)
ctx->klass->input_panel_language_set(ctx, lang);
+ ctx->input_panel_lang = lang;
+}
+
+/**
+ * Get the language of the input panel.
+ *
+ * See @ref ecore_imf_context_input_panel_language_set for more details.
+ *
+ * @param ctx An #Ecore_IMF_Context.
+ * @return Ecore_IMF_Input_Panel_Lang
+ * @ingroup Ecore_IMF_Context_IMControl_Group
+ * @since 1.1.0
+ */
+EAPI Ecore_IMF_Input_Panel_Lang
+ecore_imf_context_input_panel_language_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_language_get");
+ return ECORE_IMF_INPUT_PANEL_LANG_AUTOMATIC;
+ }
+
+ return ctx->input_panel_lang;
+}
+
Index: Ecore_IMF.h
===================================================================
--- Ecore_IMF.h (revision 59796)
+++ Ecore_IMF.h (working copy)
@@ -128,6 +128,25 @@ typedef enum
ECORE_IMF_AUTOCAPITAL_TYPE_ALLCHARACTER
} Ecore_IMF_Autocapital_Type;
+typedef enum
+{
+ ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL, /**< Default layout */
+ ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBER, /**< Number layout */
+ ECORE_IMF_INPUT_PANEL_LAYOUT_EMAIL, /**< Email layout */
+ ECORE_IMF_INPUT_PANEL_LAYOUT_URL, /**< URL layout */
+ ECORE_IMF_INPUT_PANEL_LAYOUT_PHONENUMBER, /**< Phone Number layout */
+ ECORE_IMF_INPUT_PANEL_LAYOUT_IP, /**< IP layout */
+ ECORE_IMF_INPUT_PANEL_LAYOUT_MONTH, /**< Month layout */
+ ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY, /**< Number Only layout */
+ ECORE_IMF_INPUT_PANEL_LAYOUT_INVALID
+} Ecore_IMF_Input_Panel_Layout;
+
+typedef enum
+{
+ ECORE_IMF_INPUT_PANEL_LANG_AUTOMATIC, /**< Automatic */
+ ECORE_IMF_INPUT_PANEL_LANG_ALPHABET /**< Alphabet */
+} Ecore_IMF_Input_Panel_Lang;
+
struct _Ecore_IMF_Event_Preedit_Start
{
Ecore_IMF_Context *ctx;
@@ -305,6 +324,12 @@ struct _Ecore_IMF_Context_Class
void (*preedit_string_with_attributes_get) (Ecore_IMF_Context *ctx, char
**str, Eina_List **attrs, int *cursor_pos);
void (*prediction_allow_set)(Ecore_IMF_Context *ctx, Eina_Bool prediction);
void (*autocapital_type_set)(Ecore_IMF_Context *ctx,
Ecore_IMF_Autocapital_Type autocapital_type);
+ void (*control_panel_show) (Ecore_IMF_Context *ctx);
+ void (*control_panel_hide) (Ecore_IMF_Context *ctx);
+ void (*input_panel_layout_set) (Ecore_IMF_Context *ctx,
Ecore_IMF_Input_Panel_Layout layout);
+ Ecore_IMF_Input_Panel_Layout (*input_panel_layout_get) (Ecore_IMF_Context
*ctx);
+ void (*input_panel_language_set) (Ecore_IMF_Context *ctx,
Ecore_IMF_Input_Panel_Lang lang);
+ Ecore_IMF_Input_Panel_Lang (*input_panel_language_get) (Ecore_IMF_Context
*ctx);
};
struct _Ecore_IMF_Context_Info
@@ -363,6 +388,16 @@ EAPI Eina_Bool ecore_imf_conte
EAPI void
ecore_imf_context_autocapital_type_set(Ecore_IMF_Context *ctx,
Ecore_IMF_Autocapital_Type autocapital_type);
EAPI Ecore_IMF_Autocapital_Type
ecore_imf_context_autocapital_type_get(Ecore_IMF_Context *ctx);
+EAPI void
ecore_imf_context_control_panel_show(Ecore_IMF_Context *ctx);
+EAPI void
ecore_imf_context_control_panel_hide(Ecore_IMF_Context *ctx);
+
+EAPI void
ecore_imf_context_input_panel_show(Ecore_IMF_Context *ctx);
+EAPI void
ecore_imf_context_input_panel_hide(Ecore_IMF_Context *ctx);
+EAPI void
ecore_imf_context_input_panel_layout_set(Ecore_IMF_Context *ctx,
Ecore_IMF_Input_Panel_Layout layout);
+EAPI Ecore_IMF_Input_Panel_Layout
ecore_imf_context_input_panel_layout_get(Ecore_IMF_Context *ctx);
+EAPI void
ecore_imf_context_input_panel_language_set(Ecore_IMF_Context *ctx,
Ecore_IMF_Input_Panel_Lang lang);
+EAPI Ecore_IMF_Input_Panel_Lang
ecore_imf_context_input_panel_language_get(Ecore_IMF_Context *ctx);
+
/* The following entry points must be exported by each input method module
*/
------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery,
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now.
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel