Add logic to change clicking time 62/113362/1
authorWonnam Jang <wn.jang@samsung.com>
Wed, 18 Jan 2017 07:22:22 +0000 (16:22 +0900)
committerWonnam Jang <wn.jang@samsung.com>
Tue, 7 Feb 2017 08:22:21 +0000 (00:22 -0800)
Change-Id: I53834fc8c953f65f7a39fbbb9efdf5df144eeadc
Signed-off-by: Wonnam Jang <wn.jang@samsung.com>
(cherry picked from commit 0945c3f1a2dece209853673163300fefc28a3631)

include/voice_control_elm_private.h
src/vc_elm.c
src/vc_elm_core.c
src/vc_elm_core.h

index 0e9673531970041c04312e2e6b01fac05b1971ad..bb9a1daa6db9069437576eaf3c2d8c384d9e15fd 100644 (file)
@@ -114,6 +114,10 @@ int vc_elm_set_geometry_info(int x, int y, int w, int h);
 
 int vc_elm_unset_geometry_info();
 
+int vc_elm_set_click_time(float time);
+
+int vc_elm_unset_click_time();
+
 #ifdef __cplusplus
 }
 #endif
index b6da248b5c980afd2076b242888faec632f9db22..6e396d3fc7fbdd458fc3b1c5466394f5492b2b0b 100644 (file)
@@ -1042,6 +1042,38 @@ int vc_elm_unset_geometry_info()
        return VC_ELM_ERROR_NONE;
 }
 
+int vc_elm_set_click_time(float time)
+{
+       if (0 != __vc_elm_get_feature_enabled()) {
+               return VC_ELM_ERROR_NOT_SUPPORTED;
+       }
+       if (0 != __vc_elm_check_privilege()) {
+               return VC_ELM_ERROR_PERMISSION_DENIED;
+       }
+
+       if (0 != _vc_elm_core_set_click_time(time)) {
+               return VC_ELM_ERROR_OPERATION_FAILED;
+       }
+
+       return VC_ELM_ERROR_NONE;
+}
+
+int vc_elm_unset_click_time()
+{
+       if (0 != __vc_elm_get_feature_enabled()) {
+               return VC_ELM_ERROR_NOT_SUPPORTED;
+       }
+       if (0 != __vc_elm_check_privilege()) {
+               return VC_ELM_ERROR_PERMISSION_DENIED;
+       }
+
+       if (0 != _vc_elm_core_unset_click_time()) {
+               return VC_ELM_ERROR_OPERATION_FAILED;
+       }
+
+       return VC_ELM_ERROR_NONE;
+}
+
 #ifdef SRPOL_DEBUG
 /**
  * @brief Wrapper for making internal function public - for automated test purposes
index 009ee64e2b2f4f88c390bd23f321b311409d942e..c442fb01390bf33f4e4ab647e4c667717bffd8c6 100644 (file)
@@ -71,6 +71,9 @@ static Eina_List *g_dump_list = NULL;
 
 static Eina_List *g_allowed_text_part_list = NULL;
 
+#define DEFAULT_CLICK_TIME 0.5
+static float g_click_time = DEFAULT_CLICK_TIME;
+
 #define HIDE 0xa
 #define X_VISIBILITY_TOLERANCE 32.0
 #define Y_VISIBILITY_TOLERANCE 54.0
@@ -235,7 +238,7 @@ static void __focused_cb(void *data, Evas_Object *obj, void *event_info)
                        evas_object_smart_callback_del(obj, "item,focused", __focused_cb);
                }
 
-               ecore_timer_add(0.5, __click_event, NULL);
+               ecore_timer_add(g_click_time, __click_event, NULL);
        }
 }
 
@@ -317,7 +320,7 @@ Eina_Bool _recognize_command(const char *cmd, const char *param1, const char *pa
                                                                                        VC_ELM_LOG_DBG("Click event");
                                                                                        if (EINA_TRUE == elm_object_focus_get((Evas_Object*)parent_info->address)) {
                                                                                                VC_ELM_LOG_DBG("Already focused");
-                                                                                               ecore_timer_add(0.5, __click_event, NULL);
+                                                                                               ecore_timer_add(g_click_time, __click_event, NULL);
                                                                                        } else {
                                                                                                evas_object_smart_callback_add((Evas_Object*)(parent_info->address), "focused", __focused_cb, "focused");
                                                                                                elm_object_focus_set((Evas_Object*)(parent_info->address), EINA_TRUE);
@@ -347,7 +350,7 @@ Eina_Bool _recognize_command(const char *cmd, const char *param1, const char *pa
                                                                                                        VC_ELM_LOG_DBG("Click event");
                                                                                                        if (EINA_TRUE == elm_object_item_focus_get(item)) {
                                                                                                                VC_ELM_LOG_DBG("Already focused");
-                                                                                                               ecore_timer_add(0.5, __click_event, NULL);
+                                                                                                               ecore_timer_add(g_click_time, __click_event, NULL);
                                                                                                        } else {
                                                                                                                evas_object_smart_callback_add((Evas_Object*)(parent_info->address), "item,focused", __focused_cb, "item,focused");
                                                                                                                elm_object_item_focus_set(item, EINA_TRUE);
@@ -2084,4 +2087,18 @@ int _vc_elm_core_unset_geometry_info()
        ea_object_dump_unset_geometry_info();
        VC_ELM_LOG_INFO("Unset geometry info");
        return 0;
-}
\ No newline at end of file
+}
+
+int _vc_elm_core_set_click_time(float time)
+{
+       g_click_time = time;
+       VC_ELM_LOG_INFO("Set click time (%f)sec", time);
+       return 0;
+}
+
+int _vc_elm_core_unset_click_time()
+{
+       g_click_time = DEFAULT_CLICK_TIME;
+       VC_ELM_LOG_INFO("Unset click time, time will be (%f) sec", DEFAULT_CLICK_TIME);
+       return 0;
+}
index 18e78b74456d9666e50229b66a3fef5c82d06f73..f2ca41a14470708b79391d9843dd87a50b10acad 100644 (file)
@@ -517,6 +517,11 @@ int _vc_elm_core_set_geometry_info(int x, int y, int w, int h);
 
 int _vc_elm_core_unset_geometry_info();
 
+int _vc_elm_core_set_click_time(float time);
+
+int _vc_elm_core_unset_click_time();
+
+
 #ifdef __cplusplus
 }
 #endif