add edje_object_part_text_prediction_allow_set/get.
authorjihoon <jihoon@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 14 Feb 2012 02:34:50 +0000 (02:34 +0000)
committerjihoon <jihoon@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 14 Feb 2012 02:34:50 +0000 (02:34 +0000)
These APIs can be used to set whether prediction feature is allowed or not.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@67889 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

ChangeLog
src/lib/Edje.h
src/lib/edje_entry.c
src/lib/edje_private.h
src/lib/edje_util.c

index f36aacb..183956a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 2012-02-13  Jihoon Kim
 
        * add edje_object_part_text_input_panel_show/hide.
-      These APIs can be used in input panel manual control mode 
+      These APIs can be used in input panel manual control mode.
        * add edje_object_part_text_imf_context_reset that will use
-      for reseting the input method context
+      for reseting the input method context.
+
+2012-02-14  Jihoon Kim
+
+       * add edje_object_part_text_prediction_allow_set/get.
+      These APIs can be used to set whether prediction feature is allowed or not.
index 57dc5a8..58d6b4c 100644 (file)
@@ -2900,6 +2900,26 @@ EAPI void         edje_object_part_text_autocapital_type_set        (const Evas_
 EAPI Edje_Text_Autocapital_Type edje_object_part_text_autocapital_type_get (const Evas_Object *obj, const char *part);
 
 /**
+ * @brief Set whether the prediction is allowed or not.
+ *
+ * @param obj A valid Evas_Object handle
+ * @param part The part name
+ * @param prediction If true, the prediction feature is allowed.
+ * @since 1.2.0
+ */
+EAPI void             edje_object_part_text_prediction_allow_set        (const Evas_Object *obj, const char *part, Eina_Bool prediction);
+
+/**
+ * @brief Get whether the prediction is allowed or not.
+ *
+ * @param obj A valid Evas_Object handle
+ * @param part The part name
+ * @return EINA_TRUE if prediction feature is allowed.
+ * @since 1.2.0
+ */
+EAPI Eina_Bool        edje_object_part_text_prediction_allow_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
index 5e40bf4..a74a832 100644 (file)
@@ -35,6 +35,7 @@ struct _Entry
    Eina_Bool select_mod_end : 1;
    Eina_Bool had_sel : 1;
    Eina_Bool input_panel_enable : 1;
+   Eina_Bool prediction_allow : 1;
 
 #ifdef HAVE_ECORE_IMF
    Eina_Bool have_preedit : 1;
@@ -2578,6 +2579,28 @@ _edje_entry_autocapital_type_get(Edje_Real_Part *rp)
 }
 
 void
+_edje_entry_prediction_allow_set(Edje_Real_Part *rp, Eina_Bool prediction)
+{
+   Entry *en = rp->entry_data;
+
+   if (!en) return;
+   en->prediction_allow = prediction;
+#ifdef HAVE_ECORE_IMF
+   if (en->imf_context)
+     ecore_imf_context_prediction_allow_set(en->imf_context, prediction);
+#endif
+}
+
+Eina_Bool
+_edje_entry_prediction_allow_get(Edje_Real_Part *rp)
+{
+   Entry *en = rp->entry_data;
+   if (!en) return EINA_FALSE;
+
+   return en->prediction_allow;
+}
+
+void
 _edje_entry_input_panel_enabled_set(Edje_Real_Part *rp, Eina_Bool enabled)
 {
    Entry *en = rp->entry_data;
index 763030e..30339b1 100644 (file)
@@ -1944,6 +1944,8 @@ void _edje_entry_input_panel_layout_set(Edje_Real_Part *rp, Edje_Input_Panel_Lay
 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_prediction_allow_set(Edje_Real_Part *rp, Eina_Bool prediction);
+Eina_Bool _edje_entry_prediction_allow_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_entry_input_panel_show(Edje_Real_Part *rp);
index 321d47e..9d58678 100644 (file)
@@ -1860,6 +1860,39 @@ edje_object_part_text_autocapital_type_get(const Evas_Object *obj, const char *p
 }
 
 EAPI void
+edje_object_part_text_prediction_allow_set(const Evas_Object *obj, const char *part, Eina_Bool prediction)
+{
+   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)
+     {
+        _edje_entry_prediction_allow_set(rp, prediction);
+     }
+}
+
+EAPI Eina_Bool
+edje_object_part_text_prediction_allow_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_prediction_allow_get(rp);
+     }
+   return EINA_FALSE;
+}
+
+EAPI void
 edje_object_part_text_input_panel_enabled_set(const Evas_Object *obj, const char *part, Eina_Bool enabled)
 {
    Edje *ed;