I missed to attach the patch file, so I send again.
Thanks.

-----Original Message-----
From: Jihoon Kim [mailto:jihoon48....@samsung.com] 
Sent: Wednesday, October 26, 2011 1:51 PM
To: 'Enlightenment developer list'
Cc: 박세환; 'gouni....@samsung.com'
Subject: [PATCH] add elm_entry_autocapital_type_{set/get} and
elm_entry_input_panel_enabled_{set/get} API

Hi, EFL developers.

elm_entry_autocapital_type_set API is high level API to call
ecore_imf_context_autocapital_type_set.
Application programmer can choose the type of autocapitalization such as
WORD, SENTENCE, ALLCHARACTER through this API.

elm_entry_input_panel_enabled_set API is for setting whether input panel
(virtual keyboard) should be appeared when entry has a focus or pressed.
It can be used by dialer or calculator application programmer because those
application prefer to use its keypad NOT virtual keyboard supported by
system.
They want to use entry to show the cursor for providing the cursor handling
method but don't want to appear system keyboard.

Would you please review this patch?
Please let me know if I have to do more.

Thank you.
Index: src/lib/elm_entry.c
===================================================================
--- src/lib/elm_entry.c (revision 64384)
+++ src/lib/elm_entry.c (working copy)
@@ -47,6 +47,7 @@
    Elm_Scroller_Policy policy_h, policy_v;
    Elm_Wrap_Type linewrap;
    Elm_Input_Panel_Layout input_panel_layout;
+   Elm_Autocapital_Type autocapital_type;
    Eina_Bool changed : 1;
    Eina_Bool single_line : 1;
    Eina_Bool password : 1;
@@ -64,6 +65,7 @@
    Eina_Bool textonly : 1;
    Eina_Bool usedown : 1;
    Eina_Bool scroll : 1;
+   Eina_Bool input_panel_enable : 1;
 };
 
 struct _Elm_Entry_Context_Menu_Item
@@ -518,6 +520,8 @@
    if (elm_widget_disabled_get(obj))
      edje_object_signal_emit(wd->ent, "elm,state,disabled", "elm");
    edje_object_part_text_input_panel_layout_set(wd->ent, "elm.text", 
wd->input_panel_layout);
+   edje_object_part_text_autocapital_type_set(wd->ent, "elm.text", 
wd->autocapital_type);
+   edje_object_part_text_input_panel_enabled_set(wd->ent, "elm.text", 
wd->input_panel_enable);
    elm_entry_cursor_pos_set(obj, wd->cursor_pos);
    if (elm_widget_focus_get(obj))
      edje_object_signal_emit(wd->ent, "elm,action,focus", "elm");
@@ -761,14 +765,16 @@
      {
         evas_object_focus_set(wd->ent, EINA_TRUE);
         edje_object_signal_emit(wd->ent, "elm,action,focus", "elm");
-        if (top) elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_ON);
+        if (top && wd->input_panel_enable)
+          elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_ON);
         evas_object_smart_callback_call(obj, SIG_FOCUSED, NULL);
      }
    else
      {
         edje_object_signal_emit(wd->ent, "elm,action,unfocus", "elm");
         evas_object_focus_set(wd->ent, EINA_FALSE);
-        if (top) elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_OFF);
+        if (top && wd->input_panel_enable)
+          elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_OFF);
         evas_object_smart_callback_call(obj, SIG_UNFOCUSED, NULL);
      }
 }
@@ -2259,6 +2265,9 @@
 
    elm_entry_input_panel_layout_set(obj, ELM_INPUT_PANEL_LAYOUT_NORMAL);
 
+   wd->input_panel_enable = 
edje_object_part_text_input_panel_enabled_get(wd->ent, "elm.text");
+   wd->autocapital_type = edje_object_part_text_autocapital_type_get(wd->ent, 
"elm.text");
+
 #ifdef HAVE_ELEMENTARY_X
    top = elm_widget_top_get(obj);
    if ((top) && (elm_win_xwindow_get(top)))
@@ -3255,3 +3264,36 @@
 
    return wd->input_panel_layout;
 }
