Seperate packages 66/132066/6
authorHyunho Kang <hhstark.kang@samsung.com>
Mon, 10 Jul 2017 12:42:41 +0000 (21:42 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Tue, 25 Jul 2017 01:23:21 +0000 (10:23 +0900)
Requires:
 - https://review.tizen.org/gerrit/#/c/132065/ [app-common]
 - https://review.tizen.org/gerrit/#/c/132066/ [app-control]
 - https://review.tizen.org/gerrit/#/c/132073/ [app-event]
 - https://review.tizen.org/gerrit/#/c/132080/ [preference]
 - https://review.tizen.org/gerrit/#/c/132144/ [application]

Change-Id: I8e03ed8d47a4d716aa09f4f3f06be5509ac9cd58
Signed-off-by: Hyunho Kang <hhstark.kang@samsung.com>
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
49 files changed:
AUTHORS [deleted file]
CMakeLists.txt
app_common/CMakeLists.txt [deleted file]
app_common/app_error.c [deleted file]
app_common/app_event.c [deleted file]
app_common/app_finalizer.c [deleted file]
app_common/app_package.c [deleted file]
app_common/app_path.c [deleted file]
app_common/app_resource_manager.c [deleted file]
app_control/CMakeLists.txt [deleted file]
capi-appfw-app-control.pc.in [moved from capi-appfw-module.pc.in with 100% similarity]
doc/appfw_app_common_doc.h [deleted file]
doc/appfw_app_control_doc.h [deleted file]
doc/appfw_app_doc.h [deleted file]
doc/appfw_event_doc.h [deleted file]
doc/appfw_i18n_doc.h [deleted file]
doc/appfw_preference_doc.h [deleted file]
doc/appfw_resource_manager_doc.h [deleted file]
doc/images/capi_appfw_application_lifecycle.png [deleted file]
doc/images/capi_appfw_application_package.png [deleted file]
doc/images/capi_appfw_application_resource.png [deleted file]
doc/images/capi_appfw_application_states.png [deleted file]
event/CMakeLists.txt [deleted file]
event/event.c [deleted file]
include/app.h [deleted file]
include/app_common.h [deleted file]
include/app_event.h [deleted file]
include/app_extension.h [deleted file]
include/app_i18n.h [deleted file]
include/app_internal.h [deleted file]
include/app_preference.h [deleted file]
include/app_preference_internal.h [deleted file]
include/app_preference_log.h [deleted file]
include/app_resource_manager.h [deleted file]
include/app_types.h [deleted file]
packaging/capi-appfw-app-control.manifest [moved from packaging/capi-appfw-application.manifest with 100% similarity]
packaging/capi-appfw-app-control.spec [new file with mode: 0644]
packaging/capi-appfw-application.spec [deleted file]
preference/CMakeLists.txt [deleted file]
preference/preference.c [deleted file]
preference/preference_db.c [deleted file]
preference/preference_inoti.c [deleted file]
src/CMakeLists.txt
src/app_control.c [moved from app_control/app_control.c with 99% similarity, mode: 0644]
src/app_device.c [deleted file]
src/app_main.c [deleted file]
src/app_main_legacy.c [deleted file]
src/app_resource.c [deleted file]
src/i18n.c [deleted file]

diff --git a/AUTHORS b/AUTHORS
deleted file mode 100644 (file)
index a228ba0..0000000
--- a/AUTHORS
+++ /dev/null
@@ -1,2 +0,0 @@
-junghyuk park <junghyuk.park@samsung.com>
-
index fee558f..dd27bc3 100644 (file)
@@ -2,10 +2,6 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 
 SET(INC_DIR include)
 
-ADD_SUBDIRECTORY(app_control)
-ADD_SUBDIRECTORY(app_common)
-ADD_SUBDIRECTORY(preference)
-ADD_SUBDIRECTORY(event)
 ADD_SUBDIRECTORY(src)
 
 INSTALL(
@@ -14,34 +10,3 @@ INSTALL(
         PATTERN "*_private.h" EXCLUDE
         PATTERN "${INC_DIR}/*.h"
         )
-
-IF(UNIX)
-
-ADD_CUSTOM_TARGET (distclean @echo cleaning for source distribution)
-ADD_CUSTOM_COMMAND(
-        DEPENDS clean
-        COMMENT "distribution clean"
-        COMMAND find
-        ARGS    .
-        -not -name config.cmake -and \(
-        -name tester.c -or
-        -name Testing -or
-        -name CMakeFiles -or
-        -name cmake.depends -or
-        -name cmake.check_depends -or
-        -name CMakeCache.txt -or
-        -name cmake.check_cache -or
-        -name *.cmake -or
-        -name Makefile -or
-        -name core -or
-        -name core.* -or
-        -name gmon.out -or
-        -name install_manifest.txt -or
-        -name *.pc -or
-        -name *~ \)
-        | grep -v TC | xargs rm -rf
-        TARGET  distclean
-        VERBATIM
-)
-
-ENDIF(UNIX)
diff --git a/app_common/CMakeLists.txt b/app_common/CMakeLists.txt
deleted file mode 100644 (file)
index 0c2506a..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-SET(fw_name "capi-appfw-app-common")
-
-PROJECT(${fw_name})
-
-SET(CMAKE_INSTALL_PREFIX /usr)
-SET(PREFIX ${CMAKE_INSTALL_PREFIX})
-
-SET(INC_DIR ${CMAKE_SOURCE_DIR}/include)
-INCLUDE_DIRECTORIES(${INC_DIR})
-
-SET(requires "dlog aul pkgmgr-info capi-base-common appcore-common libtzplatform-config")
-SET(pc_requires "capi-base-common")
-
-INCLUDE(FindPkgConfig)
-pkg_check_modules(${fw_name} REQUIRED ${requires})
-FOREACH(flag ${${fw_name}_CFLAGS})
-    SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC ")
-SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -Wall -Werror -Wno-error=deprecated-declarations")
-
-IF("${ARCH}" STREQUAL "arm")
-    ADD_DEFINITIONS("-DTARGET")
-ENDIF("${ARCH}" STREQUAL "arm")
-
-ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
-ADD_DEFINITIONS("-DSLP_DEBUG")
-
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
-
-add_library(${fw_name} SHARED
-               app_package.c
-               app_path.c
-               app_error.c
-               app_finalizer.c
-               app_event.c
-               app_resource_manager.c
-               )
-
-TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS})
-
-SET_TARGET_PROPERTIES(${fw_name}
-     PROPERTIES
-     VERSION ${FULLVER}
-     SOVERSION ${MAJORVER}
-     CLEAN_DIRECT_OUTPUT 1
-)
-
-INSTALL(TARGETS ${fw_name} DESTINATION ${LIB_INSTALL_DIR})
-INSTALL(
-        DIRECTORY ${INC_DIR}/ DESTINATION include/appfw
-        FILES_MATCHING
-        PATTERN "*_private.h" EXCLUDE
-        PATTERN "${INC_DIR}/*.h"
-        )
-
-SET(PC_NAME ${fw_name})
-SET(PC_REQUIRED ${pc_requires})
-SET(PC_LDFLAGS -l${fw_name})
-
-CONFIGURE_FILE(
-    ${CMAKE_SOURCE_DIR}/capi-appfw-module.pc.in
-    ${CMAKE_SOURCE_DIR}/${fw_name}.pc
-    @ONLY
-)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
-
-
diff --git a/app_common/app_error.c b/app_common/app_error.c
deleted file mode 100644 (file)
index bd25122..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2011 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <libintl.h>
-#include <dlog.h>
-#include <app_internal.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "CAPI_APPFW_APPLICATION"
-
-static const char *app_error_to_string(app_error_e error)
-{
-       switch (error) {
-       case APP_ERROR_NONE:
-               return "NONE";
-       case APP_ERROR_INVALID_PARAMETER:
-               return "INVALID_PARAMETER";
-       case APP_ERROR_OUT_OF_MEMORY:
-               return "OUT_OF_MEMORY";
-       case APP_ERROR_INVALID_CONTEXT:
-               return "INVALID_CONTEXT";
-       case APP_ERROR_NO_SUCH_FILE:
-               return "NO_SUCH_FILE";
-       case APP_ERROR_ALREADY_RUNNING:
-               return "ALREADY_RUNNING";
-       default:
-               return "UNKNOWN";
-       }
-}
-
-int app_error(app_error_e error, const char *function, const char *description)
-{
-       if (description)
-               LOGE("[%s] %s(0x%08x) : %s", function, app_error_to_string(error), error, description);
-       else
-               LOGE("[%s] %s(0x%08x)", function, app_error_to_string(error), error);
-
-       return error;
-}
-
diff --git a/app_common/app_event.c b/app_common/app_event.c
deleted file mode 100755 (executable)
index d64227a..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Copyright (c) 2011 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-
-#include <vconf-internal-keys.h>
-#include <app_common.h>
-#include <appcore_base.h>
-#include <app_internal.h>
-
-struct app_event_info {
-       app_event_type_e type;
-       void *value;
-};
-
-enum appcore_rm {
-       APPCORE_RM_UNKNOWN,
-       APPCORE_RM_PORTRAIT_NORMAL,
-       APPCORE_RM_PORTRAIT_REVERSE,
-       APPCORE_RM_LANDSCAPE_NORMAL,
-       APPCORE_RM_LANDSCAPE_REVERSE,
-};
-
-app_device_orientation_e app_convert_appcore_rm(enum appcore_rm rm)
-{
-       app_device_orientation_e dev_orientation;
-
-       switch (rm) {
-       case APPCORE_RM_PORTRAIT_NORMAL:
-               dev_orientation = APP_DEVICE_ORIENTATION_0;
-               break;
-       case APPCORE_RM_PORTRAIT_REVERSE:
-               dev_orientation = APP_DEVICE_ORIENTATION_180;
-               break;
-       case APPCORE_RM_LANDSCAPE_NORMAL:
-               dev_orientation = APP_DEVICE_ORIENTATION_270;
-               break;
-       case APPCORE_RM_LANDSCAPE_REVERSE:
-               dev_orientation = APP_DEVICE_ORIENTATION_90;
-               break;
-       default:
-               dev_orientation = APP_DEVICE_ORIENTATION_0;
-               break;
-       }
-
-       return dev_orientation;
-}
-
-static int __app_convert_low_memory(void *val)
-{
-       switch (*(int *)val) {
-       case VCONFKEY_SYSMAN_LOW_MEMORY_NORMAL:
-               return APP_EVENT_LOW_MEMORY_NORMAL;
-       case VCONFKEY_SYSMAN_LOW_MEMORY_SOFT_WARNING:
-               return APP_EVENT_LOW_MEMORY_SOFT_WARNING;
-       case VCONFKEY_SYSMAN_LOW_MEMORY_HARD_WARNING:
-               return APP_EVENT_LOW_MEMORY_HARD_WARNING;
-       default:
-               return -1;
-       }
-}
-
-static int __app_convert_low_battery(void *val)
-{
-       switch (*(int *)val) {
-       case VCONFKEY_SYSMAN_BAT_POWER_OFF:
-               return APP_EVENT_LOW_BATTERY_POWER_OFF;
-       case VCONFKEY_SYSMAN_BAT_CRITICAL_LOW:
-               return APP_EVENT_LOW_BATTERY_CRITICAL_LOW;
-       default:
-               return -1;
-       }
-}
-
-int app_event_get_low_memory_status(app_event_info_h event_info, app_event_low_memory_status_e *status)
-{
-       int ret;
-
-       if (event_info == NULL || status == NULL)
-               return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, "null parameter");
-
-       if (event_info->type != APP_EVENT_LOW_MEMORY)
-               return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, "event type mismatching");
-
-       ret = __app_convert_low_memory(event_info->value);
-       if (ret < 0)
-               return app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__, "invalid event info");
-
-       *status = ret;
-
-       return APP_ERROR_NONE;
-}
-
-int app_event_get_low_battery_status(app_event_info_h event_info, app_event_low_battery_status_e *status)
-{
-       int ret;
-
-       if (event_info == NULL || status == NULL)
-               return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, "null parameter");
-
-       if (event_info->type != APP_EVENT_LOW_BATTERY)
-               return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, "event type mismatching");
-
-       ret = __app_convert_low_battery(event_info->value);
-       if (ret < 0)
-               return app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__, "invalid event info");
-
-       *status = ret;
-
-       return APP_ERROR_NONE;
-}
-
-int app_event_get_language(app_event_info_h event_info, char **lang)
-{
-       if (event_info == NULL || event_info->value == NULL || lang == NULL)
-               return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, "null parameter");
-
-       if (event_info->type != APP_EVENT_LANGUAGE_CHANGED)
-               return app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__, "event type mismatching");
-
-       *lang = strdup(event_info->value);
-
-       return APP_ERROR_NONE;
-}
-
-int app_event_get_region_format(app_event_info_h event_info, char **region)
-{
-       if (event_info == NULL || event_info->value == NULL || region == NULL)
-               return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, "null parameter");
-
-       if (event_info->type != APP_EVENT_REGION_FORMAT_CHANGED)
-               return app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__, "event type mismatching");
-
-       *region = strdup(event_info->value);
-
-       return APP_ERROR_NONE;
-}
-
-int app_event_get_device_orientation(app_event_info_h event_info, app_device_orientation_e *orientation)
-{
-       if (event_info == NULL || orientation == NULL)
-               return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, "null parameter");
-
-       if (event_info->type != APP_EVENT_DEVICE_ORIENTATION_CHANGED)
-               return app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__, "event type mismatching");
-
-       *orientation = app_convert_appcore_rm(*(enum appcore_base_rm *)(event_info->value));
-
-       return APP_ERROR_NONE;
-}
-
-int app_event_get_suspended_state(app_event_info_h event_info, app_suspended_state_e *state)
-{
-       if (event_info == NULL || state == NULL)
-               return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, "null parameter");
-
-       if (event_info->type != APP_EVENT_SUSPENDED_STATE_CHANGED)
-               return app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__, "event type mismatching");
-
-       if (*(enum appcore_base_suspended_state *)(event_info->value) == APPCORE_BASE_SUSPENDED_STATE_WILL_ENTER_SUSPEND)
-               *state = APP_SUSPENDED_STATE_WILL_ENTER;
-       else if (*(enum appcore_base_suspended_state *)(event_info->value) == APPCORE_BASE_SUSPENDED_STATE_DID_EXIT_FROM_SUSPEND)
-               *state = APP_SUSPENDED_STATE_DID_EXIT;
-
-       return APP_ERROR_NONE;
-}
-
diff --git a/app_common/app_finalizer.c b/app_common/app_finalizer.c
deleted file mode 100644 (file)
index 2e840ea..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (c) 2011 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <libintl.h>
-
-#include <app_internal.h>
-
-typedef struct _app_finalizer_s_ {
-       app_finalizer_cb callback;
-       void *data;
-       struct _app_finalizer_s_ *next;
-} app_finalizer_s;
-
-typedef app_finalizer_s *app_finalizer_h;
-
-static app_finalizer_s finalizer_head = {
-       .callback = NULL,
-       .data = NULL,
-       .next = NULL
-};
-
-int app_finalizer_add(app_finalizer_cb callback, void *data)
-{
-       app_finalizer_h finalizer_tail = &finalizer_head;
-       app_finalizer_h finalizer_new;
-
-       finalizer_new = malloc(sizeof(app_finalizer_s));
-       if (finalizer_new == NULL)
-               return app_error(APP_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
-
-       finalizer_new->callback = callback;
-       finalizer_new->data = data;
-       finalizer_new->next = NULL;
-
-       while (finalizer_tail->next)
-               finalizer_tail = finalizer_tail->next;
-
-       finalizer_tail->next = finalizer_new;
-
-       return APP_ERROR_NONE;
-}
-
-int app_finalizer_remove(app_finalizer_cb callback)
-{
-       app_finalizer_h finalizer_node = &finalizer_head;
-
-       while (finalizer_node->next) {
-               if (finalizer_node->next->callback == callback) {
-                       app_finalizer_h removed_node = finalizer_node->next;
-                       finalizer_node->next = removed_node->next;
-                       free(removed_node);
-                       return APP_ERROR_NONE;
-               }
-
-               finalizer_node = finalizer_node->next;
-       }
-
-       return APP_ERROR_INVALID_PARAMETER;
-}
-
-void app_finalizer_execute(void)
-{
-       app_finalizer_h finalizer_node = &finalizer_head;
-       app_finalizer_h finalizer_executed;
-       app_finalizer_cb finalizer_cb = NULL;
-
-       if (finalizer_node)
-               finalizer_node = finalizer_node->next;
-
-       while (finalizer_node) {
-               finalizer_cb = finalizer_node->callback;
-
-               finalizer_cb(finalizer_node->data);
-
-               finalizer_executed = finalizer_node;
-
-               finalizer_node = finalizer_node->next;
-
-               free(finalizer_executed);
-       }
-
-       finalizer_head.next = NULL;
-}
-
diff --git a/app_common/app_package.c b/app_common/app_package.c
deleted file mode 100644 (file)
index 8a7cbfa..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Copyright (c) 2011 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-
-#include <aul.h>
-#include <pkgmgr-info.h>
-#include <dlog.h>
-
-#include <app_internal.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "CAPI_APPFW_APPLICATION"
-
-int app_get_package_app_name(const char *appid, char **name)
-{
-       char *name_token = NULL;
-
-       if (appid == NULL)
-               return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       /* com.vendor.name -> name */
-       name_token = strrchr(appid, '.');
-       if (name_token == NULL)
-               return app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__, NULL);
-
-       name_token++;
-
-       *name = strdup(name_token);
-       if (*name == NULL)
-               return app_error(APP_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
-
-       return APP_ERROR_NONE;
-}
-
-int app_get_package(char **package)
-{
-       return app_get_id(package);
-}
-
-int app_get_id(char **id)
-{
-       static char id_buf[TIZEN_PATH_MAX] = {0, };
-       int ret = -1;
-
-       if (id == NULL)
-               return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       if (id_buf[0] == '\0') {
-               ret = aul_app_get_appid_bypid(getpid(), id_buf, sizeof(id_buf));
-               if (ret < 0)
-                       return app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__, "failed to get the application ID");
-       }
-
-       if (id_buf[0] == '\0')
-               return app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__, "failed to get the application ID");
-
-       *id = strdup(id_buf);
-       if (*id == NULL)
-               return app_error(APP_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
-
-       return APP_ERROR_NONE;
-}
-
-int app_get_name(char **name)
-{
-       int retval = 0;
-       char *appid = NULL;
-       char *label = NULL;
-       pkgmgrinfo_appinfo_h appinfo = NULL;
-
-       if (name == NULL)
-               return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       if (app_get_id(&appid) != 0)
-               return app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__, "failed to get the package");
-
-       retval = pkgmgrinfo_appinfo_get_usr_appinfo(appid, getuid(), &appinfo);
-       if (retval != 0) {
-               free(appid);
-               return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-       }
-
-       retval = pkgmgrinfo_appinfo_get_label(appinfo, &label);
-       if (retval != 0) {
-               free(appid);
-               pkgmgrinfo_appinfo_destroy_appinfo(appinfo);
-               return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-       }
-
-       *name = strdup(label);
-       pkgmgrinfo_appinfo_destroy_appinfo(appinfo);
-       free(appid);
-
-       if (*name == NULL)
-               return app_error(APP_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
-
-       return APP_ERROR_NONE;
-}
-
-int app_get_version(char **version)
-{
-       int retval = 0;
-       char *appid = NULL;
-       char *pkgid = NULL;
-       char *pkg_version = NULL;
-       pkgmgrinfo_pkginfo_h pkginfo = NULL;
-       pkgmgrinfo_appinfo_h appinfo = NULL;
-
-       if (version == NULL)
-               return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       if (app_get_id(&appid) != 0)
-               return app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__, "failed to get the package");
-
-       retval = pkgmgrinfo_appinfo_get_usr_appinfo(appid, getuid(), &appinfo);
-       if (retval != 0) {
-               free(appid);
-               return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-       }
-
-       retval = pkgmgrinfo_appinfo_get_pkgid(appinfo, &pkgid);
-       if (retval != 0) {
-               free(appid);
-               pkgmgrinfo_appinfo_destroy_appinfo(appinfo);
-               return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-       }
-
-       retval = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &pkginfo);
-       if (retval != 0) {
-               free(appid);
-               pkgmgrinfo_appinfo_destroy_appinfo(appinfo);
-               return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-       }
-
-       retval = pkgmgrinfo_pkginfo_get_version(pkginfo, &pkg_version);
-       if (retval != 0) {
-               free(appid);
-               pkgmgrinfo_appinfo_destroy_appinfo(appinfo);
-               pkgmgrinfo_pkginfo_destroy_pkginfo(pkginfo);
-               return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-       }
-
-       *version = strdup(pkg_version);
-       pkgmgrinfo_pkginfo_destroy_pkginfo(pkginfo);
-       pkgmgrinfo_appinfo_destroy_appinfo(appinfo);
-       free(appid);
-
-       if (*version == NULL)
-               return app_error(APP_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
-
-       return APP_ERROR_NONE;
-}
-
diff --git a/app_common/app_path.c b/app_common/app_path.c
deleted file mode 100644 (file)
index 24ccde3..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2014 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-#include <aul.h>
-#include <tizen_error.h>
-#include <dlog.h>
-
-#include "app_types.h"
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "CAPI_APPFW_APPLICATION"
-
-#define _STRDUP(s) ((s) ? strdup(s) : NULL)
-
-char *app_get_data_path(void)
-{
-       const char *buf = aul_get_app_data_path();
-       return _STRDUP(buf);
-}
-
-char *app_get_cache_path(void)
-{
-       const char *buf = aul_get_app_cache_path();
-       return _STRDUP(buf);
-}
-
-char *app_get_resource_path(void)
-{
-       const char *buf = aul_get_app_resource_path();
-       return _STRDUP(buf);
-}
-
-char *app_get_shared_data_path(void)
-{
-       int ret;
-       char *path = NULL;
-
-       ret = aul_get_app_shared_data_path(&path);
-       if (ret == AUL_R_OK && path)
-               set_last_result(APP_ERROR_NONE);
-       else if (ret == AUL_R_EREJECTED)
-               set_last_result(APP_ERROR_PERMISSION_DENIED);
-       else
-               set_last_result(APP_ERROR_OUT_OF_MEMORY);
-
-       return path;
-}
-
-char *app_get_shared_resource_path(void)
-{
-       const char *buf = aul_get_app_shared_resource_path();
-       return _STRDUP(buf);
-}
-
-char *app_get_shared_trusted_path(void)
-{
-       const char *buf = aul_get_app_shared_trusted_path();
-       return _STRDUP(buf);
-}
-
-char *app_get_external_data_path(void)
-{
-       const char *buf = aul_get_app_external_data_path();
-       return _STRDUP(buf);
-}
-
-char *app_get_external_cache_path(void)
-{
-       const char *buf = aul_get_app_external_cache_path();
-       return _STRDUP(buf);
-}
-
-char *app_get_external_shared_data_path(void)
-{
-       dlog_print(DLOG_WARN, LOG_TAG, "DEPRECATION WARNING: app_get_external_shared_data_path() is deprecated and will be removed from next release.");
-       const char *buf = aul_get_app_external_shared_data_path();
-       return _STRDUP(buf);
-}
-
-char *app_get_tep_resource_path(void)
-{
-       const char *buf = aul_get_app_tep_resource_path();
-       return _STRDUP(buf);
-}
-
diff --git a/app_common/app_resource_manager.c b/app_common/app_resource_manager.c
deleted file mode 100644 (file)
index f7f5ba0..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <aul_rsc_mgr.h>
-#include "app_resource_manager.h"
-
-int app_resource_manager_init()
-{
-       return aul_resource_manager_init();
-}
-
-int app_resource_manager_get(app_resource_e type, const char *id, char **path)
-{
-       return aul_resource_manager_get((aul_resource_e)type, id, path);
-}
-
-int app_resource_manager_release()
-{
-       return aul_resource_manager_release();
-}
-
diff --git a/app_control/CMakeLists.txt b/app_control/CMakeLists.txt
deleted file mode 100644 (file)
index 4df198f..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-SET(fw_name "capi-appfw-app-control")
-
-PROJECT(${fw_name})
-
-SET(CMAKE_INSTALL_PREFIX /usr)
-SET(PREFIX ${CMAKE_INSTALL_PREFIX})
-
-SET(INC_DIR ${CMAKE_SOURCE_DIR}/include)
-INCLUDE_DIRECTORIES(${INC_DIR})
-
-SET(requires "dlog bundle aul capi-base-common")
-SET(pc_requires "capi-base-common")
-
-INCLUDE(FindPkgConfig)
-pkg_check_modules(${fw_name} REQUIRED ${requires})
-FOREACH(flag ${${fw_name}_CFLAGS})
-    SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror")
-SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
-
-IF("${ARCH}" STREQUAL "arm")
-    ADD_DEFINITIONS("-DTARGET")
-ENDIF("${ARCH}" STREQUAL "arm")
-
-ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
-ADD_DEFINITIONS("-DSLP_DEBUG")
-
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
-
-add_library(${fw_name} SHARED
-               app_control.c
-               )
-
-TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS})
-
-SET_TARGET_PROPERTIES(${fw_name}
-     PROPERTIES
-     VERSION ${FULLVER}
-     SOVERSION ${MAJORVER}
-     CLEAN_DIRECT_OUTPUT 1
-)
-
-INSTALL(TARGETS ${fw_name} DESTINATION ${LIB_INSTALL_DIR})
-INSTALL(
-        DIRECTORY ${INC_DIR}/ DESTINATION include/appfw
-        FILES_MATCHING
-        PATTERN "*_private.h" EXCLUDE
-        PATTERN "${INC_DIR}/*.h"
-        )
-
-SET(PC_NAME ${fw_name})
-SET(PC_REQUIRED ${pc_requires})
-SET(PC_LDFLAGS -l${fw_name})
-
-CONFIGURE_FILE(
-    ${CMAKE_SOURCE_DIR}/capi-appfw-module.pc.in
-    ${CMAKE_SOURCE_DIR}/${fw_name}.pc
-    @ONLY
-)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
-
-
diff --git a/doc/appfw_app_common_doc.h b/doc/appfw_app_common_doc.h
deleted file mode 100755 (executable)
index d0ffb9a..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2014 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __TIZEN_APPFW_APP_COMMON_DOC_H__
-#define __TIZEN_APPFW_APP_COMMON_DOC_H__
-
- /**
- * @ingroup CAPI_APPLICATION_MODULE
- * @defgroup CAPI_APP_COMMON_MODULE App Common
- * @addtogroup CAPI_APP_COMMON_MODULE
- * @brief The @ref CAPI_APP_COMMON_MODULE API provides functions for getting information about the application.
- * @section CAPI_APP_COMMON_MODULE_HEADER Required Header
- *   \#include <app_common.h>
-
- * @section CAPI_APP_COMMON_MODULE_OVERVIEW Overview
- * The App common API provides common APIs that can be used at UI application and Service application.
- * This API provides interfaces for getting information about the application.
- *
- * @subsection CAPI_APPLICATION_MODULE_PACKAGE Application Package
- * The Tizen native application consists of structured directories to manage the application executable file, library files, resource files, and data.
- * When you build the application, the Tizen SDK packages those as an application package for distribution.
- *
- * @image html capi_appfw_application_package.png "Application package"
- * <table>
- * <tr>
- * <th>Directories</th>
- * <th>Description</th>
- * </tr>
- * <tr>
- * <td>&lt;package id&gt;</td>
- * <td>The fully qualified name of an application (such as org.tizen.calculator).</td>
- * </tr>
- * <tr>
- * <td>bin</td>
- * <td>The executable file of the application.</td>
- * </tr>
- * <tr>
- * <td>lib</td>
- * <td>The application library files</td>
- * </tr>
- * <tr>
- * <td>res</td>
- * <td>The root directory in which all resource files are located.\n
- * The application cannot write and modify any resource files</td>
- * </tr>
- * <tr>
- * <td>data</td>
- * <td>The root directory in which an application's private data is located.\n
- * The application can read and write its own data files in the application's data directory.</td>
- * </tr>
- * <tr>
- * <td>shared/</td>
- * <td>The shared directory for sharing with other applications.</td>
- * </tr>
- * </table>
- *
- * @subsection CAPI_APPLICATION_MODULE_GET_INFORMATION Getting Information About the Application
- * The API provides functions for obtaining an application's package name and absolute path to specified resources
- * like Image, Sound, Video, UI layout (EDJ), and so on.
- * It also provides functions to:
- * - Get the current orientation of the device
- * - Get the Internal/External root folders which are shared among all applications
- */
-
-#endif /* __TIZEN_APPFW_APP_COMMON_DOC_H__ */
-
diff --git a/doc/appfw_app_control_doc.h b/doc/appfw_app_control_doc.h
deleted file mode 100755 (executable)
index caad900..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2011 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __TIZEN_APPFW_APP_CONTROL_DOC_H__
-#define __TIZEN_APPFW_APP_CONTROL_DOC_H__
-
- /**
- * @ingroup CAPI_APPLICATION_MODULE
- * @defgroup CAPI_APP_CONTROL_MODULE App Control
- * @brief The @ref CAPI_APP_CONTROL_MODULE API provides functions to launch other applications.
- * @section CAPI_APP_CONTROL_MODULE_HEADER Required Header
- *   \#include <app_control.h>
- *
- * @section CAPI_APP_CONTROLMODULE_OVERVIEW Overview
- * <a href="https://developer.tizen.org/development/guides/native-application/application-management/application-controls/common-application-controls">Platform Application Controls</a>
- */
-
-#endif /* __TIZEN_APPFW_APP_CONTROL_DOC_H__ */
-
diff --git a/doc/appfw_app_doc.h b/doc/appfw_app_doc.h
deleted file mode 100755 (executable)
index 4026f36..0000000
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
- * Copyright (c) 2011 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __TIZEN_APPFW_APP_DOC_H__
-#define __TIZEN_APPFW_APP_DOC_H__
-
-/**
-* @ingroup CAPI_APPLICATION_FRAMEWORK
-* @defgroup CAPI_APPLICATION_MODULE Application
-* @addtogroup CAPI_APPLICATION_MODULE
-* @brief The @ref CAPI_APPLICATION_MODULE API provides functions to manage the main event loop, the application's state change events, basic system events,
-*        and get information about the application.
-* @section CAPI_APPLICATION_MODULE_HEADER Required Header
-*   \#include <app.h>
-*
-* @section CAPI_APPLICATION_MODULE_OVERVIEW Overview
-* The Application API handles an application state change or system events and provides mechanisms that launch other applications.
-* The Tizen native application is similar to a conventional Linux application, but has some additional features optimized for mobile devices,
-* which may have constraints such as relatively small screen sizes and lack of system resources compared to a larger system.
-* For example, for power management reasons, the application may wish to take actions to reduce usage when it finds out that it had its display window
-* covered over by another application's window. State change events are delivered so that this is possible.
-* The Application API provides interfaces for the following three categories:
-* - Starting or exiting the main event loop (mandatory for every Tizen native application)
-* - Registering callbacks for application state change events
-* - Registering callbacks for basic system events
-*
-* @subsection CAPI_APPLICATION_MODULE_EVENT_LOOP Event Loop
-* For an application to operate successfully, it must receive events from the platform.
-* For this, it needs to start the main event loop - this is mandatory for all Tizen native applications.
-* The ui_app_main() function is used to start the event loop.
-* Before calling this function, you should set up the #ui_app_lifecycle_callback_s structure, which is passed to the function (see the following sections).
-*
-* @subsection CAPI_APPLICATION_MODULE_STATE_CHANGE_EVENT Registering Callbacks for Application State Change Events
-* The application state change events include the following:
-* <p>
-* <table>
-* <tr>
-*  <th> State </th>
-*  <th> Description </th>
-* </tr>
-* <tr>
-*  <td> app_create_cb() </td>
-*  <td>Hook to take necessary actions before the main event loop starts.
-*   Your UI generation code should be placed here so that you do not miss any events from your application UI.
-* </td>
-* </tr>
-* <tr>
-*  <td> app_pause_cb() </td>
-*  <td> Hook to take necessary actions when an application becomes invisible.
-*    For example, you might wish to release memory resources so other applications can use these resources.
-*    It is important not to starve the application in front, which is interacting with the user.
-* </td>
-* </tr>
-* <tr>
-*  <td> app_resume_cb() </td>
-*  <td> Hook to take necessary actions when an application becomes visible.
-*   If anything is relinquished in app_pause_cb() but is necessary to resume
-*   the application, it must be re-allocated here.
-*  </td>
-* </tr>
-* <tr>
-*  <td> app_terminate_cb() </td>
-*  <td> Hook to take necessary actions when your application is terminating.
-*   Your application should release all resources, especially any
-*   allocations and shared resources must be freed here, so other running applications can fully use these shared resources.
-*  </td>
-* </tr>
-* <tr>
-*  <td> app_control_cb() </td>
-*  <td> Hook to take necessary actions when your application called by another application.
-*   When the application gets launch request, this callback function is called.
-*   The application can get information about what is to be performed by using App Control API from app_control handle.
-*  </td>
-* </tr>
-* </table>
-* For further explanation of application state changes, see the @ref CAPI_APPLICATION_MODULE_STATES_TRANSITIONS section.
-*
-* @subsection CAPI_APPLICATION_MODULE_SYSTEM_EVENT Registering Callbacks for System Events
-* The system event callbacks can be registered using ui_app_add_event_handler(). Multiple system event callbacks can be registered.
-* The basic system event includes the following:
-* <p>
-* <table>
-* <tr>
-*  <th> System event types </th>
-*  <th> Description </th>
-* </tr>
-* <tr>
-*  <td> APP_EVENT_LOW_MEMORY </td>
-*  <td> The system memory is running low.
-*   Recommended actions are as follows:
-* - Action 1. Save data in main memory to persistent memory/storage
-*   to avoid data loss in case the Tizen platform Low Memory Killer kills your application to get more free memory.
-*   The explanation of how Low Memory Killer behaves is here(link), but basically if the low memory notice does not lead to enough
-*   memory being freed, something will be killed. Release cached data in main memory to secure more free memory.
-* </td>
-* </tr>
-* <tr>
-*  <td> APP_EVENT_LOW_BATTERY </td>
-*  <td> The battery power is running low.
-*   Recommended actions are as follows:
-* - Action 1. Save data in main memory to persistent memory/storage to avoid sudden loss of data in case power goes off completely.
-* - Action 2. Stop heavy CPU consumption or power consumption activities to save remaining power.
-* </td>
-* </tr>
-* <tr>
-*  <td> APP_EVENT_DEVICE_ORIENT </td>
-*  <td> The orientation of device is changed.
-*   Recommended action is as follows: change display orientation to match the display orientation
-* </td>
-* </tr>
-* <tr>
-*  <td> APP_EVANG_LANGUAGE_CHANGED </td>
-*  <td> The language setting is changed.
-*   Recommended action: refresh the display into the new language
-* </td>
-* </tr>
-* <tr>
-*  <td> APP_EVENT_REGION_FORMAT_CHANGED </td>
-*  <td> The region format setting changed.
-*   Region change means a different time zone; the application UI may need to update the time to reflect the time zone change.
-* </td>
-* </tr>
-* <tr>
-*  <td> APP_EVENT_SUSPENDED_STATE_CHANGED </td>
-*  <td> The suspended state is changed.
-*   The application will enter the suspended state, or exit from the state. Do the necessary action before or after suspended; the application shall not respond to requests of the other modules.
-*  </td>
-* </tr>
-* </table>
-*
-* @subsection CAPI_APPLICATION_MODULE_STATES_TRANSITIONS The Application States and Transitions
-* The Tizen native application can be in one of the several different states. Typically, the application is launched by the user from the Launcher, or by
-* another application. As the application is starting, app_create_cb() is executed, and then the main event loop starts. After executing event loop, app_control_cb() and app_resume_cb() will be invoked.
-* The application now normally becomes the front-most window with focus. When the application loses the front-most/focus status, the app_pause_cb() callback is invoked.
-* There are many scenarios for your application to go into the pause state, which means your application is not terminated, but is running in the background:
-* - A new application is launched from the request of your application
-* - The user requests to go to the home screen
-* - A system event occurs and it causes a resident application with higher priority (e.g. a phone call is received) to become active, and hides
-*   your application temporarily
-* - An alarm went off for another application so it now becomes the top-most window and hides your application
-*
-* Since Tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif, the application on the background goes in to a suspended state. In the suspended state, the application process is executed with limited CPU resources.
-* In other words, the platform does not allow the running of the background applications.
-*  When your application becomes visible again, the app_resume_cb() callback is invoked. Some possible scenarios for your application to become visible are:
-* - Another application requests your application to run (perhaps the Task Navigator which shows all running applications and lets
-*   the user select any app to run)
-* - All applications on top of your application in the window stack finish
-* - An alarm is going off for your application so it becomes the top-most window and hides other applications
-* When your application starts exiting, the app_pause_cb() callback is invoked if the application is visible, and then the app_terminate_cb() callback is invoked.
-* Possible scenarios to start termination of your application are:
-* - Your application itself requests to exit by calling ui_app_exit() to terminate the event loop
-* - The Low Memory Killer is killing your application in a low memory situation.
-* Note that a service application doesn't have UI, so the service application doesn't have Paused state.
-* Application state changes are managed by the underlying framework.
-* Refer to the following state diagram to see the possible transitions:
-*
-* @image html capi_appfw_application_states.png "Application states"
-* <p>
-* <table>
-* <tr>
-*  <th> State </th>
-*  <th> Description </th>
-* </tr>
-* <tr>
-*  <td> READY </td>
-*  <td> The application is launched. </td>
-* </tr>
-* <tr>
-*  <td> CREATED </td>
-*  <td> The application starts the main loop. </td>
-* </tr>
-* <tr>
-*  <td> RUNNING </td>
-*  <td> The application is running and visible to the user. </td>
-* </tr>
-* <tr>
-*  <td> PAUSED </td>
-*  <td> The application is running but invisible to the user. </td>
-* </tr>
-* <tr>
-*  <td> TERMINATED </td>
-*  <td> The application is terminated </td>
-* </tr>
-* </table>
-* The Application API defines five states with their corresponding transition handlers.
-* The state transition is notified through the state transition callback function,
-* whether the application is created, is running, is paused, is resumed, or is terminated.
-* And the application has to perform a specific task that is appropriate to those state changes.
-*
-* @image html capi_appfw_application_lifecycle.png "General application lifecycle"
-*
-* @subsection CAPI_APPLICATION_MODULE_HOW_TO_START  How to start the Tizen native application
-* An application can be launched by the user from the Launcher or by another application.
-* Regardless of how an application is launched, the Application Framework starts an application by creating a new process and calls
-* the entry point of the application. Like a conventional Linux application, the main function of its application is the entry point.
-* In the Tizen application, the main task is to hand over control to the Application Framework by calling the ui_app_main() function.
-*
-* @code
-* bool
-* app_create(void *user_data)
-* {
-*     // Hook to take necessary actions before the main event loop starts
-*     // Initialize UI resources and application's data
-*     // If this function returns @c true, the main loop of the application starts
-*     // If this function returns @c false, the application is terminated
-*     return true;
-* }
-*
-* void
-* app_control(app_control_h app_control, void *user_data)
-* {
-*     // Handle the launch request
-* }
-*
-* void
-* app_pause(void *user_data)
-* {
-*     // Take necessary actions when the application becomes invisible
-* }
-*
-* void
-* app_resume(void *user_data)
-* {
-*     // Take necessary actions when the application becomes visible
-* }
-*
-* void
-* app_terminate(void *user_data)
-* {
-*     // Release all resources
-* }
-*
-* int
-* main(int argc, char *argv[])
-* {
-*     struct appdata ad;
-*
-*     ui_app_lifecycle_callback_s event_callback = {0,};
-*
-*     event_callback.create = app_create;
-*     event_callback.terminate = app_terminate;
-*     event_callback.pause = app_pause;
-*     event_callback.resume = app_resume;
-*     event_callback.app_control = app_control;
-*
-*     memset(&ad, 0x0, sizeof(struct appdata));
-*
-*     return ui_app_main(argc, argv, &event_callback, &ad);
-* }
-* @endcode
-*
-* The ui_app_main() function initializes the application and then starts the main loop.
-* The ui_app_main() function takes four parameters and uses them to initialize the application.
-* The @a argc and @a argv parameters contain the values from the Application Framework, so that you should never have to change the values.
-* The third parameter is a state transition handler that is responsible for managing the state
-* transitions that the application goes through while it is running. The fourth parameter is the application data to be passed to each state handler.
-* When ui_app_main() is first invoked, the application moves from the ready state to the created state.
-* The application has to initialize itself.
-* During this transition, the Application Framework calls the application's app_create_cb() state transition callback function just
-* before the application enters the main loop. Within the registered app_create_cb() callback function, you should initialize the
-* application's resources and create the main window.
-* If the app_create_cb() callback function returns @c false, the application moves to the terminated state.\n
-* If the app_create_cb() callback function returns @c true, the application enters the main loop.
-*
-* @subsection CAPI_APPLICATION_MODULE_LAUNCH_OPTIONS Handling the launch options
-* The Application Framework calls the application's app_control_cb() callback function just after the application enters the main loop.
-* This callback function is passed to the app_control containing the reason due to which the application is launched.
-* For example, the application might be launched to open a file to handle the request that has been sent by another application.
-* In all of these cases, the application is responsible for checking the contents of the app_control and responding appropriately.
-* The contents of the app_control can be empty in situations where the application is launched by the user from the Launcher.
-*
-* @code
-* static void
-* app_control(app_control_h app_control, void *user_data)
-* {
-*     struct appdata *ad = (struct appdata *)user_data;
-*     char *operation;
-*     char *uri;
-*     char *mime_type;
-*
-*     app_control_get_operation(app_control, operation);
-*
-*     if (!strcmp(operation, SERVICE_OPERATION_VIEW)) {
-*         app_control_get_uri(app_control, &uri);
-*         app_control_get_mime(app_control, &mime_type);
-*
-*         if (uri && !strcmp(mime_type, "image/jpg"))
-*             display_image_file(ad, uri); // Display a specific image file
-*     }
-*
-*     if (ad->win)
-*         elm_win_activate(ad->win);
-* }
-* @endcode
-*/
-
-#endif /* __TIZEN_APPFW_APP_DOC_H__ */
-
diff --git a/doc/appfw_event_doc.h b/doc/appfw_event_doc.h
deleted file mode 100755 (executable)
index 1adb65f..0000000
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __TIZEN_APPFW_EVENT_DOC_H__
-#define __TIZEN_APPFW_EVENT_DOC_H__
-
- /**
- * @ingroup CAPI_APPLICATION_MODULE
- * @defgroup CAPI_EVENT_MODULE Event
- * @brief The @ref CAPI_EVENT_MODULE API provides functions to serve publication and subscription of the event.
- * @section CAPI_EVENT_MODULE_HEADER Required Header
- *   \#include <app_event.h>
- * @section CAPI_EVENT_MODULE_OVERVIEW Overview
- * The @ref CAPI_EVENT_MODULE API provides functions to broadcast user-defined event.
- * - event_publish_app_event()
- * - event_publish_trusted_app_event()
- * If you want to send an event to trusted application, you can use event_publish_trusted_app_event() API.
- * Only applications which have same signature with sender application can receive the event.
- * The @ref CAPI_EVENT_MODULE API provides functions to add and remove the event handler for event subscription.
- * The event handler's function will be called when the interested event occurs.
- * Adding multiple event handlers to one event is possible.
- * There are two types of events:
- * - User-Event is user-defined event.
- * - System-Event is pre-defined platform event. See definitions for system event.
- * NOTE: You can't receive the system-event which is not supported on the target device, even if you register event handler for that event.
- * Some system-events require the privilege. (Refer to @ref CAPI_EVENT_MODULE_PRIVILEGED_SYSTEM_EVENT)
- * The type of event data is bundle type.
- * - For System-Event, see definitions for key and value of system event.
- *
- * @subsection CAPI_EVENT_MODULE_EVENT_FORMAT The name-format of User-Event
- * The format of the User-Event's name MUST be "event.{sender's appid}.{user-defined name}", unless the API calls using event_name will fail.
- * The {user-defined name} have some restrictions.
- * - Must have length of Min 1 byte and Max 127 bytes.
- * - Must only contain the characters("[A~Z][a~z][0~9]_") and not begin with a digit.
- * For example,
- *     "event.org.tizen.testapp.user_event_1".
- *
- * @subsection CAPI_EVENT_MODULE_LAUNCH_ON_EVENT Launch-On-Event (Service Application only)
- * Service application can be launched by event triggering.
- * For Launch-On-Event,
- * - The APP_CONTROL_OPERATION_LAUNCH_ON_EVENT must be defined in the manifest file.
- * - The URI name represents event name and the format is "event://{event name"}".
- *         For URI example,
- *             "event://tizen.system.event.battery_charger_status". (System-Event)
- * - The APP_CONTROL_OPERATION_LAUNCH_ON_EVENT can not be requested via app_control_send_launch_request().
- * How to know the triggered event after launch by event triggering.
- * - You can get the event name and data in the first call of app_control_cb, which is called after 'Created' of application states.
- *
- * @code
- * static void
- * app_control(app_control_h app_control, void *data)
- * {
- *     // Check "launch on event"
- *     int ret = 0;
- *     const char *event_uri = "event://tizen.system.event.battery_charger_status";
- *     char *operation = NULL;
- *     char *uri = NULL;
- *     char *event_value = NULL;
- *
- *     ret = app_control_get_operation(app_control, &operation);
- *     if (ret == APP_CONTROL_ERROR_NONE && operation &&
- *         strcmp(operation, APP_CONTROL_OPERATION_LAUNCH_ON_EVENT) == 0) {
- *         ret = app_control_get_uri(app_control, &uri);
- *         if (ret == APP_CONTROL_ERROR_NONE && uri) {
- *             if (strncmp(uri, event_uri, strlen(event_uri) + 1) == 0) {
- *                 ret = app_control_get_extra_data(app_control, "battery_charger_status", &event_value);
- *                 if (ret == APP_CONTROL_ERROR_NONE && event_value)
- *                     free(event_value);
- *             }
- *             free(uri);
- *         }
- *         free(operation);
- *     }
- * }
- * @endcode
- * - Use event_add_event_handler() API in the first called app_control_cb for further subscription of that event.
- * NOTE: Only some of System-Events support Launch-On-Event.
- * The System-Events and their Conditions which support Launch-On-Event are listed in the table below.
- * <table>
- * <tr>
- * <th>Name</th>
- * <th>Condition</th>
- * </tr>
- * <tr>
- * <td>SYSTEM_EVENT_BATTERY_CHARGER_STATUS</td>
- * <td>When Charger CONNECTED</td>
- * </tr>
- * <tr>
- * <td>SYSTEM_EVENT_USB_STATUS</td>
- * <td>When USB CONNECTED</td>
- * </tr>
- * <tr>
- * <td>SYSTEM_EVENT_EARJACK_STATUS</td>
- * <td>When Earjack CONNECTED</td>
- * </tr>
- * <tr>
- * <td>SYSTEM_EVENT_INCOMING_MSG</td>
- * <td>When MSG_TYPE & MSG_ID exist</td>
- * </tr>
- * </table>
- *
- * @subsection CAPI_EVENT_MODULE_PRIVILEGED_SYSTEM_EVENT Privileged System-Events
- * There are some system-events which need the privilege for normal operation.
- * You can know these privileged system-events from the 'privilege' comment of the definition of each system-event.
- * If you try to add event handler for these events without privilege, you will get EVENT_ERROR_PERMISSION_DENIED return when you use the API for adding event handler.
- * Also, if you declare app_control operation and URI in the manifest file for these events to enable 'Launch On Event' without privilege, there will be no real launch.
- * @subsection CAPI_EVENT_MODULE_SYSTEM_EVENT Supported System-Events.
- * The supported system-event's name, keys, and values of each event are listed in the table below.
- * <table>
- * <tr>
- * <th>Name</th>
- * <th>Key</th>
- * <th>Value</th>
- * </tr>
- * <tr>
- * <td>SYSTEM_EVENT_BATTERY_CHARGER_STATUS</td>
- * <td>EVENT_KEY_BATTERY_CHARGER_STATUS</td>
- * <td>EVENT_VAL_BATTERY_CHARGER_DISCONNECTED<br/>EVENT_VAL_BATTERY_CHARGER_CONNECTED<br/>EVENT_VAL_BATTERY_CHARGER_CHARGING<br/>EVENT_VAL_BATTERY_CHARGER_DISCHARGING</td>
- * </tr>
- * <tr>
- * <td>SYSTEM_EVENT_BATTERY_LEVEL_STATUS</td>
- * <td>EVENT_KEY_BATTERY_LEVEL_STATUS</td>
- * <td>EVENT_VAL_BATTERY_LEVEL_EMPTY<br/>EVENT_VAL_BATTERY_LEVEL_CRITICAL<br/>EVENT_VAL_BATTERY_LEVEL_LOW<br/>EVENT_VAL_BATTERY_LEVEL_HIGH<br/>EVENT_VAL_BATTERY_LEVEL_FULL</td>
- * </tr>
- * <tr>
- * <td>SYSTEM_EVENT_USB_STATUS</td>
- * <td>EVENT_KEY_USB_STATUS</td>
- * <td>EVENT_VAL_USB_DISCONNECTED<br/>EVENT_VAL_USB_CONNECTED<br/>EVENT_VAL_USB_AVAILABLE</td>
- * </tr>
- * <tr>
- * <td>SYSTEM_EVENT_EARJACK_STATUS</td>
- * <td>EVENT_KEY_EARJACK_STATUS</td>
- * <td>EVENT_VAL_EARJACK_DISCONNECTED<br/>EVENT_VAL_EARJACK_CONNECTED</td>
- * </tr>
- * <tr>
- * <td>SYSTEM_EVENT_DISPLAY_STATE</td>
- * <td>EVENT_KEY_DISPLAY_STATE</td>
- * <td>EVENT_VAL_DISPLAY_NORMAL<br/>EVENT_VAL_DISPLAY_DIM<br/>EVENT_VAL_DISPLAY_OFF</td>
- * </tr>
- * <tr>
- * <td>SYSTEM_EVENT_BOOT_COMPLETED</td>
- * <td>N/A</td>
- * <td>N/A</td>
- * </tr>
- * <tr>
- * <td>SYSTEM_EVENT_SYSTEM_SHUTDOWN</td>
- * <td>N/A</td>
- * <td>N/A</td>
- * </tr>
- * <tr>
- * <td>SYSTEM_EVENT_LOW_MEMORY</td>
- * <td>EVENT_KEY_LOW_MEMORY</td>
- * <td>EVENT_VAL_MEMORY_NORMAL<br/>EVENT_VAL_MEMORY_SOFT_WARNING<br/>EVENT_VAL_MEMORY_HARD_WARNING</td>
- * </tr>
- * <tr>
- * <td>SYSTEM_EVENT_WIFI_STATE</td>
- * <td>EVENT_KEY_WIFI_STATE</td>
- * <td>EVENT_VAL_WIFI_OFF<br/>EVENT_VAL_WIFI_ON<br/>EVENT_VAL_WIFI_CONNECTED</td>
- * </tr>
- * <tr>
- * <td rowspan="3">SYSTEM_EVENT_BT_STATE</td>
- * <td>EVENT_KEY_BT_STATE</td>
- * <td>EVENT_VAL_BT_OFF<br/>EVENT_VAL_BT_ON</td>
- * </tr>
- * <tr>
- * <td>EVENT_KEY_BT_LE_STATE</td>
- * <td>EVENT_VAL_BT_LE_OFF<br/>EVENT_VAL_BT_LE_ON</td>
- * </tr>
- * <tr>
- * <td>EVENT_KEY_BT_TRANSFERING_STATE</td>
- * <td>EVENT_VAL_BT_NON_TRANSFERING<br/>EVENT_VAL_BT_TRANSFERING</td>
- * </tr>
- * <tr>
- * <td>SYSTEM_EVENT_LOCATION_ENABLE_STATE</td>
- * <td>EVENT_KEY_LOCATION_ENABLE_STATE</td>
- * <td>EVENT_VAL_LOCATION_DISABLED<br/>EVENT_VAL_LOCATION_ENABLED</td>
- * </tr>
- * <tr>
- * <td>SYSTEM_EVENT_GPS_ENABLE_STATE</td>
- * <td>EVENT_KEY_GPS_ENABLE_STATE</td>
- * <td>EVENT_VAL_GPS_DISABLED<br/>EVENT_VAL_GPS_ENABLED</td>
- * </tr>
- * <tr>
- * <td>SYSTEM_EVENT_NPS_ENABLE_STATE</td>
- * <td>EVENT_KEY_NPS_ENABLE_STATE</td>
- * <td>EVENT_VAL_NPS_DISABLED<br/>EVENT_VAL_NPS_ENABLED</td>
- * </tr>
- * <tr>
- * <td rowspan="2">SYSTEM_EVENT_INCOMING_MSG</td>
- * <td>EVENT_KEY_MSG_TYPE</td>
- * <td>EVENT_VAL_SMS<br/>EVENT_VAL_PUSH<br/>EVENT_VAL_CB</td>
- * </tr>
- * <tr>
- * <td>EVENT_KEY_MSG_ID</td>
- * <td>string of unsigned int type value.</td>
- * </tr>
- * <tr>
- * <td>SYSTEM_EVENT_TIME_CHANGED</td>
- * <td>N/A</td>
- * <td>N/A</td>
- * </tr>
- * <tr>
- * <td>SYSTEM_EVENT_TIME_ZONE</td>
- * <td>EVENT_KEY_TIME_ZONE</td>
- * <td>The value of this key is timezone value of tz database, for example,<br/> "Asia/Seoul", "America/New_York",<br/>. Refer to the Time Zone Database of IANA.</td>
- * </tr>
- * <tr>
- * <td>SYSTEM_EVENT_HOUR_FORMAT</td>
- * <td>EVENT_KEY_HOUR_FORMAT</td>
- * <td>EVENT_VAL_HOURFORMAT_12<br/>EVENT_VAL_HOURFORMAT_24</td>
- * </tr>
- * <tr>
- * <td>SYSTEM_EVENT_LANGUAGE_SET</td>
- * <td>EVENT_KEY_LANGUAGE_SET</td>
- * <td>The value of this key is full name of locale, for example,<br/> "ko_KR.UTF8" : in case of Korean language<br/> "en_US.UTF8" : in case of USA language,<br/>. Refer to linux locale info.</td>
- * </tr>
- * <tr>
- * <td>SYSTEM_EVENT_REGION_FORMAT</td>
- * <td>EVENT_KEY_REGION_FORMAT</td>
- * <td>The value of this key is full name of locale, for example,<br/> "ko_KR.UTF8" : in case of Korean region format<br/> "en_US.UTF8" : in case of USA region format,<br/>. Refer to linux locale info.</td>
- * </tr>
- * <tr>
- * <td>SYSTEM_EVENT_SILENT_MODE</td>
- * <td>EVENT_KEY_SILENT_MODE</td>
- * <td>EVENT_VAL_SILENTMODE_ON<br/>EVENT_VAL_SILENTMODE_OFF</td>
- * </tr>
- * <tr>
- * <td>SYSTEM_EVENT_VIBRATION_STATE</td>
- * <td>EVENT_KEY_VIBRATION_STATE</td>
- * <td>EVENT_VAL_VIBRATION_ON<br/>EVENT_VAL_VIBRATION_OFF</td>
- * </tr>
- * <tr>
- * <td>SYSTEM_EVENT_SCREEN_AUTOROTATE_STATE</td>
- * <td>EVENT_KEY_SCREEN_AUTOROTATE_STATE</td>
- * <td>EVENT_VAL_SCREEN_AUTOROTATE_ON<br/>EVENT_VAL_SCREEN_AUTOROTATE_OFF</td>
- * </tr>
- * <tr>
- * <td>SYSTEM_EVENT_MOBILE_DATA_STATE</td>
- * <td>EVENT_KEY_MOBILE_DATA_STATE</td>
- * <td>EVENT_VAL_MOBILE_DATA_OFF<br/>EVENT_VAL_MOBILE_DATA_ON</td>
- * </tr>
- * <tr>
- * <td>SYSTEM_EVENT_DATA_ROAMING_STATE</td>
- * <td>EVENT_KEY_DATA_ROAMING_STATE</td>
- * <td>EVENT_VAL_DATA_ROAMING_OFF<br/>EVENT_VAL_DATA_ROAMING_ON</td>
- * </tr>
- * <tr>
- * <td>SYSTEM_EVENT_FONT_SET</td>
- * <td>EVENT_KEY_FONT_SET</td>
- * <td>The value of this key is font name of string type by font-config.</td>
- * </tr>
- * <tr>
- * <td>SYSTEM_EVENT_NETWORK_STATUS</td>
- * <td>EVENT_KEY_NETWORK_STATUS</td>
- * <td>EVENT_VAL_NETWORK_DISCONNECTED<br/>EVENT_VAL_NETWORK_WIFI<br/>EVENT_VAL_NETWORK_CELLULAR<br/>EVENT_VAL_NETWORK_ETHERNET<br/>EVENT_VAL_NETWORK_BT<br/>EVENT_VAL_NETWORK_NET_PROXY</td>
- * </tr>
- * </table>
- */
-
-#endif /* __TIZEN_APPFW_EVENT_DOC_H__ */
-
diff --git a/doc/appfw_i18n_doc.h b/doc/appfw_i18n_doc.h
deleted file mode 100755 (executable)
index 6d1a284..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2011 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __TIZEN_APPFW_I18N_DOC_H__
-#define __TIZEN_APPFW_I18N_DOC_H__
-
-
- /**
- * @ingroup CAPI_APPLICATION_MODULE
- * @defgroup CAPI_I18N_MODULE Internationalization
- * @brief The Internationalization API provides functions to write multilingual applications through GNU gettext.
- * @section CAPI_I18_MODULE_HEADER Required Header
- *   \#include <app.h>
- * @section CAPI_I18N_MODULE_OVERVIEW Overview
- * The @ref CAPI_I18N_MODULE API provides functions to write multilingual applications through GNU gettext.
- * <p>
- * Tizen provides all the features of the GNU gettext library through the Internationalization API
- * and allows you to manage message catalogs from SDK.
- * <p>
- * The Internationalization API consists of i18n_get_text() for message translation
- * and macros to use i18n_get_text() in an easy to use form.
- * These macros allow you to mark strings for translation in source codes,
- * which are replaced with the translated strings at runtime.
- * <p>
- */
-
-
-#endif /* __TIZEN_APPFW_I18N_DOC_H__ */
diff --git a/doc/appfw_preference_doc.h b/doc/appfw_preference_doc.h
deleted file mode 100755 (executable)
index 4e962a4..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2011 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __TIZEN_APPFW_PREFERENCE_DOC_H__
-#define __TIZEN_APPFW_PREFERENCE_DOC_H__
-
- /**
- * @ingroup CAPI_APPLICATION_MODULE
- * @defgroup CAPI_PREFERENCE_MODULE Preference
- * @addtogroup CAPI_PREFERENCE_MODULE
- * @brief The @ref CAPI_PREFERENCE_MODULE API provides functions to store and retrieve small pieces of data used for application preferences.
- * @section CAPI_PREFERENCE_MODULE_HEADER Required Header
- *   \#include <app_preference.h>
-
- * @section CAPI_PREFERENCE_MODULE_OVERVIEW Overview
- * The Preference API provides a mechanism that saves data items in the form of key/value pairs for this application, and later retrieves them.
- * A typical usecase would be for an application preference screen where the user can pick some values for some options. The Preference API
- * has pairs of functions, one to set such a pair, another to retrieve the stored value given in the key. Keys are always text strings, but
- * there are functions for each of the possible value types: integer, double, string, and boolean. There is also a function to clear all of the preferences.
- * The @ref CAPI_PREFERENCE_MODULE API provides a way to register a callback to get notified when a value for a particular key changes.
- * It is useful to know when the display should be updated or some behavior is altered as a result.
- * There is an iterator function which steps through all the data pairs, invoking a callback for each one.
- */
-
-#endif /* __TIZEN_APPFW_PREFERENCE_DOC_H__ */
-
diff --git a/doc/appfw_resource_manager_doc.h b/doc/appfw_resource_manager_doc.h
deleted file mode 100755 (executable)
index 5359262..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __TIZEN_APPFW_APP_RESOURCE_MANAGER_DOC_H__
-#define __TIZEN_APPFW_APP_RESOURCE_MANAGER_DOC_H__
-
-/**
- * @ingroup CAPI_APPLICATION_MODULE
- * @defgroup CAPI_RESOURCE_MANAGER_MODULE Resource Manager
- * @brief The @ref CAPI_RESOURCE_MANAGER_MODULE API provides functions to get/set the common resource for multiple devices.
- * @section CAPI_RESOURCE_MANAGER_MODULE_HEADER Required Header
- * \#include <app_resource_manager.h>
- *
- * @section CAPI_RESOURCE_MANAGER_MODULE_OVERVIEW Overview
- * The @ref CAPI_RESOURCE_MANAGER_MODULE API provides functions to use different resources(images, layout, sounds) between each device having different device specifications.
- * For example, if you want to change button image of the application depending on the device's current language setting, put resource files into different folders which are managed by SDK as the same filename.
- * Then call app_resource_manager_get() with resource ID described below to get the appropriate resource filepath, then OS will choose resources for specific devices.
- * You should get the path of the resource file that is managed by the resource manager with app_resource_manager_get() API.
- * Tizen may remove unnecessary resource files for a certain device, so you may fail to access if you access the resource file with the path that is not recieved with app_resource_manager_get() API.
- * Make sure app_resource_manager_init() should be called first and app_resource_manager_release should be called after using resource manager.
- *
- * @section CAPI_RESOURCE_MANAGER_MODULE_RESOURCE_ID Resource ID
- * Resource ID is an identifier for specific resource. It consists of sub directories and filename including its extension.
- * Same resources are located at different locations with same filename for supporting multiple devices.
- * If you want to get actual filename with given resourceID, refer app_resource_manager_get().
- *
- * @section CAPI_RESOURCE_MANAGER_MODULE_RESOURCE_TYPE Resource Type
- * For now, 4 resource types are supported.
- * Resource which has same resource type are grouped as folder.
- * Folder name is irrelevant with its actual resource type.
- * The managed folders for each type will be generated by SDK tools.
- * In source codes, you can use resource types listed below.
- * (Types will be added for further needs)
- * <table>
- * <tr>
- * <th>TYPE</th>
- * <th>Description</th>
- * </tr>
- * <tr>
- * <td>RSC_TYPE_IMAGE</td>
- * <td>Image resources.</td>
- * </tr>
- * <tr>
- * <td>RSC_TYPE_LAYOUT</td>
- * <td>Application's layout to be displayed.</td>
- * </tr>
- * <tr>
- * <td>RSC_TYPE_SOUND</td>
- * <td>Sound, audio resources.</td>
- * </tr>
- * <tr>
- * <td>RSC_TYPE_BIN</td>
- * <td>All other resources to be needed, but not specified above.</td>
- * </tr>
- * </table>
- *
- * @subsection CAPI_RESOURCE_MANAGER_MODULE_MATCHING_ALGORITHM Matching Algorithm
- *
- * @image html capi_appfw_application_resource.png "Matching Algorithm"
- */
-
-#endif /* __TIZEN_APPFW_APP_RESOURCE_MANAGER_DOC_H__ */
-
diff --git a/doc/images/capi_appfw_application_lifecycle.png b/doc/images/capi_appfw_application_lifecycle.png
deleted file mode 100755 (executable)
index 840505c..0000000
Binary files a/doc/images/capi_appfw_application_lifecycle.png and /dev/null differ
diff --git a/doc/images/capi_appfw_application_package.png b/doc/images/capi_appfw_application_package.png
deleted file mode 100755 (executable)
index 21d43f6..0000000
Binary files a/doc/images/capi_appfw_application_package.png and /dev/null differ
diff --git a/doc/images/capi_appfw_application_resource.png b/doc/images/capi_appfw_application_resource.png
deleted file mode 100755 (executable)
index db6129b..0000000
Binary files a/doc/images/capi_appfw_application_resource.png and /dev/null differ
diff --git a/doc/images/capi_appfw_application_states.png b/doc/images/capi_appfw_application_states.png
deleted file mode 100755 (executable)
index 3bcec5a..0000000
Binary files a/doc/images/capi_appfw_application_states.png and /dev/null differ
diff --git a/event/CMakeLists.txt b/event/CMakeLists.txt
deleted file mode 100644 (file)
index da32ca0..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-SET(fw_name "capi-appfw-event")
-
-PROJECT(${fw_name})
-
-SET(CMAKE_INSTALL_PREFIX /usr)
-SET(PREFIX ${CMAKE_INSTALL_PREFIX})
-
-SET(INC_DIR ${CMAKE_SOURCE_DIR}/include)
-INCLUDE_DIRECTORIES(${INC_DIR})
-
-SET(requires "glib-2.0 dlog bundle eventsystem capi-base-common appcore-common")
-SET(pc_requires "capi-base-common")
-
-INCLUDE(FindPkgConfig)
-pkg_check_modules(${fw_name} REQUIRED ${requires})
-FOREACH(flag ${${fw_name}_CFLAGS})
-    SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC")
-SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -Wall -Werror")
-
-IF("${ARCH}" STREQUAL "arm")
-    ADD_DEFINITIONS("-DTARGET")
-ENDIF("${ARCH}" STREQUAL "arm")
-
-ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
-ADD_DEFINITIONS("-DSLP_DEBUG")
-
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
-
-add_library(${fw_name} SHARED
-               event.c
-               )
-
-TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS})
-
-SET_TARGET_PROPERTIES(${fw_name}
-     PROPERTIES
-     VERSION ${FULLVER}
-     SOVERSION ${MAJORVER}
-     CLEAN_DIRECT_OUTPUT 1
-)
-
-INSTALL(TARGETS ${fw_name} DESTINATION ${LIB_INSTALL_DIR})
-INSTALL(
-        DIRECTORY ${INC_DIR}/ DESTINATION include/appfw
-        FILES_MATCHING
-        PATTERN "*_private.h" EXCLUDE
-        PATTERN "${INC_DIR}/*.h"
-        )
-
-SET(PC_NAME ${fw_name})
-SET(PC_REQUIRED ${pc_requires})
-SET(PC_LDFLAGS -l${fw_name})
-
-CONFIGURE_FILE(
-    ${CMAKE_SOURCE_DIR}/capi-appfw-module.pc.in
-    ${CMAKE_SOURCE_DIR}/${fw_name}.pc
-    @ONLY
-)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
-
-
diff --git a/event/event.c b/event/event.c
deleted file mode 100644 (file)
index edb6c16..0000000
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdlib.h>
-#include <glib.h>
-#include <tizen.h>
-#include <dlog.h>
-#include <app_event.h>
-#include <eventsystem.h>
-#include <app_internal.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "CAPI_APPFW_EVENT"
-
-typedef struct event_handler {
-       char *event_name;
-       int event_type;
-       unsigned int reg_id;
-       event_cb cb;
-       void *user_data;
-} event_handler_s;
-
-typedef struct event_cb_data {
-       bundle *event_data;
-       void *user_data;
-} event_cb_data_s;
-
-static GHashTable *interested_event_table;
-static int _initialized;
-static event_cb earlier_callback;
-static pthread_mutex_t register_sync_lock = PTHREAD_MUTEX_INITIALIZER;
-
-static const char *event_error_to_string(event_error_e error)
-{
-       switch (error) {
-       case EVENT_ERROR_NONE:
-               return "NONE";
-       case EVENT_ERROR_INVALID_PARAMETER:
-               return "INVALID_PARAMETER";
-       case EVENT_ERROR_OUT_OF_MEMORY:
-               return "OUT_OF_MEMORY";
-       case EVENT_ERROR_TIMED_OUT:
-               return "TIMED_OUT";
-       case EVENT_ERROR_IO_ERROR:
-               return "IO ERROR";
-       case EVENT_ERROR_PERMISSION_DENIED:
-               return "PERMISSION DENIED";
-       default:
-               return "UNKNOWN";
-       }
-}
-
-int event_error(event_error_e error, const char *function, const char *description)
-{
-       if (description) {
-               LOGE("[%s] %s(0x%08x) : %s", function, event_error_to_string(error),
-                       error, description);
-       } else {
-               LOGE("[%s] %s(0x%08x)", function, event_error_to_string(error), error);
-       }
-
-       return error;
-}
-
-static void event_do_cb(gpointer data, gpointer user_data)
-{
-       event_handler_h handler = (event_handler_h)data;
-       event_cb_data_s *cb_data = (event_cb_data_s *)user_data;
-
-       if (handler->cb) {
-               handler->cb(handler->event_name,
-                       cb_data->event_data, cb_data->user_data);
-       }
-}
-
-static void event_eventsystem_callback(const char *event_name,
-       bundle_raw *event_data, int len, void *user_data)
-{
-       bundle *b_to = NULL;
-       bundle *b = NULL;
-
-       LOGD("event_name(%s)", event_name);
-
-       if (earlier_callback != NULL) {
-               b_to = bundle_decode(event_data, len);
-               if (b_to == NULL) {
-                       LOGE("bundle_decode failed");
-                       return;
-               }
-               earlier_callback(event_name, b_to, user_data);
-               bundle_free(b_to);
-               return;
-       }
-
-       GList *handler_list = (GList *)g_hash_table_lookup(interested_event_table,
-               event_name);
-       if (handler_list) {
-               event_cb_data_s *cb_data = NULL;
-               cb_data = calloc(1, sizeof(event_cb_data_s));
-               if (cb_data == NULL) {
-                       LOGE("memory alloc failed");
-                       return;
-               }
-               b_to = bundle_decode(event_data, len);
-               if (b_to == NULL) {
-                       LOGE("bundle_decode failed");
-                       free(cb_data);
-                       return;
-               }
-               b = bundle_dup(b_to);
-               bundle_free(b_to);
-
-               cb_data->event_data = b;
-               cb_data->user_data = user_data;
-
-               g_list_foreach(handler_list, event_do_cb, cb_data);
-
-               bundle_free(b);
-       }
-}
-
-int event_add_event_handler(const char *event_name, event_cb callback, void *user_data,
-       event_handler_h *event_handler)
-{
-       int ret = 0;
-       int event_type = 0;
-       unsigned int reg_id = 0;
-       event_handler_h handler = NULL;
-
-       if (!_initialized) {
-               if (interested_event_table == NULL) {
-                       interested_event_table = g_hash_table_new(g_str_hash, g_str_equal);
-                       if (interested_event_table == NULL) {
-                               return event_error(EVENT_ERROR_OUT_OF_MEMORY,
-                                       __FUNCTION__, NULL);
-                       }
-               }
-               _initialized = 1;
-       }
-
-       if (event_handler == NULL || event_name == NULL || callback == NULL)
-               return event_error(EVENT_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       handler = calloc(1, sizeof(event_handler_s));
-       if (handler == NULL)
-               return event_error(EVENT_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
-
-       pthread_mutex_lock(&register_sync_lock);
-       earlier_callback = callback;
-       ret = eventsystem_register_application_event(event_name, &reg_id, &event_type,
-               (eventsystem_cb)event_eventsystem_callback, user_data);
-       earlier_callback = NULL;
-       pthread_mutex_unlock(&register_sync_lock);
-       if (ret < 0) {
-               free(handler);
-               if (ret == ES_R_ENOTPERMITTED)
-                       return event_error(EVENT_ERROR_PERMISSION_DENIED, __FUNCTION__, NULL);
-               else
-                       return event_error(EVENT_ERROR_IO_ERROR, __FUNCTION__, NULL);
-       }
-
-       handler->event_name = strdup(event_name);
-       if (handler->event_name == NULL) {
-               free(handler);
-               return event_error(EVENT_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
-       }
-
-       handler->reg_id = reg_id;
-       handler->event_type = event_type;
-       handler->cb = callback;
-       handler->user_data = user_data;
-
-       *event_handler = handler;
-
-       GList *handler_list = (GList *)g_hash_table_lookup(interested_event_table,
-               handler->event_name);
-       if (handler_list) {
-               LOGD("add new handler");
-               handler_list = g_list_append(handler_list, handler);
-       } else {
-               LOGD("add new table item");
-               GList *ehl = NULL;
-               ehl = g_list_append(ehl, handler);
-               g_hash_table_insert(interested_event_table, handler->event_name, ehl);
-       }
-
-       return EVENT_ERROR_NONE;
-}
-
-int event_remove_event_handler(event_handler_h event_handler)
-{
-       int ret = 0;
-
-       if (!_initialized) {
-               LOGI("handler list is not initialized");
-               return EVENT_ERROR_NONE;
-       }
-
-       if (event_handler == NULL)
-               return event_error(EVENT_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       ret = eventsystem_unregister_application_event(event_handler->reg_id);
-       if (ret < 0)
-               return event_error(EVENT_ERROR_IO_ERROR, __FUNCTION__, NULL);
-
-       GList *handler_list = (GList *)g_hash_table_lookup(interested_event_table,
-               event_handler->event_name);
-       if (handler_list) {
-               GList *list = NULL;
-               list = g_list_find(handler_list, event_handler);
-               if (list) {
-                       LOGD("remove match handler");
-                       handler_list = g_list_remove_all(handler_list, event_handler);
-                       GList *first_list = NULL;
-                       first_list = g_list_first(handler_list);
-                       if (first_list == NULL) {
-                               LOGD("remove table item");
-                               g_hash_table_remove(interested_event_table,
-                                       event_handler->event_name);
-                       }
-               }
-       }
-
-       free(event_handler->event_name);
-       free(event_handler);
-
-       return EVENT_ERROR_NONE;
-}
-
-int event_publish_app_event(const char *event_name, bundle *event_data)
-{
-       if (event_data == NULL || event_name == NULL)
-               return event_error(EVENT_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       if (eventsystem_send_user_event(event_name, event_data, false) < 0)
-               return event_error(EVENT_ERROR_IO_ERROR, __FUNCTION__, NULL);
-
-       return EVENT_ERROR_NONE;
-}
-
-int event_publish_trusted_app_event(const char *event_name, bundle *event_data)
-{
-       if (event_data == NULL || event_name == NULL)
-               return event_error(EVENT_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       if (eventsystem_send_user_event(event_name, event_data, true) < 0)
-               return event_error(EVENT_ERROR_IO_ERROR, __FUNCTION__, NULL);
-
-       return EVENT_ERROR_NONE;
-}
-
-int event_keep_last_event_data(const char *event_name)
-{
-       int ret;
-
-       if (event_name == NULL)
-               return event_error(EVENT_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       ret = eventsystem_keep_last_event_data(event_name);
-       if (ret < 0) {
-               if (ret == ES_R_ENOMEM)
-                       return event_error(EVENT_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
-               else
-                       return event_error(EVENT_ERROR_IO_ERROR, __FUNCTION__, NULL);
-       }
-
-       return EVENT_ERROR_NONE;
-}
diff --git a/include/app.h b/include/app.h
deleted file mode 100644 (file)
index 0794ae2..0000000
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Copyright (c) 2011 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __TIZEN_APPFW_APP_H__
-#define __TIZEN_APPFW_APP_H__
-
-#include <app_control.h>
-#include <app_common.h>
-#include <app_i18n.h>
-#include <app_types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/**
- * @addtogroup CAPI_APPLICATION_MODULE
- * @{
- */
-
-
-/**
- * @brief Called when the application starts.
- * @details The callback function is called before the main loop of the application starts.
- *          In this callback, you can initialize application resources like window creation, data structure, and so on.
- *          After this callback function returns @c true, the main loop starts up and app_control_cb() is subsequently called.
- *          If this callback function returns @c false, the main loop doesn't start and app_terminate_cb() is subsequently called.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] user_data        The user data passed from the callback registration function
- * @return @c true on success,
- *         otherwise @c false
- * @pre        ui_app_main() will invoke this callback function.
- * @see ui_app_main()
- * @see #ui_app_lifecycle_callback_s
- */
-typedef bool (*app_create_cb) (void *user_data);
-
-
-/**
- * @brief Called when the application is completely obscured by another application and becomes invisible.
- * @details The application is not terminated and still running in the paused state.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] user_data        The user data passed from the callback registration function
- * @see        ui_app_main()
- * @see        #ui_app_lifecycle_callback_s
- */
-typedef void (*app_pause_cb) (void *user_data);
-
-
-/**
- * @brief Called when the application becomes visible.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] user_data        The user data passed from the callback registration function
- * @see        ui_app_main()
- * @see #ui_app_lifecycle_callback_s
- */
-typedef void (*app_resume_cb) (void *user_data);
-
-
-/**
- * @brief Called when the application's main loop exits.
- * @details You should release the application's resources in this function.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] user_data        The user data passed from the callback registration function
- * @see        ui_app_main()
- * @see #ui_app_lifecycle_callback_s
- */
-typedef void (*app_terminate_cb) (void *user_data);
-
-
-/**
- * @brief Called when another application sends a launch request to the application.
- * @details When the application is launched, this callback function is called after the main loop of the application starts up.
- *          The passed app_control handle describes the launch request and contains the information about why the application is launched.
- *          If the launch request is sent to the application in the running or pause state,
- *          this callback function can be called again to notify that the application has been asked to launch.
- *          The application could be explicitly launched by the user from the application launcher or be launched to perform the specific operation by another application.
- *          The application is responsible for handling each launch request and responding appropriately.
- *          Using the App Control API, the application can get information about what is to be performed.
- *          If the application is launched from the application launcher or explicitly launched by another application,
- *          the passed app_control handle may include only the default operation (#APP_CONTROL_OPERATION_DEFAULT) without any data.
- *          For more information, see The @ref CAPI_APP_CONTROL_MODULE API description.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks After this callback returns, the handle of the app_control is freed.
- *          Therefore, if you want to use the handle after returning this callback, you MUST copy it by using app_control_clone() API.
- * @param[in] app_control The handle to the app_control
- * @param[in] user_data        The user data passed from the callback registration function
- * @see ui_app_main()
- * @see #ui_app_lifecycle_callback_s
- * @see @ref CAPI_APP_CONTROL_MODULE API
- */
-typedef void (*app_control_cb) (app_control_h app_control, void *user_data);
-
-/**
- * @brief The structure type containing the set of callback functions for handling application lifecycle events.
- * @details It is one of the input parameters of the ui_app_main() function.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @see ui_app_main()
- * @see app_create_cb()
- * @see app_pause_cb()
- * @see app_resume_cb()
- * @see app_terminate_cb()
- * @see app_control_cb()
- */
-typedef struct {
-       app_create_cb create; /**< This callback function is called at the start of the application. */
-       app_terminate_cb terminate; /**< This callback function is called once after the main loop of the application exits. */
-       app_pause_cb pause; /**< This callback function is called each time the application is completely obscured by another application and becomes invisible to the user. */
-       app_resume_cb resume; /**< This callback function is called each time the application becomes visible to the user. */
-       app_control_cb app_control; /**< This callback function is called when another application sends the launch request to the application. */
-} ui_app_lifecycle_callback_s;
-
-
-/**
- * @brief Gets the current device orientation.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @return The current device orientation
- */
-app_device_orientation_e app_get_device_orientation(void);
-
-
-/**
- * @brief Runs the application's main loop until ui_app_exit() is called.
- * @details This function is the main entry point of the Tizen application.
- *          The app_create_cb() callback function is called to initialize the application before the main loop of application starts up.
- *          After the app_create_cb() callback function returns true, the main loop starts up and the app_control_cb() callback function is subsequently called.
- *          If the app_create_cb() callback function returns false, the main loop doesn't start up and app_terminate_cb() callback function is called.
- *          This main loop supports event handling for the Ecore Main Loop.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] argc The argument count
- * @param[in] argv The argument vector
- * @param[in] callback The set of callback functions to handle application lifecycle events
- * @param[in] user_data The user data to be passed to the callback functions
- * @return @c 0 on success,
- *                     otherwise a negative error value
- * @retval #APP_ERROR_NONE Successful
- * @retval #APP_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_ERROR_INVALID_CONTEXT The application is launched illegally, not launched by the launch system
- * @retval #APP_ERROR_ALREADY_RUNNING The main loop already started
- * @see app_create_cb()
- * @see app_terminate_cb()
- * @see app_pause_cb()
- * @see app_resume_cb()
- * @see app_control_cb()
- * @see ui_app_exit()
- * @see #ui_app_lifecycle_callback_s
- */
-int ui_app_main(int argc, char **argv, ui_app_lifecycle_callback_s *callback, void *user_data);
-
-
-/**
- * @brief Exits the main loop of application.
- * @details The main loop of application stops and app_terminate_cb() is invoked.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @see ui_app_main()
- * @see app_terminate_cb()
- */
-void ui_app_exit(void);
-
-
-/**
- * @brief Adds the system event handler.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[out] event_handler The event handler
- * @param[in] event_type The system event type
- * @param[in] callback The callback function
- * @param[in] user_data The user data to be passed to the callback functions
- * @return @c 0 on success,
- *                     otherwise a negative error value
- * @retval #APP_ERROR_NONE Successful
- * @retval #APP_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_ERROR_OUT_OF_MEMORY Out of memory
- * @see app_event_type_e
- * @see app_event_cb
- * @see ui_app_remove_event_handler
- */
-int ui_app_add_event_handler(app_event_handler_h *event_handler, app_event_type_e event_type, app_event_cb callback, void *user_data);
-
-
-/**
- * @brief Removes registered event handler.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] event_handler The event handler
- * @return @c 0 on success,
- *                     otherwise a negative error value
- * @retval #APP_ERROR_NONE Successful
- * @retval #APP_ERROR_INVALID_PARAMETER Invalid parameter
- * @see ui_app_add_event_handler
- */
-int ui_app_remove_event_handler(app_event_handler_h event_handler);
-
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __TIZEN_APPFW_APP_H__ */
-
diff --git a/include/app_common.h b/include/app_common.h
deleted file mode 100644 (file)
index 5f30490..0000000
+++ /dev/null
@@ -1,423 +0,0 @@
-/*
- * Copyright (c) 2014 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __TIZEN_APPFW_APP_COMMON_H__
-#define __TIZEN_APPFW_APP_COMMON_H__
-
-#include <app_types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/**
- * @file app_common.h
- */
-
-/**
- * @addtogroup CAPI_APP_COMMON_MODULE
- * @{
- */
-
-
-/**
- * @brief Enumeration for system events.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-typedef enum {
-       APP_EVENT_LOW_MEMORY, /**< The low memory event */
-       APP_EVENT_LOW_BATTERY, /**< The low battery event */
-       APP_EVENT_LANGUAGE_CHANGED, /**< The system language changed event */
-       APP_EVENT_DEVICE_ORIENTATION_CHANGED, /**< The device orientation changed event */
-       APP_EVENT_REGION_FORMAT_CHANGED, /**< The region format changed event */
-       APP_EVENT_SUSPENDED_STATE_CHANGED, /**< The suspended state changed event of the application (since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif)
-                                            @see app_event_get_suspended_state */
-       APP_EVENT_UPDATE_REQUESTED, /**< The update requested event (Since 3.0)
-                                       This event can occur when an app needs to be updated.
-                                       It is dependent on target devices. */
-} app_event_type_e;
-
-
-/**
- * @brief Enumeration for device orientation.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-typedef enum {
-       APP_DEVICE_ORIENTATION_0 = 0, /**< The device is oriented in a natural position */
-       APP_DEVICE_ORIENTATION_90 = 90, /**< The device's left side is at the top */
-       APP_DEVICE_ORIENTATION_180 = 180, /**< The device is upside down */
-       APP_DEVICE_ORIENTATION_270 = 270, /**< The device's right side is at the top */
-} app_device_orientation_e;
-
-
-/**
- * @brief Enumeration for low memory status.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-typedef enum {
-       APP_EVENT_LOW_MEMORY_NORMAL = 0x01, /**< Normal status */
-       APP_EVENT_LOW_MEMORY_SOFT_WARNING = 0x02, /**< Soft warning status */
-       APP_EVENT_LOW_MEMORY_HARD_WARNING = 0x04, /**< Hard warning status */
-} app_event_low_memory_status_e;
-
-
-/**
- * @brief Enumeration for battery status.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-typedef enum {
-       APP_EVENT_LOW_BATTERY_POWER_OFF = 1, /**< The battery status is under 1% */
-       APP_EVENT_LOW_BATTERY_CRITICAL_LOW, /**< The battery status is under 5% */
-} app_event_low_battery_status_e;
-
-
-/**
- * @brief Enumeration for suspended state.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-typedef enum {
-       APP_SUSPENDED_STATE_WILL_ENTER = 0, /**< Application will enter the suspended state */
-       APP_SUSPENDED_STATE_DID_EXIT, /**< Application did exit from the suspended state */
-} app_suspended_state_e;
-
-
-/**
- * @brief The event handler that returned from add event handler function to handle.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @see app_event_type_e
- * @see app_add_event_handler
- * @see app_remove_event_handler
- * @see app_event_info_h
- */
-typedef struct app_event_handler *app_event_handler_h;
-
-
-/**
- * @brief The system event information handle.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @see app_event_get_low_memory_status
- * @see app_event_get_low_battery_status
- * @see app_event_get_language
- * @see app_event_get_region_format
- * @see app_event_get_device_orientation
- * @see app_event_get_suspended_state
- */
-typedef struct app_event_info *app_event_info_h;
-
-
-/**
- * @brief The system event callback function.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] event_info The system event information
- * @param[in] user_data The user data passed from the add event handler function
- * @see app_add_event_handler
- * @see app_event_info_h
- * @remarks If the given @a event_info has #APP_SUSPENDED_STATE_WILL_ENTER value,
- *          the application should not call any asynchronous operations in this callback.
- *          After the callback returns, process of the application will be changed to suspended
- *          state immediately. Thus, asynchronous operations may work incorrectly. (since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif)
- */
-typedef void (*app_event_cb)(app_event_info_h event_info, void *user_data);
-
-
-/**
- * @brief Gets the low memory status from the given event info.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] event_info The system event info
- * @param[out] status The low memory status
- * @return @c 0 on success,
- *                     otherwise a negative error value
- * @retval #APP_ERROR_NONE Successful
- * @retval #APP_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_ERROR_INVALID_CONTEXT Invalid event context
- * @see app_event_info_h
- * @see app_event_low_memory_status_e
- */
-int app_event_get_low_memory_status(app_event_info_h event_info, app_event_low_memory_status_e *status);
-
-
-/**
- * @brief Gets the low battery status from given event info.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] event_info The system event info
- * @param[out] status The low battery status
- * @return @c 0 on success,
- *                     otherwise a negative error value
- * @retval #APP_ERROR_NONE Successful
- * @retval #APP_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_ERROR_INVALID_CONTEXT Invalid event context
- * @see app_event_info_h
- * @see app_event_low_battery_status_e
- */
-int app_event_get_low_battery_status(app_event_info_h event_info, app_event_low_battery_status_e *status);
-
-
-/**
- * @brief Gets the language from the given event info.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks @a lang must be released using free().
- * @param[in] event_info The system event info
- * @param[out] lang The language changed
- * @return @c 0 on success,
- *                     otherwise a negative error value
- * @retval #APP_ERROR_NONE Successful
- * @retval #APP_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_ERROR_INVALID_CONTEXT Invalid event context
- * @see app_event_info_h
- */
-int app_event_get_language(app_event_info_h event_info, char **lang);
-
-
-/**
- * @brief Gets the region format from the given event info.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks @a region must be released using free().
- * @param[in] event_info The system event info
- * @param[out] region The region format changed
- * @return @c 0 on success,
- *                     otherwise a negative error value
- * @retval #APP_ERROR_NONE Successful
- * @retval #APP_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_ERROR_INVALID_CONTEXT Invalid event context
- * @see app_event_info_h
- */
-int app_event_get_region_format(app_event_info_h event_info, char **region);
-
-
-/**
- * @brief Gets the device orientation from the given event info.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] event_info The system event info
- * @param[out] orientation The device orientation changed
- * @return @c 0 on success,
- *                     otherwise a negative error value
- * @retval #APP_ERROR_NONE Successful
- * @retval #APP_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_ERROR_INVALID_CONTEXT Invalid event context
- * @see app_event_info_h
- * @see app_device_orientation_e
- */
-int app_event_get_device_orientation(app_event_info_h event_info, app_device_orientation_e *orientation);
-
-
-/**
- * @brief Gets the suspended state of the application from the given event info.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @remarks The application should not use any asynchronous operations in #APP_SUSPENDED_STATE_WILL_ENTER event.
- *          Because applications will be changed to suspended state just after #APP_SUSPENDED_STATE_WILL_ENTER, asynchronous calls are not guaranteed to work properly.
- * @param[in] event_info The handle for getting the suspended state
- * @param[out] state The suspended state of the application
- * @return @c 0 on success,
- *                     otherwise a negative error value
- * @retval #APP_ERROR_NONE Successful
- * @retval #APP_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_ERROR_INVALID_CONTEXT Invalid event context
- */
-int app_event_get_suspended_state(app_event_info_h event_info, app_suspended_state_e *state);
-
-
-/**
- * @brief Gets the ID of the application.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks @a id must be released using free().
- * @param[out] id The ID of the application
- * @return @c 0 on success,
- *                     otherwise a negative error value
- * @retval #APP_ERROR_NONE Successful
- * @retval #APP_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_ERROR_INVALID_CONTEXT The application is launched illegally, not launched by the launch system
- * @retval #APP_ERROR_OUT_OF_MEMORY Out of memory
- */
-int app_get_id(char **id);
-
-
-/**
- * @brief Gets the localized name of the application.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks @a name must be released using free().
- * @param[out] name The name of the application
- * @return @c 0 on success,
- *                     otherwise a negative error value
- * @retval #APP_ERROR_NONE Successful
- * @retval #APP_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_ERROR_INVALID_CONTEXT The application is launched illegally, not launched by the launch system
- * @retval #APP_ERROR_OUT_OF_MEMORY Out of memory
- */
-int app_get_name(char **name);
-
-
-/**
- * @brief Gets the version of the application package.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks @a version must be released using free().
- * @param[out] version The version of the application
- * @return @c 0 on success,
- *                     otherwise a negative error value
- * @retval #APP_ERROR_NONE Successful
- * @retval #APP_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_ERROR_INVALID_CONTEXT The application is launched illegally, not launched by the launch system
- * @retval #APP_ERROR_OUT_OF_MEMORY Out of memory
- */
-int app_get_version(char **version);
-
-
-/**
- * @brief Gets the absolute path to the application's data directory which is used to store private data of the application.
- * @details    An application can read and write its own files in the application's data directory.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks    The returned path should be released.
- * @return The absolute path to the application's data directory, @n
- *         otherwise a null pointer if the memory is insufficient
- */
-char *app_get_data_path(void);
-
-
-/**
- * @brief Gets the absolute path to the application's cache directory which is used to store temporary data of the application.
- * @details    An application can read and write its own files in the application's cache directory.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks    The returned path should be released. @n
- *                     The files stored in the application's cache directory can be removed by setting application or platform while the application is running.
- * @return The absolute path to the application's cache directory, @n
- *         otherwise a null pointer if the memory is insufficient
- */
-char *app_get_cache_path(void);
-
-
-/**
- * @brief Gets the absolute path to the application resource directory. The resource files are delivered with the application package.
- * @details    An application can only read its own files in the application's resource directory.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks    The returned path should be released.
- * @return The absolute path to the application's resource directory, @n
- *         otherwise a null pointer if the memory is insufficient
- */
-char *app_get_resource_path(void);
-
-
-/**
- * @brief Gets the absolute path to the application's shared data directory which is used to share data with other applications.
- * @details    An application can read and write its own files in the application's shared data directory and others can only read the files.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @privlevel  public
- * @privilege  %http://tizen.org/privilege/appdir.shareddata
- * @remarks    The returned path should be released. @n
- *             Since Tizen 3.0, an application that want to use shared/data directory must declare http://tizen.org/privilege/appdir.shareddata privilege. If the application doesn't declare the privilege, the framework will not create shared/data directory for the application.
- *             Carefully consider the privacy implications when deciding whether to use the shared/data directory, since the application cannot control access to this directory by other applications.
- *             If you want to share files with other applications, consider passing path via @ref CAPI_APP_CONTROL_MODULE API.
- *             The @ref CAPI_APP_CONTROL_MODULE API supports giving permission to other applications by passing path via app_control. @n
- *             The specific error code can be obtained using the get_last_result(). Error codes are described in Exception section.
- *
- * @return     The absolute path to the application's shared data directory, @n
- *             otherwise a null pointer if the memory is insufficient. It will return NULL for applications with api-version 3.0 or later, and set #APP_ERROR_PERMISSION_DENIED if the application does not declare the shareddata privilege.
- * @exception APP_ERROR_NONE Success
- * @exception APP_ERROR_OUT_OF_MEMORY Out of memory
- * @exception APP_ERROR_PERMISSION_DENIED Permission denied
- */
-char *app_get_shared_data_path(void);
-
-
-/**
- * @brief Gets the absolute path to the application's shared resource directory which is used to share resources with other applications.
- * @details    An application can read its own files in the application's shared resource directory, and others can only read the files.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks    The returned path should be released.
- * @return The absolute path to the application's shared resource directory, @n
- *         otherwise a null pointer if the memory is insufficient
- */
-char *app_get_shared_resource_path(void);
-
-
-/**
- * @brief Gets the absolute path to the application's shared trusted directory which is used to share data with a family of trusted applications.
- * @details    An application can read and write its own files in the application's shared trusted directory
- *          and the family applications signed with the same certificate can read and write the files in the shared trusted directory.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks    The returned path should be released.
- * @return The absolute path to the application's shared trusted directory, @n
- *         otherwise a null pointer if the memory is insufficient
- */
-char *app_get_shared_trusted_path(void);
-
-
-/**
- * @brief Gets the absolute path to the application's external data directory which is used to store data of the application.
- * @details    An application can read and write its own files in the application's external data directory.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks    The returned path should be released. @n
- *          The important files stored in the application's external data directory should be encrypted because they can be exported via the external sdcard.
- *          To access the path returned by this function requires the privilege
- *                 that is "http://tizen.org/privilege/externalstorage.appdata".
- * @return The absolute path to the application's external data directory, @n
- *                     otherwise a null pointer if the memory is insufficient
- */
-char *app_get_external_data_path(void);
-
-
-/**
- * @brief Gets the absolute path to the application's external cache directory which is used to store temporary data of the application.
- * @details    An application can read and write its own files in the application's external cache directory.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks The returned path should be released. @n
- *          The files stored in the application's external cache directory can be removed by
- *          setting application while the application is running. @n
- *          The important files stored in the application's external cache directory should be
- *          encrypted because they can be exported via the external sdcard.
- *          To access the path returned by this function requires the privilege
- *                 that is "http://tizen.org/privilege/externalstorage.appdata".
- * @return The absolute path to the application's external cache directory, @n
- *         otherwise a null pointer if the memory is insufficient
- */
-char *app_get_external_cache_path(void);
-
-
-/**
- * @deprecated Deprecated since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif.
- * @brief Gets the absolute path to the application's external shared data directory which is used to share data with other applications.
- * @details    An application can read and write its own files in the application's external shared data directory, and others can only read the files.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks    The specified @a path should be released.
- *          To access the path returned by this function requires the privilege
- *                 that is "http://tizen.org/privilege/externalstorage.appdata".
- *          The function may not work as intended in certain devices due to some implementation issues.
- * @return The absolute path to the application's external shared data directory, @n
- *         otherwise a null pointer if the memory is insufficient
- */
-char *app_get_external_shared_data_path(void) TIZEN_DEPRECATED_API;
-
-
-/**
- * @brief Gets the absolute path to the application's TEP(Tizen Expansion Package) directory. The resource files are delivered with the expansion package.
- * @details An application can only read its own files in the application's TEP(Tizen Expansion Package) directory.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @remarks The returned path should be released.
- * @return The absolute path to the application's TEP(Tizen Expansion Package) directory, @n
- *         otherwise a null pointer if the memory is insufficient
- **/
-char *app_get_tep_resource_path(void);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __TIZEN_APPFW_APP_H__ */
-
diff --git a/include/app_event.h b/include/app_event.h
deleted file mode 100644 (file)
index 5d5ef83..0000000
+++ /dev/null
@@ -1,1084 +0,0 @@
-/*
- * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __TIZEN_APPFW_EVENT_H__
-#define __TIZEN_APPFW_EVENT_H__
-
-#include <bundle.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @file app_event.h
- */
-
-/**
- * @addtogroup CAPI_EVENT_MODULE
- * @{
- */
-
-
-/**
- * @brief Event handle.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-typedef struct event_handler *event_handler_h;
-
-
-/**
- * @brief Event callback.
- *
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @param[in] event_name The interested event name
- * @param[in] event_data The data of interested event
- * @param[in] user_data The user data set by event_add_event_handler()
- * @see event_add_event_handler
- */
-typedef void (*event_cb)(const char *event_name, bundle *event_data, void *user_data);
-
-
-/**
- * @brief Enumeration for Event Error.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-typedef enum {
-       EVENT_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
-       EVENT_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
-       EVENT_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
-       EVENT_ERROR_TIMED_OUT = TIZEN_ERROR_TIMED_OUT, /**< Time out */
-       EVENT_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< IO error */
-       EVENT_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED /**< Permisiion denied */
-} event_error_e;
-
-
-/**
- * @brief Definition for system-event of battery : charger status.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @remarks If there is earlier occurrence regarding this event, you will receive the event as soon as you register event handler for this event. You can use this earlier event-data as initial value.
- * @see EVENT_KEY_BATTERY_CHARGER_STATUS
- */
-#define SYSTEM_EVENT_BATTERY_CHARGER_STATUS "tizen.system.event.battery_charger_status"
-
-
-/**
- * @brief Definition for key of SYSTEM_EVENT_BATTERY_CHARGER_STATUS.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_VAL_BATTERY_CHARGER_DISCONNECTED
- * @see EVENT_VAL_BATTERY_CHARGER_CONNECTED
- * @see EVENT_VAL_BATTERY_CHARGER_CHARGING
- * @see EVENT_VAL_BATTERY_CHARGER_DISCHARGING
- */
-#define EVENT_KEY_BATTERY_CHARGER_STATUS "battery_charger_status"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_BATTERY_CHARGER_STATUS.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @remarks charger disconnected
- */
-#define EVENT_VAL_BATTERY_CHARGER_DISCONNECTED "disconnected"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_BATTERY_CHARGER_STATUS.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @remarks charger connected
- */
-#define EVENT_VAL_BATTERY_CHARGER_CONNECTED "connected"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_BATTERY_CHARGER_STATUS.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @remarks charging is enabled
- */
-#define EVENT_VAL_BATTERY_CHARGER_CHARGING "charging"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_BATTERY_CHARGER_STATUS.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @remarks charging is disabled
- */
-#define EVENT_VAL_BATTERY_CHARGER_DISCHARGING "discharging"
-
-
-/**
- * @brief Definition for system-event of battery : level status.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_KEY_BATTERY_LEVEL_STATUS
- */
-#define SYSTEM_EVENT_BATTERY_LEVEL_STATUS "tizen.system.event.battery_level_status"
-
-
-/**
- * @brief Definition for key of SYSTEM_EVENT_BATTERY_LEVEL_STATUS.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_VAL_BATTERY_LEVEL_EMPTY
- * @see EVENT_VAL_BATTERY_LEVEL_CRITICAL
- * @see EVENT_VAL_BATTERY_LEVEL_LOW
- * @see EVENT_VAL_BATTERY_LEVEL_HIGH
- * @see EVENT_VAL_BATTERY_LEVEL_FULL
- */
-#define EVENT_KEY_BATTERY_LEVEL_STATUS "battery_level_status"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_BATTERY_LEVEL_STATUS.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_BATTERY_LEVEL_EMPTY "empty"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_BATTERY_LEVEL_STATUS.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_BATTERY_LEVEL_CRITICAL "critical"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_BATTERY_LEVEL_STATUS.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_BATTERY_LEVEL_LOW "low"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_BATTERY_LEVEL_STATUS.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_BATTERY_LEVEL_HIGH "high"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_BATTERY_LEVEL_STATUS.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_BATTERY_LEVEL_FULL "full"
-
-
-/**
- * @brief Definition for system-event of usb : status of usb connection.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_KEY_USB_STATUS
- */
-#define SYSTEM_EVENT_USB_STATUS "tizen.system.event.usb_status"
-
-
-/**
- * @brief Definition for key of SYSTEM_EVENT_USB_STATUS.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_VAL_USB_DISCONNECTED
- * @see EVENT_VAL_USB_CONNECTED
- * @see EVENT_VAL_USB_AVAILABLE
- */
-#define EVENT_KEY_USB_STATUS "usb_status"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_USB_STATUS.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_USB_DISCONNECTED "disconnected"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_USB_STATUS.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @remarks Connected but not-available.
- */
-#define EVENT_VAL_USB_CONNECTED "connected"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_USB_STATUS.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_USB_AVAILABLE "available"
-
-
-/**
- * @brief Definition for system-event of ear-jack : status of ear-jack connection.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_KEY_EARJACK_STATUS
- */
-#define SYSTEM_EVENT_EARJACK_STATUS "tizen.system.event.earjack_status"
-
-
-/**
- * @brief Definition for key of SYSTEM_EVENT_EARJACK_STATUS.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_VAL_EARJACK_DISCONNECTED
- * @see EVENT_VAL_EARJACK_CONNECTED
- */
-#define EVENT_KEY_EARJACK_STATUS "earjack_status"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_EARJACK_STATUS.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_EARJACK_DISCONNECTED "disconnected"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_EARJACK_STATUS.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_EARJACK_CONNECTED "connected"
-
-
-/**
- * @brief Definition for system-event of display : state of display.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privilege %http://tizen.org/privilege/display
- * @remarks If you want to receive this event, you must declare this privilege.
- * @see EVENT_KEY_DISPLAY_STATE
- */
-#define SYSTEM_EVENT_DISPLAY_STATE "tizen.system.event.display_state"
-
-
-/**
- * @brief Definition for key of SYSTEM_EVENT_DISPLAY_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_VAL_DISPLAY_NORMAL
- * @see EVENT_VAL_DISPLAY_DIM
- * @see EVENT_VAL_DISPLAY_OFF
- */
-#define EVENT_KEY_DISPLAY_STATE "display_state"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_DISPLAY_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_DISPLAY_NORMAL "normal"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_DISPLAY_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_DISPLAY_DIM "dim"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_DISPLAY_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_DISPLAY_OFF "off"
-
-
-/**
- * @brief Definition for system-event of system : boot completion.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @remarks There is no corresponding key/value.
- * @remarks You can treat the initial value as "false" before you receive this event.
- * @remarks If it's already boot-completed state before you regiser event handler, you can receive the event as soon as you register the event handler.
- */
-#define SYSTEM_EVENT_BOOT_COMPLETED "tizen.system.event.boot_completed"
-
-
-/**
- * @brief Definition for system-event of system : shutdown.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @remarks There is no corresponding key/value.
- * @remarks You can treat the inital value as "false" before you receive this event.
- * @remarks If it's already shutting-down state before you regiser event handler, you can receive the event as soon as you register the event handler.
-*/
-#define SYSTEM_EVENT_SYSTEM_SHUTDOWN "tizen.system.event.system_shutdown"
-
-
-/**
- * @brief Definition for system-event of system : low memory.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_KEY_LOW_MEMORY
- */
-#define SYSTEM_EVENT_LOW_MEMORY "tizen.system.event.low_memory"
-
-
-/**
- * @brief Definition for key of SYSTEM_EVENT_LOW_MEMORY.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @remarks If there is earlier occurrence regarding this event, you will receive the event as soon as you register event handler for this event. You can use this earlier event-data as initial value.
- * @see EVENT_VAL_MEMORY_NORMAL
- * @see EVENT_VAL_MEMORY_SOFT_WARNING
- * @see EVENT_VAL_MEMORY_HARD_WARNING
- */
-#define EVENT_KEY_LOW_MEMORY "low_memory"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_LOW_MEMORY.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_MEMORY_NORMAL "normal"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_LOW_MEMORY.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_MEMORY_SOFT_WARNING "soft_warning"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_LOW_MEMORY.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_MEMORY_HARD_WARNING "hard_warning"
-
-
-/**
- * @brief Definition for system-event of wifi : state of wifi.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privilege %http://tizen.org/privilege/network.get
- * @remarks If you want to receive this event, you must declare this privilege.
- * @see EVENT_KEY_WIFI_STATE
- */
-#define SYSTEM_EVENT_WIFI_STATE "tizen.system.event.wifi_state"
-
-
-/**
- * @brief Definition for key of SYSTEM_EVENT_WIFI_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_VAL_WIFI_OFF
- * @see EVENT_VAL_WIFI_ON
- * @see EVENT_VAL_WIFI_CONNECTED
- */
-#define EVENT_KEY_WIFI_STATE "wifi_state"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_WIFI_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_WIFI_OFF "off"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_WIFI_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_WIFI_ON "on"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_WIFI_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_WIFI_CONNECTED "connected"
-
-
-/**
- * @brief Definition for system-event of bluetooth : status of bluetooth.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_KEY_BT_STATE
- * @see EVENT_KEY_BT_LE_STATE
- * @see EVENT_KEY_BT_TRANSFERING_STATE
- */
-#define SYSTEM_EVENT_BT_STATE "tizen.system.event.bt_state"
-
-
-/**
- * @brief Definition for key of SYSTEM_EVENT_BT_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_VAL_BT_STATE_OFF
- * @see EVENT_VAL_BT_STATE_ON
- */
-#define EVENT_KEY_BT_STATE "bt_state"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_BT_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_BT_OFF "off"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_BT_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_BT_ON "on"
-
-
-/**
- * @brief Definition for key of SYSTEM_EVENT_BT_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_VAL_BT_LE_STATE_OFF
- * @see EVENT_VAL_BT_LE_STATE_ON
- */
-#define EVENT_KEY_BT_LE_STATE "bt_le_state"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_BT_LE_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_BT_LE_OFF "off"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_BT_LE_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_BT_LE_ON "on"
-
-
-/**
- * @brief Definition for key of SYSTEM_EVENT_BT_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @remarks If it's already transfering state before you register this event, you can't receive the event regarding current transfer but you can receive the following transfers.
- * @see EVENT_VAL_BT_NON_TRANSFERING
- * @see EVENT_VAL_BT_TRANSFERING
- */
-#define EVENT_KEY_BT_TRANSFERING_STATE "bt_transfering_state"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_BT_TRANSFERING_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_BT_NON_TRANSFERING "non_transfering"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_BT_TRANSFERING_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_BT_TRANSFERING "transfering"
-
-
-/**
- * @brief Definition for system-event of location : enable state of location.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_KEY_LOCATION_ENABLE_STATE
- */
-#define SYSTEM_EVENT_LOCATION_ENABLE_STATE "tizen.system.event.location_enable_state"
-
-
-/**
- * @brief Definition for key of SYSTEM_EVENT_LOCATION_ENABLE_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_VAL_LOCATION_DISABLED
- * @see EVENT_VAL_LOCATION_ENABLED
- */
-#define EVENT_KEY_LOCATION_ENABLE_STATE "location_enable_state"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_LOCATION_ENABLE_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_LOCATION_DISABLED "disabled"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_LOCATION_ENABLE_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_LOCATION_ENABLED "enabled"
-
-
-/**
- * @brief Definition for system-event of location : enable state of gps.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_KEY_GPS_ENABLE_STATE
- */
-#define SYSTEM_EVENT_GPS_ENABLE_STATE "tizen.system.event.gps_enable_state"
-
-
-/**
- * @brief Definition for key of SYSTEM_EVENT_GPS_ENABLE_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_VAL_GPS_DISABLED
- * @see EVENT_VAL_GPS_ENABLED
- */
-#define EVENT_KEY_GPS_ENABLE_STATE "gps_enable_state"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_GPS_ENABLE_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_GPS_DISABLED "disabled"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_GPS_ENABLE_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_GPS_ENABLED "enabled"
-
-
-/**
- * @brief Definition for system-event of location : enable state of nps.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_KEY_NPS_ENABLE_STATE
- */
-#define SYSTEM_EVENT_NPS_ENABLE_STATE "tizen.system.event.nps_enable_state"
-
-
-/**
- * @brief Definition for key of SYSTEM_EVENT_NPS_ENABLE_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_VAL_NPS_DISABLED
- * @see EVENT_VAL_NPS_ENABLED
- */
-#define EVENT_KEY_NPS_ENABLE_STATE "nps_enable_state"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_NPS_ENABLE_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_NPS_DISABLED "disabled"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_NPS_ENABLE_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_NPS_ENABLED "enabled"
-
-
-/**
- * @brief Definition for system-event of message : incoming msg.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @privilege %http://tizen.org/privilege/message.read
- * @remarks If you want to receive this event, you must declare this privilege.
- * @see EVENT_KEY_MSG_TYPE
- * @see EVENT_KEY_MSG_ID
- */
-#define SYSTEM_EVENT_INCOMING_MSG "tizen.system.event.incoming_msg"
-
-
-/**
- * @brief Definition for key of SYSTEM_EVENT_INCOMING_MSG.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_VAL_SMS
- * @see EVENT_VAL_PUSH
- * @see EVENT_VAL_CB
- */
-#define EVENT_KEY_MSG_TYPE "msg_type"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_MSG_TYPE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_SMS "sms"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_MSG_TYPE.
- * @since_tizen 3.0
- */
-#define EVENT_VAL_MMS "mms"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_MSG_TYPE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_PUSH "push"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_MSG_TYPE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_CB "cb"
-
-
-/**
- * @brief Definition for key of SYSTEM_EVENT_INCOMING_MSG.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @remarks The value of this key is a string of unsigned int value : new message id.
- */
-#define EVENT_KEY_MSG_ID "msg_id"
-
-
-/**
- * @brief Definition for system-event of message : outgoing msg.
- * @since_tizen 3.0
- * @privilege %http://tizen.org/privilege/message.read
- * @remarks If you want to receive this event, you must declare this privilege.
- * @see EVENT_KEY_OUT_MSG_TYPE
- * @see EVENT_KEY_OUT_MSG_ID
- */
-#define SYSTEM_EVENT_OUTGOING_MSG "tizen.system.event.outgoing_msg"
-
-
-/**
- * @brief Definition for key of SYSTEM_EVENT_OUTGOING_MSG.
- * @since_tizen 3.0
- * @see EVENT_VAL_OUT_MSG_SMS
- * @see EVENT_VAL_OUT_MSG_MMS
- */
-#define EVENT_KEY_OUT_MSG_TYPE "msg_type"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_OUT_MSG_TYPE.
- * @since_tizen 3.0
- */
-#define EVENT_VAL_SMS "sms"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_OUT_MSG_TYPE.
- * @since_tizen 3.0
- */
-#define EVENT_VAL_MMS "mms"
-
-
-/**
- * @brief Definition for key of SYSTEM_EVENT_OUTGOING_MSG.
- * @since_tizen 3.0
- * @remarks The value of this key is a string of unsigned int value : new message id.
- */
-#define EVENT_KEY_OUT_MSG_ID "msg_id"
-
-
-/**
- * @brief Definition for system-event of setting : time changed.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @remarks There is no corresponding key/value.
- * @remarks You can use a @a alarm_get_current_time() API for checking new time after receiving this event.
- */
-#define SYSTEM_EVENT_TIME_CHANGED "tizen.system.event.time_changed"
-
-
-/**
- * @brief Definition for system-event of setting : timezone setting.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_KEY_TIME_ZONE
- */
-#define SYSTEM_EVENT_TIME_ZONE "tizen.system.event.time_zone"
-
-
-/**
- * @brief Definition for key of SYSTEM_EVENT_TIME_ZONE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @remarks The value of this key is timezone value of tz database, for example, "Asia/Seoul", "America/New_York", refer to the Time Zone Database of IANA.
- */
-#define EVENT_KEY_TIME_ZONE "time_zone"
-
-
-/**
- * @brief Definition for system-event of setting : hour format.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_KEY_HOUR_FORMAT
- */
-#define SYSTEM_EVENT_HOUR_FORMAT "tizen.system.event.hour_format"
-
-
-/**
- * @brief Definition for key of SYSTEM_EVENT_HOUR_FORMAT.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_VAL_HOURFORMAT_12
- * @see EVENT_VAL_HOURFORMAT_24
- */
-#define EVENT_KEY_HOUR_FORMAT "hour_format"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_HOUR_FORMAT.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_HOURFORMAT_12 "12"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_HOUR_FORMAT.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_HOURFORMAT_24 "24"
-
-
-/**
- * @brief Definition for system-event of setting : language setting.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_KEY_LANGUAGE_SET
- */
-#define SYSTEM_EVENT_LANGUAGE_SET "tizen.system.event.language_set"
-
-
-/**
- * @brief Definition for key of SYSTEM_EVENT_LANGUAGE_SET.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @remarks The value of this key is full name of locale, for example,
- *             "ko_KR.UTF8" : in case of Korean language
- *             "en_US.UTF8" : in case of USA language,
- *             refer to linux locale info.
- */
-#define EVENT_KEY_LANGUAGE_SET "language_set"
-
-
-/**
- * @brief Definition for system-event of setting : region format.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_KEY_REGION_FORMAT
- */
-#define SYSTEM_EVENT_REGION_FORMAT "tizen.system.event.region_format"
-
-
-/**
- * @brief Definition for key of SYSTEM_EVENT_REGION_FORMAT.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @remarks The value of this key is full name of locale, for example,
- *             "ko_KR.UTF8" : in case of Korean region format
- *             "en_US.UTF8" : in case of USA region format,
- *             refer to linux locale info.
- */
-#define EVENT_KEY_REGION_FORMAT "region_format"
-
-
-/**
- * @brief Definition for system-event of setting : silent_mode.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_KEY_SILENT_MODE
- */
-#define SYSTEM_EVENT_SILENT_MODE "tizen.system.event.silent_mode"
-
-
-/**
- * @brief Definition for key of SYSTEM_EVENT_SILENT_MODE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_VAL_SILENTMODE_ON
- * @see EVENT_VAL_SILENTMODE_OFF
- */
-#define EVENT_KEY_SILENT_MODE "silent_mode"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_SILENT_MODE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_SILENTMODE_ON "on"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_SILENT_MODE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_SILENTMODE_OFF "off"
-
-
-/**
- * @brief Definition for system-event of setting : state of vibration.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_KEY_VIBRATION_STATE
- */
-#define SYSTEM_EVENT_VIBRATION_STATE "tizen.system.event.vibration_state"
-
-
-/**
- * @brief Definition for key of SYSTEM_EVENT_VIBRATION_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_VAL_VIBRATION_ON
- * @see EVENT_VAL_VIBRATION_OFF
- */
-#define EVENT_KEY_VIBRATION_STATE "vibration_state"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_VIBRATION_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_VIBRATION_ON "on"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_VIBRATION_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_VIBRATION_OFF "off"
-
-
-/**
- * @brief Definition for system-event of setting : state of screen's auto-rotation.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_KEY_SCREEN_AUTOROTATE_STATE
- */
-#define SYSTEM_EVENT_SCREEN_AUTOROTATE_STATE "tizen.system.event.screen_autorotate_state"
-
-
-/**
- * @brief Definition for key of SYSTEM_EVENT_SCREEN_AUTOROTATE_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_VAL_SCREEN_AUTOROTATE_ON
- * @see EVENT_VAL_SCREEN_AUTOROTATE_OFF
- */
-#define EVENT_KEY_SCREEN_AUTOROTATE_STATE "screen_autorotate_state"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_SCREEN_AUTOROTATE_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_SCREEN_AUTOROTATE_ON "on"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_SCREEN_AUTOROTATE_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_SCREEN_AUTOROTATE_OFF "off"
-
-
-/**
- * @brief Definition for system-event of setting : state of mobile data.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_KEY_MOBILE_DATA_STATE
- */
-#define SYSTEM_EVENT_MOBILE_DATA_STATE "tizen.system.event.mobile_data_state"
-
-
-/**
- * @brief Definition for key of SYSTEM_EVENT_MOBILE_DATA_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_VAL_MOBILE_DATA_OFF
- * @see EVENT_VAL_MOBILE_DATA_ON
- */
-#define EVENT_KEY_MOBILE_DATA_STATE "mobile_data_state"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_MOBILE_DATA_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_MOBILE_DATA_OFF "off"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_MOBILE_DATA_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_MOBILE_DATA_ON "on"
-
-
-/**
- * @brief Definition for system-event of setting : state of data roaming.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_KEY_DATA_ROAMING_STATE
- */
-#define SYSTEM_EVENT_DATA_ROAMING_STATE "tizen.system.event.data_roaming_state"
-
-
-/**
- * @brief Definition for key of SYSTEM_EVENT_DATA_ROAMING_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_VAL_DATA_ROAMING_OFF
- * @see EVENT_VAL_DATA_ROAMING_ON
- */
-#define EVENT_KEY_DATA_ROAMING_STATE "data_roaming_state"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_DATA_ROAMING_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_DATA_ROAMING_OFF "off"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_DATA_ROAMING_STATE.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define EVENT_VAL_DATA_ROAMING_ON "on"
-
-
-/**
- * @brief Definition for system-event of setting : font setting.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @see EVENT_KEY_FONT_SET
- */
-#define SYSTEM_EVENT_FONT_SET "tizen.system.event.font_set"
-
-
-/**
- * @brief Definition for key of SYSTEM_EVENT_FONT_SET.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @remarks The value of this key is font name of string type by font-config.
- */
-#define EVENT_KEY_FONT_SET "font_set"
-
-
-/**
- * @brief Definition for system-event of network : status of network.
- * @since_tizen 3.0
- * @see EVENT_KEY_NETWORK_STATUS
- */
-#define SYSTEM_EVENT_NETWORK_STATUS "tizen.system.event.network_status"
-
-
-/**
- * @brief Definition for key of SYSTEM_EVENT_NETWORK_STATUS.
- * @since_tizen 3.0
- * @remarks The values of this event indicate the type of the current profile for data connection.
- * @see EVENT_VAL_NETWORK_DISCONNECTED
- * @see EVENT_VAL_NETWORK_WIFI
- * @see EVENT_VAL_NETWORK_CELLULAR
- * @see EVENT_VAL_NETWORK_ETHERNET
- * @see EVENT_VAL_NETWORK_BT
- * @see EVENT_VAL_NETWORK_NET_PROXY
- */
-#define EVENT_KEY_NETWORK_STATUS "network_status"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_NETWORK_STATUS.
- * @since_tizen 3.0
- */
-#define EVENT_VAL_NETWORK_DISCONNECTED "disconnected"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_NETWORK_STATUS.
- * @since_tizen 3.0
- */
-#define EVENT_VAL_NETWORK_WIFI "wifi"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_NETWORK_STATUS.
- * @since_tizen 3.0
- */
-#define EVENT_VAL_NETWORK_CELLULAR "cellular"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_NETWORK_STATUS.
- * @since_tizen 3.0
- */
-#define EVENT_VAL_NETWORK_ETHERNET "ethernet"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_NETWORK_STATUS.
- * @since_tizen 3.0
- */
-#define EVENT_VAL_NETWORK_BT "bt"
-
-
-/**
- * @brief Definition for value of EVENT_KEY_NETWORK_STATUS.
- * @since_tizen 3.0
- */
-#define EVENT_VAL_NETWORK_NET_PROXY "net_proxy"
-
-
-/**
- * @brief Adds the event handler for receiving event-data of interested events.
- *
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @remarks If you want to add the privileged event, you MUST declare right privilge first. Unless that, this function returns #EVENT_ERROR_PERMISSION_DENIED. The privileged events are commented on remarks of it's definitions.
- * @param[in] event_name The interested event name
- * @param[in] callback The event callback called when the event occurs
- * @param[in] user_data The user data for passing to callback
- * @param[out] event_handler The event handler
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #EVENT_ERROR_NONE Successful
- * @retval #EVENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #EVENT_ERROR_PERMISSION_DENIED Permission denied
- * @retval #EVENT_ERROR_IO_ERROR Adding handler failed
- * @retval #EVENT_ERROR_OUT_OF_MEMORY Out of memory
- */
-int event_add_event_handler(const char *event_name, event_cb callback, void *user_data, event_handler_h *event_handler);
-
-
-/**
- * @brief Removes the registered event handler.
- *
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @param[in] event_handler The event handler
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #EVENT_ERROR_NONE Successful
- * @retval #EVENT_ERROR_INVALID_PARAMETER Invalid parameter
- */
-int event_remove_event_handler(event_handler_h event_handler);
-
-
-/**
- * @brief Sends the User-Event to receiver applications.
- *
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @remarks The format of User-Event's name MUST be "event.{sender's appid}.{user-defined name}", refer to 'The name-format of User-Event' section, If the event_name is invalid, the function returns #EVENT_ERROR_IO_ERROR.
- * @param[in] event_name The event's name to send
- * @param[in] event_data The event's data to send
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #EVENT_ERROR_NONE Successful
- * @retval #EVENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #EVENT_ERROR_IO_ERROR Sending operation failed
- */
-int event_publish_app_event(const char *event_name, bundle *event_data);
-
-
-/**
- * @brief Sends the User-Event to trusted receiver-applications.
- *
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @remarks The application which has same certification with sender can receive the event.
- * @remarks The format of User-Event's name MUST be "event.{sender's appid}.{user-defined name}", refer to 'The name-format of User-Event' section,  If the event_name is invalid, the function returns #EVENT_ERROR_IO_ERROR.
- * @param[in] event_name The event's name to send
- * @param[in] event_data The event's data to send
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #EVENT_ERROR_NONE Successful
- * @retval #EVENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #EVENT_ERROR_IO_ERROR Sending operation failed
- */
-int event_publish_trusted_app_event(const char *event_name, bundle *event_data);
-
-
-/**
- * @brief Keeps last User-Event data for receiver applications.
- *
- * @since_tizen 3.0
- * @remarks The receiver applications will receive this last event data after adding their new handlers via event_add_event_handler() API since the sender application called this API.
- * @remarks If a sender application sends same event via trusted API and non-trusted API, then a trusted receiver will get latest data regardless of trusted or non-trusted, but non-trusted receiver will get the last data only from non-trusted API.
- * @remarks The effect of this API continues during runtime. That means when the sender application process restarts, the sender application needs to call this api again to make the event to keep the last event.
- * @param[in] event_name The event's name to keep last event data
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #EVENT_ERROR_NONE Successful
- * @retval #EVENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #EVENT_ERROR_IO_ERROR Sending operation failed
- * @retval #EVENT_ERROR_OUT_OF_MEMORY Out of memory
- */
-int event_keep_last_event_data(const char *event_name);
-
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __TIZEN_APPFW_EVENT_H__ */
-
diff --git a/include/app_extension.h b/include/app_extension.h
deleted file mode 100755 (executable)
index a66852f..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2011 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __TIZEN_APPFW_APP_EXTENSION_H__
-#define __TIZEN_APPFW_APP_EXTENSION_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @brief      Gets the preinitialized window object.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks    This API only supports BASIC type window.
- *
- * @param[in] win_name The name to be set for the preinitialized window
- *
- * @return     A @a window object on success,
- *             otherwise @c NULL
- */
-void *app_get_preinitialized_window(const char *win_name);
-
-/**
- * @brief      Gets the preinitialized background object added to the preinitialized window.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks    This API should be called after calling app_get_preinitizlized_window().
- *
- * @return     A @a background object on success,
- *             otherwise @c NULL
- */
-void *app_get_preinitialized_background(void);
-
-/**
- * @brief      Gets the preinitialized conformant widget added to the preinitialized window.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks    This API should be called after calling app_get_preinitizlized_window().
- *
- * @return     A conformant object on success,
- *             otherwise @c NULL
- */
-void *app_get_preinitialized_conformant(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __TIZEN_APPFW_APP_EXTENSION_H__ */
-
diff --git a/include/app_i18n.h b/include/app_i18n.h
deleted file mode 100644 (file)
index d30a285..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2011 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __TIZEN_APPFW_I18N_H__
-#define __TIZEN_APPFW_I18N_H__
-
-#include <tizen.h>
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/**
- * @file app_i18n.h
- */
-
- /**
- * @addtogroup CAPI_I18N_MODULE
- * @{
- */
-
-/**
- * @brief Definition to mark a string for translation, which is replaced with the translated string at runtime.
- * @param[in] msg The string to be translated
- */
-#ifndef _
-#define _(msg) i18n_get_text(msg)
-#endif
-
-
-/**
- * @brief Gets the localized translation for the specified string.
- *
- * @details If a translation is not found in the localization file(.po file), @a message is returned.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks Do not free the returned value.
- *
- * @param[in] message The string to be translated
- * @return The localized translation for the given @a message on success,
- *         otherwise the given @a message
- */
-char *i18n_get_text(const char *message);
-
-
-/**
- * @}
- */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __TIZEN_APPFW_I18N_H__ */
-
diff --git a/include/app_internal.h b/include/app_internal.h
deleted file mode 100644 (file)
index f0624d8..0000000
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- * Copyright (c) 2011 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __TIZEN_APPFW_APP_INTERNAL_H__
-#define __TIZEN_APPFW_APP_INTERNAL_H__
-
-#include <app.h>
-#include <tzplatform_config.h>
-
-/* GNU gettext macro is already defined at appcore-common.h */
-#ifdef _
-#undef _
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define TIZEN_PATH_MAX 1024
-
-#define PATH_FMT_APP_ROOT tzplatform_getenv(TZ_USER_APP)
-#define PATH_FMT_RES_DIR "/res"
-#define PATH_FMT_LOCALE_DIR "/locale"
-#define PATH_FMT_DATA_DIR "/data"
-
-#define PATH_FMT_RO_APP_ROOT tzplatform_getenv(TZ_SYS_RO_APP)
-#define PATH_FMT_RO_RES_DIR "/res"
-#define PATH_FMT_RO_LOCALE_DIR "/local"
-
-typedef void (*app_finalizer_cb) (void *data);
-typedef void *appcore_context_h;
-
-int app_error(app_error_e error, const char *function, const char *description);
-
-int app_get_package_app_name(const char *package, char **name);
-
-int app_finalizer_add(app_finalizer_cb callback, void *data);
-
-int app_finalizer_remove(app_finalizer_cb callback);
-
-void app_finalizer_execute(void);
-
-int app_get_package(char **package);
-
-/**
- * @internal
- * @brief Called when the system memory is running low.
- *
- * @details When a low memory event is dispatched, the application should immediately save state and release resources to save as much memory as possible. \n
- *          If enough memory is not reclaimed during low memory conditions, the system will terminate some of the applications to reclaim the memory.
- *
- * @since_tizen 2.3
- * @param[in] user_data        The user data passed from the callback registration function
- * @see        app_main()
- * @see #app_event_callback_s
- */
-typedef void (*app_low_memory_cb) (void *user_data);
-
-/**
- * @internal
- * @brief Called when the battery power is running low.
- * @details When the battery level falls below 5%, it is called.
- *
- * @since_tizen 2.3
- * @param[in] user_data        The user data passed from the callback registration function
- * @see        app_main()
- * @see #app_event_callback_s
- */
-typedef void (*app_low_battery_cb) (void *user_data);
-
-/**
- * @internal
- * @brief Called when the orientation of the device changes.
- *
- * @since_tizen 2.3
- * @param[in] orientation The orientation of the device
- * @param[in] user_data        The user data passed from the callback registration function
- * @see        app_main()
- * @see #app_event_callback_s
- */
-typedef void (*app_device_orientation_cb) (app_device_orientation_e orientation, void *user_data);
-
-/**
- * @internal
- * @brief Called when language setting changes.
- *
- * @since_tizen 2.3
- * @param[in] user_data The user data passed from the callback registration function
- * @see        app_main()
- * @see #app_event_callback_s
- */
-typedef void (*app_language_changed_cb) (void *user_data);
-
-/**
- * @internal
- * @brief Called when region format setting changes.
- *
- * @since_tizen 2.3
- * @param[in] user_data The user data passed from the callback registration function
- * @see        app_main()
- * @see #app_event_callback_s
- */
-typedef void (*app_region_format_changed_cb) (void *user_data);
-
-/**
- * @internal
- * @brief The structure type containing the set of callback functions for handling application events.
- * @details It is one of the input parameters of the app_main() function.
- *
- * @since_tizen 2.3
- * @see app_main()
- * @see app_create_cb()
- * @see app_pause_cb()
- * @see app_resume_cb()
- * @see app_terminate_cb()
- * @see app_control_cb()
- * @see app_low_memory_cb()
- * @see app_low_battery_cb()
- * @see app_device_orientation_cb()
- * @see app_language_changed_cb()
- * @see app_region_format_changed_cb()
- */
-typedef struct {
-       app_create_cb create; /**< This callback function is called at the start of the application. */
-       app_terminate_cb terminate; /**< This callback function is called once after the main loop of the application exits. */
-       app_pause_cb pause; /**< This callback function is called each time the application is completely obscured by another application and becomes invisible to the user. */
-       app_resume_cb resume; /**< This callback function is called each time the application becomes visible to the user. */
-       app_control_cb app_control; /**< This callback function is called when another application sends the launch request to the application. */
-       app_low_memory_cb low_memory; /**< The registered callback function is called when the system runs low on memory. */
-       app_low_battery_cb low_battery; /**< The registered callback function is called when the battery is low. */
-       app_device_orientation_cb device_orientation; /**< The registered callback function is called when the orientation of the device changes */
-       app_language_changed_cb language_changed; /**< The registered callback function is called when language setting changes. */
-       app_region_format_changed_cb region_format_changed; /**< The registered callback function is called when region format setting changes. */
-} app_event_callback_s;
-
-/**
- * @internal
- * @brief Runs the application's main loop until app_exit() is called.
- *
- * @details This function is the main entry point of the Tizen application.
- *          The app_create_cb() callback function is called to initialize the application before the main loop of application starts up.
- *          After the app_create_cb() callback function returns true, the main loop starts up and the app_control_cb() callback function is subsequently called.
- *          If the app_create_cb() callback function returns false, the main loop doesn't start up and app_terminate_cb() callback function is called.
- *
- * @since_tizen 2.3
- * @param[in] argc The argument count
- * @param[in] argv The argument vector
- * @param[in] callback The set of callback functions to handle application events
- * @param[in] user_data The user data to be passed to the callback functions
- *
- * @return 0 on success, otherwise a negative error value
- * @retval #APP_ERROR_NONE Successful
- * @retval #APP_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_ERROR_INVALID_CONTEXT The application is illegally launched, not launched by the launch system
- * @retval #APP_ERROR_ALREADY_RUNNING The main loop already starts
- *
- * @see app_create_cb()
- * @see app_terminate_cb()
- * @see app_pause_cb()
- * @see app_resume_cb()
- * @see app_control_cb()
- * @see app_low_memory_cb()
- * @see app_low_battery_cb()
- * @see app_device_orientation_cb()
- * @see app_language_changed_cb()
- * @see app_region_format_changed_cb()
- * @see app_exit()
- * @see #app_event_callback_s
- */
-int app_main(int argc, char **argv, app_event_callback_s *callback, void *user_data);
-
-/**
- * @internal
- * @brief Runs the application's main loop until app_efl_exit() is called.
- *
- * @details This function is the main entry point of the Tizen application.
- *          The app_create_cb() callback function is called to initialize the application before the main loop of the application starts up.
- *          After the app_create_cb() callback function returns @c true, the main loop starts up and the app_control_cb() callback function is subsequently called.
- *          If the app_create_cb() callback function returns @c false, the main loop doesn't start up and the app_terminate_cb() callback function is called.
- *
- * @since_tizen 2.3
- * @param[in] argc The argument count
- * @param[in] argv The argument vector
- * @param[in] callback The set of callback functions to handle application events
- * @param[in] user_data The user data to be passed to the callback functions
- *
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #APP_ERROR_NONE Successful
- * @retval #APP_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_ERROR_INVALID_CONTEXT The application is illegally launched, not launched by the launch system
- * @retval #APP_ERROR_ALREADY_RUNNING The main loop has already started
- *
- * @see app_create_cb()
- * @see app_terminate_cb()
- * @see app_pause_cb()
- * @see app_resume_cb()
- * @see app_control_cb()
- * @see app_low_memory_cb()
- * @see app_low_battery_cb()
- * @see app_device_orientation_cb()
- * @see app_language_changed_cb()
- * @see app_region_format_changed_cb()
- * @see app_efl_exit()
- * @see #app_event_callback_s
- */
-int app_efl_main(int *argc, char ***argv, app_event_callback_s *callback, void *user_data);
-
-/**
- * @internal
- * @brief Exits the main loop of application.
- *
- * @details The main loop of application stops and app_terminate_cb() is invoked.
- * @since_tizen 2.3
- * @see app_main()
- * @see app_terminate_cb()
- */
-void app_exit(void);
-
-/**
- * @internal
- * @brief Exits the main loop of the application.
- *
- * @details The main loop of the application stops and app_terminate_cb() is invoked.
- * @since_tizen 2.3
- * @see app_efl_main()
- * @see app_terminate_cb()
- */
-void app_efl_exit(void);
-
-/**
- * @brief Initialize the application main loop.
- *
- * @details After calling this API, the application main loop doesn't run.
- * @since_tizen 3.0
- * @param[in] argc The argument count
- * @param[in] argv The argument vector
- * @param[in] callback The set of callback functions to handle application lifecycle events
- * @param[in] user_data The user data to be passed to the callback functions
- * @param[out] handle The appcore_context handle to be newly created on success
- *
- * @return 0 on success, otherwise a negative error value
- * @retval #APP_ERROR_NONE Successful
- * @retval #APP_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_ERROR_INVALID_CONTEXT The application is illegally launched, not launched by the launch system
- * @retval #APP_ERROR_ALREADY_RUNNING The main loop already starts
- * @sett ui_app_fini()
- */
-int ui_app_init(int argc, char **argv, ui_app_lifecycle_callback_s *callback, void *user_data, appcore_context_h *handle);
-
-/**
- * @brief Finalize the application main loop.
- *
- * @since_tizen 3.0
- * @param[in] handle The handle of appcore context
- *
- * @see ui_app_init()
- */
-void ui_app_fini(appcore_context_h handle);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __TIZEN_APPFW_APP_INTERNAL_H__ */
-
diff --git a/include/app_preference.h b/include/app_preference.h
deleted file mode 100644 (file)
index 478793a..0000000
+++ /dev/null
@@ -1,322 +0,0 @@
-/*
- * Copyright (c) 2011 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __TIZEN_APPFW_PREFERENCE_H__
-#define __TIZEN_APPFW_PREFERENCE_H__
-
-#include <tizen.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/**
- * @file app_preference.h
- */
-
-/**
- * @addtogroup CAPI_PREFERENCE_MODULE
- * @{
- */
-
-
-/**
- * @brief Enumeration for Preference Error.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-typedef enum {
-       PREFERENCE_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
-       PREFERENCE_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
-       PREFERENCE_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
-       PREFERENCE_ERROR_NO_KEY = TIZEN_ERROR_APPLICATION | 0x30, /**< Required key not available */
-       PREFERENCE_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR , /**< Internal I/O Error */
-} preference_error_e;
-
-
-/**
- * @brief Called when the given key's value in the preference changes.
- * @details When the @a key is added or removed, this callback function is skipped(only update can be handled).
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] key The name of the key in the preference
- * @param[in] user_data The user data passed from the callback registration function
- * @pre This function is invoked when the value of the key is overwritten after you register this callback using preference_set_changed_cb().
- * @see preference_set_changed_cb()
- * @see preference_unset_changed_cb()
- * @see        preference_set_boolean()
- * @see preference_set_int()
- * @see preference_set_string()
- * @see preference_set_double()
- */
-typedef void (*preference_changed_cb) (const char *key, void *user_data);
-
-
-/**
- * @brief Called to get key string, once for each key-value pair in the preference.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks You should not free the @a key returned by this function.
- * @param[in] key The key of the value added to the preference
- * @param[in] value The value associated with the key
- * @param[in] user_data The user data passed from the foreach function
- * @return @c true to continue with the next iteration of the loop,
- *         otherwise @c false to break out of the loop
- * @pre        preference_foreach_item() will invoke this callback function.
- * @see        preference_foreach_item()
- */
-typedef bool (*preference_item_cb)(const char *key, void *user_data);
-
-
-/**
- * @brief Sets an integer value in the preference.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] key The name of the key to modify
- * @param[in] value  The new @c int value for the given key
- * @return @c 0 on success,
- *                     otherwise a negative error value
- * @retval #PREFERENCE_ERROR_NONE Successful
- * @retval #PREFERENCE_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #PREFERENCE_ERROR_OUT_OF_MEMORY     Out of memory
- * @retval #PREFERENCE_ERROR_IO_ERROR Internal I/O Error
- * @see        preference_get_int()
- */
-int preference_set_int(const char *key, int value);
-
-
-/**
- * @brief Gets an integer value from the preference.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] key The name of the key to retrieve
- * @param[out] value The @c int value for the given key
- * @return @c 0 on success,
- *                     otherwise a negative error value
- * @retval #PREFERENCE_ERROR_NONE Successful
- * @retval #PREFERENCE_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #PREFERENCE_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #PREFERENCE_ERROR_NO_KEY    Required key not available
- * @retval #PREFERENCE_ERROR_IO_ERROR Internal I/O Error
- * @see        preference_set_int()
- */
-int preference_get_int(const char *key, int *value);
-
-
-/**
- * @brief Sets a double value in the preference.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] key The name of the key to modify
- * @param[in] value  The new @c double value associated with the given key
- * @return @c 0 on success,
- *                     otherwise a negative error value
- * @retval #PREFERENCE_ERROR_NONE Successful
- * @retval #PREFERENCE_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #PREFERENCE_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #PREFERENCE_ERROR_IO_ERROR Internal I/O Error
- * @see        preference_get_double()
- */
-int preference_set_double(const char *key, double value);
-
-
-/**
- * @brief Gets a double value from the preference.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] key The name of the key to retrieve
- * @param[out] value The @c double value associated with the given key
- * @return @c 0 on success,
- *                     otherwise a negative error value
- * @retval #PREFERENCE_ERROR_NONE Successful
- * @retval #PREFERENCE_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #PREFERENCE_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #PREFERENCE_ERROR_NO_KEY    Required key not available
- * @retval #PREFERENCE_ERROR_IO_ERROR Internal I/O Error
- * @see        preference_set_double()
- */
-int preference_get_double(const char *key, double *value);
-
-
-/**
- * @brief Sets a string value in the preference.
- * @details It makes a deep copy of the added string value.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] key The name of the key to modify
- * @param[in] value The new @c string value associated with the given key
- * @return @c 0 on success,
- *                     otherwise a negative error value
- * @retval #PREFERENCE_ERROR_NONE Successful
- * @retval #PREFERENCE_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #PREFERENCE_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #PREFERENCE_ERROR_IO_ERROR Internal I/O Error
- * @see        preference_get_string()
- */
-int preference_set_string(const char *key, const char *value);
-
-
-/**
- * @brief Gets a string value from the preference.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks @a value must be released using free().
- * @param[in] key The name of the key to retrieve
- * @param[out] value The @c string value associated with the given key
- * @return @c 0 on success,
- *                     otherwise a negative error value
- * @retval #PREFERENCE_ERROR_NONE Successful
- * @retval #PREFERENCE_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #PREFERENCE_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #PREFERENCE_ERROR_NO_KEY    Required key not available
- * @retval #PREFERENCE_ERROR_IO_ERROR Internal I/O Error
- * @see        preference_set_string()
- */
-int preference_get_string(const char *key, char **value);
-
-
-/**
- * @brief Sets a boolean value in the preference.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] key The name of the key to modify
- * @param[in] value The new @c boolean value associated with the given key
- * @return @c 0 on success,
- *                     otherwise a negative error value
- * @retval #PREFERENCE_ERROR_NONE Successful
- * @retval #PREFERENCE_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #PREFERENCE_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #PREFERENCE_ERROR_IO_ERROR Internal I/O Error
- * @see        preference_get_boolean()
- */
-int preference_set_boolean(const char *key, bool value);
-
-
-/**
- * @brief Gets a boolean value from the preference.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] key The name of the key to retrieve
- * @param[out] value The @c boolean value associated with the given key
- * @return @c 0 on success,
- *                     otherwise a negative error value
- * @retval #PREFERENCE_ERROR_NONE Successful
- * @retval #PREFERENCE_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #PREFERENCE_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #PREFERENCE_ERROR_NO_KEY    Required key not available
- * @retval #PREFERENCE_ERROR_IO_ERROR Internal I/O Error
- * @see        preference_set_boolean()
- */
-int preference_get_boolean(const char *key, bool *value);
-
-
-/**
- * @brief Removes any value with the given @a key from the preference.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] key The name of the key to remove
- * @return @c 0 on success,
- *                     otherwise a negative error value
- * @retval #PREFERENCE_ERROR_NONE Successful
- * @retval #PREFERENCE_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #PREFERENCE_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #PREFERENCE_ERROR_NO_KEY Required key not available
- * @retval #PREFERENCE_ERROR_IO_ERROR Internal I/O Error
- */
-int preference_remove(const char *key);
-
-
-/**
- * @brief Checks whether the given @a key exists in the preference.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] key The name of the key to check
- * @param[out] existing If @c true the @a key exists in the preference,
- *                         otherwise @c false
- * @return @c 0 on success,
- *                     otherwise a negative error value
- * @retval #PREFERENCE_ERROR_NONE Successful
- * @retval #PREFERENCE_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #PREFERENCE_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #PREFERENCE_ERROR_IO_ERROR Internal I/O Error
- */
-int preference_is_existing(const char *key, bool *existing);
-
-
-/**
- * @brief Removes all key-value pairs from the preference.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @return @c 0 on success,
- *                     otherwise a negative error value
- * @retval #PREFERENCE_ERROR_NONE Successful
- * @retval #PREFERENCE_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #PREFERENCE_ERROR_IO_ERROR Internal I/O Error
- * @see        preference_remove()
- */
-int preference_remove_all(void);
-
-
-/**
- * @brief Registers a callback function to be invoked when value of the given key in the preference changes.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] key The name of the key to monitor
- * @param[in] callback The callback function to register
- * @param[in] user_data The user data to be passed to the callback function
- * @return @c 0 on success,
- *                     otherwise a negative error value
- * @retval #PREFERENCE_ERROR_NONE Successful
- * @retval #PREFERENCE_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #PREFERENCE_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #PREFERENCE_ERROR_NO_KEY Required key not available
- * @retval #PREFERENCE_ERROR_IO_ERROR Internal I/O Error
- * @post preference_changed_cb() will be invoked.
- * @see        preference_unset_changed_cb()
- * @see preference_changed_cb()
- */
-int preference_set_changed_cb(const char *key, preference_changed_cb callback, void *user_data);
-
-
-/**
- * @brief Unregisters the callback function.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] key The name of the key to monitor
- * @return @c 0 on success,
- *                     otherwise a negative error value
- * @retval #PREFERENCE_ERROR_NONE Successful
- * @retval #PREFERENCE_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #PREFERENCE_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #PREFERENCE_ERROR_NO_KEY Required key not available
- * @retval #PREFERENCE_ERROR_IO_ERROR Internal I/O Error
- * @see        preference_set_changed_cb()
- */
-int preference_unset_changed_cb(const char *key);
-
-
-/**
- * @brief Retrieves all key-value pairs in the preference by invoking the callback function.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] callback The callback function to get key value once for each key-value pair in the preference
- * @param[in] user_data The user data to be passed to the callback function
- * @return @c 0 on success,
- *                     otherwise a negative error value
- * @retval #PREFERENCE_ERROR_NONE Successful
- * @retval #PREFERENCE_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #PREFERENCE_ERROR_IO_ERROR Internal I/O Error
- * @post This function invokes preference_item_cb() repeatedly to get each key-value pair in the preference.
- * @see preference_item_cb()
- */
-int preference_foreach_item(preference_item_cb callback, void *user_data);
-
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __TIZEN_APPFW_PREFERENCE_H__ */
-
diff --git a/include/app_preference_internal.h b/include/app_preference_internal.h
deleted file mode 100644 (file)
index 478efb7..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Copyright (c) 2011 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __TIZEN_APPFW_PREFERENCE_INTERNAL_H__
-#define __TIZEN_APPFW_PREFERENCE_INTERNAL_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "app_preference_log.h"
-#include "linux/limits.h"
-
-#define BUF_LEN                        (4096)
-#define PREF_DIR       ".pref/"
-
-#define PREFERENCE_KEY_PATH_LEN        1024
-#define ERR_LEN                        1024
-
-#define PREF_DB_NAME           ".pref.db"
-#define PREF_TBL_NAME          "pref"
-#define PREF_F_KEY_NAME                "pref_key"
-#define PREF_F_TYPE_NAME       "pref_type"
-#define PREF_F_DATA_NAME       "pref_data"
-
-/* ASCII VALUE */
-#define PREF_KEYNAME_C_PAD '='
-#define PREF_KEYNAME_C_PLUS '+'
-#define PREF_KEYNAME_C_SLASH '/'
-
-#define PREF_KEYNAME_C_DOT '.'
-#define PREF_KEYNAME_C_UNDERSCORE '_'
-#define PREF_KEYNAME_C_HYPHEN '-'
-
-/**
- * @brief Definition for PREFERENCE_ERROR_WRONG_PREFIX.
- */
-#define PREFERENCE_ERROR_WRONG_PREFIX    -2
-
-/**
- * @brief Definition for PREFERENCE_ERROR_WRONG_TYPE.
- */
-#define PREFERENCE_ERROR_WRONG_TYPE      -3
-
-/**
- * @brief Definition for PREFERENCE_ERROR_FILE_OPEN.
- */
-#define PREFERENCE_ERROR_FILE_OPEN       -21
-
-/**
- * @brief Definition for PREFERENCE_ERROR_FILE_FREAD.
- */
-#define PREFERENCE_ERROR_FILE_FREAD      -22
-
-/**
- * @brief Definition for PREFERENCE_ERROR_FILE_FGETS.
- */
-#define PREFERENCE_ERROR_FILE_FGETS      -23
-
-/**
- * @brief Definition for PREFERENCE_ERROR_FILE_WRITE.
- */
-#define PREFERENCE_ERROR_FILE_WRITE      -24
-
-/**
- * @brief Definition for PREFERENCE_ERROR_FILE_SYNC.
- */
-#define PREFERENCE_ERROR_FILE_SYNC       -25
-
-/**
- * @brief Definition for PREFERENCE_ERROR_FILE_CHMOD.
- */
-#define PREFERENCE_ERROR_FILE_CHMOD      -28
-
-/**
- * @brief Definition for PREFERENCE_ERROR_FILE_LOCK.
- */
-#define PREFERENCE_ERROR_FILE_LOCK       -29
-
-typedef enum {
-       PREFERENCE_TYPE_NONE = 0,
-       PREFERENCE_TYPE_STRING,
-       PREFERENCE_TYPE_INT,
-       PREFERENCE_TYPE_DOUBLE,
-       PREFERENCE_TYPE_BOOLEAN,
-} preference_type_e;
-
-typedef struct _pref_changed_cb_node_t {
-       char *key;
-       preference_changed_cb cb;
-       void *user_data;
-       struct _pref_changed_cb_node_t *prev;
-       struct _pref_changed_cb_node_t *next;
-} pref_changed_cb_node_t;
-
-typedef struct _keynode_t {
-       char *keyname;                  /**< Keyname for keynode */
-       int type;                       /**< Keynode type */
-       union {
-               int i;                  /**< Integer type */
-               int b;                  /**< Bool type */
-               double d;               /**< Double type */
-               char *s;                /**< String type */
-       } value;                        /**< Value for keynode */
-       struct _keynode_t *next;        /**< Next keynode */
-} keynode_t;
-
-/**
- * @brief The structure type for opaque type. It must be used via accessor functions.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-typedef struct _keylist_t {
-       int num;                /**< Number of list */
-       keynode_t *head;        /**< Head node */
-       keynode_t *cursor;      /**< Cursor node */
-} keylist_t;
-
-
-int _preference_kdb_add_notify
-       (keynode_t *keynode, preference_changed_cb cb, void *data);
-int _preference_kdb_del_notify
-       (keynode_t *keynode);
-
-int _preference_get_key_path(keynode_t *keynode, char *path);
-int _preference_get_key(keynode_t *keynode);
-
-int _preference_keynode_set_keyname(keynode_t *keynode, const char *keyname);
-__attribute__ ((gnu_inline)) inline keynode_t *_preference_keynode_new(void);
-__attribute__ ((gnu_inline)) inline void _preference_keynode_free(keynode_t *keynode);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __TIZEN_APPFW_PREFERENCE_INTERNAL_H__ */
-
diff --git a/include/app_preference_log.h b/include/app_preference_log.h
deleted file mode 100644 (file)
index 5aa8144..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "CAPI_APPFW_APPLICATION_PREFERENCE"
-#define DBG_MODE (1)
-
-#ifndef __PREFERENCE_LOG_H__
-#define __PREFERENCE_LOG_H__
-
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <dlog.h>
-
-
-#define INFO(fmt, arg...)
-#define DBG(fmt, arg...) SECURE_SLOGI(fmt, ##arg)
-#define ERR(fmt, arg...) LOGE(fmt, ##arg)
-#define SECURE_ERR(fmt, arg...) SECURE_SLOGE(fmt, ##arg)
-#define FATAL(fmt, arg...) SECURE_SLOGF(fmt, ##arg)
-#define WARN(fmt, arg...) SECURE_SLOGW(fmt, ##arg)
-
-
-/************** Return ***************/
-#define ret_if(expr) \
-       do { \
-               if (expr) { \
-                       ERR("(%s) -> %s() return", #expr, __FUNCTION__); \
-                       return; \
-               } \
-       } while (0)
-#define retv_if(expr, val) \
-       do { \
-               if (expr) { \
-                       ERR("(%s) -> %s() return", #expr, __FUNCTION__); \
-                       return (val); \
-               } \
-       } while (0)
-#define retm_if(expr, fmt, arg...) \
-       do { \
-               if (expr) { \
-                       ERR(fmt, ##arg); \
-                       return; \
-               } \
-       } while (0)
-#define retvm_if(expr, val, fmt, arg...) \
-       do { \
-               if (expr) { \
-                       ERR(fmt, ##arg); \
-                       return (val); \
-               } \
-       } while (0)
-#define retex_if(expr, fmt, arg...) \
-       do { \
-               if (expr) { \
-                       ERR(fmt, ##arg); \
-                       goto CATCH; \
-               } \
-       } while (0)
-
-
-/************** TimeCheck ***************/
-#ifdef PREFERENCE_TIMECHECK
-#define START_TIME_CHECK \
-       init_time();\
-       startT = set_start_time();
-#define END_TIME_CHECK \
-       PREFERENCE_DEBUG("time = %f ms\n", exec_time(startT));
-#else
-#define START_TIME_CHECK
-#define END_TIME_CHECK
-#endif
-
-
-#endif                         /* __PREFERENCE_LOG_H__ */
-
diff --git a/include/app_resource_manager.h b/include/app_resource_manager.h
deleted file mode 100644 (file)
index 927f00b..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (c) 2011 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __TIZEN_APPFW_RESOURCE_MANAGER_H__
-#define __TIZEN_APPFW_RESOURCE_MANAGER_H__
-
-#include <tizen.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @file app_resource_manager.h
- */
-
-/**
- * @addtogroup CAPI_RESOURCE_MANAGER_MODULE
- * @{
- */
-
-/**
- * @brief Enumeration for Resource Types
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-typedef enum {
-       APP_RESOURCE_TYPE_IMAGE = 0, /**<Image*/
-       APP_RESOURCE_TYPE_LAYOUT, /**<Edje*/
-       APP_RESOURCE_TYPE_SOUND, /**<Sound*/
-       APP_RESOURCE_TYPE_BIN, /**<Bin*/
-       APP_RESOURCE_TYPE_MIN = APP_RESOURCE_TYPE_IMAGE,
-       APP_RESOURCE_TYPE_MAX = APP_RESOURCE_TYPE_BIN,
-/*add values between APP_RESOURCE_TYPE_MIN and APP_RESOURCE_TYPE_MAX*/
-} app_resource_e;
-
-
-/**
- * @brief Enumeration for App Resource Manager Error.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-typedef enum {
-       APP_RESOURCE_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
-       APP_RESOURCE_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
-       APP_RESOURCE_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
-       APP_RESOURCE_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< I/O error */
-} app_resource_error_e;
-
-
-/**
- * @brief Creates resource manager and get from db.
- *
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @remarks If resource manager already exists,
- *                     It will just return APP_RESOURCE_ERROR_NONE
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #APP_RESOURCE_ERROR_NONE Successful
- * @retval #APP_RESOURCE_ERROR_IO_ERROR IO Internal I/O Error
- * @retval #APP_RESOURCE_ERROR_OUT_OF_MEMORY Out of memeory
- * @see        app_resource_manager_release()
- */
-int app_resource_manager_init(void);
-
-
-/**
- * @brief Converts resource ID to path name
- *
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @remarks If resource manager is not created yet,
- *                     app_resource_manager_init() will be invoked automatically.
- *                     Caller should free the returned pointer.
- * @param[in] type Resource type @see app_resource_e
- * @param[in] id Resource ID
- * @param[out] path The name of requested resource on success, otherwise NULL
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #APP_RESOURCE_ERROR_NONE Successful
- * @retval #APP_RESOURCE_ERROR_INVALID_PARAMETER Invalid Parameter
- * @retval #APP_RESOURCE_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #APP_RESOURCE_ERROR_IO_ERROR Internal I/O Error or failed to find valid resource
- * @see        app_resource_manager_init()
- */
-int app_resource_manager_get(app_resource_e type, const char *id, char **path);
-
-
-/**
- * @brief Destroys resource manager.
- *
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @remarks Please note that the instance of resource manager should only be released when the application is closing.
- *          It is a highly recommended way to improve run-time performance.
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #APP_RESOURCE_ERROR_NONE Successful
- * @see        app_resource_manager_init()
- */
-int app_resource_manager_release(void);
-
-
-/**
- * @}
- */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __TIZEN_APPFW_RESOURCE_MANAGER_H__ */
-
diff --git a/include/app_types.h b/include/app_types.h
deleted file mode 100644 (file)
index a939615..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2011 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-
-
-#ifndef __TIZEN_APPFW_APP_TYPES_H__
-#define __TIZEN_APPFW_APP_TYPES_H__
-
-#include <tizen.h>
-
-/**
- * @file app_types.h
- */
-
-/**
- * @addtogroup CAPI_APPLICATION_MODULE
- * @{
- */
-
-/**
- * @brief Enumeration for application error.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-typedef enum {
-       APP_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
-       APP_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
-       APP_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
-       APP_ERROR_INVALID_CONTEXT = TIZEN_ERROR_APPLICATION | 0x01, /**< Invalid application context */
-       APP_ERROR_NO_SUCH_FILE = TIZEN_ERROR_NO_SUCH_FILE, /**< No such file or directory */
-       APP_ERROR_ALREADY_RUNNING = TIZEN_ERROR_ALREADY_IN_PROGRESS, /**< Application is already running */
-       APP_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied @if MOBILE (Since 2.3.1) @endif */
-} app_error_e;
-
-
-/**
- * @}
- */
-
-#endif /* __TIZEN_APPFW_APP_TYPES_H__ */
-
diff --git a/packaging/capi-appfw-app-control.spec b/packaging/capi-appfw-app-control.spec
new file mode 100644 (file)
index 0000000..35bf4cb
--- /dev/null
@@ -0,0 +1,53 @@
+Name:       capi-appfw-app-control
+Summary:    App control API
+Version:    0.5.11
+Release:    0
+Group:      System/API
+License:    Apache-2.0
+Source0:    %{name}-%{version}.tar.gz
+Source1001:     capi-appfw-app-control.manifest
+BuildRequires:  cmake
+BuildRequires:  pkgconfig(dlog)
+BuildRequires:  pkgconfig(bundle)
+BuildRequires:  pkgconfig(aul)
+BuildRequires:  pkgconfig(capi-base-common)
+
+%description
+An Application Control library in Tizen C API
+
+%package devel
+Summary:  An Application Control library in Tizen C API (Development)
+Group:    System/API
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+An Application Control library in Tizen C API (Development) package.
+
+%prep
+%setup -q
+cp %{SOURCE1001} .
+
+%build
+MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
+%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
+%__make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+%make_install
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%files
+%manifest %{name}.manifest
+%{_libdir}/libcapi-appfw-app-control.so.*
+%license LICENSE
+
+%files devel
+%manifest %{name}.manifest
+%{_includedir}/appfw/app_control.h
+%{_includedir}/appfw/app_control_internal.h
+%{_libdir}/pkgconfig/capi-appfw-app-control.pc
+%{_libdir}/libcapi-appfw-app-control.so
+
diff --git a/packaging/capi-appfw-application.spec b/packaging/capi-appfw-application.spec
deleted file mode 100644 (file)
index 28c406f..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-Name:       capi-appfw-application
-Summary:    An Application library in SLP C API
-Version:    0.5.11
-Release:    0
-Group:      System/API
-License:    Apache-2.0
-Source0:    %{name}-%{version}.tar.gz
-Source1001:     capi-appfw-application.manifest
-BuildRequires:  cmake
-BuildRequires:  pkgconfig(dlog)
-BuildRequires:  pkgconfig(bundle)
-BuildRequires:  pkgconfig(appcore-common)
-BuildRequires:  pkgconfig(appcore-efl)
-BuildRequires:  pkgconfig(aul)
-BuildRequires:  pkgconfig(appsvc)
-BuildRequires:  pkgconfig(elementary)
-BuildRequires:  pkgconfig(capi-base-common)
-BuildRequires:  pkgconfig(sqlite3)
-BuildRequires:  pkgconfig(libtzplatform-config)
-BuildRequires:  pkgconfig(vconf-internal-keys)
-BuildRequires:  pkgconfig(eventsystem)
-BuildRequires:  pkgconfig(pkgmgr-info)
-BuildRequires:  pkgconfig(glib-2.0)
-
-%description
-An Application library in SLP C API package.
-
-%package -n capi-appfw-app-control
-Summary:  An Application Control library in Tizen C API
-Group:    System/API
-
-%description -n capi-appfw-app-control
-An Application Control library in Tizen C API package.
-
-%package -n capi-appfw-app-common
-Summary:  An Application Common library in Tizen C API
-Group:    System/API
-
-%description -n capi-appfw-app-common
-An Application Common library in Tizen C API package.
-
-%package -n capi-appfw-preference
-Summary:  An Application Preference library in Tizen C API
-Group:    System/API
-
-%description -n capi-appfw-preference
-An Application Preference library in Tizen C API package.
-
-%package -n capi-appfw-event
-Summary:  An Application Event library in Tizen C API
-Group:    System/API
-
-%description -n capi-appfw-event
-An Application Event library in Tizen C API package.
-
-%package devel
-Summary:  An Application library in SLP C API (Development)
-Group:    System/API
-Requires: %{name} = %{version}-%{release}
-
-%description devel
-An Application library in SLP C API (Development) package.
-
-%package -n capi-appfw-app-control-devel
-Summary:  An Application Control library in Tizen C API (Development)
-Group:    System/API
-Requires: capi-appfw-app-control = %{version}-%{release}
-
-%description -n capi-appfw-app-control-devel
-An Application Control library in Tizen C API (Development) package.
-
-%package -n capi-appfw-app-common-devel
-Summary:  An Application Common library in Tizen C API (Development)
-Group:    System/API
-Requires: capi-appfw-app-common = %{version}-%{release}
-
-%description -n capi-appfw-app-common-devel
-An Application Common library in Tizen C API (Development) package.
-
-%package -n capi-appfw-preference-devel
-Summary:  An Application Preference library in Tizen C API (Development)
-Group:    System/API
-Requires: capi-appfw-preference = %{version}-%{release}
-
-%description -n capi-appfw-preference-devel
-An Application Preference library in Tizen C API (Development) package.
-
-%package -n capi-appfw-event-devel
-Summary:  An Application Event library in Tizen C API (Development)
-Group:    System/API
-Requires: capi-appfw-event = %{version}-%{release}
-
-%description -n capi-appfw-event-devel
-An Application Event library in Tizen C API (Development) package.
-
-
-%prep
-%setup -q
-cp %{SOURCE1001} .
-
-%build
-MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
-%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
-%__make %{?jobs:-j%jobs}
-
-%install
-rm -rf %{buildroot}
-%make_install
-
-%post -p /sbin/ldconfig
-%postun -p /sbin/ldconfig
-
-%post -n capi-appfw-app-control -p /sbin/ldconfig
-%postun -n capi-appfw-app-control -p /sbin/ldconfig
-
-%post -n capi-appfw-app-common -p /sbin/ldconfig
-%postun -n capi-appfw-app-common -p /sbin/ldconfig
-
-%post -n capi-appfw-preference -p /sbin/ldconfig
-%postun -n capi-appfw-preference -p /sbin/ldconfig
-
-%post -n capi-appfw-event -p /sbin/ldconfig
-%postun -n capi-appfw-event -p /sbin/ldconfig
-
-%files
-%manifest %{name}.manifest
-%{_libdir}/libcapi-appfw-application.so.*
-%license LICENSE
-
-%files -n capi-appfw-app-control
-%manifest %{name}.manifest
-%{_libdir}/libcapi-appfw-app-control.so.*
-%license LICENSE
-
-%files -n capi-appfw-app-common
-%manifest %{name}.manifest
-%{_libdir}/libcapi-appfw-app-common.so.*
-%license LICENSE
-
-%files -n capi-appfw-preference
-%manifest %{name}.manifest
-%{_libdir}/libcapi-appfw-preference.so.*
-%license LICENSE
-
-%files -n capi-appfw-event
-%manifest %{name}.manifest
-%{_libdir}/libcapi-appfw-event.so.*
-%license LICENSE
-
-%files devel
-%manifest %{name}.manifest
-%{_includedir}/appfw/app.h
-%{_includedir}/appfw/app_internal.h
-%{_includedir}/appfw/app_extension.h
-%{_includedir}/appfw/app_i18n.h
-%{_libdir}/pkgconfig/capi-appfw-application.pc
-%{_libdir}/libcapi-appfw-application.so
-
-%files -n capi-appfw-app-control-devel
-%manifest %{name}.manifest
-%{_includedir}/appfw/app_control.h
-%{_includedir}/appfw/app_control_internal.h
-%{_libdir}/pkgconfig/capi-appfw-app-control.pc
-%{_libdir}/libcapi-appfw-app-control.so
-
-%files -n capi-appfw-app-common-devel
-%manifest %{name}.manifest
-%{_includedir}/appfw/app_common.h
-%{_includedir}/appfw/app_types.h
-%{_includedir}/appfw/app_resource_manager.h
-%{_libdir}/pkgconfig/capi-appfw-app-common.pc
-%{_libdir}/libcapi-appfw-app-common.so
-
-%files -n capi-appfw-preference-devel
-%manifest %{name}.manifest
-%{_includedir}/appfw/app_preference.h
-%{_includedir}/appfw/app_preference_internal.h
-%{_includedir}/appfw/app_preference_log.h
-%{_libdir}/pkgconfig/capi-appfw-preference.pc
-%{_libdir}/libcapi-appfw-preference.so
-
-%files -n capi-appfw-event-devel
-%manifest %{name}.manifest
-%{_includedir}/appfw/app_event.h
-%{_libdir}/pkgconfig/capi-appfw-event.pc
-%{_libdir}/libcapi-appfw-event.so
diff --git a/preference/CMakeLists.txt b/preference/CMakeLists.txt
deleted file mode 100644 (file)
index ef5c08b..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-SET(fw_name "capi-appfw-preference")
-
-PROJECT(${fw_name})
-
-SET(CMAKE_INSTALL_PREFIX /usr)
-SET(PREFIX ${CMAKE_INSTALL_PREFIX})
-
-SET(INC_DIR ${CMAKE_SOURCE_DIR}/include)
-INCLUDE_DIRECTORIES(${INC_DIR})
-
-SET(requires "dlog capi-base-common sqlite3 glib-2.0")
-SET(pc_requires "capi-base-common capi-appfw-app-common")
-
-INCLUDE(FindPkgConfig)
-pkg_check_modules(${fw_name} REQUIRED ${requires})
-FOREACH(flag ${${fw_name}_CFLAGS})
-    SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror")
-SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
-
-IF("${ARCH}" STREQUAL "arm")
-    ADD_DEFINITIONS("-DTARGET")
-ENDIF("${ARCH}" STREQUAL "arm")
-
-ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
-ADD_DEFINITIONS("-DSLP_DEBUG")
-
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
-
-add_library(${fw_name} SHARED
-               preference.c
-               preference_inoti.c
-               )
-
-TARGET_LINK_LIBRARIES(${fw_name} capi-appfw-app-common ${${fw_name}_LDFLAGS})
-
-SET_TARGET_PROPERTIES(${fw_name}
-     PROPERTIES
-     VERSION ${FULLVER}
-     SOVERSION ${MAJORVER}
-     CLEAN_DIRECT_OUTPUT 1
-)
-
-INSTALL(TARGETS ${fw_name} DESTINATION ${LIB_INSTALL_DIR})
-INSTALL(
-        DIRECTORY ${INC_DIR}/ DESTINATION include/appfw
-        FILES_MATCHING
-        PATTERN "*_private.h" EXCLUDE
-        PATTERN "${INC_DIR}/*.h"
-        )
-
-SET(PC_NAME ${fw_name})
-SET(PC_REQUIRED ${pc_requires})
-SET(PC_LDFLAGS -l${fw_name})
-
-CONFIGURE_FILE(
-    ${CMAKE_SOURCE_DIR}/capi-appfw-module.pc.in
-    ${CMAKE_SOURCE_DIR}/${fw_name}.pc
-    @ONLY
-)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
-
-
diff --git a/preference/preference.c b/preference/preference.c
deleted file mode 100755 (executable)
index 246f011..0000000
+++ /dev/null
@@ -1,1578 +0,0 @@
-/*
- * Copyright (c) 2011 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdlib.h>
-#include <limits.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <dirent.h>
-#include <sys/stat.h>
-#include <sys/xattr.h>
-#include <ctype.h>
-#include <string.h>
-#include <execinfo.h>
-#include <glib.h>
-
-#include <app_preference.h>
-#include <app_preference_internal.h>
-#include <app_common.h>
-
-#include <sys/syscall.h>
-
-#ifdef PREFERENCE_TIMECHECK
-#include <sys/time.h>
-#endif
-
-#ifndef API
-#define API __attribute__ ((visibility("default")))
-#endif
-
-#define PREFERENCE_ERROR_RETRY_CNT 7
-#define PREFERENCE_ERROR_RETRY_SLEEP_UTIME 10000
-
-#define DELIMITER 29
-
-static int g_posix_errno;
-static int g_preference_errno;
-static char *g_pref_dir_path = NULL;
-
-enum preference_op_t {
-       PREFERENCE_OP_GET = 0,
-       PREFERENCE_OP_SET = 1
-};
-
-#ifdef PREFERENCE_TIMECHECK
-double correction, startT;
-
-double set_start_time(void)
-{
-       struct timeval tv;
-       double curtime;
-
-       gettimeofday(&tv, NULL);
-       curtime = tv.tv_sec * 1000 + (double)tv.tv_usec / 1000;
-       return curtime;
-}
-
-double exec_time(double start)
-{
-       double end = set_start_time();
-       return (end - start - correction);
-}
-
-int init_time(void)
-{
-       double temp_t;
-       temp_t = set_start_time();
-       correction = exec_time(temp_t);
-
-       return 0;
-}
-#endif
-
-char *_preference_get_pref_dir_path()
-{
-       char *app_data_path = NULL;
-
-       if (!g_pref_dir_path) {
-               g_pref_dir_path = (char *)malloc(PREFERENCE_KEY_PATH_LEN + 1);
-
-               if ((app_data_path = app_get_data_path()) == NULL) {
-                       /* LCOV_EXCL_START */
-                       ERR("IO_ERROR(0x%08x) : fail to get data directory", PREFERENCE_ERROR_IO_ERROR);
-                       free(g_pref_dir_path);
-                       g_pref_dir_path = NULL;
-                       return NULL;
-                       /* LCOV_EXCL_STOP */
-               }
-
-               snprintf(g_pref_dir_path, PREFERENCE_KEY_PATH_LEN, "%s%s", app_data_path, PREF_DIR);
-               INFO("pref_dir_path: %s", g_pref_dir_path);
-               free(app_data_path);
-       }
-       return g_pref_dir_path;
-}
-
-int _preference_keynode_set_keyname(keynode_t *keynode, const char *keyname)
-{
-       if (keynode->keyname) free(keynode->keyname);
-       keynode->keyname = strndup(keyname, PREFERENCE_KEY_PATH_LEN);
-       retvm_if(keynode->keyname == NULL, PREFERENCE_ERROR_IO_ERROR, "strndup Fails");
-       return PREFERENCE_ERROR_NONE;
-}
-
-static inline void _preference_keynode_set_value_int(keynode_t *keynode, const int value)
-{
-       keynode->type = PREFERENCE_TYPE_INT;
-       keynode->value.i = value;
-}
-
-static inline void _preference_keynode_set_value_boolean(keynode_t *keynode, const int value)
-{
-       keynode->type = PREFERENCE_TYPE_BOOLEAN;
-       keynode->value.b = !!value;
-}
-
-static inline void _preference_keynode_set_value_double(keynode_t *keynode, const double value)
-{
-       keynode->type = PREFERENCE_TYPE_DOUBLE;
-       keynode->value.d = value;
-}
-
-static inline void _preference_keynode_set_value_string(keynode_t *keynode, const char *value)
-{
-       keynode->type = PREFERENCE_TYPE_STRING;
-       keynode->value.s = strdup(value);
-}
-
-__attribute__ ((gnu_inline)) inline keynode_t *_preference_keynode_new(void)
-{
-       keynode_t *keynode;
-       keynode = calloc(1, sizeof(keynode_t));
-
-       return keynode;
-}
-
-__attribute__ ((gnu_inline)) inline void _preference_keynode_free(keynode_t *keynode)
-{
-       if (keynode) {
-               if (keynode->keyname)
-                       free(keynode->keyname);
-               if (keynode->type == PREFERENCE_TYPE_STRING && keynode->value.s)
-                       free(keynode->value.s);
-               free(keynode);
-       }
-}
-
-int _preference_get_key_name(const char *path, char **keyname)
-{
-       int read_size = 0;
-       size_t keyname_len = 0;
-       char *convert_key = NULL;
-       FILE *fp = NULL;
-
-       if ((fp = fopen(path, "r")) == NULL)
-               return PREFERENCE_ERROR_FILE_OPEN;
-
-       read_size = fread((void *)&keyname_len, sizeof(int), 1, fp);
-       if (read_size <= 0 || keyname_len > PREFERENCE_KEY_PATH_LEN) {
-               fclose(fp);
-               return PREFERENCE_ERROR_FILE_FREAD;
-       }
-
-       convert_key = (char *)calloc(1, keyname_len+1);
-       if (convert_key == NULL) {
-               LOGE("memory alloc failed");
-               fclose(fp);
-               return PREFERENCE_ERROR_OUT_OF_MEMORY;
-       }
-
-       read_size = fread((void *)convert_key, keyname_len, 1, fp);
-       if (read_size <= 0) {
-               free(convert_key);
-               fclose(fp);
-               return PREFERENCE_ERROR_FILE_FREAD;
-       }
-
-       *keyname = convert_key;
-
-       fclose(fp);
-
-       return PREFERENCE_ERROR_NONE;
-}
-
-int _preference_get_key_path(keynode_t *keynode, char *path)
-{
-       const char *key = NULL;
-       char *pref_dir_path = NULL;
-       gchar *convert_key;
-       char *keyname = keynode->keyname;
-
-       if (!keyname) {
-               LOGE("keyname is null");
-               return PREFERENCE_ERROR_WRONG_PREFIX;
-       }
-
-       pref_dir_path = _preference_get_pref_dir_path();
-       if (!pref_dir_path) {
-               LOGE("_preference_get_pref_dir_path() failed.");
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       convert_key = g_compute_checksum_for_string(G_CHECKSUM_SHA1,
-                                                       keyname,
-                                                       strlen(keyname));
-       if (convert_key == NULL) {
-               LOGE("fail to convert");
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       key = (const char *)convert_key;
-
-       snprintf(path, PATH_MAX-1, "%s%s", pref_dir_path, key);
-
-       g_free(convert_key);
-
-       return PREFERENCE_ERROR_NONE;
-}
-
-static int _preference_set_key_check_pref_dir()
-{
-       char *pref_dir_path = NULL;
-       mode_t dir_mode = 0664 | 0111;
-       char err_buf[ERR_LEN] = {0,};
-
-       pref_dir_path = _preference_get_pref_dir_path();
-       if (!pref_dir_path) {
-               LOGE("_preference_get_pref_dir_path() failed.");
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       if (access(pref_dir_path, F_OK) < 0) {
-               if (mkdir(pref_dir_path, dir_mode) < 0) {
-                       strerror_r(errno, err_buf, sizeof(err_buf));
-                       ERR("mkdir() failed(%d/%s)", errno, err_buf);
-                       return PREFERENCE_ERROR_IO_ERROR;
-               }
-       }
-
-       return PREFERENCE_ERROR_NONE;
-}
-
-static int _preference_set_key_creation(const char *path)
-{
-       int fd;
-       mode_t temp;
-       char err_buf[ERR_LEN] = {0,};
-
-       temp = umask(0000);
-       fd = open(path, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
-       umask(temp);
-
-       if (fd == -1) {
-               strerror_r(errno, err_buf, sizeof(err_buf));
-               ERR("open(rdwr,create) error: %d(%s)", errno, err_buf);
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-       close(fd);
-
-       return PREFERENCE_ERROR_NONE;
-}
-
-static int _preference_set_file_lock(int fd, short type)
-{
-       struct flock l;
-
-       l.l_type = type;
-       l.l_start = 0;          /*Start at begin*/
-       l.l_whence = SEEK_SET;
-       l.l_len = 0;            /*Do it with whole file*/
-
-       return fcntl(fd, F_SETLK, &l);
-}
-
-/* LCOV_EXCL_START */
-static int _preference_get_pid_of_file_lock_owner(int fd, short type)
-{
-       struct flock l;
-
-       l.l_type = type;
-       l.l_start = 0;          /*Start at begin*/
-       l.l_whence = SEEK_SET;
-       l.l_len = 0;            /*Do it with whole file*/
-
-       if (fcntl(fd, F_GETLK, &l) < 0) {
-               WARN("error in getting lock info");
-               return -1;
-       }
-
-       if (l.l_type == F_UNLCK)
-               return 0;
-       else
-               return l.l_pid;
-}
-/* LCOV_EXCL_STOP */
-
-static int _preference_set_read_lock(int fd)
-{
-       return _preference_set_file_lock(fd, F_RDLCK);
-}
-
-static int _preference_set_write_lock(int fd)
-{
-       return _preference_set_file_lock(fd, F_WRLCK);
-}
-
-static int _preference_set_unlock(int fd)
-{
-       return _preference_set_file_lock(fd, F_UNLCK);
-}
-
-/* LCOV_EXCL_START */
-static void _preference_log_subject_label(void)
-{
-       int fd;
-       int ret;
-       char smack_label[256] = {0,};
-       char curren_path[256] = {0,};
-       int tid;
-       char err_buf[ERR_LEN] = {0,};
-
-       tid = (int)syscall(SYS_gettid);
-       snprintf(curren_path, sizeof(curren_path)-1, "/proc/%d/attr/current", tid);
-       fd = open(curren_path, O_RDONLY);
-       if (fd < 0) {
-               strerror_r(errno, err_buf, sizeof(err_buf));
-               LOGE("fail to open self current attr (err: %s)", err_buf);
-               return;
-       }
-
-       ret = read(fd, smack_label, sizeof(smack_label)-1);
-       if (ret < 0) {
-               close(fd);
-               strerror_r(errno, err_buf, sizeof(err_buf));
-               LOGE("fail to open self current attr (err: %s)", err_buf);
-               return;
-       }
-
-       ERR("current(%d) subject label : %s", tid, smack_label);
-
-       close(fd);
-}
-/* LCOV_EXCL_STOP */
-
-static int _preference_check_retry_err(keynode_t *keynode, int preference_errno, int io_errno, int op_type)
-{
-       int is_busy_err = 0;
-       int rc = 0;
-       char path[PATH_MAX] = {0,};
-       char err_buf[ERR_LEN] = {0,};
-
-       if (preference_errno == PREFERENCE_ERROR_FILE_OPEN) {
-               switch (io_errno) {
-               case ENOENT:
-                       if (op_type == PREFERENCE_OP_SET) {
-                               rc = _preference_get_key_path(keynode, path);
-                               if (rc != PREFERENCE_ERROR_NONE) {
-                                       /* LCOV_EXCL_START */
-                                       ERR("_preference_get_key_path error");
-                                       _preference_log_subject_label();
-                                       break;
-                                       /* LCOV_EXCL_STOP */
-                               }
-
-                               rc = _preference_set_key_check_pref_dir();
-                               if (rc != PREFERENCE_ERROR_NONE) {
-                                       /* LCOV_EXCL_START */
-                                       ERR("_preference_set_key_check_pref_dir() failed.");
-                                       _preference_log_subject_label();
-                                       break;
-                                       /* LCOV_EXCL_STOP */
-                               }
-
-                               rc = _preference_set_key_creation(path);
-                               if (rc != PREFERENCE_ERROR_NONE) {
-                                       /* LCOV_EXCL_START */
-                                       ERR("_preference_set_key_creation error : %s", path);
-                                       _preference_log_subject_label();
-                                       break;
-                                       /* LCOV_EXCL_STOP */
-                               }
-                               INFO("%s key is created", keynode->keyname);
-
-                               is_busy_err = 1;
-                       }
-                       break;
-               case EACCES:
-                       _preference_log_subject_label();
-                       break;
-               case EAGAIN:
-               case EMFILE:
-               case ENFILE:
-               case ETXTBSY:
-                       is_busy_err = 1;
-               }
-       } else if (preference_errno == PREFERENCE_ERROR_FILE_CHMOD) {
-               switch (io_errno) {
-               case EINTR:
-               case EBADF:
-                       is_busy_err = 1;
-               }
-       } else if (preference_errno == PREFERENCE_ERROR_FILE_LOCK) {
-               switch (io_errno) {
-               case EBADF:
-               case EAGAIN:
-               case ENOLCK:
-                       is_busy_err = 1;
-               }
-       } else if (preference_errno == PREFERENCE_ERROR_FILE_WRITE) {
-               switch (io_errno) {
-               case 0:
-               case EAGAIN:
-               case EINTR:
-               case EIO:
-               case ENOMEM:
-                       is_busy_err = 1;
-               }
-       } else if (preference_errno == PREFERENCE_ERROR_FILE_FREAD) {
-               switch (io_errno) {
-               case EAGAIN:
-               case EINTR:
-               case EIO:
-                       is_busy_err = 1;
-               }
-       } else {
-               is_busy_err = 0;
-       }
-
-       if (is_busy_err == 1) {
-               return 1;
-       } else {
-               strerror_r(errno, err_buf, sizeof(err_buf));
-               ERR("key(%s), check retry err: %d/(%d/%s).", keynode->keyname, preference_errno, io_errno, err_buf);
-               return 0;
-       }
-}
-
-static int _preference_set_key_filesys(keynode_t *keynode, int *io_errno)
-{
-       char path[PATH_MAX] = {0,};
-       FILE *fp = NULL;
-       int ret = -1;
-       int func_ret = PREFERENCE_ERROR_NONE;
-       int err_no = 0;
-       char err_buf[100] = { 0, };
-       int is_write_error = 0;
-       int retry_cnt = 0;
-       size_t keyname_len = 0;
-
-retry_open:
-       errno = 0;
-       err_no = 0;
-       func_ret = PREFERENCE_ERROR_NONE;
-
-       ret = _preference_get_key_path(keynode, path);
-       retv_if(ret != PREFERENCE_ERROR_NONE, ret);
-
-       if ((fp = fopen(path, "r+")) == NULL) {
-               func_ret = PREFERENCE_ERROR_FILE_OPEN;
-               err_no = errno;
-               goto out_return;
-       }
-
-retry:
-       errno = 0;
-       err_no = 0;
-       func_ret = PREFERENCE_ERROR_NONE;
-
-       ret = _preference_set_write_lock(fileno(fp));
-       if (ret == -1) {
-               /* LCOV_EXCL_START */
-               func_ret = PREFERENCE_ERROR_FILE_LOCK;
-               err_no = errno;
-               ERR("file(%s) lock owner(%d)",
-                       keynode->keyname,
-                       _preference_get_pid_of_file_lock_owner(fileno(fp), F_WRLCK));
-               goto out_return;
-               /* LCOV_EXCL_STOP */
-       }
-
-       /* write keyname and size */
-       keyname_len = strlen(keynode->keyname);
-
-       ret = fwrite((void *)&keyname_len, sizeof(int), 1, fp);
-       if (ret <= 0) {
-               /* LCOV_EXCL_START */
-               if (!errno) {
-                       LOGW("number of written items is 0. try again");
-                       errno = EAGAIN;
-               }
-               err_no = errno;
-               func_ret = PREFERENCE_ERROR_FILE_WRITE;
-               goto out_unlock;
-               /* LCOV_EXCL_STOP */
-       }
-
-       ret = fwrite((void *)keynode->keyname, keyname_len, 1, fp);
-       if (ret <= 0) {
-               /* LCOV_EXCL_START */
-               if (!errno) {
-                       LOGW("number of written items is 0. try again");
-                       errno = EAGAIN;
-               }
-               err_no = errno;
-               func_ret = PREFERENCE_ERROR_FILE_WRITE;
-               goto out_unlock;
-               /* LCOV_EXCL_STOP */
-       }
-
-       /* write key type */
-       ret = fwrite((void *)&(keynode->type), sizeof(int), 1, fp);
-       if (ret <= 0) {
-               /* LCOV_EXCL_START */
-               if (!errno) {
-                       LOGW("number of written items is 0. try again");
-                       errno = EAGAIN;
-               }
-               err_no = errno;
-               func_ret = PREFERENCE_ERROR_FILE_WRITE;
-               goto out_unlock;
-               /* LCOV_EXCL_STOP */
-       }
-
-       /* write key value */
-       switch (keynode->type) {
-       case PREFERENCE_TYPE_INT:
-               ret = fwrite((void *)&(keynode->value.i), sizeof(int), 1, fp);
-               if (ret <= 0) is_write_error = 1;
-               break;
-       case PREFERENCE_TYPE_DOUBLE:
-               ret = fwrite((void *)&(keynode->value.d), sizeof(double), 1, fp);
-               if (ret <= 0) is_write_error = 1;
-               break;
-       case PREFERENCE_TYPE_BOOLEAN:
-               ret = fwrite((void *)&(keynode->value.b), sizeof(int), 1, fp);
-               if (ret <= 0) is_write_error = 1;
-               break;
-       case PREFERENCE_TYPE_STRING:
-               ret = fprintf(fp, "%s", keynode->value.s);
-               if (ret < strlen(keynode->value.s))
-                       is_write_error = 1;
-               if (ftruncate(fileno(fp), ret) == -1)
-                       is_write_error = 1;
-               break;
-       default:
-               func_ret = PREFERENCE_ERROR_WRONG_TYPE;
-               goto out_unlock;
-       }
-
-       if (is_write_error) {
-               /* LCOV_EXCL_START */
-               if (!errno) {
-                       LOGW("number of written items is 0. try again");
-                       errno = EAGAIN;
-               }
-               err_no = errno;
-               func_ret = PREFERENCE_ERROR_FILE_WRITE;
-               goto out_unlock;
-               /* LCOV_EXCL_STOP */
-       }
-
-       fflush(fp);
-
-out_unlock:
-       ret = _preference_set_unlock(fileno(fp));
-       if (ret == -1) {
-               func_ret = PREFERENCE_ERROR_FILE_LOCK;
-               err_no = errno;
-               goto out_return;
-       }
-
-out_return:
-       if (func_ret != PREFERENCE_ERROR_NONE) {
-               strerror_r(err_no, err_buf, 100);
-               if (_preference_check_retry_err(keynode, func_ret, err_no, PREFERENCE_OP_SET)) {
-                       if (retry_cnt < PREFERENCE_ERROR_RETRY_CNT) {
-                               WARN("_preference_set_key_filesys(%d-%s) step(%d) failed(%d / %s) retry(%d)", keynode->type, keynode->keyname, func_ret, err_no, err_buf, retry_cnt);
-                               retry_cnt++;
-                               usleep((retry_cnt)*PREFERENCE_ERROR_RETRY_SLEEP_UTIME);
-
-                               if (fp)
-                                       goto retry;
-                               else
-                                       goto retry_open;
-                       } else {
-                               ERR("_preference_set_key_filesys(%d-%s) step(%d) faild(%d / %s) over the retry count.",
-                                       keynode->type, keynode->keyname, func_ret, err_no, err_buf);
-                       }
-               } else {
-                       ERR("_preference_set_key_filesys(%d-%s) step(%d) failed(%d / %s)\n", keynode->type, keynode->keyname, func_ret, err_no, err_buf);
-               }
-       } else if (retry_cnt > 0) {
-               DBG("_preference_set_key_filesys ok with retry cnt(%d)", retry_cnt);
-       }
-
-       if (fp) {
-               if (func_ret == PREFERENCE_ERROR_NONE) {
-                       ret = fdatasync(fileno(fp));
-                       if (ret == -1) {
-                               err_no = errno;
-                               func_ret = PREFERENCE_ERROR_FILE_SYNC;
-                       }
-               }
-               fclose(fp);
-       }
-       *io_errno = err_no;
-
-       return func_ret;
-}
-
-static int _preference_set_key(keynode_t *keynode)
-{
-       int ret = 0;
-       int io_errno = 0;
-       char err_buf[100] = { 0, };
-
-       ret = _preference_set_key_filesys(keynode, &io_errno);
-       if (ret == PREFERENCE_ERROR_NONE) {
-               g_posix_errno = PREFERENCE_ERROR_NONE;
-               g_preference_errno = PREFERENCE_ERROR_NONE;
-       } else {
-               /* LCOV_EXCL_START */
-               strerror_r(io_errno, err_buf, 100);
-               ERR("_preference_set_key(%s) step(%d) failed(%d / %s)", keynode->keyname, ret, io_errno, err_buf);
-               g_posix_errno = io_errno;
-               g_preference_errno = ret;
-               /* LCOV_EXCL_STOP */
-       }
-
-       return ret;
-}
-
-
-/*
- * This function set the integer value of given key
- * @param[in]  key     key
- * @param[in]  intval integer value to set
- * @return 0 on success, -1 on error
- */
-API int preference_set_int(const char *key, int intval)
-{
-       int func_ret = PREFERENCE_ERROR_NONE;
-       keynode_t *pKeyNode;
-
-       START_TIME_CHECK
-
-       retvm_if(key == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: key is NULL");
-
-       pKeyNode = _preference_keynode_new();
-       retvm_if(pKeyNode == NULL, PREFERENCE_ERROR_OUT_OF_MEMORY, "key malloc fail");
-
-       func_ret = _preference_keynode_set_keyname(pKeyNode, key);
-       if (func_ret != PREFERENCE_ERROR_NONE) {
-               /* LCOV_EXCL_START */
-               ERR("set key name error");
-               _preference_keynode_free(pKeyNode);
-               return PREFERENCE_ERROR_IO_ERROR;
-               /* LCOV_EXCL_STOP */
-       }
-       _preference_keynode_set_value_int(pKeyNode, intval);
-
-       if (_preference_set_key(pKeyNode) != PREFERENCE_ERROR_NONE) {
-               ERR("preference_set_int(%d) : key(%s/%d) error", getpid(), key, intval);
-               func_ret = PREFERENCE_ERROR_IO_ERROR;
-       } else {
-               INFO("%s(%d) success", key, intval);
-       }
-
-       _preference_keynode_free(pKeyNode);
-
-       END_TIME_CHECK
-
-       return func_ret;
-}
-
-/*
-* This function set the boolean value of given key
-* @param[in]   key     key
-* @param[in]   boolval boolean value to set
-               (Integer value 1 is 'True', and 0 is 'False')
-* @return 0 on success, -1 on error
-*/
-API int preference_set_boolean(const char *key, bool boolval)
-{
-       int func_ret = PREFERENCE_ERROR_NONE;
-       keynode_t *pKeyNode;
-
-       START_TIME_CHECK
-
-       retvm_if(key == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: key is NULL");
-
-       pKeyNode = _preference_keynode_new();
-       retvm_if(pKeyNode == NULL, PREFERENCE_ERROR_OUT_OF_MEMORY, "key malloc fail");
-
-       func_ret = _preference_keynode_set_keyname(pKeyNode, key);
-       if (func_ret != PREFERENCE_ERROR_NONE) {
-               /* LCOV_EXCL_START */
-               ERR("set key name error");
-               _preference_keynode_free(pKeyNode);
-               return PREFERENCE_ERROR_IO_ERROR;
-               /* LCOV_EXCL_STOP */
-       }
-       _preference_keynode_set_value_boolean(pKeyNode, boolval);
-
-       if (_preference_set_key(pKeyNode) != PREFERENCE_ERROR_NONE) {
-               ERR("preference_set_boolean(%d) : key(%s/%d) error", getpid(), key, boolval);
-               func_ret = PREFERENCE_ERROR_IO_ERROR;
-       } else {
-               INFO("%s(%d) success", key, boolval);
-       }
-
-       _preference_keynode_free(pKeyNode);
-
-       END_TIME_CHECK
-
-       return func_ret;
-}
-
-/*
- * This function set the double value of given key
- * @param[in]  key     key
- * @param[in]  dblval double value to set
- * @return 0 on success, -1 on error
- */
-API int preference_set_double(const char *key, double dblval)
-{
-       int func_ret = PREFERENCE_ERROR_NONE;
-       keynode_t *pKeyNode;
-
-       START_TIME_CHECK
-
-       retvm_if(key == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: key is NULL");
-
-       pKeyNode = _preference_keynode_new();
-       retvm_if(pKeyNode == NULL, PREFERENCE_ERROR_OUT_OF_MEMORY, "key malloc fail");
-
-       func_ret = _preference_keynode_set_keyname(pKeyNode, key);
-       if (func_ret != PREFERENCE_ERROR_NONE) {
-               /* LCOV_EXCL_START */
-               ERR("set key name error");
-               _preference_keynode_free(pKeyNode);
-               return PREFERENCE_ERROR_IO_ERROR;
-               /* LCOV_EXCL_STOP */
-       }
-       _preference_keynode_set_value_double(pKeyNode, dblval);
-
-       if (_preference_set_key(pKeyNode) != PREFERENCE_ERROR_NONE) {
-               ERR("preference_set_double(%d) : key(%s/%f) error", getpid(), key, dblval);
-               func_ret = PREFERENCE_ERROR_IO_ERROR;
-       } else {
-               INFO("%s(%f) success", key, dblval);
-       }
-
-       _preference_keynode_free(pKeyNode);
-
-       END_TIME_CHECK
-
-       return func_ret;
-}
-
-/*
- * This function set the string value of given key
- * @param[in]  key     key
- * @param[in]  strval string value to set
- * @return 0 on success, -1 on error
- */
-API int preference_set_string(const char *key, const char *strval)
-{
-       int func_ret = PREFERENCE_ERROR_NONE;
-       keynode_t *pKeyNode;
-
-       START_TIME_CHECK
-
-       retvm_if(key == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: key is NULL");
-       retvm_if(strval == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: value is NULL");
-
-       pKeyNode = _preference_keynode_new();
-       retvm_if(pKeyNode == NULL, PREFERENCE_ERROR_OUT_OF_MEMORY, "key malloc fail");
-
-       func_ret = _preference_keynode_set_keyname(pKeyNode, key);
-       if (func_ret != PREFERENCE_ERROR_NONE) {
-               /* LCOV_EXCL_START */
-               ERR("set key name error");
-               _preference_keynode_free(pKeyNode);
-               return PREFERENCE_ERROR_IO_ERROR;
-               /* LCOV_EXCL_STOP */
-       }
-       _preference_keynode_set_value_string(pKeyNode, strval);
-
-       if (_preference_set_key(pKeyNode) != PREFERENCE_ERROR_NONE) {
-               ERR("preference_set_string(%d) : key(%s/%s) error", getpid(), key, strval);
-               func_ret = PREFERENCE_ERROR_IO_ERROR;
-       } else {
-               INFO("%s(%s) success", key, strval);
-       }
-
-       _preference_keynode_free(pKeyNode);
-
-       END_TIME_CHECK
-
-       return func_ret;
-}
-
-static int _preference_get_key_filesys(keynode_t *keynode, int* io_errno)
-{
-       char path[PATH_MAX] = {0,};
-       int ret = -1;
-       int func_ret = PREFERENCE_ERROR_NONE;
-       char err_buf[100] = { 0, };
-       int err_no = 0;
-       int type = 0;
-       FILE *fp = NULL;
-       int retry_cnt = 0;
-       int read_size = 0;
-       size_t keyname_len = 0;
-       int value_int = 0;
-       double value_dbl = 0;
-       char file_buf[BUF_LEN] = {0,};
-       char *value = NULL;
-       char *tmp_value;
-       int value_size = 0;
-
-retry_open:
-       errno = 0;
-       func_ret = PREFERENCE_ERROR_NONE;
-
-       ret = _preference_get_key_path(keynode, path);
-       retv_if(ret != PREFERENCE_ERROR_NONE, ret);
-
-       if ((fp = fopen(path, "r")) == NULL) {
-               func_ret = PREFERENCE_ERROR_FILE_OPEN;
-               err_no = errno;
-               goto out_return;
-       }
-
-retry:
-       err_no = 0;
-       func_ret = PREFERENCE_ERROR_NONE;
-
-       ret = _preference_set_read_lock(fileno(fp));
-       if (ret == -1) {
-               /* LCOV_EXCL_START */
-               func_ret = PREFERENCE_ERROR_FILE_LOCK;
-               err_no = errno;
-               goto out_return;
-               /* LCOV_EXCL_STOP */
-       }
-
-       read_size = fread((void *)&keyname_len, sizeof(int), 1, fp);
-       if ((read_size <= 0) || (read_size > sizeof(int))) {
-               /* LCOV_EXCL_START */
-               if (!ferror(fp))
-                       errno = ENODATA;
-
-               err_no = errno;
-               func_ret = PREFERENCE_ERROR_FILE_FREAD;
-               goto out_unlock;
-               /* LCOV_EXCL_STOP */
-       }
-
-       ret = fseek(fp, keyname_len, SEEK_CUR);
-       if (ret) {
-               /* LCOV_EXCL_START */
-               if (!ferror(fp))
-                       errno = ENODATA;
-
-               err_no = errno;
-               func_ret = PREFERENCE_ERROR_FILE_FREAD;
-               goto out_unlock;
-               /* LCOV_EXCL_STOP */
-       }
-
-       read_size = fread((void *)&type, sizeof(int), 1, fp);
-       if (read_size <= 0) {
-               /* LCOV_EXCL_START */
-               if (!ferror(fp))
-                       errno = ENODATA;
-
-               err_no = errno;
-               func_ret = PREFERENCE_ERROR_FILE_FREAD;
-               goto out_unlock;
-               /* LCOV_EXCL_STOP */
-       }
-
-       /* read data value */
-       switch (type) {
-       case PREFERENCE_TYPE_INT:
-               read_size = fread((void *)&value_int, sizeof(int), 1, fp);
-               if ((read_size <= 0) || (read_size > sizeof(int))) {
-                       /* LCOV_EXCL_START */
-                       if (!ferror(fp))
-                               LOGW("number of read items for value is wrong. err : %d", errno);
-
-                       err_no = errno;
-                       func_ret = PREFERENCE_ERROR_FILE_FREAD;
-                       goto out_unlock;
-                       /* LCOV_EXCL_STOP */
-               } else {
-                       _preference_keynode_set_value_int(keynode, value_int);
-               }
-
-               break;
-       case PREFERENCE_TYPE_DOUBLE:
-               read_size = fread((void *)&value_dbl, sizeof(double), 1, fp);
-               if ((read_size <= 0) || (read_size > sizeof(double))) {
-                       /* LCOV_EXCL_START */
-                       if (!ferror(fp))
-                               LOGW("number of read items for value is wrong. err : %d", errno);
-
-                       err_no = errno;
-                       func_ret = PREFERENCE_ERROR_FILE_FREAD;
-                       goto out_unlock;
-                       /* LCOV_EXCL_STOP */
-               } else {
-                       _preference_keynode_set_value_double(keynode, value_dbl);
-               }
-
-               break;
-       case PREFERENCE_TYPE_BOOLEAN:
-               read_size = fread((void *)&value_int, sizeof(int), 1, fp);
-               if ((read_size <= 0) || (read_size > sizeof(int))) {
-                       /* LCOV_EXCL_START */
-                       if (!ferror(fp))
-                               LOGW("number of read items for value is wrong. err : %d", errno);
-
-                       err_no = errno;
-                       func_ret = PREFERENCE_ERROR_FILE_FREAD;
-                       goto out_unlock;
-                       /* LCOV_EXCL_STOP */
-               } else {
-                       _preference_keynode_set_value_boolean(keynode, value_int);
-               }
-
-               break;
-       case PREFERENCE_TYPE_STRING:
-               while (fgets(file_buf, sizeof(file_buf), fp)) {
-                       if (value) {
-                               value_size = value_size + strlen(file_buf);
-                               tmp_value = (char *) realloc(value, value_size);
-                               if (tmp_value == NULL) {
-                                       func_ret = PREFERENCE_ERROR_OUT_OF_MEMORY;
-                                       free(value);
-                                       value = NULL;
-                                       break;
-                               }
-                               value = tmp_value;
-                               strncat(value, file_buf, strlen(file_buf));
-                       } else {
-                               value_size = strlen(file_buf) + 1;
-                               value = (char *)malloc(value_size);
-                               if (value == NULL) {
-                                       func_ret = PREFERENCE_ERROR_OUT_OF_MEMORY;
-                                       break;
-                               }
-                               memset(value, 0x00, value_size);
-                               strncpy(value, file_buf, strlen(file_buf));
-                       }
-               }
-
-               if (ferror(fp)) {
-                       err_no = errno;
-                       func_ret = PREFERENCE_ERROR_FILE_FGETS;
-               } else {
-                       if (value)
-                               _preference_keynode_set_value_string(keynode, value);
-                       else
-                               _preference_keynode_set_value_string(keynode, "");
-               }
-               if (value)
-                       free(value);
-
-               break;
-       default:
-               func_ret = PREFERENCE_ERROR_WRONG_TYPE;
-       }
-
-out_unlock:
-       ret = _preference_set_unlock(fileno(fp));
-       if (ret == -1) {
-               func_ret = PREFERENCE_ERROR_FILE_LOCK;
-               err_no = errno;
-               goto out_return;
-       }
-
-
-out_return:
-       if (func_ret != PREFERENCE_ERROR_NONE) {
-               strerror_r(err_no, err_buf, 100);
-
-               if (_preference_check_retry_err(keynode, func_ret, err_no, PREFERENCE_OP_GET)) {
-                       /* LCOV_EXCL_START */
-                       if (retry_cnt < PREFERENCE_ERROR_RETRY_CNT) {
-                               retry_cnt++;
-                               usleep((retry_cnt)*PREFERENCE_ERROR_RETRY_SLEEP_UTIME);
-
-                               if (fp)
-                                       goto retry;
-                               else
-                                       goto retry_open;
-                       } else {
-                               ERR("_preference_get_key_filesys(%s) step(%d) faild(%d / %s) over the retry count.",
-                                       keynode->keyname, func_ret, err_no, err_buf);
-                       }
-                       /* LCOV_EXCL_STOP */
-               }
-       }
-
-       if (fp)
-               fclose(fp);
-
-       *io_errno = err_no;
-
-       return func_ret;
-}
-
-int _preference_get_key(keynode_t *keynode)
-{
-       int ret = 0;
-       int io_errno = 0;
-       char err_buf[100] = {0,};
-
-       ret = _preference_get_key_filesys(keynode, &io_errno);
-       if (ret == PREFERENCE_ERROR_NONE) {
-               g_posix_errno = PREFERENCE_ERROR_NONE;
-               g_preference_errno = PREFERENCE_ERROR_NONE;
-       } else {
-               if (io_errno == ENOENT)
-                       ret = PREFERENCE_ERROR_NO_KEY;
-               else
-                       ret = PREFERENCE_ERROR_IO_ERROR;
-
-               strerror_r(io_errno, err_buf, 100);
-               ERR("_preference_get_key(%s) step(%d) failed(%d / %s)\n", keynode->keyname, ret, io_errno, err_buf);
-               g_posix_errno = io_errno;
-               g_preference_errno = ret;
-       }
-
-       return ret;
-}
-
-
-/*
- * This function get the integer value of given key
- * @param[in]  key     key
- * @param[out] intval output buffer
- * @return 0 on success, -1 on error
- */
-API int preference_get_int(const char *key, int *intval)
-{
-       int func_ret = PREFERENCE_ERROR_IO_ERROR;
-       keynode_t *pKeyNode;
-
-       START_TIME_CHECK
-
-       retvm_if(key == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: key is null");
-       retvm_if(intval == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: output buffer is null");
-
-       pKeyNode = _preference_keynode_new();
-       retvm_if(pKeyNode == NULL, PREFERENCE_ERROR_OUT_OF_MEMORY, "key malloc fail");
-
-       func_ret = _preference_keynode_set_keyname(pKeyNode, key);
-       if (func_ret != PREFERENCE_ERROR_NONE) {
-               ERR("set key name error");
-               _preference_keynode_free(pKeyNode);
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       func_ret = _preference_get_key(pKeyNode);
-       if (func_ret != PREFERENCE_ERROR_NONE) {
-               ERR("preference_get_int(%d) : key(%s) error", getpid(), key);
-       } else {
-               *intval = pKeyNode->value.i;
-               if (pKeyNode->type == PREFERENCE_TYPE_INT) {
-                       INFO("%s(%d) success", key, *intval);
-                       func_ret = PREFERENCE_ERROR_NONE;
-               } else {
-                       ERR("The type(%d) of keynode(%s) is not INT", pKeyNode->type, pKeyNode->keyname);
-                       func_ret = PREFERENCE_ERROR_INVALID_PARAMETER;
-               }
-       }
-
-       _preference_keynode_free(pKeyNode);
-
-       END_TIME_CHECK
-
-       return func_ret;
-}
-
-/*
- * This function get the boolean value of given key
- * @param[in]  key     key
- * @param[out] boolval output buffer
- * @return 0 on success, -1 on error
- */
-API int preference_get_boolean(const char *key, bool *boolval)
-{
-       int func_ret = PREFERENCE_ERROR_IO_ERROR;
-       keynode_t *pKeyNode;
-
-       START_TIME_CHECK
-
-       retvm_if(key == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: key is null");
-       retvm_if(boolval == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: output buffer is null");
-
-       pKeyNode = _preference_keynode_new();
-       retvm_if(pKeyNode == NULL, PREFERENCE_ERROR_OUT_OF_MEMORY, "key malloc fail");
-
-       func_ret = _preference_keynode_set_keyname(pKeyNode, key);
-       if (func_ret != PREFERENCE_ERROR_NONE) {
-               ERR("set key name error");
-               _preference_keynode_free(pKeyNode);
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       func_ret = _preference_get_key(pKeyNode);
-
-       if (func_ret != PREFERENCE_ERROR_NONE) {
-               ERR("preference_get_boolean(%d) : %s error", getpid(), key);
-       } else {
-               *boolval = !!(pKeyNode->value.b);
-               if (pKeyNode->type == PREFERENCE_TYPE_BOOLEAN) {
-                       INFO("%s(%d) success", key, *boolval);
-                       func_ret = PREFERENCE_ERROR_NONE;
-               } else {
-                       ERR("The type(%d) of keynode(%s) is not BOOL", pKeyNode->type, pKeyNode->keyname);
-                       func_ret = PREFERENCE_ERROR_INVALID_PARAMETER;
-               }
-       }
-
-       _preference_keynode_free(pKeyNode);
-
-       END_TIME_CHECK
-
-       return func_ret;
-}
-
-/*
- * This function get the double value of given key
- * @param[in]  key     key
- * @param[out] dblval output buffer
- * @return 0 on success, -1 on error
- */
-API int preference_get_double(const char *key, double *dblval)
-{
-       int func_ret = PREFERENCE_ERROR_IO_ERROR;
-       keynode_t *pKeyNode;
-
-       START_TIME_CHECK
-
-       retvm_if(key == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: key is null");
-       retvm_if(dblval == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: output buffer is null");
-
-       pKeyNode = _preference_keynode_new();
-       retvm_if(pKeyNode == NULL, PREFERENCE_ERROR_OUT_OF_MEMORY, "key malloc fail");
-
-       func_ret = _preference_keynode_set_keyname(pKeyNode, key);
-       if (func_ret != PREFERENCE_ERROR_NONE) {
-               ERR("set key name error");
-               _preference_keynode_free(pKeyNode);
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       func_ret = _preference_get_key(pKeyNode);
-
-       if (func_ret != PREFERENCE_ERROR_NONE) {
-               ERR("preference_get_double(%d) : %s error", getpid(), key);
-       } else {
-               *dblval = pKeyNode->value.d;
-               if (pKeyNode->type == PREFERENCE_TYPE_DOUBLE) {
-                       INFO("%s(%f) success", key, *dblval);
-                       func_ret = PREFERENCE_ERROR_NONE;
-               } else {
-                       ERR("The type(%d) of keynode(%s) is not DBL", pKeyNode->type, pKeyNode->keyname);
-                       func_ret = PREFERENCE_ERROR_INVALID_PARAMETER;
-               }
-       }
-
-       _preference_keynode_free(pKeyNode);
-
-       END_TIME_CHECK
-
-       return func_ret;
-}
-
-/*
- * This function get the string value of given key
- * @param[in]  key     key
- * @param[out] value output buffer
- * @return 0 on success, -1 on error
- */
-API int preference_get_string(const char *key, char **value)
-{
-       int func_ret = PREFERENCE_ERROR_IO_ERROR;
-       keynode_t *pKeyNode;
-       char *tempstr = NULL;
-
-       START_TIME_CHECK
-
-       retvm_if(key == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: key is null");
-       retvm_if(value == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: output buffer is null");
-
-       pKeyNode = _preference_keynode_new();
-       retvm_if(pKeyNode == NULL, PREFERENCE_ERROR_OUT_OF_MEMORY, "key malloc fail");
-
-       func_ret = _preference_keynode_set_keyname(pKeyNode, key);
-       if (func_ret != PREFERENCE_ERROR_NONE) {
-               ERR("set key name error");
-               _preference_keynode_free(pKeyNode);
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       func_ret = _preference_get_key(pKeyNode);
-       if (func_ret != PREFERENCE_ERROR_NONE) {
-               ERR("preference_get_string(%d) : %s error", getpid(), key);
-       } else {
-               if (pKeyNode->type == PREFERENCE_TYPE_STRING) {
-                       tempstr = pKeyNode->value.s;
-               } else {
-                       ERR("The type(%d) of keynode(%s) is not STR", pKeyNode->type, pKeyNode->keyname);
-                       func_ret = PREFERENCE_ERROR_INVALID_PARAMETER;
-               }
-
-               if (tempstr) {
-                       *value = strdup(tempstr);
-                       INFO("%s(%s) success", key, value);
-               }
-       }
-
-       _preference_keynode_free(pKeyNode);
-
-       END_TIME_CHECK
-
-       return func_ret;
-}
-
-/*
- * This function unset given key
- * @param[in]  key     key
- * @return 0 on success, -1 on error
- */
-API int preference_remove(const char *key)
-{
-       char path[PATH_MAX] = {0,};
-       int ret = -1;
-       int err_retry = PREFERENCE_ERROR_RETRY_CNT;
-       int func_ret = PREFERENCE_ERROR_NONE;
-       char err_buf[ERR_LEN] = {0,};
-
-       START_TIME_CHECK
-
-       retvm_if(key == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: key is null");
-
-       keynode_t *pKeyNode = _preference_keynode_new();
-       retvm_if(pKeyNode == NULL, PREFERENCE_ERROR_OUT_OF_MEMORY, "key malloc fail");
-
-       ret = _preference_keynode_set_keyname(pKeyNode, key);
-       if (ret != PREFERENCE_ERROR_NONE) {
-               ERR("set key name error");
-               _preference_keynode_free(pKeyNode);
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       ret = _preference_get_key_path(pKeyNode, path);
-       if (ret != PREFERENCE_ERROR_NONE) {
-               ERR("Invalid argument: key is not valid");
-               _preference_keynode_free(pKeyNode);
-               return PREFERENCE_ERROR_INVALID_PARAMETER;
-       }
-
-       if (access(path, F_OK) == -1) {
-               ERR("Error : key(%s) is not exist", key);
-               _preference_keynode_free(pKeyNode);
-               return PREFERENCE_ERROR_NO_KEY;
-       }
-
-       do {
-               ret = remove(path);
-               if (ret == -1) {
-                       strerror_r(errno, err_buf, sizeof(err_buf));
-                       ERR("preference_remove() failed. ret=%d(%s), key(%s)", errno, err_buf, key);
-                       func_ret = PREFERENCE_ERROR_IO_ERROR;
-               } else {
-                       func_ret = PREFERENCE_ERROR_NONE;
-                       break;
-               }
-       } while (err_retry--);
-
-       END_TIME_CHECK;
-
-       _preference_keynode_free(pKeyNode);
-
-       return func_ret;
-}
-
-API int preference_remove_all(void)
-{
-       int ret = -1;
-       int err_retry = PREFERENCE_ERROR_RETRY_CNT;
-       int func_ret = PREFERENCE_ERROR_NONE;
-       DIR *dir;
-       struct dirent *dent = NULL;
-       char *pref_dir_path = NULL;
-       char err_buf[ERR_LEN] = {0,};
-       const char *entry;
-       char *keyname = NULL;
-       char path[PATH_MAX] = {0,};
-
-       START_TIME_CHECK
-
-       pref_dir_path = _preference_get_pref_dir_path();
-       if (!pref_dir_path) {
-               LOGE("_preference_get_pref_dir_path() failed.");
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       dir = opendir(pref_dir_path);
-       if (dir == NULL) {
-               if (errno == ENOENT)
-                       return PREFERENCE_ERROR_NONE;
-               strerror_r(errno, err_buf, sizeof(err_buf));
-               LOGE("opendir() failed. pref_path: %s, error: %d(%s)", pref_dir_path, errno, err_buf);
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       keynode_t *pKeyNode = _preference_keynode_new();
-       if (pKeyNode == NULL) {
-               ERR("key malloc fail");
-               closedir(dir);
-               return PREFERENCE_ERROR_OUT_OF_MEMORY;
-       }
-
-       while ((dent = readdir(dir)) != NULL) {
-               entry = dent->d_name;
-               if (entry[0] == '.')
-                       continue;
-
-               snprintf(path, PATH_MAX-1, "%s%s", pref_dir_path, entry);
-
-               ret = _preference_get_key_name(path, &keyname);
-               if (ret != PREFERENCE_ERROR_NONE) {
-                       /* LCOV_EXCL_START */
-                       ERR("_preference_get_key_name() failed(%d)", ret);
-                       _preference_keynode_free(pKeyNode);
-                       closedir(dir);
-                       return PREFERENCE_ERROR_IO_ERROR;
-                       /* LCOV_EXCL_STOP */
-               }
-
-               ret = preference_unset_changed_cb(keyname);
-               if (ret != PREFERENCE_ERROR_NONE) {
-                       /* LCOV_EXCL_START */
-                       if (ret == PREFERENCE_ERROR_NO_KEY) {
-                               ERR("can't find %s's cb()", keyname);
-                       } else {
-                               ERR("preference_unset_changed_cb() failed(%d)", ret);
-                               _preference_keynode_free(pKeyNode);
-                               closedir(dir);
-                               free(keyname);
-                               return PREFERENCE_ERROR_IO_ERROR;
-                       }
-                       /* LCOV_EXCL_STOP */
-               }
-
-               do {
-                       ret = remove(path);
-                       if (ret == -1) {
-                               /* LCOV_EXCL_START */
-                               strerror_r(errno, err_buf, sizeof(err_buf));
-                               ERR("preference_remove_all error: %d(%s)", errno, err_buf);
-                               func_ret = PREFERENCE_ERROR_IO_ERROR;
-                               /* LCOV_EXCL_STOP */
-                       } else {
-                               func_ret = PREFERENCE_ERROR_NONE;
-                               break;
-                       }
-               } while (err_retry--);
-
-               free(keyname);
-       }
-
-       _preference_keynode_free(pKeyNode);
-       closedir(dir);
-
-       END_TIME_CHECK
-
-       return func_ret;
-}
-
-int preference_is_existing(const char *key, bool *exist)
-{
-       char path[PATH_MAX] = {0,};
-       int ret = -1;
-       int func_ret = PREFERENCE_ERROR_NONE;
-       keynode_t *pKeyNode;
-
-       START_TIME_CHECK
-
-       retvm_if(key == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: key is null");
-       retvm_if(exist == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: key is null");
-
-       pKeyNode = _preference_keynode_new();
-       retvm_if(pKeyNode == NULL, PREFERENCE_ERROR_OUT_OF_MEMORY, "key malloc fail");
-
-       ret = _preference_keynode_set_keyname(pKeyNode, key);
-       if (ret != PREFERENCE_ERROR_NONE) {
-               ERR("set key name error");
-               _preference_keynode_free(pKeyNode);
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       ret = _preference_get_key_path(pKeyNode, path);
-       if (ret != PREFERENCE_ERROR_NONE) {
-               _preference_keynode_free(pKeyNode);
-               return ret;
-       }
-
-       ret = access(path, F_OK);
-       if (ret == -1) {
-               ERR("Error : key(%s) is not exist", key);
-               *exist = 0;
-       } else {
-               *exist = 1;
-       }
-
-       _preference_keynode_free(pKeyNode);
-
-       END_TIME_CHECK
-
-       return func_ret;
-}
-
-API int preference_set_changed_cb(const char *key, preference_changed_cb callback, void *user_data)
-{
-       int func_ret = PREFERENCE_ERROR_IO_ERROR;
-       keynode_t *pKeyNode;
-
-       START_TIME_CHECK
-
-       retvm_if(key == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: key is null");
-       retvm_if(callback == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: cb(%p)", callback);
-
-       pKeyNode = _preference_keynode_new();
-       retvm_if(pKeyNode == NULL, PREFERENCE_ERROR_OUT_OF_MEMORY, "key malloc fail");
-
-       func_ret = _preference_keynode_set_keyname(pKeyNode, key);
-       if (func_ret != PREFERENCE_ERROR_NONE) {
-               ERR("set key name error");
-               _preference_keynode_free(pKeyNode);
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       if (_preference_kdb_add_notify(pKeyNode, callback, user_data)) {
-               if (errno == ENOENT) {
-                       LOGE("NO_KEY(0x%08x) : fail to find given key(%s)", PREFERENCE_ERROR_NO_KEY, key);
-                       _preference_keynode_free(pKeyNode);
-                       return PREFERENCE_ERROR_NO_KEY;
-               } else if (errno != 0) {
-                       ERR("preference_notify_key_changed : key(%s) add notify fail", key);
-                       _preference_keynode_free(pKeyNode);
-                       return PREFERENCE_ERROR_IO_ERROR;
-               }
-       }
-       INFO("%s noti is added", key);
-       _preference_keynode_free(pKeyNode);
-
-       END_TIME_CHECK
-
-       return PREFERENCE_ERROR_NONE;
-}
-
-API int preference_unset_changed_cb(const char *key)
-{
-       int func_ret = PREFERENCE_ERROR_IO_ERROR;
-       keynode_t *pKeyNode;
-       char err_buf[ERR_LEN] = {0,};
-
-       START_TIME_CHECK
-
-       retvm_if(key == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: key is null");
-
-       pKeyNode = _preference_keynode_new();
-       retvm_if(pKeyNode == NULL, PREFERENCE_ERROR_OUT_OF_MEMORY, "key malloc fail");
-
-       func_ret = _preference_keynode_set_keyname(pKeyNode, key);
-       if (func_ret != PREFERENCE_ERROR_NONE) {
-               ERR("set key name error");
-               _preference_keynode_free(pKeyNode);
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       if (_preference_kdb_del_notify(pKeyNode)) {
-               if (errno == ENOENT) {
-                       LOGE("NO_KEY(0x%08x) : fail to find given key(%s)", PREFERENCE_ERROR_NO_KEY, key);
-                       _preference_keynode_free(pKeyNode);
-                       return PREFERENCE_ERROR_NO_KEY;
-               } else if (errno != 0) {
-                       strerror_r(errno, err_buf, sizeof(err_buf));
-                       ERR("preference_unset_changed_cb() failed: key(%s) error(%d/%s)", key, errno, err_buf);
-                       _preference_keynode_free(pKeyNode);
-                       return PREFERENCE_ERROR_IO_ERROR;
-               }
-       }
-       INFO("%s noti removed", key);
-       _preference_keynode_free(pKeyNode);
-
-       END_TIME_CHECK
-
-       return PREFERENCE_ERROR_NONE;
-}
-
-
-API int preference_foreach_item(preference_item_cb callback, void *user_data)
-{
-       int ret = 0;
-       DIR *dir;
-       struct dirent *dent = NULL;
-       char *pref_dir_path = NULL;
-       char err_buf[ERR_LEN] = {0,};
-       const char *entry;
-       char *keyname = NULL;
-       char path[PATH_MAX] = {0,};
-
-
-       START_TIME_CHECK
-       retvm_if(callback == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: cb(%p)", callback);
-
-       pref_dir_path = _preference_get_pref_dir_path();
-       if (!pref_dir_path) {
-               LOGE("_preference_get_pref_dir_path() failed.");
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       dir = opendir(pref_dir_path);
-       if (dir == NULL) {
-               if (errno == ENOENT)
-                       return PREFERENCE_ERROR_NONE;
-               strerror_r(errno, err_buf, sizeof(err_buf));
-               LOGE("opendir() failed. path: %s, error: %d(%s)", pref_dir_path, errno, err_buf);
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       while ((dent = readdir(dir)) != NULL) {
-               entry = dent->d_name;
-               if (entry[0] == '.')
-                       continue;
-
-               snprintf(path, PATH_MAX-1, "%s%s", pref_dir_path, entry);
-
-               ret = _preference_get_key_name(path, &keyname);
-               if (ret != PREFERENCE_ERROR_NONE) {
-                       ERR("_preference_get_key_name() failed(%d)", ret);
-                       closedir(dir);
-                       return PREFERENCE_ERROR_IO_ERROR;
-               }
-
-               callback(keyname, user_data);
-               free(keyname);
-       }
-
-       closedir(dir);
-       END_TIME_CHECK
-
-       return PREFERENCE_ERROR_NONE;
-}
-
diff --git a/preference/preference_db.c b/preference/preference_db.c
deleted file mode 100755 (executable)
index e87b34a..0000000
+++ /dev/null
@@ -1,795 +0,0 @@
-/*
- * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <sqlite3.h>
-
-#include <app_internal.h>
-
-#include <app_preference.h>
-#include <app_preference_internal.h>
-
-#include <dlog.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "CAPI_APPFW_APPLICATION_PREFERENCE"
-#define DBG_MODE (1)
-
-static sqlite3 *pref_db = NULL;
-static bool is_update_hook_registered = false;
-static pref_changed_cb_node_t *head = NULL;
-
-static void _finish(void *data)
-{
-       if (pref_db != NULL) {
-               sqlite3_close(pref_db);
-               pref_db = NULL;
-       }
-}
-
-static int _busy_handler(void *pData, int count)
-{
-       if (5 - count > 0) {
-               LOGD("Busy Handler Called! : PID(%d) / CNT(%d)\n", getpid(), count + 1);
-               usleep((count + 1) * 100000);
-               return 1;
-       } else {
-               LOGD("Busy Handler will be returned SQLITE_BUSY error : PID(%d) \n", getpid());
-               return 0;
-       }
-}
-
-static int _initialize(void)
-{
-       char *data_path = NULL;
-       char db_path[TIZEN_PATH_MAX] = {0, };
-       int ret;
-       char *errmsg;
-
-       if ((data_path = app_get_data_path()) == NULL) {
-               LOGE("IO_ERROR(0x%08x) : fail to get data directory", PREFERENCE_ERROR_IO_ERROR);
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-       snprintf(db_path, sizeof(db_path), "%s/%s", data_path, PREF_DB_NAME);
-       free(data_path);
-
-       ret = sqlite3_open(db_path, &pref_db);
-       if (ret != SQLITE_OK) {
-               LOGE("IO_ERROR(0x%08x) : fail to open db(%s)", PREFERENCE_ERROR_IO_ERROR, sqlite3_errmsg(pref_db));
-               pref_db = NULL;
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       ret = sqlite3_busy_handler(pref_db, _busy_handler, NULL);
-       if (ret != SQLITE_OK)
-               LOGW("IO_ERROR(0x%08x) : fail to register busy handler(%s)\n", PREFERENCE_ERROR_IO_ERROR, sqlite3_errmsg(pref_db));
-
-       ret = sqlite3_exec(pref_db, "CREATE TABLE IF NOT EXISTS pref ( pref_key TEXT PRIMARY KEY, pref_type TEXT, pref_data TEXT)",
-                       NULL, NULL, &errmsg);
-       if (ret != SQLITE_OK) {
-               LOGE("IO_ERROR(0x%08x) : fail to create db table(%s)", PREFERENCE_ERROR_IO_ERROR, errmsg);
-               sqlite3_free(errmsg);
-               sqlite3_close(pref_db);
-               pref_db = NULL;
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       app_finalizer_add(_finish, NULL);
-
-       return PREFERENCE_ERROR_NONE;
-}
-
-static int _write_data(const char *key, const char *type, const char *data)
-{
-       int ret;
-       char *buf = NULL;
-       bool exist = false;
-       sqlite3_stmt *stmt;
-
-       if (key == NULL || key[0] == '\0'  || data == NULL) {
-               LOGE("INVALID_PARAMETER(0x%08x)", PREFERENCE_ERROR_INVALID_PARAMETER);
-               return PREFERENCE_ERROR_INVALID_PARAMETER;
-       }
-
-       /* insert data or update data if data already exist */
-       ret = preference_is_existing(key, &exist);
-       if (ret != PREFERENCE_ERROR_NONE)
-               return ret;
-
-       /* to use sqlite3_update_hook, we have to use INSERT/UPDATE operation instead of REPLACE operation */
-       if (exist)
-               buf = sqlite3_mprintf("UPDATE %s SET %s=?, %s=? WHERE %s=?;",
-                                                               PREF_TBL_NAME, PREF_F_TYPE_NAME, PREF_F_DATA_NAME, PREF_F_KEY_NAME);
-       else
-               buf = sqlite3_mprintf("INSERT INTO %s (%s, %s, %s) values (?, ?, ?);",
-                                                               PREF_TBL_NAME, PREF_F_KEY_NAME, PREF_F_TYPE_NAME, PREF_F_DATA_NAME);
-
-       if (buf == NULL) {
-               LOGE("IO_ERROR(0x%08x) : fail to create query string", PREFERENCE_ERROR_IO_ERROR);
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       ret = sqlite3_prepare(pref_db, buf, strlen(buf), &stmt, NULL);
-       if (ret != SQLITE_OK) {
-               LOGE("IO_ERROR(0x%08x) : fail to prepare query (%d/%s)",
-                       PREFERENCE_ERROR_IO_ERROR,
-                       sqlite3_extended_errcode(pref_db),
-                       sqlite3_errmsg(pref_db));
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       if (exist) {
-               ret = sqlite3_bind_text(stmt, 1, type, strlen(type), SQLITE_STATIC);
-               if (ret != SQLITE_OK) {
-                       LOGE("IO_ERROR(0x%08x) : fail to bind(1) query (%d/%s)",
-                               PREFERENCE_ERROR_IO_ERROR,
-                               sqlite3_extended_errcode(pref_db),
-                               sqlite3_errmsg(pref_db));
-                       sqlite3_finalize(stmt);
-                       return PREFERENCE_ERROR_IO_ERROR;
-               }
-               ret = sqlite3_bind_text(stmt, 2, data, strlen(data), SQLITE_STATIC);
-               if (ret != SQLITE_OK) {
-                       LOGE("IO_ERROR(0x%08x) : fail to bind(2) query (%d/%s)",
-                               PREFERENCE_ERROR_IO_ERROR,
-                               sqlite3_extended_errcode(pref_db),
-                               sqlite3_errmsg(pref_db));
-                       sqlite3_finalize(stmt);
-                       return PREFERENCE_ERROR_IO_ERROR;
-               }
-               ret = sqlite3_bind_text(stmt, 3, key, strlen(key), SQLITE_STATIC);
-               if (ret != SQLITE_OK) {
-                       LOGE("IO_ERROR(0x%08x) : fail to bind(3) query (%d/%s)",
-                               PREFERENCE_ERROR_IO_ERROR,
-                               sqlite3_extended_errcode(pref_db),
-                               sqlite3_errmsg(pref_db));
-                       sqlite3_finalize(stmt);
-                       return PREFERENCE_ERROR_IO_ERROR;
-               }
-       } else {
-               ret = sqlite3_bind_text(stmt, 1, key, strlen(key), SQLITE_STATIC);
-               if (ret != SQLITE_OK) {
-                       LOGE("IO_ERROR(0x%08x) : fail to bind(1) query (%d/%s)",
-                               PREFERENCE_ERROR_IO_ERROR,
-                               sqlite3_extended_errcode(pref_db),
-                               sqlite3_errmsg(pref_db));
-                       sqlite3_finalize(stmt);
-                       return PREFERENCE_ERROR_IO_ERROR;
-               }
-               ret = sqlite3_bind_text(stmt, 2, type, strlen(type), SQLITE_STATIC);
-               if (ret != SQLITE_OK) {
-                       LOGE("IO_ERROR(0x%08x) : fail to bind(2) query (%d/%s)",
-                               PREFERENCE_ERROR_IO_ERROR,
-                               sqlite3_extended_errcode(pref_db),
-                               sqlite3_errmsg(pref_db));
-                       sqlite3_finalize(stmt);
-                       return PREFERENCE_ERROR_IO_ERROR;
-               }
-               ret = sqlite3_bind_text(stmt, 3, data, strlen(data), SQLITE_STATIC);
-               if (ret != SQLITE_OK) {
-                       LOGE("IO_ERROR(0x%08x) : fail to bind(3) query (%d/%s)",
-                               PREFERENCE_ERROR_IO_ERROR,
-                               sqlite3_extended_errcode(pref_db),
-                               sqlite3_errmsg(pref_db));
-                       sqlite3_finalize(stmt);
-                       return PREFERENCE_ERROR_IO_ERROR;
-               }
-       }
-
-       ret = sqlite3_step(stmt);
-       if (ret != SQLITE_DONE) {
-               LOGE("IO_ERROR(0x%08x): fail to write data(%d/%s)",
-                       PREFERENCE_ERROR_IO_ERROR,
-                       sqlite3_extended_errcode(pref_db),
-                       sqlite3_errmsg(pref_db));
-               sqlite3_finalize(stmt);
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       sqlite3_finalize(stmt);
-       if (buf) {
-               sqlite3_free(buf);
-               buf = NULL;
-       }
-
-       return PREFERENCE_ERROR_NONE;
-}
-
-/* static int _read_data(const char *key, preference_type_e *type, char *data) */
-static int _read_data(const char *key, char *type, char *data)
-{
-       int ret;
-       char *buf;
-       char **result;
-       int rows;
-       int columns;
-       char *errmsg;
-
-       if (key == NULL || key[0] == '\0'  || data == NULL) {
-               LOGE("INVALID_PARAMETER(0x%08x)", PREFERENCE_ERROR_INVALID_PARAMETER);
-               return PREFERENCE_ERROR_INVALID_PARAMETER;
-       }
-
-       if (pref_db == NULL) {
-               if (_initialize() != PREFERENCE_ERROR_NONE) {
-                       LOGE("IO_ERROR(0x%08x) : fail to initialize db", PREFERENCE_ERROR_IO_ERROR);
-                       return PREFERENCE_ERROR_IO_ERROR;
-               }
-       }
-
-       buf = sqlite3_mprintf("SELECT %s, %s, %s FROM %s WHERE %s=%Q;",
-                                                       PREF_F_KEY_NAME, PREF_F_TYPE_NAME, PREF_F_DATA_NAME, PREF_TBL_NAME, PREF_F_KEY_NAME, key);
-       if (buf == NULL) {
-               LOGE("IO_ERROR(0x%08x) : fail to create query string", PREFERENCE_ERROR_IO_ERROR);
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       ret = sqlite3_get_table(pref_db, buf, &result, &rows, &columns, &errmsg);
-       sqlite3_free(buf);
-       if (ret != SQLITE_OK) {
-               LOGE("IO_ERROR(0x%08x) : fail to read data (%s)", PREFERENCE_ERROR_IO_ERROR, errmsg);
-               sqlite3_free(errmsg);
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       if (rows == 0) {
-               LOGE("NO_KEY(0x%08x) : fail to find given key(%s)", PREFERENCE_ERROR_NO_KEY, key);
-               sqlite3_free_table(result);
-               return PREFERENCE_ERROR_NO_KEY;
-       }
-
-       snprintf(type, 2, "%s", result[4]);             /* get type value */
-       snprintf(data, BUF_LEN, "%s", result[5]);       /* get data value */
-
-       sqlite3_free_table(result);
-
-       return PREFERENCE_ERROR_NONE;
-}
-
-
-int preference_set_int(const char *key, int value)
-{
-       char type[2];
-       char data[BUF_LEN];
-       snprintf(type, 2, "%d", PREFERENCE_TYPE_INT);
-       snprintf(data, BUF_LEN, "%d", value);
-       return _write_data(key, type, data);
-}
-
-int preference_get_int(const char *key, int *value)
-{
-       char type[2];
-       char data[BUF_LEN];
-       int ret;
-
-       if (value == NULL) {
-               LOGE("INVALID_PARAMETER(0x%08x)", PREFERENCE_ERROR_INVALID_PARAMETER);
-               return PREFERENCE_ERROR_INVALID_PARAMETER;
-       }
-
-       ret = _read_data(key, type, data);
-       if (ret == PREFERENCE_ERROR_NONE) {
-               if (atoi(type) == PREFERENCE_TYPE_INT)
-                       *value = atoi(data);
-               else {
-                       LOGE("INVALID_PARAMETER(0x%08x) : param type(%d)", PREFERENCE_ERROR_INVALID_PARAMETER, atoi(type));
-                       return PREFERENCE_ERROR_INVALID_PARAMETER;
-               }
-       }
-
-       return ret;
-}
-
-int preference_set_double(const char *key, double value)
-{
-       char type[2];
-       char data[BUF_LEN];
-
-       locale_t loc = newlocale(LC_NUMERIC_MASK, "C", NULL);
-       uselocale(loc);
-
-       snprintf(type, 2, "%d", PREFERENCE_TYPE_DOUBLE);
-       snprintf(data, BUF_LEN, "%f", value);
-
-       freelocale(loc);
-       uselocale(LC_GLOBAL_LOCALE);
-
-       return _write_data(key, type, data);
-}
-
-int preference_get_double(const char *key, double *value)
-{
-       char type[2];
-       char data[BUF_LEN];
-       int ret;
-
-       if (value == NULL) {
-               LOGE("INVALID_PARAMETER(0x%08x)", PREFERENCE_ERROR_INVALID_PARAMETER);
-               return PREFERENCE_ERROR_INVALID_PARAMETER;
-       }
-
-       ret = _read_data(key, type, data);
-       if (ret == PREFERENCE_ERROR_NONE) {
-               if (atoi(type) == PREFERENCE_TYPE_DOUBLE) {
-                       locale_t loc = newlocale(LC_NUMERIC_MASK, "C", NULL);
-                       uselocale(loc);
-
-                       *value = atof(data);
-
-                       freelocale(loc);
-                       uselocale(LC_GLOBAL_LOCALE);
-               } else {
-                       LOGE("INVALID_PARAMETER(0x%08x) : param type(%d)", PREFERENCE_ERROR_INVALID_PARAMETER, atoi(type));
-                       return PREFERENCE_ERROR_INVALID_PARAMETER;
-               }
-       }
-
-       return ret;
-}
-
-int preference_set_string(const char *key, const char *value)
-{
-       char type[2];
-
-       snprintf(type, 2, "%d", PREFERENCE_TYPE_STRING);
-       if (strlen(value) > (BUF_LEN-1)) {
-               LOGE("INVALID_PARAMETER(0x%08x) : param type(%d)", PREFERENCE_ERROR_INVALID_PARAMETER, atoi(type));
-               return PREFERENCE_ERROR_INVALID_PARAMETER;
-       }
-       return _write_data(key, type, value);
-}
-
-int preference_get_string(const char *key, char **value)
-{
-       char type[2];
-       char data[BUF_LEN];
-       int ret;
-
-       if (value == NULL) {
-               LOGE("INVALID_PARAMETER(0x%08x)", PREFERENCE_ERROR_INVALID_PARAMETER);
-               return PREFERENCE_ERROR_INVALID_PARAMETER;
-       }
-
-       ret = _read_data(key, type, data);
-       if (ret == PREFERENCE_ERROR_NONE) {
-               if (atoi(type) == PREFERENCE_TYPE_STRING) {
-                       *value = strdup(data);
-                       if (value == NULL) {
-                               LOGE("OUT_OF_MEMORY(0x%08x)", PREFERENCE_ERROR_OUT_OF_MEMORY);
-                               return PREFERENCE_ERROR_OUT_OF_MEMORY;
-                       }
-               } else {
-                       LOGE("INVALID_PARAMETER(0x%08x) : param type(%d)", PREFERENCE_ERROR_INVALID_PARAMETER, atoi(type));
-                       return PREFERENCE_ERROR_INVALID_PARAMETER;
-               }
-       }
-
-       return ret;
-}
-
-int preference_set_boolean(const char *key, bool value)
-{
-       char type[2];
-       char data[BUF_LEN];
-
-       snprintf(type, 2, "%d", PREFERENCE_TYPE_BOOLEAN);
-       snprintf(data, BUF_LEN, "%d", value);
-
-       return _write_data(key, type, data);
-}
-
-int preference_get_boolean(const char *key, bool *value)
-{
-       char type[2];
-       char data[BUF_LEN];
-       int ret;
-
-       if (value == NULL) {
-               LOGE("INVALID_PARAMETER(0x%08x)", PREFERENCE_ERROR_INVALID_PARAMETER);
-               return PREFERENCE_ERROR_INVALID_PARAMETER;
-       }
-
-       ret = _read_data(key, type, data);
-       if (ret == PREFERENCE_ERROR_NONE) {
-               if (atoi(type) == PREFERENCE_TYPE_BOOLEAN)
-                       *value = (bool)atoi(data);
-               else {
-                       LOGE("INVALID_PARAMETER(0x%08x) : param type(%d)", PREFERENCE_ERROR_INVALID_PARAMETER, atoi(type));
-                       return PREFERENCE_ERROR_INVALID_PARAMETER;
-               }
-       }
-
-       return ret;
-}
-
-/* TODO: below operation is too heavy, let's find the light way to check. */
-int preference_is_existing(const char *key, bool *exist)
-{
-       int ret;
-       char *buf;
-       char **result;
-       int rows;
-       int columns;
-       char *errmsg;
-
-       if (key == NULL || key[0] == '\0' || exist == NULL) {
-               LOGE("INVALID_PARAMETER(0x%08x)", PREFERENCE_ERROR_INVALID_PARAMETER);
-               return PREFERENCE_ERROR_INVALID_PARAMETER;
-       }
-
-       if (pref_db == NULL) {
-               if (_initialize() != PREFERENCE_ERROR_NONE) {
-                       LOGE("IO_ERROR(0x%08x) : fail to initialize db", PREFERENCE_ERROR_IO_ERROR);
-                       return PREFERENCE_ERROR_IO_ERROR;
-               }
-       }
-
-       /* check data is exist */
-       buf = sqlite3_mprintf("SELECT %s FROM %s WHERE %s=%Q;", PREF_F_KEY_NAME, PREF_TBL_NAME, PREF_F_KEY_NAME, key);
-       if (buf == NULL) {
-               LOGE("IO_ERROR(0x%08x) : fail to create query string", PREFERENCE_ERROR_IO_ERROR);
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       ret = sqlite3_get_table(pref_db, buf, &result, &rows, &columns, &errmsg);
-       sqlite3_free(buf);
-       if (ret != SQLITE_OK) {
-               LOGE("IO_ERROR(0x%08x) : fail to read data(%s)", PREFERENCE_ERROR_IO_ERROR, errmsg);
-               sqlite3_free(errmsg);
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       if (rows > 0)
-               *exist = true;
-       else
-               *exist = false;
-
-       sqlite3_free_table(result);
-       return PREFERENCE_ERROR_NONE;
-}
-
-static pref_changed_cb_node_t *_find_node(const char *key)
-{
-       pref_changed_cb_node_t *tmp_node;
-
-       if (key == NULL || key[0] == '\0')
-               return NULL;
-
-       tmp_node = head;
-       while (tmp_node) {
-               if (strcmp(tmp_node->key, key) == 0)
-                       break;
-
-               tmp_node = tmp_node->next;
-       }
-
-       return tmp_node;
-}
-
-static int _add_node(const char *key, preference_changed_cb cb, void *user_data)
-{
-       pref_changed_cb_node_t *tmp_node;
-
-       if (key == NULL || key[0] == '\0' || cb == NULL) {
-               LOGE("INVALID_PARAMETER(0x%08x)", PREFERENCE_ERROR_INVALID_PARAMETER);
-               return PREFERENCE_ERROR_INVALID_PARAMETER;
-       }
-
-       tmp_node = _find_node(key);
-       if (tmp_node != NULL) {
-               tmp_node->cb = cb;
-               tmp_node->user_data = user_data;
-       } else {
-               tmp_node = (pref_changed_cb_node_t *)malloc(sizeof(pref_changed_cb_node_t));
-               if (tmp_node == NULL) {
-                       LOGE("OUT_OF_MEMORY(0x%08x)", PREFERENCE_ERROR_OUT_OF_MEMORY);
-                       return PREFERENCE_ERROR_OUT_OF_MEMORY;
-               }
-
-               tmp_node->key = strdup(key);
-               if (tmp_node->key == NULL) {
-                       free(tmp_node);
-                       LOGE("OUT_OF_MEMORY(0x%08x)", PREFERENCE_ERROR_OUT_OF_MEMORY);
-                       return PREFERENCE_ERROR_OUT_OF_MEMORY;
-               }
-
-               if (head != NULL)
-                       head->prev = tmp_node;
-               tmp_node->cb = cb;
-               tmp_node->user_data = user_data;
-               tmp_node->prev = NULL;
-               tmp_node->next = head;
-               head = tmp_node;
-       }
-
-       return PREFERENCE_ERROR_NONE;
-}
-
-static int _remove_node(const char *key)
-{
-       pref_changed_cb_node_t *tmp_node;
-
-       if (key == NULL || key[0] == '\0') {
-               LOGE("INVALID_PARAMETER(0x%08x)", PREFERENCE_ERROR_INVALID_PARAMETER);
-               return PREFERENCE_ERROR_INVALID_PARAMETER;
-       }
-
-       tmp_node = _find_node(key);
-       if (tmp_node == NULL)
-               return PREFERENCE_ERROR_NONE;
-
-       if (tmp_node->prev != NULL)
-               tmp_node->prev->next = tmp_node->next;
-       else
-               head = tmp_node->next;
-
-       if (tmp_node->next != NULL)
-               tmp_node->next->prev = tmp_node->prev;
-
-       if (tmp_node->key)
-               free(tmp_node->key);
-
-       free(tmp_node);
-
-       return PREFERENCE_ERROR_NONE;
-}
-
-static void _remove_all_node(void)
-{
-       pref_changed_cb_node_t *tmp_node;
-
-       while (head) {
-               tmp_node = head;
-               head = tmp_node->next;
-
-               if (tmp_node->key)
-                       free(tmp_node->key);
-
-               free(tmp_node);
-       }
-}
-
-static void _update_cb(void *data, int action, char const *db_name, char const *table_name, sqlite_int64 rowid)
-{
-       int ret;
-       char *buf;
-       char **result;
-       int rows;
-       int columns;
-       char *errmsg;
-       pref_changed_cb_node_t *tmp_node;
-
-       /* skip INSERT/DELETE event */
-       if (action != SQLITE_UPDATE)
-               return;
-
-       if (strcmp(table_name, PREF_TBL_NAME) != 0) {
-               SECURE_LOGE("given table name (%s) is not same", table_name);
-               return;
-       }
-
-       buf = sqlite3_mprintf("SELECT %s FROM %s WHERE rowid='%lld';", PREF_F_KEY_NAME, PREF_TBL_NAME, rowid);
-       if (buf == NULL)
-               return;
-
-       ret = sqlite3_get_table(pref_db, buf, &result, &rows, &columns, &errmsg);
-       sqlite3_free(buf);
-       if (ret != SQLITE_OK) {
-               LOGI("fail to read data(%s)", errmsg);
-               sqlite3_free(errmsg);
-               return;
-       }
-
-       if (rows == 0) {
-               sqlite3_free_table(result);
-               return;
-       }
-
-       tmp_node = _find_node(result[1]);
-       if (tmp_node != NULL && tmp_node->cb != NULL)
-               tmp_node->cb(result[1], tmp_node->user_data);
-
-       sqlite3_free_table(result);
-}
-
-int preference_remove(const char *key)
-{
-       int ret;
-       char *buf;
-       bool exist;
-       sqlite3_stmt *stmt;
-
-       ret = preference_is_existing(key, &exist);
-       if (ret != PREFERENCE_ERROR_NONE)
-               return ret;
-
-       if (!exist)
-               return PREFERENCE_ERROR_NO_KEY;
-
-       /* insert data or update data if data already exist */
-       buf = sqlite3_mprintf("DELETE FROM %s WHERE %s = ?",
-                                                       PREF_TBL_NAME, PREF_F_KEY_NAME, key);
-       if (buf == NULL) {
-               LOGE("IO_ERROR(0x%08x) : fail to create query string", PREFERENCE_ERROR_IO_ERROR);
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       ret = sqlite3_prepare(pref_db, buf, strlen(buf), &stmt, NULL);
-       if (ret != SQLITE_OK) {
-               LOGE("IO_ERROR(0x%08x) : fail to prepare query (%d/%s)",
-                       PREFERENCE_ERROR_IO_ERROR,
-                       sqlite3_extended_errcode(pref_db),
-                       sqlite3_errmsg(pref_db));
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       ret = sqlite3_bind_text(stmt, 1, key, strlen(key), SQLITE_STATIC);
-       if (ret != SQLITE_OK) {
-               LOGE("IO_ERROR(0x%08x) : fail to bind(1) query (%d/%s)",
-                       PREFERENCE_ERROR_IO_ERROR,
-                       sqlite3_extended_errcode(pref_db),
-                       sqlite3_errmsg(pref_db));
-               sqlite3_finalize(stmt);
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       ret = sqlite3_step(stmt);
-       if (ret != SQLITE_DONE) {
-               LOGE("IO_ERROR(0x%08x): fail to delete data(%d/%s)",
-                       PREFERENCE_ERROR_IO_ERROR,
-                       sqlite3_extended_errcode(pref_db),
-                       sqlite3_errmsg(pref_db));
-               sqlite3_finalize(stmt);
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       sqlite3_finalize(stmt);
-       if (buf) {
-               sqlite3_free(buf);
-               buf = NULL;
-       }
-
-       /* if exist, remove changed cb */
-       _remove_node(key);
-
-       return PREFERENCE_ERROR_NONE;
-}
-
-int preference_remove_all(void)
-{
-       int ret;
-       char *buf;
-       char *errmsg;
-
-       if (pref_db == NULL) {
-               if (_initialize() != PREFERENCE_ERROR_NONE) {
-                       LOGE("IO_ERROR(0x%08x) : fail to initialize db", PREFERENCE_ERROR_IO_ERROR);
-                       return PREFERENCE_ERROR_IO_ERROR;
-               }
-       }
-
-       /* insert data or update data if data already exist */
-       buf = sqlite3_mprintf("DELETE FROM %s;", PREF_TBL_NAME);
-       if (buf == NULL) {
-               LOGE("IO_ERROR(0x%08x) : fail to create query string", PREFERENCE_ERROR_IO_ERROR);
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       ret = sqlite3_exec(pref_db, buf, NULL, NULL, &errmsg);
-       sqlite3_free(buf);
-       if (ret != SQLITE_OK) {
-               LOGE("IO_ERROR(0x%08x) : fail to delete data (%s)", PREFERENCE_ERROR_IO_ERROR, errmsg);
-               sqlite3_free(errmsg);
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       /* if exist, remove changed cb */
-       _remove_all_node();
-
-       return PREFERENCE_ERROR_NONE;
-}
-
-int preference_set_changed_cb(const char *key, preference_changed_cb callback, void *user_data)
-{
-       int ret;
-       bool exist;
-
-       ret = preference_is_existing(key, &exist);
-       if (ret != PREFERENCE_ERROR_NONE)
-               return ret;
-
-       if (!exist) {
-               LOGE("NO_KEY(0x%08x) : fail to find given key(%s)", PREFERENCE_ERROR_NO_KEY, key);
-               return PREFERENCE_ERROR_NO_KEY;
-       }
-
-       if (!is_update_hook_registered) {
-               sqlite3_update_hook(pref_db, _update_cb, NULL);
-               is_update_hook_registered = true;
-       }
-
-       return _add_node(key, callback, user_data);
-}
-
-int preference_unset_changed_cb(const char *key)
-{
-       int ret;
-       bool exist;
-
-       ret = preference_is_existing(key, &exist);
-       if (ret != PREFERENCE_ERROR_NONE)
-               return ret;
-
-       if (!exist) {
-               LOGE("NO_KEY(0x%08x) : fail to find given key(%s)", PREFERENCE_ERROR_NO_KEY, key);
-               return PREFERENCE_ERROR_NO_KEY;
-       }
-
-       return _remove_node(key);
-}
-
-int preference_foreach_item(preference_item_cb callback, void *user_data)
-{
-       int ret;
-       char *buf;
-       char **result;
-       int rows;
-       int columns;
-       char *errmsg;
-       int i;
-
-       if (callback == NULL) {
-               LOGE("INVALID_PARAMETER(0x%08x)", PREFERENCE_ERROR_INVALID_PARAMETER);
-               return PREFERENCE_ERROR_INVALID_PARAMETER;
-       }
-
-       if (pref_db == NULL) {
-               if (_initialize() != PREFERENCE_ERROR_NONE) {
-                       LOGE("IO_ERROR(0x%08x) : fail to initialize db", PREFERENCE_ERROR_IO_ERROR);
-                       return PREFERENCE_ERROR_IO_ERROR;
-               }
-       }
-
-       buf = sqlite3_mprintf("SELECT %s FROM %s;", PREF_F_KEY_NAME, PREF_TBL_NAME);
-       if (buf == NULL) {
-               LOGE("IO_ERROR(0x%08x) : fail to create query string", PREFERENCE_ERROR_IO_ERROR);
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       ret = sqlite3_get_table(pref_db, buf, &result, &rows, &columns, &errmsg);
-       sqlite3_free(buf);
-       if (ret != SQLITE_OK) {
-               LOGE("IO_ERROR(0x%08x) : fail to read data (%s)", PREFERENCE_ERROR_IO_ERROR, errmsg);
-               sqlite3_free(errmsg);
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       for (i = 1; i <= rows; i++) {
-               if (callback(result[i], user_data) != true)
-                       break;
-       }
-
-       sqlite3_free_table(result);
-
-       return PREFERENCE_ERROR_NONE;
-}
-
diff --git a/preference/preference_inoti.c b/preference/preference_inoti.c
deleted file mode 100755 (executable)
index 77bccda..0000000
+++ /dev/null
@@ -1,440 +0,0 @@
-/*
- * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <sys/types.h>
-#include <sys/inotify.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <string.h>
-#include <linux/version.h>
-#include <stdlib.h>
-#include <pthread.h>
-#include <glib.h>
-
-#include <app_preference.h>
-#include <app_preference_internal.h>
-
-#include <glib.h>
-
-#define INOTY_EVENT_MASK   (IN_CLOSE_WRITE | IN_DELETE_SELF)
-
-/* inotify */
-struct noti_node {
-       int wd;
-       char *keyname;
-       preference_changed_cb cb;
-       void *cb_data;
-       struct noti_node *next;
-};
-typedef struct noti_node noti_node_s;
-static GList *g_notilist;
-
-static int _preference_inoti_comp_with_wd(gconstpointer a, gconstpointer b)
-{
-       int r;
-
-       noti_node_s *key1 = (noti_node_s *) a;
-       noti_node_s *key2 = (noti_node_s *) b;
-
-       r = key1->wd - key2->wd;
-       return r;
-}
-
-static int _kdb_inoti_fd;
-
-static pthread_mutex_t _kdb_inoti_fd_mutex = PTHREAD_MUTEX_INITIALIZER;
-static pthread_mutex_t _kdb_g_ns_mutex = PTHREAD_MUTEX_INITIALIZER;
-
-static GSource *_kdb_handler;
-
-static GList *_preference_copy_noti_list(GList *orig_notilist)
-{
-       GList *copy_notilist = NULL;
-       struct noti_node *n = NULL;
-       struct noti_node *t = NULL;
-       char err_buf[ERR_LEN] = {0,};
-
-       if (!orig_notilist)
-               return NULL;
-
-       orig_notilist = g_list_first(orig_notilist);
-       if (!orig_notilist)
-               return NULL;
-
-       while (orig_notilist) {
-               do {
-                       t = orig_notilist->data;
-                       if (t == NULL) {
-                               WARN("noti item data is null");
-                               break;
-                       }
-
-                       if ((t->keyname == NULL) || (strlen(t->keyname) == 0)) {
-                               WARN("noti item data key name is null");
-                               break;
-                       }
-
-                       n = calloc(1, sizeof(noti_node_s));
-                       if (n == NULL) {
-                               ERR("_preference_copy_noti_list : calloc failed. memory full");
-                               break;
-                       }
-
-                       n->keyname = strndup(t->keyname, PREFERENCE_KEY_PATH_LEN);
-                       if (n->keyname == NULL) {
-                               /* LCOV_EXCL_START */
-                               strerror_r(errno, err_buf, sizeof(err_buf));
-                               ERR("The memory is insufficient, errno: %d (%s)", errno, err_buf);
-                               free(n);
-                               break;
-                               /* LCOV_EXCL_STOP */
-                       }
-                       n->wd = t->wd;
-                       n->cb_data = t->cb_data;
-                       n->cb = t->cb;
-
-                       copy_notilist = g_list_append(copy_notilist, n);
-               } while (0);
-
-               orig_notilist = g_list_next(orig_notilist);
-       }
-       return copy_notilist;
-}
-
-static void _preference_free_noti_node(gpointer data)
-{
-       struct noti_node *n = (struct noti_node *)data;
-       g_free(n->keyname);
-       g_free(n);
-}
-
-static void _preference_free_noti_list(GList *noti_list)
-{
-       g_list_free_full(noti_list, _preference_free_noti_node);
-}
-
-
-static gboolean _preference_kdb_gio_cb(GIOChannel *src, GIOCondition cond, gpointer data)
-{
-       int fd, r, res;
-       struct inotify_event ie;
-       GList *l_notilist = NULL;
-       struct noti_node *t = NULL;
-       GList *noti_list = NULL;
-       keynode_t *keynode;
-
-       fd = g_io_channel_unix_get_fd(src);
-       r = read(fd, &ie, sizeof(ie));
-
-       while (r > 0) {
-               if (ie.mask & INOTY_EVENT_MASK) {
-
-                       INFO("read event from GIOChannel. wd : %d", ie.wd);
-
-                       pthread_mutex_lock(&_kdb_g_ns_mutex);
-                       l_notilist = _preference_copy_noti_list(g_notilist);
-                       pthread_mutex_unlock(&_kdb_g_ns_mutex);
-
-                       if (l_notilist) {
-                               noti_list = g_list_first(l_notilist);
-                               while (noti_list) {
-                                       t = noti_list->data;
-
-                                       keynode = _preference_keynode_new();
-                                       if (keynode == NULL) {
-                                               ERR("key malloc fail");
-                                               break;
-                                       }
-
-                                       if ((t) && (t->wd == ie.wd) && (t->keyname)) {
-                                               res = _preference_keynode_set_keyname(keynode, t->keyname);
-                                               if (res != PREFERENCE_ERROR_NONE) {
-                                                       ERR("_preference_keynode_set_keyname() failed(%d)", res);
-                                                       goto out_func;
-                                               }
-
-                                               if ((ie.mask & IN_DELETE_SELF)) {
-                                                       res = _preference_kdb_del_notify(keynode);
-                                                       if (res != PREFERENCE_ERROR_NONE)
-                                                               ERR("_preference_kdb_del_notify() failed(%d)", res);
-                                               } else {
-                                                       res = _preference_get_key(keynode);
-                                                       if (res != PREFERENCE_ERROR_NONE)
-                                                               ERR("_preference_get_key() failed(%d)", res);
-
-                                                       INFO("key(%s) is changed. cb(%p) called", t->keyname, t->cb);
-                                                       t->cb(t->keyname, t->cb_data);
-                                               }
-                                       } else if ((t) && (t->keyname == NULL)) { /* for debugging */
-                                               ERR("preference keyname is null.");
-                                       }
-out_func:
-                                       _preference_keynode_free(keynode);
-
-                                       noti_list = g_list_next(noti_list);
-                               }
-
-                               _preference_free_noti_list(l_notilist);
-                       }
-               }
-
-               if (ie.len > 0)
-                       (void) lseek(fd, ie.len, SEEK_CUR);
-
-               r = read(fd, &ie, sizeof(ie));
-       }
-       return TRUE;
-}
-
-static int _preference_kdb_noti_init(void)
-{
-       GIOChannel *gio;
-       int ret = 0;
-       char err_buf[ERR_LEN] = { 0, };
-
-       pthread_mutex_lock(&_kdb_inoti_fd_mutex);
-
-       if (0 < _kdb_inoti_fd) {
-               /* LCOV_EXCL_START */
-               ERR("Error: invalid _kdb_inoti_fd");
-               pthread_mutex_unlock(&_kdb_inoti_fd_mutex);
-               return PREFERENCE_ERROR_IO_ERROR;
-               /* LCOV_EXCL_STOP */
-       }
-       _kdb_inoti_fd = inotify_init();
-       if (_kdb_inoti_fd == -1) {
-               /* LCOV_EXCL_START */
-               strerror_r(errno, err_buf, sizeof(err_buf));
-               ERR("inotify init: %s", err_buf);
-               pthread_mutex_unlock(&_kdb_inoti_fd_mutex);
-               return PREFERENCE_ERROR_IO_ERROR;
-               /* LCOV_EXCL_STOP */
-       }
-
-       ret = fcntl(_kdb_inoti_fd, F_SETFD, FD_CLOEXEC);
-       if (ret < 0) {
-               /* LCOV_EXCL_START */
-               strerror_r(errno, err_buf, sizeof(err_buf));
-               ERR("inotify init: %s", err_buf);
-               pthread_mutex_unlock(&_kdb_inoti_fd_mutex);
-               return PREFERENCE_ERROR_IO_ERROR;
-               /* LCOV_EXCL_STOP */
-       }
-
-       ret = fcntl(_kdb_inoti_fd, F_SETFL, O_NONBLOCK);
-       if (ret < 0) {
-               /* LCOV_EXCL_START */
-               strerror_r(errno, err_buf, sizeof(err_buf));
-               ERR("inotify init: %s", err_buf);
-               pthread_mutex_unlock(&_kdb_inoti_fd_mutex);
-               return PREFERENCE_ERROR_IO_ERROR;
-               /* LCOV_EXCL_STOP */
-       }
-
-       pthread_mutex_unlock(&_kdb_inoti_fd_mutex);
-
-       gio = g_io_channel_unix_new(_kdb_inoti_fd);
-       retvm_if(gio == NULL, -1, "Error: create a new GIOChannel");
-
-       g_io_channel_set_flags(gio, G_IO_FLAG_NONBLOCK, NULL);
-
-       _kdb_handler = g_io_create_watch(gio, G_IO_IN);
-       g_source_set_callback(_kdb_handler, (GSourceFunc) _preference_kdb_gio_cb, NULL, NULL);
-       g_source_attach(_kdb_handler, NULL);
-       g_io_channel_unref(gio);
-       g_source_unref(_kdb_handler);
-
-       return PREFERENCE_ERROR_NONE;
-}
-
-int _preference_kdb_add_notify(keynode_t *keynode, preference_changed_cb cb, void *data)
-{
-       char path[PATH_MAX];
-       int wd;
-       struct noti_node t, *n, *node;
-       char err_buf[ERR_LEN] = { 0, };
-       int ret = 0;
-       GList *list = NULL;
-       int func_ret = PREFERENCE_ERROR_NONE;
-       char *keyname = keynode->keyname;
-
-       retvm_if((keyname == NULL || cb == NULL), PREFERENCE_ERROR_INVALID_PARAMETER,
-                       "_preference_kdb_add_notify : Invalid argument - keyname(%s) cb(%p)",
-                       keyname, cb);
-
-       if (_kdb_inoti_fd <= 0)
-               if (_preference_kdb_noti_init())
-                       return PREFERENCE_ERROR_IO_ERROR;
-
-       ret = _preference_get_key_path(keynode, path);
-       if (ret != PREFERENCE_ERROR_NONE) {
-               ERR("Invalid argument: key is not valid");
-               return PREFERENCE_ERROR_INVALID_PARAMETER;
-       }
-
-       if (access(path, F_OK) != 0) {
-               if (errno == ENOENT) {
-                       ERR("_preference_kdb_add_notify : Key(%s) does not exist", keyname);
-                       return PREFERENCE_ERROR_IO_ERROR;
-               }
-       }
-
-       wd = inotify_add_watch(_kdb_inoti_fd, path, INOTY_EVENT_MASK);
-       if (wd == -1) {
-               strerror_r(errno, err_buf, sizeof(err_buf));
-               ERR("_preference_kdb_add_notify : add noti(%s)", err_buf);
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       t.wd = wd;
-
-       pthread_mutex_lock(&_kdb_g_ns_mutex);
-
-       list = g_list_find_custom(g_notilist, &t, (GCompareFunc)_preference_inoti_comp_with_wd);
-       if (list) {
-               /* LCOV_EXCL_START */
-               WARN("_preference_kdb_add_notify : key(%s) change callback(%p)", keyname, cb);
-
-               node = list->data;
-               node->wd = wd;
-               node->cb_data = data;
-               node->cb = cb;
-
-               goto out_func;
-               /* LCOV_EXCL_STOP */
-       }
-
-       n = calloc(1, sizeof(noti_node_s));
-       if (n == NULL) {
-               /* LCOV_EXCL_START */
-               strerror_r(errno, err_buf, sizeof(err_buf));
-               ERR("_preference_kdb_add_notify : add noti(%s)", err_buf);
-               func_ret = PREFERENCE_ERROR_IO_ERROR;
-               goto out_func;
-               /* LCOV_EXCL_STOP */
-       }
-
-       n->keyname = strndup(keyname, PREFERENCE_KEY_PATH_LEN);
-       if (n->keyname == NULL) {
-               /* LCOV_EXCL_START */
-               strerror_r(errno, err_buf, sizeof(err_buf));
-               ERR("The memory is insufficient, errno: %d (%s)", errno, err_buf);
-               free(n);
-               goto out_func;
-               /* LCOV_EXCL_STOP */
-       }
-       n->wd = wd;
-       n->cb_data = data;
-       n->cb = cb;
-
-       g_notilist = g_list_append(g_notilist, n);
-       if (!g_notilist)
-               ERR("g_list_append fail");
-
-       INFO("cb(%p) is added for %s. tot cb cnt : %d\n", cb, n->keyname, g_list_length(g_notilist));
-
-out_func:
-       pthread_mutex_unlock(&_kdb_g_ns_mutex);
-
-       return func_ret;
-}
-
-int _preference_kdb_del_notify(keynode_t *keynode)
-{
-       int wd = 0;
-       int r = 0;
-       struct noti_node *n = NULL;
-       struct noti_node t;
-       char path[PATH_MAX] = { 0, };
-       char err_buf[ERR_LEN] = { 0, };
-       int del = 0;
-       int ret = 0;
-       char *keyname = keynode->keyname;
-       int func_ret = PREFERENCE_ERROR_NONE;
-       GList *noti_list;
-
-       retvm_if(keyname == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: keyname(%s)", keyname);
-
-       ret = _preference_get_key_path(keynode, path);
-       if (ret != PREFERENCE_ERROR_NONE) {
-               ERR("Invalid argument: key is not valid");
-               return PREFERENCE_ERROR_INVALID_PARAMETER;
-       }
-
-       if (access(path, F_OK) != 0) {
-               if (errno == ENOENT) {
-                       ERR("_preference_kdb_del_notify : Key(%s) does not exist", keyname);
-                       return PREFERENCE_ERROR_IO_ERROR;
-               }
-       }
-
-       retvm_if(_kdb_inoti_fd == 0, PREFERENCE_ERROR_NONE, "Invalid operation: not exist anything for inotify");
-
-       /* get wd */
-       wd = inotify_add_watch(_kdb_inoti_fd, path, INOTY_EVENT_MASK);
-       if (wd == -1) {
-               strerror_r(errno, err_buf, sizeof(err_buf));
-               ERR("Error: inotify_add_watch() [%s]: %s", path, err_buf);
-               return PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       pthread_mutex_lock(&_kdb_g_ns_mutex);
-
-       t.wd = wd;
-
-       noti_list = g_list_find_custom(g_notilist, &t, (GCompareFunc)_preference_inoti_comp_with_wd);
-       if (noti_list) {
-               del++;
-
-               n = noti_list->data;
-               g_notilist = g_list_remove(g_notilist, n);
-               g_free(n->keyname);
-               g_free(n);
-
-               r = inotify_rm_watch(_kdb_inoti_fd, wd);
-               if (r == -1) {
-                       strerror_r(errno, err_buf, sizeof(err_buf));
-                       ERR("Error: inotify_rm_watch [%s]: %s", keyname, err_buf);
-                       func_ret = PREFERENCE_ERROR_IO_ERROR;
-               }
-
-               INFO("key(%s) cb is removed. remained noti list total length(%d)",
-                               keyname, g_list_length(g_notilist));
-       }
-
-       if (g_list_length(g_notilist) == 0) {
-               close(_kdb_inoti_fd);
-               _kdb_inoti_fd = 0;
-
-               g_source_destroy(_kdb_handler);
-               _kdb_handler = NULL;
-
-               g_list_free(g_notilist);
-               g_notilist = NULL;
-
-               INFO("all noti list is freed");
-       }
-
-       pthread_mutex_unlock(&_kdb_g_ns_mutex);
-
-       if (del == 0) {
-               errno = ENOENT;
-               func_ret = PREFERENCE_ERROR_IO_ERROR;
-       }
-
-       return func_ret;
-}
-
index 426b997..ed06e63 100644 (file)
@@ -1,5 +1,5 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-SET(fw_name "capi-appfw-application")
+SET(fw_name "capi-appfw-app-control")
 
 PROJECT(${fw_name})
 
@@ -9,17 +9,17 @@ SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 SET(INC_DIR ${CMAKE_SOURCE_DIR}/include)
 INCLUDE_DIRECTORIES(${INC_DIR})
 
-SET(requires "dlog bundle appcore-common appcore-efl aul capi-base-common libtzplatform-config pkgmgr-info glib-2.0")
-SET(pc_requires "capi-base-common vconf-internal-keys capi-appfw-app-control capi-appfw-app-common appcore-common libtzplatform-config")
+SET(requires "dlog bundle aul capi-base-common")
+SET(pc_requires "capi-base-common")
 
 INCLUDE(FindPkgConfig)
 pkg_check_modules(${fw_name} REQUIRED ${requires})
 FOREACH(flag ${${fw_name}_CFLAGS})
-       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag} -Werror")
+    SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
 ENDFOREACH(flag)
 
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC ")
-SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -Wall -Werror")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror")
+SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
 
 IF("${ARCH}" STREQUAL "arm")
     ADD_DEFINITIONS("-DTARGET")
@@ -30,15 +30,11 @@ ADD_DEFINITIONS("-DSLP_DEBUG")
 
 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
 
-ADD_LIBRARY(${fw_name} SHARED
-       app_device.c
-       app_main.c
-       app_main_legacy.c
-       app_resource.c
-       i18n.c
-       )
+add_library(${fw_name} SHARED
+               app_control.c
+               )
 
-TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS} capi-appfw-app-common capi-appfw-app-control)
+TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS})
 
 SET_TARGET_PROPERTIES(${fw_name}
      PROPERTIES
@@ -60,8 +56,8 @@ SET(PC_REQUIRED ${pc_requires})
 SET(PC_LDFLAGS -l${fw_name})
 
 CONFIGURE_FILE(
-    ${CMAKE_SOURCE_DIR}/capi-appfw-module.pc.in
-    ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc
+    ${CMAKE_SOURCE_DIR}/${fw_name}.pc.in
+    ${CMAKE_SOURCE_DIR}/${fw_name}.pc
     @ONLY
 )
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
old mode 100755 (executable)
new mode 100644 (file)
similarity index 99%
rename from app_control/app_control.c
rename to src/app_control.c
index 6d51d44..55eda27
@@ -555,7 +555,7 @@ int app_control_clone(app_control_h *clone, app_control_h app_control)
 int app_control_set_launch_mode(app_control_h app_control,
                app_control_launch_mode_e mode)
 {
-       const char *launch_mode;
+       char launch_mode[LAUNCH_MODE_SIZE] = { 0, };
 
        if (app_control_validate(app_control)) {
                return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER,
@@ -564,10 +564,10 @@ int app_control_set_launch_mode(app_control_h app_control,
 
        switch (mode) {
        case APP_CONTROL_LAUNCH_MODE_SINGLE:
-               launch_mode = LAUNCH_MODE_SINGLE;
+               strncpy(launch_mode, LAUNCH_MODE_SINGLE, strlen(LAUNCH_MODE_SINGLE));
                break;
        case APP_CONTROL_LAUNCH_MODE_GROUP:
-               launch_mode = LAUNCH_MODE_GROUP;
+               strncpy(launch_mode, LAUNCH_MODE_GROUP, strlen(LAUNCH_MODE_GROUP));
                break;
        default:
                return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER,
diff --git a/src/app_device.c b/src/app_device.c
deleted file mode 100644 (file)
index 4c9db0f..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2011 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-#include <bundle.h>
-#include <appcore_base.h>
-#include <aul.h>
-#include <dlog.h>
-#include <vconf.h>
-
-#include <app_internal.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "CAPI_APPFW_APPLICATION"
-
-static app_device_orientation_e __convert_appcore_rm(int rm)
-{
-       app_device_orientation_e dev_orientation;
-
-       switch (rm) {
-       case APPCORE_BASE_RM_PORTRAIT_NORMAL:
-               dev_orientation = APP_DEVICE_ORIENTATION_0;
-               break;
-       case APPCORE_BASE_RM_PORTRAIT_REVERSE:
-               dev_orientation = APP_DEVICE_ORIENTATION_180;
-               break;
-       case APPCORE_BASE_RM_LANDSCAPE_NORMAL:
-               dev_orientation = APP_DEVICE_ORIENTATION_270;
-               break;
-       case APPCORE_BASE_RM_LANDSCAPE_REVERSE:
-               dev_orientation = APP_DEVICE_ORIENTATION_90;
-               break;
-       default:
-               dev_orientation = APP_DEVICE_ORIENTATION_0;
-               break;
-       }
-
-       return dev_orientation;
-}
-
-app_device_orientation_e app_get_device_orientation(void)
-{
-       enum appcore_base_rm rm;
-       app_device_orientation_e dev_orientation = APP_DEVICE_ORIENTATION_0;
-
-       if (appcore_base_get_rotation_state(&rm) == 0)
-               dev_orientation = __convert_appcore_rm(rm);
-
-       return dev_orientation;
-}
-
diff --git a/src/app_main.c b/src/app_main.c
deleted file mode 100755 (executable)
index b8aad27..0000000
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- * Copyright (c) 2011 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-#include <bundle.h>
-#include <appcore_efl_base.h>
-#include <dlog.h>
-
-#include <app_internal.h>
-#include <app_control_internal.h>
-#include <tizen_error.h>
-
-#include "app_extension.h"
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "CAPI_APPFW_APPLICATION"
-
-#define UI_APP_EVENT_MAX 7
-
-typedef enum {
-       APP_STATE_NOT_RUNNING, /* The application has been launched or was running but was terminated */
-       APP_STATE_CREATING, /* The application is initializing the resources on app_create_cb callback */
-       APP_STATE_RUNNING, /* The application is running in the foreground and background */
-} app_state_e;
-
-struct app_event_handler {
-       app_event_type_e type;
-       app_event_cb cb;
-       void *data;
-       void *raw;
-};
-
-struct app_event_info {
-       app_event_type_e type;
-       void *value;
-};
-
-struct ui_app_context {
-       ui_app_lifecycle_callback_s callback;
-       void *data;
-};
-
-static struct ui_app_context __context;
-static app_state_e __app_state = APP_STATE_NOT_RUNNING;
-
-static int __app_event_converter[APPCORE_BASE_EVENT_MAX] = {
-       [APP_EVENT_LOW_MEMORY] = APPCORE_BASE_EVENT_LOW_MEMORY,
-       [APP_EVENT_LOW_BATTERY] = APPCORE_BASE_EVENT_LOW_BATTERY,
-       [APP_EVENT_LANGUAGE_CHANGED] = APPCORE_BASE_EVENT_LANG_CHANGE,
-       [APP_EVENT_DEVICE_ORIENTATION_CHANGED] = APPCORE_BASE_EVENT_DEVICE_ORIENTATION_CHANGED,
-       [APP_EVENT_REGION_FORMAT_CHANGED] = APPCORE_BASE_EVENT_REGION_CHANGE,
-       [APP_EVENT_SUSPENDED_STATE_CHANGED] = APPCORE_BASE_EVENT_SUSPENDED_STATE_CHANGE,
-};
-
-static int __ui_app_create(void *data)
-{
-       appcore_efl_base_on_create();
-       if (__context.callback.create == NULL ||
-                       __context.callback.create(__context.data) == false)
-               return app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__, "app_create_cb() returns false");
-
-       return APP_ERROR_NONE;
-}
-
-static int __ui_app_terminate(void *data)
-{
-       appcore_efl_base_on_terminate();
-
-       if (__context.callback.terminate)
-               __context.callback.terminate(__context.data);
-
-       return APP_ERROR_NONE;
-}
-
-static int __ui_app_control(bundle *b, void *data)
-{
-       app_control_h app_control = NULL;
-
-       appcore_efl_base_on_control(b);
-
-       if (b) {
-               if (app_control_create_event(b, &app_control) != APP_ERROR_NONE)
-                       return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, "Failed to create an app_control handle");
-       } else {
-               if (app_control_create(&app_control) != APP_ERROR_NONE)
-                       return app_error(APP_ERROR_OUT_OF_MEMORY, __FUNCTION__, "Failed to create an app_control handle");
-       }
-
-       if (__context.callback.app_control)
-               __context.callback.app_control(app_control, __context.data);
-
-       app_control_destroy(app_control);
-
-       return APP_ERROR_NONE;
-}
-
-static int __ui_app_pause(void *data)
-{
-       appcore_efl_base_on_pause();
-       if (__context.callback.pause)
-               __context.callback.pause(__context.data);
-       return APP_ERROR_NONE;
-}
-
-static int __ui_app_resume(void *data)
-{
-       appcore_efl_base_on_resume();
-       if (__context.callback.resume)
-               __context.callback.resume(__context.data);
-       return APP_ERROR_NONE;
-}
-
-static int __app_init(int argc, char **argv, ui_app_lifecycle_callback_s *callback, void *user_data, appcore_efl_base_ops ops)
-{
-       int ret;
-
-       if (argc < 1 || argv == NULL || callback == NULL)
-               return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       if (callback->create == NULL)
-               return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, "app_create_cb() callback must be registered");
-
-       if (__app_state != APP_STATE_NOT_RUNNING)
-               return app_error(APP_ERROR_ALREADY_RUNNING, __FUNCTION__, NULL);
-
-       __context.callback = *callback;
-       __context.data = user_data;
-       __app_state = APP_STATE_CREATING;
-
-       ret = appcore_efl_base_init(ops, argc, argv, NULL,
-                       APPCORE_EFL_BASE_HINT_WINDOW_GROUP_CONTROL |
-                       APPCORE_EFL_BASE_HINT_WINDOW_STACK_CONTROL |
-                       APPCORE_EFL_BASE_HINT_BG_LAUNCH_CONTROL |
-                       APPCORE_EFL_BASE_HINT_HW_ACC_CONTROL |
-                       APPCORE_EFL_BASE_HINT_WINDOW_AUTO_CONTROL |
-                       APPCORE_EFL_BASE_HINT_LEGACY_CONTROL);
-
-       if (ret < 0) {
-               __app_state = APP_STATE_NOT_RUNNING;
-               return app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__, NULL);
-       }
-
-       return APP_ERROR_NONE;
-}
-
-static void __app_fini(void)
-{
-       appcore_efl_base_fini();
-       __app_state = APP_STATE_NOT_RUNNING;
-
-}
-
-int ui_app_init(int argc, char **argv, ui_app_lifecycle_callback_s *callback, void *user_data, appcore_context_h *handle)
-{
-       appcore_efl_base_ops ops = appcore_efl_base_get_default_ops();
-
-       /* override methods */
-       ops.ui_base.base.create = __ui_app_create;
-       ops.ui_base.base.control = __ui_app_control;
-       ops.ui_base.base.terminate = __ui_app_terminate;
-       ops.ui_base.pause = __ui_app_pause;
-       ops.ui_base.resume = __ui_app_resume;
-       ops.ui_base.base.run = NULL;
-       ops.ui_base.base.exit = NULL;
-
-       return __app_init(argc, argv, callback, user_data, ops);
-}
-
-void ui_app_fini(appcore_context_h handle)
-{
-       __app_fini();
-}
-
-int ui_app_main(int argc, char **argv, ui_app_lifecycle_callback_s *callback, void *user_data)
-{
-       int ret;
-       appcore_efl_base_ops ops = appcore_efl_base_get_default_ops();
-
-       /* override methods */
-       ops.ui_base.base.create = __ui_app_create;
-       ops.ui_base.base.control = __ui_app_control;
-       ops.ui_base.base.terminate = __ui_app_terminate;
-       ops.ui_base.pause = __ui_app_pause;
-       ops.ui_base.resume = __ui_app_resume;
-
-       ret = __app_init(argc, argv, callback, user_data, ops);
-       if (ret != APP_ERROR_NONE)
-               return ret;
-
-        __app_fini();
-
-        return APP_ERROR_NONE;
-}
-
-void ui_app_exit(void)
-{
-       appcore_efl_base_exit();
-}
-
-int __event_cb(void *event, void *data)
-{
-       app_event_handler_h handler = data;
-
-       struct app_event_info app_event;
-
-       app_event.type = handler->type;
-       app_event.value = event;
-
-       if (handler->cb)
-               handler->cb(&app_event, handler->data);
-
-       return 0;
-}
-
-int ui_app_add_event_handler(app_event_handler_h *event_handler, app_event_type_e event_type, app_event_cb callback, void *user_data)
-{
-       app_event_handler_h handler;
-
-       if (event_handler == NULL || callback == NULL)
-               return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, "null parameter");
-
-       if (event_type < APP_EVENT_LOW_MEMORY || event_type > APP_EVENT_UPDATE_REQUESTED)
-               return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, "invalid event type");
-
-       handler = calloc(1, sizeof(struct app_event_handler));
-       if (!handler)
-               return app_error(APP_ERROR_OUT_OF_MEMORY, __FUNCTION__, "failed to create handler");
-
-       handler->type = event_type;
-       handler->cb = callback;
-       handler->data = user_data;
-       handler->raw = appcore_base_add_event(__app_event_converter[event_type], __event_cb, handler);
-
-       *event_handler = handler;
-
-       return APP_ERROR_NONE;
-}
-
-int ui_app_remove_event_handler(app_event_handler_h event_handler)
-{
-       int ret;
-       app_event_type_e type;
-
-       if (event_handler == NULL)
-               return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, "handler is null");
-
-       type = event_handler->type;
-       if (type < APP_EVENT_LOW_MEMORY || type > APP_EVENT_UPDATE_REQUESTED)
-               return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, "invalid handler");
-
-
-       ret = appcore_base_remove_event(event_handler->raw);
-       if (ret < 0)
-               return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, "invalid raw handler");
-
-       free(event_handler);
-
-       return APP_ERROR_NONE;
-}
-
diff --git a/src/app_main_legacy.c b/src/app_main_legacy.c
deleted file mode 100755 (executable)
index e803535..0000000
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * Copyright (c) 2011 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <dlog.h>
-
-#include <app_internal.h>
-#include <tizen_error.h>
-
-#include <app.h>
-#include "app_extension.h"
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "CAPI_APPFW_APPLICATION"
-
-typedef struct {
-       app_event_callback_s *callback;
-       void *data;
-} app_context_s;
-
-static bool __on_create(void *data)
-{
-       app_context_s *context = data;
-
-       if (context->callback->create)
-               return context->callback->create(context->data);
-
-       return false;
-}
-
-static void __on_terminate(void *data)
-{
-       app_context_s *context = data;
-
-       if (context->callback->terminate)
-               context->callback->terminate(context->data);
-}
-
-/* LCOV_EXCL_START */
-static void __on_pause(void *data)
-{
-       app_context_s *context = data;
-
-       if (context->callback->pause)
-               context->callback->pause(context->data);
-}
-/* LCOV_EXCL_STOP */
-
-/* LCOV_EXCL_START */
-static void __on_resume(void *data)
-{
-       app_context_s *context = data;
-
-       if (context->callback->resume)
-               context->callback->resume(context->data);
-
-}
-/* LCOV_EXCL_STOP */
-
-static void __on_app_control(app_control_h app_control, void *data)
-{
-       app_context_s *context = data;
-
-       if (context->callback->app_control)
-               context->callback->app_control(app_control, context->data);
-}
-
-static void __on_low_memory(app_event_info_h event_info, void *data)
-{
-       app_context_s *context = data;
-
-       if (context->callback->low_memory)
-               context->callback->low_memory(context->data);
-}
-
-static void __on_low_battery(app_event_info_h event_info, void *data)
-{
-       app_context_s *context = data;
-
-       if (context->callback->low_battery)
-               context->callback->low_battery(context->data);
-}
-
-/* LCOV_EXCL_START */
-static void __on_rotation_event(app_event_info_h event_info, void *data)
-{
-       app_context_s *context = data;
-
-       if (context->callback->device_orientation) {
-               app_device_orientation_e ori;
-               app_event_get_device_orientation(event_info, &ori);
-               context->callback->device_orientation(ori, context->data);
-       }
-
-}
-/* LCOV_EXCL_STOP */
-
-static void __on_lang_changed(app_event_info_h event_info, void *data)
-{
-       app_context_s *context = data;
-
-       if (context->callback->language_changed)
-               context->callback->language_changed(context->data);
-}
-
-static void __on_region_changed(app_event_info_h event_info, void *data)
-{
-       app_context_s *context = data;
-
-       if (context->callback->region_format_changed)
-               context->callback->region_format_changed(context->data);
-}
-
-int app_main(int argc, char **argv, app_event_callback_s *callback, void *data)
-{
-       ui_app_lifecycle_callback_s cb = {
-               .create = __on_create,
-               .terminate = __on_terminate,
-               .pause = __on_pause,
-               .resume = __on_resume,
-               .app_control = __on_app_control
-       };
-
-       app_context_s app_context = {
-               .callback = callback,
-               .data = data
-       };
-
-       app_event_handler_h handler;
-
-       if (!callback)
-               return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       if (callback->low_memory)
-               ui_app_add_event_handler(&handler, APP_EVENT_LOW_MEMORY, __on_low_memory, &app_context);
-       if (callback->low_battery)
-               ui_app_add_event_handler(&handler, APP_EVENT_LOW_BATTERY, __on_low_battery, &app_context);
-       if (callback->language_changed)
-               ui_app_add_event_handler(&handler, APP_EVENT_LANGUAGE_CHANGED, __on_lang_changed, &app_context);
-       if (callback->device_orientation)
-               ui_app_add_event_handler(&handler, APP_EVENT_DEVICE_ORIENTATION_CHANGED, __on_rotation_event, &app_context);
-       if (callback->region_format_changed)
-               ui_app_add_event_handler(&handler, APP_EVENT_REGION_FORMAT_CHANGED, __on_region_changed, &app_context);
-
-       return ui_app_main(argc, argv, &cb, &app_context);
-}
-
-int app_efl_main(int *argc, char ***argv, app_event_callback_s *callback, void *user_data)
-{
-       if (argc == NULL || argv == NULL)
-               return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       return app_main(*argc, *argv, callback, user_data);
-}
-
-void app_exit(void)
-{
-       ui_app_exit();
-}
-
-void app_efl_exit(void)
-{
-       ui_app_exit();
-}
-
-
-
diff --git a/src/app_resource.c b/src/app_resource.c
deleted file mode 100644 (file)
index 5ab9a16..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2011 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <Elementary.h>
-#include "app_extension.h"
-
-static void __set_preinit_window_name(const char *win_name, void *win)
-{
-       const Evas *e;
-       Ecore_Evas *ee;
-
-       if (!win_name || !win)
-               return;
-
-       e = evas_object_evas_get((const Evas_Object *)win);
-       if (e) {
-               ee = ecore_evas_ecore_evas_get(e);
-               if (ee)
-                       ecore_evas_name_class_set(ee, win_name, win_name);
-       }
-}
-
-void *app_get_preinitialized_window(const char *win_name)
-{
-       void *win;
-
-       win = elm_win_precreated_object_get();
-       if (win == NULL)
-               return NULL;
-
-       __set_preinit_window_name(win_name, win);
-       elm_win_precreated_object_set(NULL);
-
-       return win;
-}
-
-void *app_get_preinitialized_background(void)
-{
-       void *background;
-
-       background = elm_bg_precreated_object_get();
-       if (background == NULL)
-               return NULL;
-
-       elm_bg_precreated_object_set(NULL);
-
-       return background;
-}
-
-void *app_get_preinitialized_conformant(void)
-{
-       void *conformant;
-
-       conformant = elm_conformant_precreated_object_get();
-       if (conformant == NULL)
-               return NULL;
-
-       elm_conformant_precreated_object_set(NULL);
-
-       return conformant;
-}
-
diff --git a/src/i18n.c b/src/i18n.c
deleted file mode 100644 (file)
index c22ebbf..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2011 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <libintl.h>
-
-#include <app_i18n.h>
-
-char *i18n_get_text(const char *message)
-{
-       return gettext(message);
-}
-