Ecore_Imf: Merge Tizen changes to upstream EFL.

SVN revision: 73204
This commit is contained in:
Christopher Michael 2012-07-03 07:39:08 +00:00
parent bf69d7dcc6
commit 1d5c7fd1ec
2 changed files with 197 additions and 0 deletions

View File

@ -38,6 +38,35 @@ extern "C" {
*
* @{
*/
/* ecore_imf_context_input_panel_event_callback_add() flag */
typedef enum
{
ECORE_IMF_INPUT_PANEL_STATE_EVENT, /**< called when the state of the input panel is changed. */
ECORE_IMF_INPUT_PANEL_LANGUAGE_EVENT, /**< called when the language of the input panel is changed. */
ECORE_IMF_INPUT_PANEL_SHIFT_MODE_EVENT, /**< called when the shift key state of the input panel is changed */
ECORE_IMF_INPUT_PANEL_GEOMETRY_EVENT, /**< called when the size of the input panel is changed. */
ECORE_IMF_CANDIDATE_PANEL_STATE_EVENT, /**< called when the state of the candidate word panel is changed. */
ECORE_IMF_CANDIDATE_PANEL_GEOMETRY_EVENT /**< called when the size of the candidate word panel is changed. */
} Ecore_IMF_Input_Panel_Event;
typedef enum
{
ECORE_IMF_INPUT_PANEL_STATE_SHOW, /**< Notification after the display of the input panel */
ECORE_IMF_INPUT_PANEL_STATE_HIDE, /**< Notification prior to the dismissal of the input panel */
ECORE_IMF_INPUT_PANEL_STATE_WILL_SHOW /**< Notification prior to the display of the input panel */
} Ecore_IMF_Input_Panel_State;
typedef enum
{
ECORE_IMF_INPUT_PANEL_SHIFT_MODE_OFF,
ECORE_IMF_INPUT_PANEL_SHIFT_MODE_ON
} Ecore_IMF_Input_Panel_Shift_Mode;
typedef enum
{
ECORE_IMF_CANDIDATE_PANEL_SHOW, /**< Notification after the display of the candidate word panel */
ECORE_IMF_CANDIDATE_PANEL_HIDE /**< Notification prior to the dismissal of the candidate word panel */
} Ecore_IMF_Candidate_Panel_State;
/* Events sent by the Input Method */
typedef struct _Ecore_IMF_Event_Preedit_Start Ecore_IMF_Event_Preedit_Start;
@ -428,6 +457,12 @@ struct _Ecore_IMF_Context_Class
void (*input_panel_return_key_type_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Return_Key_Type return_key_type);
void (*input_panel_return_key_disabled_set) (Ecore_IMF_Context *ctx, Eina_Bool disabled);
void (*input_panel_caps_lock_mode_set) (Ecore_IMF_Context *ctx, Eina_Bool mode);
void (*input_panel_geometry_get)(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h);
Ecore_IMF_Input_Panel_State (*input_panel_state_get) (Ecore_IMF_Context *ctx);
void (*input_panel_event_callback_add) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*func) (void *data, Ecore_IMF_Context *ctx, int value), void *data);
void (*input_panel_event_callback_del) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*func) (void *data, Ecore_IMF_Context *ctx, int value));
void (*input_panel_language_locale_get) (Ecore_IMF_Context *ctx, char **lang);
void (*candidate_panel_geometry_get)(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h);
};
struct _Ecore_IMF_Context_Info
@ -513,6 +548,12 @@ EAPI void ecore_imf_context_input_panel_return_key_disa
EAPI Eina_Bool ecore_imf_context_input_panel_return_key_disabled_get(Ecore_IMF_Context *ctx);
EAPI void ecore_imf_context_input_panel_caps_lock_mode_set(Ecore_IMF_Context *ctx, Eina_Bool mode);
EAPI Eina_Bool ecore_imf_context_input_panel_caps_lock_mode_get(Ecore_IMF_Context *ctx);
EAPI void ecore_imf_context_input_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h);
EAPI Ecore_IMF_Input_Panel_State ecore_imf_context_input_panel_state_get(Ecore_IMF_Context *ctx);
EAPI void ecore_imf_context_input_panel_event_callback_add(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*func) (void *data, Ecore_IMF_Context *ctx, int value), const void *data);
EAPI void ecore_imf_context_input_panel_event_callback_del(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*func) (void *data, Ecore_IMF_Context *ctx, int value));
EAPI void ecore_imf_context_input_panel_language_locale_get(Ecore_IMF_Context *ctx, char **lang);
EAPI void ecore_imf_context_candidate_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h);
/* The following entry points must be exported by each input method module
*/

