Clean up code 30/191530/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Thu, 18 Oct 2018 05:53:09 +0000 (14:53 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Thu, 18 Oct 2018 05:53:09 +0000 (14:53 +0900)
Change-Id: I4ce52975e2ebbec19f94733ce8b8b703e2475d2c
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
12 files changed:
client/autofill_fill_request.c
common/autofill_fill_response_item.c
common/autofill_view_info.c
include/autofill.h
include/autofill_common.h
include/autofill_service.h
packaging/capi-ui-autofill.spec
server/CMakeLists.txt
service/CMakeLists.txt
service/service_main.c
test/CMakeLists.txt
test/ecore_imf_example.c

index 6993dcd..25ac9b4 100644 (file)
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <string.h>
 #include <dlog.h>
 #include <unistd.h>
-//#include <privilege_checker_private.h>
 #include <autofill.h>
 #include "autofill_private.h"
 #include "autofill_proxy.h"
index 54982e0..0a4f809 100644 (file)
 #define LOG_TAG "AUTOFILL"
 
 struct autofill_response_item_s {
-       char *id;
-       char *presentation_text; // context popup 표기용 (ex> ‘ID A’s password)
-       char *value; // autofill value
+    char *id;
+    char *presentation_text;
+    char *value;
 };
 
-// autofill fill response item 생성
 EXPORT_API int autofill_fill_response_item_create(autofill_fill_response_item_h *it)
 {
     LOGD("autofill fill response item create");
@@ -50,7 +49,6 @@ EXPORT_API int autofill_fill_response_item_create(autofill_fill_response_item_h
     return AUTOFILL_ERROR_NONE;
 }
 
-// autofill fill response item 삭제
 EXPORT_API int autofill_fill_response_item_destroy(autofill_fill_response_item_h it)
 {
     if (!it)
@@ -117,7 +115,6 @@ EXPORT_API int autofill_fill_response_item_clone(autofill_fill_response_item_h h
     return AUTOFILL_ERROR_NONE;
 }
 
-// Set autofill ID
 EXPORT_API int autofill_fill_response_item_set_id(autofill_fill_response_item_h it, const char *id)
 {
     if (!it || !id)
@@ -132,7 +129,6 @@ EXPORT_API int autofill_fill_response_item_set_id(autofill_fill_response_item_h
     return AUTOFILL_ERROR_NONE;
 }
 
-// Get autofill ID
 EXPORT_API int autofill_fill_response_item_get_id(autofill_fill_response_item_h it, char **id)
 {
     if (!it || !id)
@@ -146,7 +142,6 @@ EXPORT_API int autofill_fill_response_item_get_id(autofill_fill_response_item_h
     return AUTOFILL_ERROR_NONE;
 }
 
-// Set autofill value
 EXPORT_API int autofill_fill_response_item_set_value(autofill_fill_response_item_h it, const char *value)
 {
     if (!it || !value)
@@ -161,7 +156,6 @@ EXPORT_API int autofill_fill_response_item_set_value(autofill_fill_response_item
     return AUTOFILL_ERROR_NONE;
 }
 
-// Get autofill value
 EXPORT_API int autofill_fill_response_item_get_value(autofill_fill_response_item_h it, char **value)
 {
     if (!it || !value)
@@ -175,7 +169,6 @@ EXPORT_API int autofill_fill_response_item_get_value(autofill_fill_response_item
     return AUTOFILL_ERROR_NONE;
 }
 
-// Set presentation text
 EXPORT_API int autofill_fill_response_item_set_presentation_text(autofill_fill_response_item_h it, const char *presentation_text)
 {
     if (!it || !presentation_text)
@@ -190,7 +183,6 @@ EXPORT_API int autofill_fill_response_item_set_presentation_text(autofill_fill_r
     return AUTOFILL_ERROR_NONE;
 }
 
-// Get presentation text
 EXPORT_API int autofill_fill_response_item_get_presentation_text(autofill_fill_response_item_h it, char ** presentation_text)
 {
     if (!it || !presentation_text)
index 6ce95f1..f658b5e 100644 (file)
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <string.h>
 #include <dlog.h>
 #include <unistd.h>
 #include <app.h>
-//#include <privilege_checker_private.h>
 
 #include "autofill_private.h"
 #include <autofill_common.h>
index 8f6f418..0b514d1 100644 (file)
@@ -41,9 +41,9 @@ extern "C" {
  * @since_tizen 5.5
  */
 typedef enum {
-       AUTOFILL_CONNECTION_STATUS_CONNECTED = 0, /**< Connected */
-       AUTOFILL_CONNECTION_STATUS_DISCONNECTED, /**< Disconnected */
-       AUTOFILL_CONNECTION_STATUS_REJECTED, /**< Rejected */
+    AUTOFILL_CONNECTION_STATUS_CONNECTED = 0, /**< Connected */
+    AUTOFILL_CONNECTION_STATUS_DISCONNECTED, /**< Disconnected */
+    AUTOFILL_CONNECTION_STATUS_REJECTED, /**< Rejected */
 } autofill_connection_status_e;
 
 /**
index 921891c..1482a14 100644 (file)
@@ -41,15 +41,15 @@ extern "C" {
  * @since_tizen 5.5
  */
 typedef enum {
-       AUTOFILL_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
-       AUTOFILL_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< I/O Error */
-       AUTOFILL_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
-       AUTOFILL_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
-       AUTOFILL_ERROR_NOT_INITIALIZED = TIZEN_ERROR_ENDPOINT_NOT_CONNECTED, /**< Initialization is not set */
-       AUTOFILL_ERROR_NO_CALLBACK_FUNCTION = TIZEN_ERROR_IME | 0x0001, /**< Necessary callback function is not set */
-       AUTOFILL_ERROR_NOT_RUNNING = TIZEN_ERROR_IME | 0x0002, /**< IME main loop isn't started yet */
-       AUTOFILL_ERROR_OPERATION_FAILED = TIZEN_ERROR_IME | 0x0003, /**< Operation failed */
-       AUTOFILL_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< out of memory */
+    AUTOFILL_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
+    AUTOFILL_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< I/O Error */
+    AUTOFILL_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
+    AUTOFILL_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
+    AUTOFILL_ERROR_NOT_INITIALIZED = TIZEN_ERROR_ENDPOINT_NOT_CONNECTED, /**< Initialization is not set */
+    AUTOFILL_ERROR_NO_CALLBACK_FUNCTION = TIZEN_ERROR_IME | 0x0001, /**< Necessary callback function is not set */
+    AUTOFILL_ERROR_NOT_RUNNING = TIZEN_ERROR_IME | 0x0002, /**< IME main loop isn't started yet */
+    AUTOFILL_ERROR_OPERATION_FAILED = TIZEN_ERROR_IME | 0x0003, /**< Operation failed */
+    AUTOFILL_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< out of memory */
 } autofill_error_e;
 
 typedef struct autofill_item_s *autofill_item_h;
@@ -229,7 +229,7 @@ int autofill_item_get_value(autofill_item_h it, char **value);
  * @return 0 on success, otherwise a negative error value
  * @retval #AUTOFILL_ERROR_NONE No error
  */
-int autofill_auth_info_create(autofill_auth_info_h *vi); //
+int autofill_auth_info_create(autofill_auth_info_h *vi);
 
 /**
  * @brief Destroy autofill view info
@@ -253,7 +253,7 @@ int autofill_auth_info_destroy(autofill_auth_info_h vi);
  * @return 0 on success, otherwise a negative error value
  * @retval #AUTOFILL_ERROR_NONE No error
  */
-int autofill_auth_info_set_app_id(autofill_auth_info_h vi, const char *app_id); //
+int autofill_auth_info_set_app_id(autofill_auth_info_h vi, const char *app_id);
 
 /**
  * @brief Get app id
@@ -545,7 +545,7 @@ int autofill_save_view_info_set_view_id(autofill_save_view_info_h vi, const char
  * @return 0 on success, otherwise a negative error value
  * @retval #IME_ERROR_NONE No error
  */
-int autofill_save_view_info_get_view_id(autofill_save_view_info_h vi, char **view_id); // app id get
+int autofill_save_view_info_get_view_id(autofill_save_view_info_h vi, char **view_id);
 
 /**
  * @brief Add autofill save item
@@ -562,9 +562,8 @@ int autofill_save_view_info_add_item(const autofill_save_view_info_h vi, autofil
 int autofill_save_view_info_foreach_items(autofill_save_view_info_h h, bool (*callback)(autofill_save_item_h item, void *user_data), void *user_data);
 
 // fill response
-// 각 입력 필드별 autofill fill response item
 /**
- * @brief Add autofill fill response item
+ * @brief Create autofill fill response
  *
  * @since_tizen 5.5
  *
@@ -576,7 +575,7 @@ int autofill_save_view_info_foreach_items(autofill_save_view_info_h h, bool (*ca
 int autofill_fill_response_create(autofill_fill_response_h *h);
 
 /**
- * @brief Remove autofill fill response item
+ * @brief Destroy autofill fill response
  *
  * @since_tizen 5.5
  *
@@ -752,7 +751,7 @@ int autofill_fill_response_group_foreach_items(autofill_fill_response_group_h h,
  * @return 0 on success, otherwise a negative error value
  * @retval #AUTOFILL_ERROR_NONE No error
  */
-int autofill_fill_response_item_create(autofill_fill_response_item_h *it); //
+int autofill_fill_response_item_create(autofill_fill_response_item_h *it);
 
 /**
  * @brief Destroy autofill fill response item
@@ -921,7 +920,7 @@ int autofill_save_item_get_autofill_hint(autofill_save_item_h it, autofill_hint_
  * @return 0 on success, otherwise a negative error value
  * @retval #IME_ERROR_NONE No error
  */
-int autofill_save_item_set_id(autofill_save_item_h it, const char *id); // Set autofill ID
+int autofill_save_item_set_id(autofill_save_item_h it, const char *id);
 
 /**
  * @brief Get autofill ID
@@ -933,7 +932,7 @@ int autofill_save_item_set_id(autofill_save_item_h it, const char *id); // Set a
  * @return 0 on success, otherwise a negative error value
  * @retval #IME_ERROR_NONE No error
  */
-int autofill_save_item_get_id(autofill_save_item_h it, char **id); // Get autofill ID
+int autofill_save_item_get_id(autofill_save_item_h it, char **id);
 
 /**
  * @brief Set autofill label
@@ -981,7 +980,7 @@ int autofill_save_item_set_sensitive_data(autofill_save_item_h it, bool sensitiv
  * @return 0 on success, otherwise a negative error value
  * @retval #IME_ERROR_NONE No error
  */
-int autofill_save_item_get_sensitive_data(autofill_save_item_h it, bool *sensitive); // Get sensitive data
+int autofill_save_item_get_sensitive_data(autofill_save_item_h it, bool *sensitive);
 
 /**
  * @brief Set autofill value
index 3b513c6..c0de9b8 100644 (file)
@@ -129,12 +129,18 @@ int autofill_service_set_fill_request_cb(autofill_service_fill_request_cb callba
  */
 int autofill_service_send_fill_response(autofill_fill_response_h h);
 
-// commit (save)
+/**
+ * @brief Register the callback to receive the commit request
+ *
+ * @since_tizen 5.5
+ *
+ * @privlevel public
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #AUTOFILL_ERROR_NONE No error
+ */
 int autofill_service_set_commit_cb(autofill_service_commit_cb callback, void *user_data);
 
-// save request
-//int autofill_service_set_save_request_cb();
-
 /**
  * @}
  */
index abdcacf..e102295 100644 (file)
@@ -118,7 +118,7 @@ make %{?jobs:-j%jobs}
 rm -rf %{buildroot}
 %make_install
 
-%post 
+%post
 /sbin/ldconfig
 
 %post -n org.tizen.autofill-test
index 78e70c8..9c44a9b 100644 (file)
@@ -2,7 +2,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 PROJECT(autofill-daemon C)
 
 SET(SRCS
-       main.c
+    main.c
     autofill_stub.c
     autofill_service_proxy.c
 )
index ed867d1..174d11a 100644 (file)
@@ -2,7 +2,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 PROJECT(autofill-service C)
 
 SET(SRCS
-       service_main.c
+    service_main.c
 #    autofill_stub.c
 )
 
index d34a7bf..416075b 100644 (file)
@@ -228,7 +228,7 @@ static void _commit_cb(autofill_save_view_info_h vi, void *user_data)
 bool service_app_create(void *data)
 {
     // Todo: add your code here.
-       LOGD("");
+    LOGD("");
 
     autofill_service_initialize();
 
@@ -242,7 +242,7 @@ bool service_app_create(void *data)
 void service_app_terminate(void *data)
 {
     // Todo: add your code here.
-       LOGD("");
+    LOGD("");
 
     autofill_service_deinitialize();
 
@@ -285,7 +285,7 @@ service_app_low_memory(app_event_info_h event_info, void *user_data)
  */
 int main(int argc, char *argv[])
 {
-       LOGI("BEGIN");
+    LOGI("BEGIN");
 
     char ad[50] = {0,};
     service_app_lifecycle_callback_s event_callback;
index 63da7e6..8018441 100644 (file)
@@ -10,7 +10,7 @@ pkg_check_modules(pkgs_test REQUIRED
     dlog
     ecore
     ecore-evas
-    evas 
+    evas
     eina
     ecore-imf
     ecore-imf-evas
index 85a1d09..14ae53f 100644 (file)
@@ -123,17 +123,11 @@ static bool _fill_response_item_cb(autofill_fill_response_item_h item, void *use
     LOGD("id : %s, value : %s, presentation text : %s", id, value, presentation_text);
 
     if (id1 && strcmp(id, id1) == 0) {
-        //ecore_imf_context_event_callback_call(en1.imf_context, ECORE_IMF_CALLBACK_AUTOFILL_DATA_SET, response_item->value);
-        //LOGD("autofill id : %s, value : %s", response_item->id, response_item->value);
         evas_object_textblock_text_markup_prepend(en1.cursor, value);
-        //return;
     }
 
     if (id2 && strcmp(id, id2) == 0) {
-        //ecore_imf_context_event_callback_call(en1.imf_context, ECORE_IMF_CALLBACK_AUTOFILL_DATA_SET, response_item->value);
-        //LOGD("autofill id : %s, value : %s", response_item->id, response_item->value);
         evas_object_textblock_text_markup_prepend(en2.cursor, value);
-        //return;
     }
 
     if (id) {