davemds pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=15b29e3ce88cb90e967140f76d001dc3d46a4c5e

commit 15b29e3ce88cb90e967140f76d001dc3d46a4c5e
Author: Dave Andreoli <d...@gurumeditation.it>
Date:   Sat Jul 15 17:07:08 2017 +0200

    New 1.20 API: elm/edje text_prediction_hint
    
    no tests, as I have no idea on how to use this feature
---
 efl/edje/efl.edje_object.pxi  | 19 +++++++++++++++++++
 efl/elementary/entry.pxi      | 18 ++++++++++++++++++
 efl/elementary/entry_cdef.pxi |  1 +
 include/efl.edje.pxd          |  2 ++
 4 files changed, 40 insertions(+)

diff --git a/efl/edje/efl.edje_object.pxi b/efl/edje/efl.edje_object.pxi
index 34d25e0..3ff969f 100644
--- a/efl/edje/efl.edje_object.pxi
+++ b/efl/edje/efl.edje_object.pxi
@@ -783,6 +783,25 @@ cdef class Edje(Object):
         return edje_object_part_text_input_hint_get(self.obj,
                             <const char *>part if part is not None else NULL)
 
+    def part_text_prediction_hint_set(self, part, hint):
+        """Sets the prediction hint to use an intelligent reply suggestion
+        service.
+
+        :param part: the part name
+        :type part: str
+
+        :param hint: the prediction hint text
+        :type hint: str
+
+        .. versionadded:: 1.20
+
+        """
+        if isinstance(part, unicode): part = PyUnicode_AsUTF8String(part)
+        if isinstance(hint, unicode): hint = PyUnicode_AsUTF8String(hint)
+        edje_object_part_text_prediction_hint_set(self.obj,
+            <const char *>part if part is not None else NULL,
+            <const char *>hint if hint is not None else NULL)
+
     def part_swallow(self, part, Object obj):
         """Swallows an object into the edje
 
diff --git a/efl/elementary/entry.pxi b/efl/elementary/entry.pxi
index 358b9a5..155d4c3 100644
--- a/efl/elementary/entry.pxi
+++ b/efl/elementary/entry.pxi
@@ -1472,6 +1472,24 @@ cdef class Entry(LayoutClass):
     def prediction_allow_get(self):
         return elm_entry_prediction_allow_get(self.obj)
 
+    property prediction_hint:
+        """The prediction hint to use an intelligent reply suggestion service.
+
+        :type: string (**writeonly**)
+
+        .. versionadded:: 1.20
+
+        """
+        def __set__(self, string):
+            if isinstance(string, unicode): string = 
PyUnicode_AsUTF8String(string)
+            elm_entry_prediction_hint_set(self.obj,
+                <const char *>string if string is not None else NULL)
+
+    def prediction_hint_set(self, string):
+        if isinstance(string, unicode): string = PyUnicode_AsUTF8String(string)
+        elm_entry_prediction_hint_set(self.obj,
+            <const char *>string if string is not None else NULL)
+
     # TODO:
     # def filter_limit_size(self, data, text):
     #     """Filter inserted text based on user defined character and byte 
limits
diff --git a/efl/elementary/entry_cdef.pxi b/efl/elementary/entry_cdef.pxi
index 8a579a3..8e95e6d 100644
--- a/efl/elementary/entry_cdef.pxi
+++ b/efl/elementary/entry_cdef.pxi
@@ -139,6 +139,7 @@ cdef extern from "Elementary.h":
     void                    elm_entry_imf_context_reset(Evas_Object *obj)
     void                    elm_entry_prediction_allow_set(Evas_Object *obj, 
Eina_Bool allow)
     Eina_Bool               elm_entry_prediction_allow_get(const Evas_Object 
*obj)
+    void                    elm_entry_prediction_hint_set(Evas_Object *obj, 
const char *prediction_hint)
     # TODO: void                    elm_entry_filter_limit_size(void *data, 
Evas_Object *entry, char **text)
     # TODO: void                    elm_entry_filter_accept_set(void *data, 
Evas_Object *entry, char **text)
     # TODO: void                  *elm_entry_imf_context_get(const Evas_Object 
*obj)
diff --git a/include/efl.edje.pxd b/include/efl.edje.pxd
index de6fa7a..14862c8 100644
--- a/include/efl.edje.pxd
+++ b/include/efl.edje.pxd
@@ -255,6 +255,8 @@ cdef extern from "Edje.h":
     void edje_object_part_text_input_hint_set(Evas_Object *obj, char *part, 
Edje_Input_Hints input_hints)
     Edje_Input_Hints edje_object_part_text_input_hint_get(Evas_Object *obj, 
char *part)
 
+    void edje_object_part_text_prediction_hint_set(Evas_Object *obj, char 
*part, const char *prediction_hint)
+
     void edje_object_part_swallow(Evas_Object *obj, char *part, Evas_Object 
*obj_swallow)
     void edje_object_part_unswallow(Evas_Object *obj, Evas_Object *obj_swallow)
     Evas_Object *edje_object_part_swallow_get(Evas_Object *obj, char *part)

-- 


Reply via email to