summaryrefslogtreecommitdiff
path: root/src/lib/ecore_imf
diff options
context:
space:
mode:
authorJihoon Kim <jihoon48.kim@samsung.com>2017-04-18 16:18:10 +0900
committerJihoon Kim <jihoon48.kim@samsung.com>2017-04-18 16:18:10 +0900
commitbadf7bca455afcc680cc218ded64069c99436a80 (patch)
tree3342edf59123e4d761863d9f2e6eae3f23cd8944 /src/lib/ecore_imf
parent52ddf9331a6eceac4b11fade920a7c6e85fe8a38 (diff)
ecore_imf: Added a new ecore_imf_context_keyboard_mode_get API and input_panel_event_callback type
Summary: Applications want to know the current keyboard mode state to handle application's size manually. So added a new ecore_imf_context_keyboard_mode_get API and input_panel_event_callback type for keyboard mode. Test Plan: Tested in Tizen device Reviewers: jihoon, woohyun, id213sin Reviewed By: jihoon Subscribers: cedric, jsuya, z-wony, jpeg Differential Revision: https://phab.enlightenment.org/D4790
Diffstat (limited to 'src/lib/ecore_imf')
-rw-r--r--src/lib/ecore_imf/Ecore_IMF.h25
-rw-r--r--src/lib/ecore_imf/ecore_imf_context.c16
2 files changed, 40 insertions, 1 deletions
diff --git a/src/lib/ecore_imf/Ecore_IMF.h b/src/lib/ecore_imf/Ecore_IMF.h
index 6bca58f..e411728 100644
--- a/src/lib/ecore_imf/Ecore_IMF.h
+++ b/src/lib/ecore_imf/Ecore_IMF.h
@@ -90,7 +90,8 @@ typedef enum
90 ECORE_IMF_INPUT_PANEL_SHIFT_MODE_EVENT, /**< called when the shift key state of the input panel is changed @since 1.7 */ 90 ECORE_IMF_INPUT_PANEL_SHIFT_MODE_EVENT, /**< called when the shift key state of the input panel is changed @since 1.7 */
91 ECORE_IMF_INPUT_PANEL_GEOMETRY_EVENT, /**< called when the size of the input panel is changed. @since 1.7 */ 91 ECORE_IMF_INPUT_PANEL_GEOMETRY_EVENT, /**< called when the size of the input panel is changed. @since 1.7 */
92 ECORE_IMF_CANDIDATE_PANEL_STATE_EVENT, /**< called when the state of the candidate word panel is changed. @since 1.7 */ 92 ECORE_IMF_CANDIDATE_PANEL_STATE_EVENT, /**< called when the state of the candidate word panel is changed. @since 1.7 */
93 ECORE_IMF_CANDIDATE_PANEL_GEOMETRY_EVENT /**< called when the size of the candidate word panel is changed. @since 1.7 */ 93 ECORE_IMF_CANDIDATE_PANEL_GEOMETRY_EVENT, /**< called when the size of the candidate word panel is changed. @since 1.7 */
94 ECORE_IMF_INPUT_PANEL_KEYBOARD_MODE_EVENT /**< called when the keyboard mode state of the input panel is changed @since 1.20 */
94} Ecore_IMF_Input_Panel_Event; 95} Ecore_IMF_Input_Panel_Event;
95 96
96/** 97/**
@@ -124,6 +125,16 @@ typedef enum
124 ECORE_IMF_CANDIDATE_PANEL_HIDE /**< Notification prior to the dismissal of the candidate word panel @since 1.7 */ 125 ECORE_IMF_CANDIDATE_PANEL_HIDE /**< Notification prior to the dismissal of the candidate word panel @since 1.7 */
125} Ecore_IMF_Candidate_Panel_State; 126} Ecore_IMF_Candidate_Panel_State;
126 127
128/**
129 * @typedef Ecore_IMF_Input_Panel_Keyboard_Mode
130 * Enum containing keyboard mode states.
131 */
132typedef enum
133{
134 ECORE_IMF_INPUT_PANEL_HW_KEYBOARD_MODE, /**< @since 1.20 */
135 ECORE_IMF_INPUT_PANEL_SW_KEYBOARD_MODE /**< @since 1.20 */
136} Ecore_IMF_Input_Panel_Keyboard_Mode;
137
127/* Events sent by the Input Method */ 138/* Events sent by the Input Method */
128typedef struct _Ecore_IMF_Event_Preedit_Start Ecore_IMF_Event_Preedit_Start; 139typedef struct _Ecore_IMF_Event_Preedit_Start Ecore_IMF_Event_Preedit_Start;
129typedef struct _Ecore_IMF_Event_Preedit_End Ecore_IMF_Event_Preedit_End; 140typedef struct _Ecore_IMF_Event_Preedit_End Ecore_IMF_Event_Preedit_End;
@@ -700,6 +711,7 @@ struct _Ecore_IMF_Context_Class
700 void (*candidate_panel_geometry_get)(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h); /**< Return the candidate panel geometry */ 711 void (*candidate_panel_geometry_get)(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h); /**< Return the candidate panel geometry */
701 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 */
702 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 */
703}; 715};
704 716
705/** 717/**
@@ -1861,6 +1873,17 @@ EAPI void ecore_imf_context_bidi_direction_set(Ecore_IM
1861 */ 1873 */
1862EAPI Ecore_IMF_BiDi_Direction ecore_imf_context_bidi_direction_get(Ecore_IMF_Context *ctx); 1874EAPI Ecore_IMF_BiDi_Direction ecore_imf_context_bidi_direction_get(Ecore_IMF_Context *ctx);
1863 1875
1876/**
1877 * @ingroup Ecore_IMF_Context_Group
1878 * @brief Get the keyboard mode on the input panel.
1879 *
1880 * @since 1.20.0
1881 *
1882 * @param[in] ctx An #Ecore_IMF_Context
1883 * @return the keyboard mode
1884 */
1885EAPI Ecore_IMF_Input_Panel_Keyboard_Mode ecore_imf_context_keyboard_mode_get(Ecore_IMF_Context *ctx);
1886
1864/* The following entry points must be exported by each input method module 1887/* The following entry points must be exported by each input method module
1865 */ 1888 */
1866 1889
diff --git a/src/lib/ecore_imf/ecore_imf_context.c b/src/lib/ecore_imf/ecore_imf_context.c
index d6fd854..961c4ae 100644
--- a/src/lib/ecore_imf/ecore_imf_context.c
+++ b/src/lib/ecore_imf/ecore_imf_context.c
@@ -1391,3 +1391,19 @@ ecore_imf_context_bidi_direction_get(Ecore_IMF_Context *ctx)
1391 return ctx->bidi_direction; 1391 return ctx->bidi_direction;
1392} 1392}
1393 1393
1394EAPI Ecore_IMF_Input_Panel_Keyboard_Mode
1395ecore_imf_context_keyboard_mode_get(Ecore_IMF_Context *ctx)
1396{
1397 Ecore_IMF_Input_Panel_Keyboard_Mode mode = ECORE_IMF_INPUT_PANEL_SW_KEYBOARD_MODE;
1398 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1399 {
1400 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1401 "ecore_imf_context_keyboard_mode_get");
1402 return ECORE_IMF_INPUT_PANEL_SW_KEYBOARD_MODE;
1403 }
1404
1405 if (ctx->klass->keyboard_mode_get)
1406 mode = ctx->klass->keyboard_mode_get(ctx);
1407
1408 return mode;
1409} \ No newline at end of file