Add APIs to set and get autofill hint in fill response item 90/209590/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Tue, 9 Jul 2019 07:01:31 +0000 (16:01 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Tue, 9 Jul 2019 07:01:31 +0000 (16:01 +0900)
Change-Id: Ic4420969b9a966d4cc0096311a9f931ddce6cf68
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
client/autofill.c
common/autofill_fill_response_item.c
include/autofill_common.h
service_lib/autofill_service.c
tidl/autofill.tidl
tidl/autofill_service.tidl

index 17edcdd..f78b1be 100644 (file)
@@ -40,6 +40,7 @@ static bool fill_response_item_cb(rpc_port_autofill_response_item_h response_ite
     char *id = NULL;
     char *presentation_text = NULL;
     char *value = NULL;
+    int autofill_hint;
     autofill_fill_response_group_h res_group = (autofill_fill_response_group_h)user_data;
 
     if (!res_group)
@@ -48,8 +49,9 @@ static bool fill_response_item_cb(rpc_port_autofill_response_item_h response_ite
     rpc_port_autofill_response_item_get_id(response_items, &id);
     rpc_port_autofill_response_item_get_presentation_text(response_items, &presentation_text);
     rpc_port_autofill_response_item_get_value(response_items, &value);
+    rpc_port_autofill_response_item_get_autofill_hint(response_items, &autofill_hint);
 
-    SECURE_LOGD("id : %s, presentation text : %s, value : %s", id, presentation_text, value);
+    SECURE_LOGD("id : %s, presentation text : %s, value : %s, autofill hint : %d", id, presentation_text, value, autofill_hint);
 
     autofill_fill_response_item_h ritem;
 
@@ -57,6 +59,7 @@ static bool fill_response_item_cb(rpc_port_autofill_response_item_h response_ite
     autofill_fill_response_item_set_id(ritem, id);
     autofill_fill_response_item_set_presentation_text(ritem, presentation_text);
     autofill_fill_response_item_set_value(ritem, value);
+    autofill_fill_response_item_set_autofill_hint(ritem, autofill_hint);
 
     autofill_fill_response_group_add_item(res_group, ritem);
 
index ef60672..f7595a3 100644 (file)
@@ -31,6 +31,7 @@ struct autofill_response_item_s {
     char *id;
     char *presentation_text;
     char *value;
+    autofill_hint_e autofill_hint;
 };
 
 EXPORT_API int autofill_fill_response_item_create(autofill_fill_response_item_h *it)
@@ -118,6 +119,8 @@ EXPORT_API int autofill_fill_response_item_clone(autofill_fill_response_item_h i
         }
     }
 
+    handle->autofill_hint = it->autofill_hint;
+
     *clone = handle;
 
     return AUTOFILL_ERROR_NONE;
@@ -203,3 +206,23 @@ EXPORT_API int autofill_fill_response_item_get_presentation_text(autofill_fill_r
 
     return AUTOFILL_ERROR_NONE;
 }
+
+EXPORT_API int autofill_fill_response_item_set_autofill_hint(autofill_fill_response_item_h it, autofill_hint_e hint)
+{
+    if (!it)
+        return AUTOFILL_ERROR_INVALID_PARAMETER;
+
+    it->autofill_hint = hint;
+
+    return AUTOFILL_ERROR_NONE;
+}
+
+EXPORT_API int autofill_fill_response_item_get_autofill_hint(autofill_fill_response_item_h it, autofill_hint_e *hint)
+{
+    if (!it || !hint)
+        return AUTOFILL_ERROR_INVALID_PARAMETER;
+
+    *hint = it->autofill_hint;
+
+    return AUTOFILL_ERROR_NONE;
+}
index 1ce7fca..26e7d17 100644 (file)
@@ -980,6 +980,29 @@ int autofill_fill_response_item_set_presentation_text(autofill_fill_response_ite
 int autofill_fill_response_item_get_presentation_text(autofill_fill_response_item_h it, char **presentation_text);
 
 /**
+ * @brief Sets the autofill hint in an autofill fill response item.
+ * @since_tizen 5.5
+ * @param[in] it The autofill fill response item handle
+ * @param[in] hint The autofill hint
+ * @return 0 on success, otherwise a negative error value
+ * @retval #AUTOFILL_ERROR_NONE No error
+ * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int autofill_fill_response_item_set_autofill_hint(autofill_fill_response_item_h it, autofill_hint_e hint);
+
+/**
+ * @brief Gets the autofill hint from an autofill fill response item.
+ * @since_tizen 5.5
+ * @param[in] it The autofill fill response item handle
+ * @param[out] hint The autofill hint
+ * @return 0 on success, otherwise a negative error value
+ * @retval #AUTOFILL_ERROR_NONE No error
+ * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #AUTOFILL_ERROR_OPERATION_FAILED Operation failure
+ */
+int autofill_fill_response_item_get_autofill_hint(autofill_fill_response_item_h it, autofill_hint_e *hint);
+
+/**
  * @brief Creates autofill save item.
  * @since_tizen 5.5
  * @remarks If the function succeeds, @a it handle must be released with autofill_save_item_destroy().
index 3ddaf7c..2ee461c 100644 (file)
@@ -547,6 +547,7 @@ bool __fill_response_item_cb(autofill_fill_response_item_h it, void * user_data)
     char *id = NULL;
     char *value = NULL;
     char *presentation_text = NULL;
+    autofill_hint_e autofill_hint;
 
     rpc_port_autofill_svc_response_group_h res_group_h = (rpc_port_autofill_svc_response_group_h)user_data;
 
@@ -555,13 +556,15 @@ bool __fill_response_item_cb(autofill_fill_response_item_h it, void * user_data)
     autofill_fill_response_item_get_id(it, &id);
     autofill_fill_response_item_get_value(it, &value);
     autofill_fill_response_item_get_presentation_text(it, &presentation_text);
+    autofill_fill_response_item_get_autofill_hint(it, &autofill_hint);
 
-    SECURE_LOGD("it : %p, id : %s, value : %s, presentation text : %s", it, id, value, presentation_text);
+    SECURE_LOGD("it : %p, id : %s, value : %s, presentation text : %s, autofill hint : %d", it, id, value, presentation_text, autofill_hint);
 
     rpc_port_autofill_svc_response_item_create(&ritem_h);
     rpc_port_autofill_svc_response_item_set_id(ritem_h, id);
     rpc_port_autofill_svc_response_item_set_presentation_text(ritem_h, presentation_text);
     rpc_port_autofill_svc_response_item_set_value(ritem_h, value);
+    rpc_port_autofill_svc_response_item_set_autofill_hint(ritem_h, autofill_hint);
 
     rpc_port_autofill_svc_response_group_add_response_items(res_group_h, ritem_h);
 
index bfac23d..803697e 100644 (file)
@@ -40,6 +40,7 @@ struct autofill_response_item {
     string id;
     string presentation_text;
     string value;
+    int autofill_hint;
 }
 
 struct autofill_response_group {
index ffe3dc1..06d1aa3 100644 (file)
@@ -42,6 +42,7 @@ struct autofill_svc_response_item {
     string id;
     string presentation_text;
     string value;
+    int autofill_hint;
 }
 
 struct autofill_svc_response_group {