typedef void (*autofill_service_commited_cb)(autofill_save_view_info_h vi, void *user_data);
/**
+ * @brief Called when receiving terminate request.
+ * @since_tizen 5.5
+ * @param[in] user_data The user data passed from the callback function
+ * @see autofill_service_set_terminate_received_cb()
+ */
+typedef void (*autofill_service_terminate_received_cb)(void *user_data);
+
+/**
* @brief Initializes autofill service library.
* @since_tizen 5.5
* @return 0 on success, otherwise a negative error value
int autofill_service_unset_commited_cb(void);
/**
+ * @brief Sets the callback to receive the terminate request.
+ * @since_tizen 5.5
+ * @param[in] callback The callback function to register
+ * @param[in] user_data The user data to be passed to the callback function
+ * @return 0 on success, otherwise a negative error value
+ * @retval #AUTOFILL_ERROR_NONE No error
+ * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int autofill_service_set_terminate_received_cb(autofill_service_terminate_received_cb callback, void *user_data);
+
+/**
+ * @brief Unsets the callback to receive the terminate request.
+ * @since_tizen 5.5
+ * @return 0 on success, otherwise a negative error value
+ * @retval #AUTOFILL_ERROR_NONE No error
+ */
+int autofill_service_unset_terminate_received_cb(void);
+
+/**
* @}
*/
#include <rpc-port.h>
#include <glib.h>
#include <Eina.h>
+#include <Ecore.h>
#include "autofill_service.h"
#include "autofill_private.h"
static autofill_service_commited_cb g_autofill_service_commited_cb;
static void *g_autofill_service_commit_data = NULL;
+static autofill_service_terminate_received_cb g_autofill_service_terminate_received_cb;
+static void *g_autofill_service_terminate_received_data = NULL;
+
rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h g_auth_info_cb;
rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h g_fill_response_received_cb;
}
}
+static void __terminate_received_cb(rpc_port_stub_AutofillSvcPort_context_h context, void *user_data)
+{
+ LOGD("");
+
+ if (g_autofill_service_terminate_received_cb)
+ g_autofill_service_terminate_received_cb(g_autofill_service_terminate_received_data);
+
+ ecore_main_loop_quit();
+}
+
static autofill_svc_s *__create_client(const char *app_id,
rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h auth_info_cb,
rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h fill_response_received_cb)
__auth_info_request_cb,
__autofill_fill_request_cb,
__autofill_commit_cb,
+ __terminate_received_cb
};
ret = rpc_port_stub_AutofillSvcPort_register(&callback, NULL);
return AUTOFILL_ERROR_NONE;
}
+
+EXPORT_API int autofill_service_set_terminate_received_cb(autofill_service_terminate_received_cb callback, void *user_data)
+{
+ g_autofill_service_terminate_received_cb = callback;
+ g_autofill_service_terminate_received_data = user_data;
+
+ return AUTOFILL_ERROR_NONE;
+}
+
+EXPORT_API int autofill_service_unset_terminate_received_cb(void)
+{
+ g_autofill_service_terminate_received_cb = NULL;
+ g_autofill_service_terminate_received_data = NULL;
+
+ return AUTOFILL_ERROR_NONE;
+}