+
+EAPI void
+elm_entry_autocapital_type_set(Evas_Object *obj, Elm_Autocapital_Type 
autocapital_type)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype);
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return;
+
+   wd->autocapital_type = autocapital_type;
+   edje_object_part_text_autocapital_type_set(wd->ent, "elm.text", 
autocapital_type);
+}
+
+EAPI Elm_Autocapital_Type
+elm_entry_autocapital_type_get(Evas_Object *obj)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype) ELM_AUTOCAPITAL_TYPE_NONE;
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return ELM_AUTOCAPITAL_TYPE_NONE;
+
+   return wd->autocapital_type;
+}
+
+EAPI void
+elm_entry_input_panel_enabled_set(Evas_Object *obj, Eina_Bool enabled)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype);
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return;
+
+   wd->input_panel_enable = enabled;
+   edje_object_part_text_input_panel_enabled_set(wd->ent, "elm.text", enabled);
+}
+
Index: src/lib/Elementary.h.in
===================================================================
--- src/lib/Elementary.h.in     (revision 64384)
+++ src/lib/Elementary.h.in     (working copy)
@@ -579,6 +579,14 @@
         ELM_INPUT_PANEL_LAYOUT_INVALID
      } Elm_Input_Panel_Layout;
 
+   typedef enum
+     {
+        ELM_AUTOCAPITAL_TYPE_NONE,
+        ELM_AUTOCAPITAL_TYPE_WORD,
+        ELM_AUTOCAPITAL_TYPE_SENTENCE,
+        ELM_AUTOCAPITAL_TYPE_ALLCHARACTER,
+     } Elm_Autocapital_Type;
+
    /**
     * @typedef Elm_Object_Item
     * An Elementary Object item handle.
@@ -11791,6 +11799,35 @@
     */
    EAPI Elm_Input_Panel_Layout elm_entry_input_panel_layout_get(Evas_Object 
*obj) EINA_ARG_NONNULL(1);
    /**
+    * Set the autocapitalization type on the immodule.
+    *
+    * @param obj The entry object
+    * @param autocapital_type The type of autocapitalization
+    */
+   EAPI void         elm_entry_autocapital_type_set(Evas_Object *obj, 
Elm_Autocapital_Type autocapital_type) EINA_ARG_NONNULL(1);
+   /**
+    * Retrieve the autocapitalization type on the immodule.
+    *
+    * @param obj The entry object
+    * @return autocapitalization type
+    */
+   EAPI Elm_Autocapital_Type elm_entry_autocapital_type_get(Evas_Object *obj) 
EINA_ARG_NONNULL(1);
+   /**
+    * Sets the attribute to show the input panel automatically.
+    *
+    * @param obj The entry object
+    * @param enabled If true, the input panel is appeared when entry is 
clicked or has a focus
+    */
+   EAPI void elm_entry_input_panel_enabled_set(Evas_Object *obj, Eina_Bool 
enabled) EINA_ARG_NONNULL(1);
+   /**
+    * Retrieve the attribute to show the input panel automatically.
+    *
+    * @param obj The entry object
+    * @return EINA_TRUE if input panel will be appeared when the entry is 
clicked or has a focus, EINA_FALSE otherwise
+    */
+   EAPI Eina_Bool elm_entry_input_panel_enabled_get(Evas_Object *obj) 
EINA_ARG_NONNULL(1);
+
+   /**
     * @}
     */
 

