From: Jihoon Kim Date: Tue, 9 Jul 2019 07:01:31 +0000 (+0900) Subject: Add APIs to set and get autofill hint in fill response item X-Git-Tag: submit/tizen/20190710.101845~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F90%2F209590%2F1;p=platform%2Fcore%2Fuifw%2Fautofill.git Add APIs to set and get autofill hint in fill response item Change-Id: Ic4420969b9a966d4cc0096311a9f931ddce6cf68 Signed-off-by: Jihoon Kim --- diff --git a/client/autofill.c b/client/autofill.c index 17edcdd..f78b1be 100644 --- a/client/autofill.c +++ b/client/autofill.c @@ -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); diff --git a/common/autofill_fill_response_item.c b/common/autofill_fill_response_item.c index ef60672..f7595a3 100644 --- a/common/autofill_fill_response_item.c +++ b/common/autofill_fill_response_item.c @@ -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; +} diff --git a/include/autofill_common.h b/include/autofill_common.h index 1ce7fca..26e7d17 100644 --- a/include/autofill_common.h +++ b/include/autofill_common.h @@ -979,6 +979,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 diff --git a/service_lib/autofill_service.c b/service_lib/autofill_service.c index 3ddaf7c..2ee461c 100644 --- a/service_lib/autofill_service.c +++ b/service_lib/autofill_service.c @@ -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); diff --git a/tidl/autofill.tidl b/tidl/autofill.tidl index bfac23d..803697e 100644 --- a/tidl/autofill.tidl +++ b/tidl/autofill.tidl @@ -40,6 +40,7 @@ struct autofill_response_item { string id; string presentation_text; string value; + int autofill_hint; } struct autofill_response_group { diff --git a/tidl/autofill_service.tidl b/tidl/autofill_service.tidl index ffe3dc1..06d1aa3 100644 --- a/tidl/autofill_service.tidl +++ b/tidl/autofill_service.tidl @@ -42,6 +42,7 @@ struct autofill_svc_response_item { string id; string presentation_text; string value; + int autofill_hint; } struct autofill_svc_response_group {