View File

@ -1736,3 +1736,159 @@ ecore_imf_context_input_panel_caps_lock_mode_get(Ecore_IMF_Context *ctx)
return ctx->input_panel_caps_lock_mode;
}
/**
* Get the position of the current active input panel.
*
* @param ctx An #Ecore_IMF_Context.
* @param x top-left x co-ordinate of the input panel
* @param y top-left y co-ordinate of the input panel
* @param w width of the input panel
* @param h height of the input panel
* @ingroup Ecore_IMF_Context_Group
* @since 1.2.0
*/
EAPI void
ecore_imf_context_input_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h)
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
"ecore_imf_context_input_panel_geometry_get");
return;
}
if (ctx->klass->input_panel_geometry_get)
ctx->klass->input_panel_geometry_get(ctx, x, y, w, h);
}
/**
* Get state of current active input panel.
*
* @param ctx An #Ecore_IMF_Context.
* @param The state of input panel.
* @ingroup Ecore_IMF_Context_Group
* @since 1.2.0
*/
EAPI Ecore_IMF_Input_Panel_State
ecore_imf_context_input_panel_state_get(Ecore_IMF_Context *ctx)
{
Ecore_IMF_Input_Panel_State state = ECORE_IMF_INPUT_PANEL_STATE_HIDE;
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
"ecore_imf_context_input_panel_state_get");
return ECORE_IMF_INPUT_PANEL_STATE_HIDE;
}
if (ctx->klass->input_panel_state_get)
state = ctx->klass->input_panel_state_get(ctx);
return state;
}
/**
* Register a callback function which will be called if there is change in input panel state,language,mode etc.
* In order to deregister the callback function
* Use @ref ecore_imf_context_input_panel_event_callback_del.
*
* @param ctx An #Ecore_IMF_Context
* @param type event type
* @param func the callback function
* @param data application-input panel specific data.
* @ingroup Ecore_IMF_Context_Group
* @since 1.2.0
*/
EAPI void
ecore_imf_context_input_panel_event_callback_add(Ecore_IMF_Context *ctx,
Ecore_IMF_Input_Panel_Event type,
void (*func) (void *data, Ecore_IMF_Context *ctx, int value),
const void *data)
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
"ecore_imf_context_input_panel_event_callback_add");
return;
}
if (ctx->klass->input_panel_event_callback_add)
ctx->klass->input_panel_event_callback_add(ctx, type, func, (void *)data);
}
/**
* Unregister a callback function which will be called if there is change in input panel state, language, mode etc.
*
* @param ctx An #Ecore_IMF_Context.
* @param func the callback function
* @param data application-input panel specific data.
* @ingroup Ecore_IMF_Context_Group
* @since 1.2.0
*/
EAPI void
ecore_imf_context_input_panel_event_callback_del(Ecore_IMF_Context *ctx,
Ecore_IMF_Input_Panel_Event type,
void (*func) (void *data, Ecore_IMF_Context *ctx, int value))
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
"ecore_imf_context_input_panel_event_callback_del");
return;
}
if (ctx->klass->input_panel_event_callback_del)
ctx->klass->input_panel_event_callback_del(ctx, type, func);
}
/**
* Get the current language locale of the input panel.
*
* ex) fr_FR
*
* @param ctx An #Ecore_IMF_Context.
* @param lang Location to store the retrieved language string. The
* string retrieved must be freed with free().
* @ingroup Ecore_IMF_Context_Group
*/
EAPI void
ecore_imf_context_input_panel_language_locale_get(Ecore_IMF_Context *ctx, char **lang)
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
"ecore_imf_context_input_panel_language_locale_get");
return;
}
if (ctx->klass->input_panel_language_locale_get)
ctx->klass->input_panel_language_locale_get(ctx, lang);
else
{
if (lang) *lang = strdup("");
}
}
/**
* Get the geometry information of the candidate panel.
*
* @param ctx An #Ecore_IMF_Context.
* @param x top-left x co-ordinate of the candidate panel
* @param y top-left y co-ordinate of the candidate panel
* @param w width of the candidate panel
* @param h height of the candidate panel
* @ingroup Ecore_IMF_Context_Group
*/
EAPI void
ecore_imf_context_candidate_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h)
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
"ecore_imf_context_candidate_panel_geometry_get");
return;
}
if (ctx->klass->candidate_panel_geometry_get)
ctx->klass->candidate_panel_geometry_get(ctx, x, y, w, h);
}