Index: src/lib/edje_private.h
===================================================================
--- src/lib/edje_private.h      (revision 64355)
+++ src/lib/edje_private.h      (working copy)
@@ -1847,6 +1847,10 @@ void _edje_entry_cursor_pos_set(Edje_Real_Part *rp
 int _edje_entry_cursor_pos_get(Edje_Real_Part *rp, Edje_Cursor cur);
 void _edje_entry_input_panel_layout_set(Edje_Real_Part *rp, 
Edje_Input_Panel_Layout layout);
 Edje_Input_Panel_Layout _edje_entry_input_panel_layout_get(Edje_Real_Part *rp);
+void _edje_entry_autocapital_type_set(Edje_Real_Part *rp, 
Edje_Text_Autocapital_Type autocapital_type);
+Edje_Text_Autocapital_Type _edje_entry_autocapital_type_get(Edje_Real_Part 
*rp);
+void _edje_entry_input_panel_enabled_set(Edje_Real_Part *rp, Eina_Bool 
enabled);
+Eina_Bool _edje_entry_input_panel_enabled_get(Edje_Real_Part *rp);
 
 void _edje_external_init();
 void _edje_external_shutdown();
Index: src/lib/edje_util.c
===================================================================
--- src/lib/edje_util.c (revision 64355)
+++ src/lib/edje_util.c (working copy)
@@ -1759,6 +1759,72 @@ edje_object_part_text_input_panel_layout_get(const
 }
 
 EAPI void
+edje_object_part_text_autocapital_type_set(const Evas_Object *obj, const char 
*part, Edje_Text_Autocapital_Type autocapital_type)
+{
+   Edje *ed;
+   Edje_Real_Part *rp;
+
+   ed = _edje_fetch(obj);
+   if ((!ed) || (!part)) return;
+   rp = _edje_real_part_recursive_get(ed, (char *)part);
+   if (!rp) return;
+   if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
+     {
+        _edje_entry_autocapital_type_set(rp, autocapital_type);
+     }
+}
+
+EAPI Edje_Text_Autocapital_Type
+edje_object_part_text_autocapital_type_get(const Evas_Object *obj, const char 
*part)
+{
+   Edje *ed;
+   Edje_Real_Part *rp;
+
+   ed = _edje_fetch(obj);
+   if ((!ed) || (!part)) return EDJE_TEXT_AUTOCAPITAL_TYPE_NONE;
+   rp = _edje_real_part_recursive_get(ed, (char *)part);
+   if (!rp) return EDJE_TEXT_AUTOCAPITAL_TYPE_NONE;
+   if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
+     {
+        return _edje_entry_autocapital_type_get(rp);
+     }
+   return EDJE_TEXT_AUTOCAPITAL_TYPE_NONE;
+}
+
+EAPI void
+edje_object_part_text_input_panel_enabled_set(const Evas_Object *obj, const 
char *part, Eina_Bool enabled)
+{
+   Edje *ed;
+   Edje_Real_Part *rp;
+
+   ed = _edje_fetch(obj);
+   if ((!ed) || (!part)) return;
+   rp = _edje_real_part_recursive_get(ed, part);
+   if (!rp) return;
+   if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
+     {
+        return _edje_entry_input_panel_enabled_set(rp, enabled);
+     }
+}
+
+EAPI Eina_Bool
+edje_object_part_text_input_panel_enabled_get(const Evas_Object *obj, const 
char *part)
+{
+   Edje *ed;
+   Edje_Real_Part *rp;
+
+   ed = _edje_fetch(obj);
+   if ((!ed) || (!part)) return EINA_FALSE;
+   rp = _edje_real_part_recursive_get(ed, part);
+   if (!rp) return EINA_FALSE;
+   if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
+     {
+        return _edje_entry_input_panel_enabled_get(rp);
+     }
+   return EINA_FALSE;
+}
+
+EAPI void
 edje_object_text_insert_filter_callback_add(Evas_Object *obj, const char 
*part, Edje_Text_Filter_Cb func, void *data)
 {
    Edje *ed;
Index: src/lib/Edje.h
===================================================================
--- src/lib/Edje.h      (revision 64355)
+++ src/lib/Edje.h      (working copy)
@@ -768,6 +768,14 @@ typedef enum _Edje_Text_Filter_Type
    EDJE_TEXT_FILTER_MARKUP = 2
 } Edje_Text_Filter_Type;
 
+typedef enum _Edje_Text_Autocapital_Type
+{
+   EDJE_TEXT_AUTOCAPITAL_TYPE_NONE,
+   EDJE_TEXT_AUTOCAPITAL_TYPE_WORD,
+   EDJE_TEXT_AUTOCAPITAL_TYPE_SENTENCE,
+   EDJE_TEXT_AUTOCAPITAL_TYPE_ALLCHARACTER
+} Edje_Text_Autocapital_Type;
+
 /**
  * The possible types the parameters of an EXTERNAL part can be.
  */
@@ -2818,6 +2826,47 @@ EAPI void             edje_object_part_text_input_
 EAPI Edje_Input_Panel_Layout edje_object_part_text_input_panel_layout_get 
(const Evas_Object *obj, const char *part);
 
 /**
+ * @brief Set the autocapitalization type on the immodule.
+ *
+ * @param obj A valid Evas_Object handle
+ * @param part The part name
+ * @param autocapital_type The type of autocapitalization
+ * @since 1.1.0
+ */
+EAPI void         edje_object_part_text_autocapital_type_set        (const 
Evas_Object *obj, const char *part, Edje_Text_Autocapital_Type 
autocapital_type);
+
+/**
+ * @brief Retrieves the autocapitalization type
+ *
+ * @param obj A valid Evas_Object handle
+ * @param part The part name
+ * @return The autocapitalization type
+ * @since 1.1.0
+ */
+EAPI Edje_Text_Autocapital_Type edje_object_part_text_autocapital_type_get 
(const Evas_Object *obj, const char *part);
+
+/**
+ * @brief Sets the attribute to show the input panel automatically.
+ *
+ * @param obj A valid Evas_Object handle
+ * @param part The part name
+ * @param enabled If true, the input panel is appeared when entry is clicked 
or has a focus
+ * @since 1.1.0
+ */
+EAPI void             edje_object_part_text_input_panel_enabled_set (const 
Evas_Object *obj, const char *part, Eina_Bool enabled);
+
+/**
+ * @brief Retrieve the attribute to show the input panel automatically.
+ * @see edje_object_part_text_input_panel_enabled_set
+ *
+ * @param obj A valid Evas_Object handle
+ * @param part The part name
+ * @return EINA_TRUE if it supports or EINA_FALSE otherwise
+ * @since 1.1.0
+ */
+EAPI Eina_Bool        edje_object_part_text_input_panel_enabled_get (const 
Evas_Object *obj, const char *part);
+
+/**
  * Add a filter function for newly inserted text.
  *
  * Whenever text is inserted (not the same as set) into the given @p part,
Index: src/lib/edje_entry.c
===================================================================
--- src/lib/edje_entry.c        (revision 64355)
+++ src/lib/edje_entry.c        (working copy)
@@ -2470,6 +2470,59 @@ _edje_entry_select_abort(Edje_Real_Part *rp)
      }
 }
 
+void
+_edje_entry_autocapital_type_set(Edje_Real_Part *rp, 
Edje_Text_Autocapital_Type autocapital_type)
+{
+   Entry *en = rp->entry_data;
+   if (!en) return;
+
+   if (rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD)
+     autocapital_type = EDJE_TEXT_AUTOCAPITAL_TYPE_NONE;
+
+#ifdef HAVE_ECORE_IMF
+   if (en->imf_context)
+     ecore_imf_context_autocapital_type_set(en->imf_context, autocapital_type);
+#endif
+}
+
+Edje_Text_Autocapital_Type
+_edje_entry_autocapital_type_get(Edje_Real_Part *rp)
+{
+   Entry *en = rp->entry_data;
+   if (!en) return EDJE_TEXT_AUTOCAPITAL_TYPE_NONE;
+
+#ifdef HAVE_ECORE_IMF
+   if (en->imf_context)
+     return ecore_imf_context_autocapital_type_get(en->imf_context);
+#endif
+
+   return EDJE_TEXT_AUTOCAPITAL_TYPE_NONE;
+}
+
+void
+_edje_entry_input_panel_enabled_set(Edje_Real_Part *rp, Eina_Bool enabled)
+{
+   Entry *en = rp->entry_data;
+   if (!en) return;
+#ifdef HAVE_ECORE_IMF
+   if (en->imf_context)
+     ecore_imf_context_input_panel_enabled_set(en->imf_context, enabled);
+#endif
+}
+
+Eina_Bool
+_edje_entry_input_panel_enabled_get(Edje_Real_Part *rp)
+{
+   Entry *en = rp->entry_data;
+   if (!en) return EINA_FALSE;
+#ifdef HAVE_ECORE_IMF
+   if (en->imf_context)
+     return ecore_imf_context_input_panel_enabled_get(en->imf_context);
+#endif
+
+   return EINA_FALSE;
+}
+
 static Evas_Textblock_Cursor *
 _cursor_get(Edje_Real_Part *rp, Edje_Cursor cur)
 {

------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to