Seperate packages 73/132073/5
authorHyunho Kang <hhstark.kang@samsung.com>
Mon, 10 Jul 2017 12:40:53 +0000 (21:40 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Tue, 25 Jul 2017 01:24:43 +0000 (10:24 +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: I6cb2015717dbf337d795cf61c5f528f88fbad2f0
Signed-off-by: Hyunho Kang <hhstark.kang@samsung.com>
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
50 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]
app_control/app_control.c [deleted file]
capi-appfw-event.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]
include/app.h [deleted file]
include/app_common.h [deleted file]
include/app_control.h [deleted file]
include/app_control_internal.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-application.spec [deleted file]
packaging/capi-appfw-event.manifest [moved from packaging/capi-appfw-application.manifest with 100% similarity]
packaging/capi-appfw-event.spec [new file with mode: 0644]
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_device.c [deleted file]
src/app_main.c [deleted file]
src/app_main_legacy.c [deleted file]
src/app_resource.c [deleted file]
src/event.c [moved from event/event.c with 99% similarity]
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/app_control/app_control.c b/app_control/app_control.c
deleted file mode 100755 (executable)
index 6d51d44..0000000
+++ /dev/null
@@ -1,1286 +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 <errno.h>
-
-#include <bundle.h>
-#include <bundle_internal.h>
-#include <aul.h>
-#include <aul_svc.h>
-#include <dlog.h>
-
-#include <app_control.h>
-#include <app_control_internal.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "CAPI_APPFW_APP_CONTROL"
-
-#ifndef TIZEN_PATH_MAX
-#define TIZEN_PATH_MAX 1024
-#endif
-
-#define BUNDLE_KEY_PREFIX_AUL "__AUL_"
-#define BUNDLE_KEY_PREFIX_SERVICE "__APP_SVC_"
-
-#define BUNDLE_KEY_OPERATION   "__APP_SVC_OP_TYPE__"
-#define BUNDLE_KEY_URI         "__APP_SVC_URI__"
-#define BUNDLE_KEY_MIME                "__APP_SVC_MIME_TYPE__"
-#define BUNDLE_KEY_DATA                "__APP_SVC_DATA__"
-#define BUNDLE_KEY_PACKAGE     "__APP_SVC_PKG_NAME__"
-#define BUNDLE_KEY_WINDOW      "__APP_SVC_K_WIN_ID__"
-#define BUNDLE_KEY_CATEGORY    "__APP_SVC_CATEGORY__"
-
-#define LAUNCH_MODE_SIZE 8
-#define LAUNCH_MODE_SINGLE "single"
-#define LAUNCH_MODE_GROUP "group"
-
-typedef enum {
-       APP_CONTROL_TYPE_REQUEST,
-       APP_CONTROL_TYPE_EVENT,
-       APP_CONTROL_TYPE_REPLY,
-} app_control_type_e;
-
-struct app_control_s {
-       int id;
-       app_control_type_e type;
-       bundle *data;
-       int launch_pid;
-};
-
-typedef struct app_control_request_context_s {
-       app_control_h app_control;
-       app_control_reply_cb reply_cb;
-       void *user_data;
-} *app_control_request_context_h;
-
-static int app_control_create_reply(bundle *data, struct app_control_s **app_control);
-
-static const char *app_control_error_to_string(app_control_error_e error)
-{
-       switch (error) {
-       case APP_CONTROL_ERROR_NONE:
-               return "NONE";
-       case APP_CONTROL_ERROR_INVALID_PARAMETER:
-               return "INVALID_PARAMETER";
-       case APP_CONTROL_ERROR_OUT_OF_MEMORY:
-               return "OUT_OF_MEMORY";
-       case APP_CONTROL_ERROR_APP_NOT_FOUND:
-               return "APP_NOT_FOUND";
-       case APP_CONTROL_ERROR_KEY_NOT_FOUND:
-               return "KEY_NOT_FOUND";
-       case APP_CONTROL_ERROR_KEY_REJECTED:
-               return "KEY_REJECTED";
-       case APP_CONTROL_ERROR_INVALID_DATA_TYPE:
-               return "INVALID_DATA_TYPE";
-       case APP_CONTROL_ERROR_LAUNCH_REJECTED:
-               return "LAUNCH_REJECTED";
-       case APP_CONTROL_ERROR_PERMISSION_DENIED:
-               return "PERMISSION_DENIED";
-       case APP_CONTROL_ERROR_LAUNCH_FAILED:
-               return "LAUNCH_FAILED";
-       case APP_CONTROL_ERROR_TIMED_OUT:
-               return "TIMED_OUT";
-       case APP_CONTROL_ERROR_IO_ERROR:
-               return "IO ERROR";
-       default:
-               return "UNKNOWN";
-       }
-}
-
-int app_control_error(app_control_error_e error, const char *function, const char *description)
-{
-       if (description)
-               LOGE("[%s] %s(0x%08x) : %s", function, app_control_error_to_string(error), error, description);
-       else {
-               if (error == APP_CONTROL_ERROR_KEY_NOT_FOUND)
-                       LOGW("[%s] %s(0x%08x)", function, app_control_error_to_string(error), error);
-               else
-                       LOGE("[%s] %s(0x%08x)", function, app_control_error_to_string(error), error);
-       }
-
-       return error;
-}
-
-static int app_control_validate_extra_data(const char *data)
-{
-       if (data == NULL || data[0] == '\0')
-               return APP_CONTROL_ERROR_INVALID_PARAMETER;
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-static int app_control_validate(app_control_h app_control)
-{
-       if (app_control == NULL || app_control->data == NULL)
-               return APP_CONTROL_ERROR_INVALID_PARAMETER;
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-static int app_control_new_id()
-{
-       static int sid = 0;
-       return sid++;
-}
-
-int app_control_validate_internal_key(const char *key)
-{
-       if (strncmp(BUNDLE_KEY_PREFIX_AUL, key, strlen(BUNDLE_KEY_PREFIX_AUL)) == 0)
-               return -1;
-
-       if (strncmp(BUNDLE_KEY_PREFIX_SERVICE, key, strlen(BUNDLE_KEY_PREFIX_SERVICE)) == 0)
-               return -1;
-
-       return 0;
-}
-
-/* LCOV_EXCL_START */
-static void app_control_request_result_broker(bundle *appsvc_bundle, int appsvc_request_code, aul_svc_result_val appsvc_result, void *appsvc_data)
-{
-       app_control_request_context_h request_context;
-       app_control_h request;
-       app_control_h reply = NULL;
-       app_control_result_e result;
-       void *user_data;
-       app_control_reply_cb reply_cb;
-
-       if (appsvc_data == NULL) {
-               app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, "invalid app_control reply");
-               return;
-       }
-
-       if (app_control_create_reply(appsvc_bundle, &reply) != 0) {
-               app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, "failed to create app_control reply");
-               return;
-       }
-
-       request_context = appsvc_data;
-       request = request_context->app_control;
-
-       switch (appsvc_result) {
-       case AUL_SVC_RES_OK:
-               result = APP_CONTROL_RESULT_SUCCEEDED;
-               break;
-       case AUL_SVC_RES_NOT_OK:
-               result = APP_CONTROL_RESULT_FAILED;
-               break;
-       case AUL_SVC_RES_CANCEL:
-               result = APP_CONTROL_RESULT_CANCELED;
-               break;
-       default:
-               result = APP_CONTROL_RESULT_CANCELED;
-               break;
-       }
-
-       user_data = request_context->user_data;
-       reply_cb = request_context->reply_cb;
-
-       if (reply_cb != NULL)
-               reply_cb(request, reply, result, user_data);
-       else
-               app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, "invalid callback ");
-
-       app_control_destroy(reply);
-
-       if (request_context->app_control != NULL)
-               app_control_destroy(request_context->app_control);
-
-       free(request_context);
-}
-/* LCOV_EXCL_STOP */
-
-int app_control_create_request(bundle *data, app_control_h *app_control)
-{
-       struct app_control_s *app_control_request;
-
-       if (app_control == NULL)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       app_control_request = malloc(sizeof(struct app_control_s));
-       if (app_control_request == NULL)
-               return app_control_error(APP_CONTROL_ERROR_OUT_OF_MEMORY, __FUNCTION__, "failed to create a app_control handle");
-
-       app_control_request->type = APP_CONTROL_TYPE_REQUEST;
-
-       if (data != NULL)
-               app_control_request->data = bundle_dup(data);
-       else
-               app_control_request->data = bundle_create();
-
-       if (app_control_request->data == NULL) {
-               free(app_control_request);
-               return app_control_error(APP_CONTROL_ERROR_OUT_OF_MEMORY, __FUNCTION__, "failed to create a bundle");
-       }
-
-       app_control_request->id = app_control_new_id();
-       app_control_request->launch_pid = -1;
-
-       *app_control = app_control_request;
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-int app_control_create(app_control_h *app_control)
-{
-       return app_control_create_request(NULL, app_control);
-}
-
-int app_control_create_event(bundle *data, struct app_control_s **app_control)
-{
-       struct app_control_s *app_control_event;
-
-       const char *operation;
-
-       if (data == NULL || app_control == NULL)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       app_control_event = malloc(sizeof(struct app_control_s));
-       if (app_control_event == NULL)
-               return app_control_error(APP_CONTROL_ERROR_OUT_OF_MEMORY, __FUNCTION__, "failed to create a app_control handle");
-
-       app_control_event->type = APP_CONTROL_TYPE_EVENT;
-       app_control_event->data = bundle_dup(data);
-       app_control_event->id = app_control_new_id();
-
-       operation = aul_svc_get_operation(app_control_event->data);
-       if (operation == NULL)
-               aul_svc_set_operation(app_control_event->data, APP_CONTROL_OPERATION_DEFAULT);
-
-       *app_control = app_control_event;
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-/* LCOV_EXCL_START */
-static int app_control_create_reply(bundle *data, struct app_control_s **app_control)
-{
-       struct app_control_s *app_control_reply;
-
-       if (data == NULL || app_control == NULL)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       app_control_reply = malloc(sizeof(struct app_control_s));
-       if (app_control_reply == NULL)
-               return app_control_error(APP_CONTROL_ERROR_OUT_OF_MEMORY, __FUNCTION__, "failed to create a app_control handle");
-
-       app_control_reply->type = APP_CONTROL_TYPE_REPLY;
-       app_control_reply->data = bundle_dup(data);
-       app_control_reply->id = app_control_new_id();
-
-       *app_control = app_control_reply;
-
-       return APP_CONTROL_ERROR_NONE;
-}
-/* LCOV_EXCL_STOP */
-
-int app_control_destroy(app_control_h app_control)
-{
-       if (app_control_validate(app_control))
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       if (app_control->type == APP_CONTROL_TYPE_REQUEST && app_control->launch_pid > 0
-                       && bundle_get_val(app_control->data, AUL_SVC_K_LAUNCH_RESULT_APP_STARTED) == NULL)
-               aul_remove_caller_cb(app_control->launch_pid, app_control);
-
-       bundle_free(app_control->data);
-       app_control->data = NULL;
-       free(app_control);
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-int app_control_to_bundle(app_control_h app_control, bundle **data)
-{
-       if (app_control_validate(app_control) || data == NULL)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       *data = app_control->data;
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-int app_control_set_operation(app_control_h app_control, const char *operation)
-{
-       if (app_control_validate(app_control))
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       if (operation != NULL) {
-               if (aul_svc_set_operation(app_control->data, operation) != 0)
-                       return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, "invalid operation");
-       } else {
-               bundle_del(app_control->data, BUNDLE_KEY_OPERATION);
-       }
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-int app_control_get_operation(app_control_h app_control, char **operation)
-{
-       const char *operation_value;
-
-       if (app_control_validate(app_control) || operation == NULL)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       operation_value = aul_svc_get_operation(app_control->data);
-       if (operation_value) {
-               *operation = strdup(operation_value);
-               if (*operation == NULL)
-                       return app_control_error(APP_CONTROL_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
-       } else {
-               *operation = NULL;
-       }
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-int app_control_set_uri(app_control_h app_control, const char *uri)
-{
-       if (app_control_validate(app_control))
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       if (uri != NULL) {
-               if (aul_svc_set_uri(app_control->data, uri) != 0)
-                       return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, "invalid URI");
-       } else {
-               bundle_del(app_control->data, BUNDLE_KEY_URI);
-       }
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-int app_control_get_uri(app_control_h app_control, char **uri)
-{
-       const char *uri_value;
-
-       if (app_control_validate(app_control) || uri == NULL)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       uri_value = aul_svc_get_uri(app_control->data);
-       if (uri_value) {
-               *uri = strdup(uri_value);
-               if (*uri == NULL)
-                       return app_control_error(APP_CONTROL_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
-       } else {
-               *uri = NULL;
-       }
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-int app_control_set_mime(app_control_h app_control, const char *mime)
-{
-       if (app_control_validate(app_control))
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       if (mime != NULL) {
-               if (aul_svc_set_mime(app_control->data, mime) != 0)
-                       return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, "invalid MIME type");
-       } else {
-               bundle_del(app_control->data, BUNDLE_KEY_MIME);
-       }
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-int app_control_get_mime(app_control_h app_control, char **mime)
-{
-       const char *mime_value;
-
-       if (app_control_validate(app_control) || mime == NULL)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       mime_value = aul_svc_get_mime(app_control->data);
-       if (mime_value) {
-               *mime = strdup(mime_value);
-               if (*mime == NULL)
-                       return app_control_error(APP_CONTROL_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
-       } else {
-               *mime = NULL;
-       }
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-int app_control_set_category(app_control_h app_control, const char *category)
-{
-       if (app_control_validate(app_control))
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       if (category != NULL) {
-               if (aul_svc_set_category(app_control->data, category) != 0)
-                       return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, "invalid Category");
-       } else {
-               bundle_del(app_control->data, BUNDLE_KEY_CATEGORY);
-       }
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-int app_control_get_category(app_control_h app_control, char **category)
-{
-       const char *category_value;
-
-       if (app_control_validate(app_control) || category == NULL)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       category_value = aul_svc_get_category(app_control->data);
-       if (category_value) {
-               *category = strdup(category_value);
-               if (*category == NULL)
-                       return app_control_error(APP_CONTROL_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
-       } else {
-               *category = NULL;
-       }
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-int app_control_set_package(app_control_h app_control, const char *package)
-{
-       /* TODO: this function must be deprecated */
-       return app_control_set_app_id(app_control, package);
-}
-
-int app_control_get_package(app_control_h app_control, char **package)
-{
-       /* TODO: this function must be deprecated */
-       return app_control_get_app_id(app_control, package);
-}
-
-int app_control_set_app_id(app_control_h app_control, const char *app_id)
-{
-       if (app_control_validate(app_control))
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       if (app_id != NULL) {
-               if (aul_svc_set_appid(app_control->data, app_id) != 0)
-                       return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, "invalid application ID");
-       } else {
-               bundle_del(app_control->data, BUNDLE_KEY_PACKAGE);
-       }
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-int app_control_get_app_id(app_control_h app_control, char **app_id)
-{
-       const char *app_id_value;
-
-       if (app_control_validate(app_control) || app_id == NULL)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       app_id_value = aul_svc_get_appid(app_control->data);
-       if (app_id_value) {
-               *app_id = strdup(app_id_value);
-               if (*app_id == NULL)
-                       return app_control_error(APP_CONTROL_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
-       } else {
-               *app_id = NULL;
-       }
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-int app_control_set_window(app_control_h app_control, unsigned int id)
-{
-       if (app_control_validate(app_control))
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       if (id > 0) {
-               if (aul_svc_allow_transient_app(app_control->data, id) != 0)
-                       return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, "invalid id");
-       } else {
-               bundle_del(app_control->data, BUNDLE_KEY_WINDOW);
-       }
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-int app_control_get_window(app_control_h app_control, unsigned int *id)
-{
-       const char *window_id;
-
-       if (app_control_validate(app_control) || id == NULL)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       window_id = bundle_get_val(app_control->data, BUNDLE_KEY_WINDOW);
-       if (window_id != NULL)
-               *id = atoi(window_id);
-       else
-               *id = 0;
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-int app_control_clone(app_control_h *clone, app_control_h app_control)
-{
-       app_control_h app_control_clone;
-
-       if (app_control_validate(app_control) || clone == NULL)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       app_control_clone = malloc(sizeof(struct app_control_s));
-       if (app_control_clone == NULL)
-               return app_control_error(APP_CONTROL_ERROR_OUT_OF_MEMORY, __FUNCTION__, "failed to create a app_control handle");
-
-       app_control_clone->id = app_control_new_id();
-       app_control_clone->type = app_control->type;
-       app_control_clone->data = bundle_dup(app_control->data);
-
-       *clone = app_control_clone;
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-int app_control_set_launch_mode(app_control_h app_control,
-               app_control_launch_mode_e mode)
-{
-       const char *launch_mode;
-
-       if (app_control_validate(app_control)) {
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER,
-                               __FUNCTION__, NULL);
-       }
-
-       switch (mode) {
-       case APP_CONTROL_LAUNCH_MODE_SINGLE:
-               launch_mode = LAUNCH_MODE_SINGLE;
-               break;
-       case APP_CONTROL_LAUNCH_MODE_GROUP:
-               launch_mode = LAUNCH_MODE_GROUP;
-               break;
-       default:
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER,
-                               __FUNCTION__, "invalid mode");
-       }
-
-       return aul_svc_set_launch_mode(app_control->data, launch_mode);
-}
-
-int app_control_get_launch_mode(app_control_h app_control,
-               app_control_launch_mode_e *mode)
-{
-       const char *launch_mode;
-
-       if (app_control_validate(app_control)) {
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER,
-                               __FUNCTION__, NULL);
-       }
-
-       launch_mode = aul_svc_get_launch_mode(app_control->data);
-       if (launch_mode == NULL) {
-               *mode = APP_CONTROL_LAUNCH_MODE_SINGLE;
-       } else {
-               if (!strcmp(launch_mode, LAUNCH_MODE_SINGLE)) {
-                       *mode = APP_CONTROL_LAUNCH_MODE_SINGLE;
-               } else if (!strcmp(launch_mode, LAUNCH_MODE_GROUP)) {
-                       *mode = APP_CONTROL_LAUNCH_MODE_GROUP;
-               } else {
-                       *mode = APP_CONTROL_LAUNCH_MODE_SINGLE;
-                       return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER,
-                                       __FUNCTION__, "launch_mode is not matched");
-               }
-       }
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-int app_control_set_defapp(app_control_h app_control, const char *app_id)
-{
-       int ret;
-
-       if (app_control_validate(app_control) || app_id == NULL)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       ret = aul_svc_set_appid(app_control->data, app_id);
-       if (ret < 0)
-               return app_control_error(APP_CONTROL_ERROR_IO_ERROR, __FUNCTION__, NULL);
-
-       ret = aul_set_default_app_by_operation(app_control->data);
-       if (ret < 0) {
-               if (ret == AUL_R_EILLACC)
-                       return app_control_error(APP_CONTROL_ERROR_PERMISSION_DENIED, __FUNCTION__, NULL);
-               else
-                       return app_control_error(APP_CONTROL_ERROR_IO_ERROR, __FUNCTION__, NULL);
-       }
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-int app_control_unset_defapp(const char *app_id)
-{
-       int ret;
-
-       if (app_id == NULL)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       ret = aul_unset_default_app_by_operation(app_id);
-       if (ret < 0) {
-               if (ret == AUL_R_EILLACC)
-                       return app_control_error(APP_CONTROL_ERROR_PERMISSION_DENIED, __FUNCTION__, NULL);
-               else
-                       return app_control_error(APP_CONTROL_ERROR_IO_ERROR, __FUNCTION__, NULL);
-       }
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-/* LCOV_EXCL_START */
-static void __update_launch_pid(int launched_pid, void *data)
-{
-       app_control_h app_control;
-
-       if (data == NULL)
-               return;
-
-       app_control = data;
-
-       app_control->launch_pid = launched_pid;
-}
-/* LCOV_EXCL_STOP */
-
-static void __handle_launch_result(int launched_pid, void *data)
-{
-       app_control_request_context_h request_context;
-       app_control_h reply = NULL;
-       app_control_h request;
-       app_control_result_e result;
-       app_control_reply_cb reply_cb;
-       void *user_data;
-       char callee[255] = {0, };
-       char instance_id[256] = {0,};
-       int ret;
-
-       if (data == NULL)
-               return;
-
-       request_context = (app_control_request_context_h)data;
-
-       if (app_control_create_event(request_context->app_control->data, &reply) != 0) {
-               app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, "failed to create app_control event");
-               return;
-       }
-
-       ret = aul_app_get_appid_bypid(launched_pid, callee, sizeof(callee));
-       if (ret < 0)
-               LOGE("aul_app_get_appid_bypid failed: %d", launched_pid);
-
-       app_control_set_app_id(reply, callee);
-       LOGI("app control async result callback callee pid:%d", launched_pid);
-
-       ret = aul_app_get_instance_id_bypid(launched_pid, instance_id,
-                       sizeof(instance_id));
-       if (ret == AUL_R_OK) {
-               app_control_set_instance_id(reply, instance_id);
-               LOGI("instance id(%s)", instance_id);
-       }
-
-       result = APP_CONTROL_RESULT_APP_STARTED;
-       request = request_context->app_control;
-       user_data = request_context->user_data;
-       reply_cb = request_context->reply_cb;
-
-       if (reply_cb != NULL)
-               reply_cb(request, reply, result, user_data);
-       else
-               app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, "invalid callback ");
-
-       app_control_destroy(reply);
-}
-
-int app_control_send_launch_request(app_control_h app_control, app_control_reply_cb callback, void *user_data)
-{
-       const char *operation;
-       bool implicit_default_operation = false;
-       int launch_pid;
-       app_control_request_context_h request_context = NULL;
-       int ret;
-
-       if (app_control_validate(app_control))
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       operation = aul_svc_get_operation(app_control->data);
-       if (operation == NULL) {
-               implicit_default_operation = true;
-               operation = APP_CONTROL_OPERATION_DEFAULT;
-       }
-
-       if (!strcmp(operation, APP_CONTROL_OPERATION_LAUNCH_ON_EVENT))
-               return app_control_error(APP_CONTROL_ERROR_LAUNCH_REJECTED, __FUNCTION__,
-                               "Not supported operation value");
-
-       /* TODO: Check the privilege for call operation */
-
-       /* operation : default */
-       if (!strcmp(operation, APP_CONTROL_OPERATION_DEFAULT)) {
-               const char *appid  = aul_svc_get_appid(app_control->data);
-               if (appid == NULL)
-                       return app_control_error(APP_CONTROL_ERROR_APP_NOT_FOUND, __FUNCTION__, "package must be specified if the operation is default value");
-       }
-
-       if (callback != NULL) {
-               app_control_h request_clone = NULL;
-
-               request_context = calloc(1, sizeof(struct app_control_request_context_s));
-               if (request_context == NULL)
-                       return app_control_error(APP_CONTROL_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
-
-               request_context->reply_cb = callback;
-
-               ret = app_control_clone(&request_clone, app_control);
-               if (ret != APP_CONTROL_ERROR_NONE) {
-                       free(request_context);
-                       return app_control_error(ret, __FUNCTION__, "failed to clone the app_control request handle");
-               }
-
-               request_context->app_control = request_clone;
-               request_context->user_data = user_data;
-       }
-
-       if (implicit_default_operation == true)
-               aul_svc_set_operation(app_control->data, APP_CONTROL_OPERATION_DEFAULT);
-
-       launch_pid = aul_svc_run_service_for_uid(app_control->data, app_control->id, callback ? app_control_request_result_broker : NULL, request_context, getuid());
-       if (implicit_default_operation == true)
-               bundle_del(app_control->data, BUNDLE_KEY_OPERATION);
-
-       if (launch_pid < 0) {
-               if (request_context) {
-                       if (request_context->app_control)
-                               app_control_destroy(request_context->app_control);
-
-                       free(request_context);
-               }
-
-               if (launch_pid == AUL_SVC_RET_ENOMATCH)
-                       return app_control_error(APP_CONTROL_ERROR_APP_NOT_FOUND, __FUNCTION__, NULL);
-               else if (launch_pid == AUL_SVC_RET_EILLACC)
-                       return app_control_error(APP_CONTROL_ERROR_PERMISSION_DENIED, __FUNCTION__, NULL);
-               else if (launch_pid == AUL_SVC_RET_EINVAL)
-                       return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-               else
-                       return app_control_error(APP_CONTROL_ERROR_LAUNCH_REJECTED, __FUNCTION__, NULL);
-       }
-
-       app_control->launch_pid = launch_pid;
-       /* app_control_enable_app_started_result_event called */
-       if (bundle_get_val(app_control->data, AUL_SVC_K_LAUNCH_RESULT_APP_STARTED)) {
-               char callee[255] = {0,};
-               if (aul_app_get_appid_bypid(launch_pid, callee, sizeof(callee)) != AUL_R_OK)
-                       LOGE("aul_app_get_appid_bypid failed: %d", launch_pid);
-
-               if (request_context && request_context->app_control)
-                       request_context->app_control->launch_pid = launch_pid;
-
-               aul_add_caller_cb(launch_pid, __handle_launch_result, request_context);
-
-               /* launched without app selector */
-               if ((strcmp(callee, APP_SELECTOR) != 0) &&
-                               (strcmp(callee, SHARE_PANEL) != 0))
-
-                       aul_invoke_caller_cb(request_context);
-
-       } else { /* default case */
-               aul_add_caller_cb(launch_pid, __update_launch_pid, app_control);
-       }
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-int app_control_send_terminate_request(app_control_h app_control)
-{
-       if (app_control_validate(app_control))
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       if (app_control->type != APP_CONTROL_TYPE_REQUEST || app_control->launch_pid < 0)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       aul_svc_subapp_terminate_request_pid(app_control->launch_pid);
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-/* LCOV_EXCL_START */
-static bool app_control_copy_reply_data_cb(app_control_h app_control, const char *key, void *user_data)
-{
-       bundle *reply_data = user_data;
-       char *value = NULL;
-       char **value_array = NULL;
-       int value_array_length = 0;
-       int value_array_index = 0;
-
-       if (reply_data == NULL) {
-               app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-               return false;
-       }
-
-       if (aul_svc_data_is_array(app_control->data, key)) {
-               app_control_get_extra_data_array(app_control, key, &value_array, &value_array_length);
-               aul_svc_add_data_array(reply_data, key, (const char **)value_array, value_array_length);
-
-               for (value_array_index = 0; value_array_index < value_array_length; value_array_index++)
-                       free(value_array[value_array_index]);
-
-               free(value_array);
-       } else {
-               app_control_get_extra_data(app_control, key, &value);
-               aul_svc_add_data(reply_data, key, value);
-               free(value);
-       }
-
-       return true;
-}
-/* LCOV_EXCL_STOP */
-
-int app_control_reply_to_launch_request(app_control_h reply, app_control_h request, app_control_result_e result)
-{
-       bundle *reply_data;
-       int appsvc_result;
-       int ret = 0;
-
-       if (app_control_validate(reply) || app_control_validate(request))
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       if (result == APP_CONTROL_RESULT_APP_STARTED)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, "APP_CONTROL_RESULT_APP_STARTED is not allowed to use");
-
-       if (aul_svc_create_result_bundle(request->data, &reply_data) != 0)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, "failed to create a result bundle");
-
-       app_control_foreach_extra_data(reply, app_control_copy_reply_data_cb, reply_data);
-
-       switch (result) {
-       case APP_CONTROL_RESULT_SUCCEEDED:
-               appsvc_result = AUL_SVC_RES_OK;
-               break;
-       case APP_CONTROL_RESULT_FAILED:
-               appsvc_result = AUL_SVC_RES_NOT_OK;
-               break;
-       case APP_CONTROL_RESULT_CANCELED:
-               appsvc_result = AUL_SVC_RES_CANCEL;
-               break;
-       default:
-               appsvc_result = AUL_SVC_RES_CANCEL;
-               break;
-       }
-
-       ret = aul_svc_send_result(reply_data, appsvc_result);
-       bundle_free(reply_data);
-       if (ret < 0) {
-               if (ret == AUL_SVC_RET_EINVAL)
-                       return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-               else
-                       return app_control_error(APP_CONTROL_ERROR_LAUNCH_REJECTED, __FUNCTION__, NULL);
-       }
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-
-int app_control_add_extra_data(app_control_h app_control, const char *key, const char *value)
-{
-       if (app_control_validate(app_control) || app_control_validate_extra_data(key) || app_control_validate_extra_data(value))
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       if (app_control_validate_internal_key(key))
-               return app_control_error(APP_CONTROL_ERROR_KEY_REJECTED, __FUNCTION__, "the given key is reserved as internal use");
-
-       if (aul_svc_get_data(app_control->data, key) != NULL) {
-               /* overwrite any existing value */
-               bundle_del(app_control->data, key);
-       }
-
-       if (aul_svc_add_data(app_control->data, key, value) != 0)
-               return app_control_error(APP_CONTROL_ERROR_KEY_REJECTED, __FUNCTION__, "failed to add data to the appsvc handle");
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-
-int app_control_add_extra_data_array(app_control_h app_control, const char *key, const char* value[], int length)
-{
-       if (app_control_validate(app_control) || app_control_validate_extra_data(key))
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       if (value == NULL || length <= 0)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, "invalid array");
-
-       if (app_control_validate_internal_key(key))
-               return app_control_error(APP_CONTROL_ERROR_KEY_REJECTED, __FUNCTION__, "the given key is reserved as internal use");
-
-       if (aul_svc_get_data_array(app_control->data, key, NULL) != NULL) {
-               /* overwrite any existing value */
-               bundle_del(app_control->data, key);
-       }
-
-       if (aul_svc_add_data_array(app_control->data, key, value, length) != 0)
-               return app_control_error(APP_CONTROL_ERROR_KEY_REJECTED, __FUNCTION__, "failed to add array data to the appsvc handle");
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-int app_control_remove_extra_data(app_control_h app_control, const char *key)
-{
-       if (app_control_validate(app_control) || app_control_validate_extra_data(key))
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       if (app_control_validate_internal_key(key))
-               return app_control_error(APP_CONTROL_ERROR_KEY_REJECTED, __FUNCTION__, "the given key is reserved as internal use");
-
-       if (bundle_del(app_control->data, key))
-               return app_control_error(APP_CONTROL_ERROR_KEY_NOT_FOUND, __FUNCTION__, NULL);
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-int app_control_get_extra_data(app_control_h app_control, const char *key, char **value)
-{
-       const char *data_value;
-
-       if (app_control_validate(app_control) || app_control_validate_extra_data(key) || value == NULL)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       if (app_control_validate_internal_key(key))
-               return app_control_error(APP_CONTROL_ERROR_KEY_REJECTED, __FUNCTION__, "the given key is reserved as internal use");
-
-       data_value = aul_svc_get_data(app_control->data, key);
-       if (data_value == NULL) {
-               if (errno == ENOTSUP)
-                       return app_control_error(APP_CONTROL_ERROR_INVALID_DATA_TYPE, __FUNCTION__, NULL);
-               else
-                       return app_control_error(APP_CONTROL_ERROR_KEY_NOT_FOUND, __FUNCTION__, NULL);
-       }
-
-       *value = strdup(data_value);
-       if (*value == NULL)
-               return app_control_error(APP_CONTROL_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-int app_control_get_extra_data_array(app_control_h app_control, const char *key, char ***value, int *length)
-{
-       const char **array_data;
-       int array_data_length;
-       char **array_data_clone;
-       int i;
-
-       if (app_control_validate(app_control) || app_control_validate_extra_data(key))
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       if (value == NULL || length == 0)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       if (app_control_validate_internal_key(key))
-               return app_control_error(APP_CONTROL_ERROR_KEY_REJECTED, __FUNCTION__, "the given key is reserved as internal use");
-
-       array_data = aul_svc_get_data_array(app_control->data, key, &array_data_length);
-       if (array_data == NULL) {
-               if (errno == ENOTSUP)
-                       return app_control_error(APP_CONTROL_ERROR_INVALID_DATA_TYPE, __FUNCTION__, NULL);
-               else
-                       return app_control_error(APP_CONTROL_ERROR_KEY_NOT_FOUND, __FUNCTION__, NULL);
-       }
-
-       array_data_clone = calloc(array_data_length, sizeof(char *));
-       if (array_data_clone == NULL)
-               return app_control_error(APP_CONTROL_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
-
-       for (i = 0; i < array_data_length; i++) {
-               if (array_data[i] != NULL) {
-                       array_data_clone[i] = strdup(array_data[i]);
-                       if (array_data_clone[i] == NULL)
-                               goto error_oom;
-               }
-       }
-
-       *value = array_data_clone;
-       *length = array_data_length;
-
-       return APP_CONTROL_ERROR_NONE;
-
-error_oom:
-       for (i = 0; i < array_data_length; i++) {
-               if (array_data_clone[i])
-                       free(array_data_clone[i]);
-       }
-       free(array_data_clone);
-
-       return app_control_error(APP_CONTROL_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
-}
-
-int app_control_is_extra_data_array(app_control_h app_control, const char *key, bool *array)
-{
-       if (app_control_validate(app_control) || app_control_validate_extra_data(key) || array == NULL)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       if (app_control_validate_internal_key(key))
-               return app_control_error(APP_CONTROL_ERROR_KEY_REJECTED, __FUNCTION__, "the given key is reserved as internal use");
-
-       if (!aul_svc_data_is_array(app_control->data, key))
-               *array = false;
-       else
-               *array = true;
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-typedef struct {
-       app_control_h app_control;
-       app_control_extra_data_cb callback;
-       void *user_data;
-       bool foreach_break;
-} foreach_context_extra_data_t;
-
-static void app_control_cb_broker_bundle_iterator(const char *key, const int type, const bundle_keyval_t *kv, void *user_data)
-{
-       foreach_context_extra_data_t *foreach_context = NULL;
-       app_control_extra_data_cb extra_data_cb;
-
-       if (key == NULL || !(type == BUNDLE_TYPE_STR || type == BUNDLE_TYPE_STR_ARRAY))
-               return;
-
-       foreach_context = (foreach_context_extra_data_t *)user_data;
-       if (foreach_context->foreach_break == true)
-               return;
-
-       if (app_control_validate_internal_key(key))
-               return;
-
-       extra_data_cb = foreach_context->callback;
-
-       if (extra_data_cb != NULL) {
-               bool stop_foreach = false;
-
-               stop_foreach = !extra_data_cb(foreach_context->app_control, key, foreach_context->user_data);
-
-               foreach_context->foreach_break = stop_foreach;
-       }
-}
-
-int app_control_foreach_extra_data(app_control_h app_control, app_control_extra_data_cb callback, void *user_data)
-{
-       foreach_context_extra_data_t foreach_context = {
-               .app_control = app_control,
-               .callback = callback,
-               .user_data = user_data,
-               .foreach_break = false
-       };
-
-       if (app_control_validate(app_control) || callback == NULL)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       bundle_foreach(app_control->data, app_control_cb_broker_bundle_iterator, &foreach_context);
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-typedef struct {
-       app_control_h app_control;
-       app_control_app_matched_cb callback;
-       void *user_data;
-       bool foreach_break;
-} foreach_context_launchable_app_t;
-
-/* LCOV_EXCL_START */
-int app_control_cb_broker_foreach_app_matched(const char *package, void *data)
-{
-       foreach_context_launchable_app_t *foreach_context;
-       app_control_app_matched_cb app_matched_cb;
-
-       if (package == NULL || data == NULL) {
-               app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-               return -1;
-       }
-
-       foreach_context = (foreach_context_launchable_app_t *)data;
-       if (foreach_context->foreach_break == true)
-               return -1;
-
-       app_matched_cb = foreach_context->callback;
-       if (app_matched_cb != NULL) {
-               bool stop_foreach = false;
-
-               stop_foreach = !app_matched_cb(foreach_context->app_control, package, foreach_context->user_data);
-
-               foreach_context->foreach_break = stop_foreach;
-       }
-
-       return 0;
-}
-/* LCOV_EXCL_STOP */
-
-int app_control_foreach_app_matched(app_control_h app_control, app_control_app_matched_cb callback, void *user_data)
-{
-       foreach_context_launchable_app_t foreach_context = {
-               .app_control = app_control,
-               .callback = callback,
-               .user_data = user_data,
-               .foreach_break = false
-       };
-
-       if (app_control_validate(app_control) || callback == NULL)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       aul_svc_get_list_for_uid(app_control->data, app_control_cb_broker_foreach_app_matched, &foreach_context, getuid());
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-int app_control_get_caller(app_control_h app_control, char **package)
-{
-       const char *bundle_value;
-       char *package_dup;
-
-       if (app_control_validate(app_control) || package == NULL)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       if (app_control->type != APP_CONTROL_TYPE_EVENT)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, "invalid app_control handle type");
-
-       bundle_value = bundle_get_val(app_control->data, AUL_K_CALLER_APPID);
-       if (bundle_value == NULL)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, "failed to retrieve the appid of the caller");
-
-       package_dup = strdup(bundle_value);
-       if (package_dup == NULL)
-               return app_control_error(APP_CONTROL_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
-
-       *package = package_dup;
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-int app_control_is_reply_requested(app_control_h app_control, bool *requested)
-{
-       const char *bundle_value;
-
-       if (app_control_validate(app_control) || requested == NULL)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       if (app_control->type != APP_CONTROL_TYPE_EVENT)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, "invalid app_control handle type");
-
-       bundle_value = bundle_get_val(app_control->data, AUL_K_WAIT_RESULT);
-       if (bundle_value != NULL)
-               *requested = true;
-       else
-               *requested = false;
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-int app_control_import_from_bundle(app_control_h app_control, bundle *data)
-{
-       bundle *data_dup = NULL;
-
-       if (app_control_validate(app_control) || data == NULL)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       data_dup = bundle_dup(data);
-       if (data_dup == NULL)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, "failed to duplicate the bundle");
-
-       if (app_control->data != NULL)
-               bundle_free(app_control->data);
-
-       app_control->data = data_dup;
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-int app_control_export_as_bundle(app_control_h app_control, bundle **data)
-{
-       bundle *data_dup = NULL;
-
-       if (app_control_validate(app_control) || data == NULL)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       data_dup = bundle_dup(app_control->data);
-       if (data_dup == NULL)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, "failed to duplicate the bundle");
-
-       *data = data_dup;
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-int app_control_request_transient_app(app_control_h app_control, unsigned int callee_id, app_control_host_res_fn cbfunc, void *data)
-{
-       int ret;
-
-       if (app_control_validate(app_control))
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       ret = aul_svc_request_transient_app(app_control->data, callee_id, (aul_svc_host_res_fn)cbfunc, data);
-       if (ret < 0)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-int app_control_enable_app_started_result_event(app_control_h app_control)
-{
-       int ret;
-
-       if (app_control_validate(app_control))
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       ret = aul_svc_subscribe_launch_result(app_control->data, AUL_SVC_K_LAUNCH_RESULT_APP_STARTED);
-       if (ret < 0)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-int app_control_set_instance_id(app_control_h app_control, const char *instance_id)
-{
-       int ret;
-
-       if (app_control_validate(app_control) || instance_id == NULL)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       ret = aul_svc_set_instance_id(app_control->data, instance_id);
-       if (ret < 0)
-               return app_control_error(APP_CONTROL_ERROR_OUT_OF_MEMORY, __FUNCTION__, "Out of memory");
-
-       return APP_CONTROL_ERROR_NONE;
-}
-
-int app_control_get_instance_id(app_control_h app_control, char **instance_id)
-{
-       const char *id;
-
-       if (app_control_validate(app_control) || instance_id == NULL)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
-       id = aul_svc_get_instance_id(app_control->data);
-       if (id == NULL)
-               return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, "Failed to get the instance id");
-
-       *instance_id = strdup(id);
-       if (*instance_id == NULL)
-               return app_control_error(APP_CONTROL_ERROR_OUT_OF_MEMORY, __FUNCTION__, "Failed to duplicate the instance id");
-
-       return APP_CONTROL_ERROR_NONE;
-}
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/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_control.h b/include/app_control.h
deleted file mode 100644 (file)
index 1ba1372..0000000
+++ /dev/null
@@ -1,1177 +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_CONTROL_H__
-#define __TIZEN_APPFW_APP_CONTROL_H__
-
-#include <tizen.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @file app_control.h
- */
-
-/**
- * @addtogroup CAPI_APP_CONTROL_MODULE
- * @{
- */
-
-
-typedef struct _bundle_t bundle;
-typedef unsigned char bundle_raw;
-
-/**
- * @brief App Control handle.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-typedef struct app_control_s *app_control_h;
-
-
-/**
- * @brief Enumeration for App Control Error.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-typedef enum {
-       APP_CONTROL_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
-       APP_CONTROL_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
-       APP_CONTROL_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
-       APP_CONTROL_ERROR_APP_NOT_FOUND = TIZEN_ERROR_APPLICATION | 0x21, /**< The application is not found */
-       APP_CONTROL_ERROR_KEY_NOT_FOUND = TIZEN_ERROR_KEY_NOT_AVAILABLE, /**< Specified key is not found */
-       APP_CONTROL_ERROR_KEY_REJECTED = TIZEN_ERROR_KEY_REJECTED, /**< Key is not available */
-       APP_CONTROL_ERROR_INVALID_DATA_TYPE = TIZEN_ERROR_APPLICATION | 0x22, /**< Invalid data type */
-       APP_CONTROL_ERROR_LAUNCH_REJECTED = TIZEN_ERROR_APPLICATION | 0x23, /**< The application cannot be launched now*/
-       APP_CONTROL_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED,    /**< Permission denied */
-       APP_CONTROL_ERROR_LAUNCH_FAILED = TIZEN_ERROR_APPLICATION | 0x24, /**< Internal launch error */
-       APP_CONTROL_ERROR_TIMED_OUT = TIZEN_ERROR_TIMED_OUT, /**< Time out */
-       APP_CONTROL_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR       /**< IO error */
-} app_control_error_e;
-
-
-/**
- * @brief Enumeration for App Control Result.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @see app_control_enable_app_started_result_event()
- */
-typedef enum {
-       APP_CONTROL_RESULT_APP_STARTED = 1, /**< Callee application launched actually (Since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif) */
-       APP_CONTROL_RESULT_SUCCEEDED = 0, /**< Operation succeeded */
-       APP_CONTROL_RESULT_FAILED = -1, /**< Operation failed by the callee */
-       APP_CONTROL_RESULT_CANCELED = -2, /**< Operation canceled by the platform */
-} app_control_result_e;
-
-
-/**
- * @brief Enumeration for App Control Launch Mode.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-typedef enum {
-       APP_CONTROL_LAUNCH_MODE_SINGLE = 0, /**< Prefer to launch an application as single mode */
-       APP_CONTROL_LAUNCH_MODE_GROUP, /**< Prefer to launch an application as group mode */
-} app_control_launch_mode_e;
-
-
-/**
- * @brief Definition for the app_control operation: An explicit launch for a homescreen application.
- * @details Input: Nothing\n
- *          Output: Nothing\n
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-#define APP_CONTROL_OPERATION_MAIN "http://tizen.org/appcontrol/operation/main"
-
-
-/**
- * @brief Definition for the app_control operation: An explicit launch for an application that excludes a homescreen application.
- * @details Input: Nothing\n
- *          Output: Nothing\n
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-#define APP_CONTROL_OPERATION_DEFAULT "http://tizen.org/appcontrol/operation/default"
-
-
-/**
- * @brief Definition for the app_control operation: Provides an editable access to the given data.
- * @details Input: It depends on application scenario/configuration.\n
- *             Output: It depends on application scenario/configuration.\n
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-#define APP_CONTROL_OPERATION_EDIT "http://tizen.org/appcontrol/operation/edit"
-
-
-/**
- * @brief Definition for the app_control operation: Displays the data.
- * @details Input: URI is usually used to inform the path to show. In some cases, some other data in Extra can be used (e.g., VIEW operation for viewing Contact, Calendar data).\n
- *             Output: Nothing\n
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-#define APP_CONTROL_OPERATION_VIEW "http://tizen.org/appcontrol/operation/view"
-
-
-/**
- * @brief Definition for the app_control operation: Picks item.
- * @details Input: It depends on application scenario/configuration.\n
- *                     Output: APP_CONTROL_DATA_SELECTED in Extra\n
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-#define APP_CONTROL_OPERATION_PICK "http://tizen.org/appcontrol/operation/pick"
-
-
-/**
- * @brief Definition for the app_control operation: Creates contents.
- * @details Input: It depends on application scenario/configuration.\n
- *             Output: APP_CONTROL_DATA_SELECTED in Extra\n
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-#define APP_CONTROL_OPERATION_CREATE_CONTENT "http://tizen.org/appcontrol/operation/create_content"
-
-
-/**
- * @brief Definition for the app_control operation: Performs a call to someone.
- * @details Input: URI is the number to be dialed. This is a mandatory field.\n
- *          Output: Nothing\n
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @privlevel public
- * @privilege %http://tizen.org/privilege/call
- * @remarks When you request this operation, you must declare this privilege.
- */
-#define APP_CONTROL_OPERATION_CALL "http://tizen.org/appcontrol/operation/call"
-
-
-/**
- * @brief Definition for the app_control operation: Delivers some data to someone else.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @deprecated Deprecated since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif. Use #APP_CONTROL_OPERATION_SHARE instead.
- */
-#define APP_CONTROL_OPERATION_SEND "http://tizen.org/appcontrol/operation/send"
-
-
-/**
- * @brief Definition for the app_control operation: Delivers text data to someone else.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @deprecated Deprecated since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif. Use #APP_CONTROL_OPERATION_SHARE_TEXT instead.
- */
-#define APP_CONTROL_OPERATION_SEND_TEXT "http://tizen.org/appcontrol/operation/send_text"
-
-
-/**
- * @brief Definition for the app_control operation: Shares an item with someone else.
- * @details Input: URI is usually used to inform the path to share. In some cases, some other data in Extra can be used (e.g., SHARE operation for sharing Contact data, SHARE operation for sharing an item through Message, Email applications).\n
- *         Output: Nothing\n
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-#define APP_CONTROL_OPERATION_SHARE "http://tizen.org/appcontrol/operation/share"
-
-
-/**
- * @brief Definition for the app_control operation: Shares multiple items with someone else.
- * @details Input: APP_CONTROL_DATA_PATH in Extra is usually used to inform the data to share. In some cases, some other data in Extra can be used (e.g., MULTI_SHARE opeation for sharing Contact data).\n
- *          Output: Nothing\n
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-#define APP_CONTROL_OPERATION_MULTI_SHARE "http://tizen.org/appcontrol/operation/multi_share"
-
-
-/**
- * @brief Definition for the app_control operation: Shares text data with someone else.
- * @details Input: APP_CONTROL_DATA_TEXT in Extra is the text to share\n
- *          Output: Nothing\n
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-#define APP_CONTROL_OPERATION_SHARE_TEXT "http://tizen.org/appcontrol/operation/share_text"
-
-
-/**
- * @brief Definition for the app_control operation: Dials a number. This shows a UI with the number to be dialed, allowing the user to explicitly initiate the call.
- * @details Input: URI is the number to be dialed. If empty, show a UI without number.\n
- *          Output: Nothing\n
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-#define APP_CONTROL_OPERATION_DIAL "http://tizen.org/appcontrol/operation/dial"
-
-
-/**
- * @brief Definition for the app_control operation: Performs a search.
- * @details Input: APP_CONTROL_DATA_TEXT in Extra is the text to search for. If empty, show a search UI.\n
- *          Output: Nothing\n
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-#define APP_CONTROL_OPERATION_SEARCH "http://tizen.org/appcontrol/operation/search"
-
-
-/**
- * @brief Definition for the app_control operation: Downloads item.
- * @details Input: It depends on application scenario/configuration.\n
- *             Output: It depends on application scenario/configuration.\n
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @privlevel public
- * @privilege %http://tizen.org/privilege/download (Since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif)
- * @remarks When you request this operation, you must declare this privilege. (Since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif)
- */
-#define APP_CONTROL_OPERATION_DOWNLOAD "http://tizen.org/appcontrol/operation/download"
-
-
-/**
- * @brief Definition for the app_control operation: Prints content.
- * @details Input: It depends on application scenario/configuration.\n
- *             Output: It depends on application scenario/configuration.\n
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-#define APP_CONTROL_OPERATION_PRINT "http://tizen.org/appcontrol/operation/print"
-
-
-/**
- * @brief Definition for the app_control operation: Composes a message.
- * @details Input: It depends on application scenario/configuration.\n
- *          Output: Nothing\n
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-#define APP_CONTROL_OPERATION_COMPOSE "http://tizen.org/appcontrol/operation/compose"
-
-
-/**
- * @brief Definition for the app_control operation: Can be launched by interested System-Event.
- * @details Input : URI and extras data defined in Event module.\n
- *          Output: Nothing\n
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @remarks This operation is for handling event from the platform. This operation cannot be requested through app_control_send_launch_request().
- * @remarks Refer to Launch-On-Event section of Event module.
- */
-#define APP_CONTROL_OPERATION_LAUNCH_ON_EVENT "http://tizen.org/appcontrol/operation/launch_on_event"
-
-
-/**
- * @brief Definition for the app_control operation: Adds an item.
- * @details Input: It depends on application scenario/configuration.\n
- *          Output: It depends on application scenario/configuration.\n
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define APP_CONTROL_OPERATION_ADD "http://tizen.org/appcontrol/operation/add"
-
-
-/**
- * @brief Definition for the app_control operation: Captures images by camera applications.
- * @details Input: Nothing\n
- *         Output: APP_CONTROL_DATA_SELECTED in Extra\n
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define APP_CONTROL_OPERATION_IMAGE_CAPTURE "http://tizen.org/appcontrol/operation/image_capture"
-
-
-/**
- * @brief Definition for the app_control operation: Captures videos by camera applications.
- * @details Input: Nothing\n
- *             Output: APP_CONTROL_DATA_SELECTED in Extra\n
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define APP_CONTROL_OPERATION_VIDEO_CAPTURE "http://tizen.org/appcontrol/operation/video_capture"
-
-
-/**
- * @brief Definition for the app_control operation: Shows settings to enable Bluetooth.
- * @details Input: Nothing\n
- *          Output: Nothing\n
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define APP_CONTROL_OPERATION_SETTING_BT_ENABLE "http://tizen.org/appcontrol/operation/setting/bt_enable"
-
-
-/**
- * @brief Definition for the app_control operation: Shows settings to configure Bluetooth visibility.
- * @details Input: Nothing\n
- *          Output: Nothing\n
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define APP_CONTROL_OPERATION_SETTING_BT_VISIBILITY "http://tizen.org/appcontrol/operation/setting/bt_visibility"
-
-
-/**
- * @brief Definition for the app_control operation: Shows settings to allow configuration of current location sources.
- * @details Input: Nothing\n
- *          Output: Nothing\n
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define APP_CONTROL_OPERATION_SETTING_LOCATION "http://tizen.org/appcontrol/operation/setting/location"
-
-
-/**
- * @brief Definition for the app_control operation: Shows NFC settings.
- * @details Input: APP_CONTROL_DATA_TYPE in Extra (Since 3.0).\n
- *          Output: Nothing\n
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @remarks Prior to Tizen 3.0, no input value was needed.
- */
-#define APP_CONTROL_OPERATION_SETTING_NFC "http://tizen.org/appcontrol/operation/setting/nfc"
-
-
-/**
- * @brief Definition for the app_control operation: Shows system settings.
- * @details Input: Nothing\n
- *          Output: Nothing\n
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define APP_CONTROL_OPERATION_SETTING "http://tizen.org/appcontrol/operation/setting"
-
-
-/**
- * @brief Definition for the app_control operation: Shows settings to allow configuration of Wi-Fi.
- * @details Input: Nothing\n
- *          Output: Nothing\n
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define APP_CONTROL_OPERATION_SETTING_WIFI "http://tizen.org/appcontrol/operation/setting/wifi"
-
-
-/**
- * @brief Definition for the app control operation: Shows VPN service settings.
- * @details Input: Nothing\n
- *          Output: Nothing\n
- * @since_tizen 3.0
- */
-#define APP_CONTROL_OPERATION_SETTING_VPN "http://tizen.org/appcontrol/operation/setting/vpn"
-
-
-/**
- * @brief Definition for the app control operation: Select the type of input method to receive input from user.
- * @details Input: It depends on application scenario/configuration.\n
- *          Output: APP_CONTROL_DATA_TEXT in Extra.\n
- * @since_tizen @if WEARABLE 2.3.2 @elseif MOBILE 3.0 @endif
- */
-#define APP_CONTROL_OPERATION_GET_INPUT "http://tizen.org/appcontrol/operation/get_input"
-
-
-/**
- * @brief Definition for app_control data: Subject
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-#define APP_CONTROL_DATA_SUBJECT "http://tizen.org/appcontrol/data/subject"
-
-
-/**
- * @brief Definition for app_control data: Recipients
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-#define APP_CONTROL_DATA_TO "http://tizen.org/appcontrol/data/to"
-
-
-/**
- * @brief Definition for app_control data: E-mail addresses that should be carbon copied.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-#define APP_CONTROL_DATA_CC "http://tizen.org/appcontrol/data/cc"
-
-
-/**
- * @brief Definition for app_control data: E-mail addresses that should be blind carbon copied.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-#define APP_CONTROL_DATA_BCC "http://tizen.org/appcontrol/data/bcc"
-
-
-/**
- * @brief Definition for app_control data: Text
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-#define APP_CONTROL_DATA_TEXT "http://tizen.org/appcontrol/data/text"
-
-
-/**
- * @brief Definition for app_control data: Title
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-#define APP_CONTROL_DATA_TITLE "http://tizen.org/appcontrol/data/title"
-
-
-/**
- * @brief Definition for app_control data: Selected items
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks Since Tizen 3.0, if all added paths with this key are under the caller application's data path which can be obtained by calling app_get_data_path() function, those will be shared to the callee application. Framework will grant a temporary permission to the callee application for those files and revoke it when the callee application is terminated. Paths should be regular files. The callee application can just read them. Note that the callee application doesn't have read permission of the directory that is obtained by caller's app_get_data_path(), you should open the file path with read only mode directly. For example, access() call to the file path will return error because access() needs the read permission of the directory. The callee application can call open() with O_RDONLY mode for the passed file path, because framework grants read permission to the passed file path.
- */
-#define APP_CONTROL_DATA_SELECTED "http://tizen.org/appcontrol/data/selected"
-
-
-/**
- * @brief Definition for app_control data: Paths of items
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks Since Tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif, if all added paths with this key are under the caller application's data path which can be obtained by calling app_get_data_path() function, those will be shared to the callee application. Framework will grant a temporary permission to the callee application for those files and revoke it when the callee application is terminated. Paths should be regular files. The callee application can just read them. Note that the callee application doesn't have read permission of the directory that is obtained by caller's app_get_data_path(), you should open the file path with read only mode directly. For example, access() call to the file path will return error because access() needs the read permission of the directory. The callee application can call open() with O_RDONLY mode for the passed file path, because framework grants read permission to the passed file path.
- */
-#define APP_CONTROL_DATA_PATH "http://tizen.org/appcontrol/data/path"
-
-
-/**
- * @brief Definition for app_control data: Selection mode ("single" or "multiple")
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-#define APP_CONTROL_DATA_SELECTION_MODE "http://tizen.org/appcontrol/data/selection_mode"
-
-
-/**
- * @brief Definition for app_control data: All-day mode of event ("true" or "false")
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define APP_CONTROL_DATA_CALENDAR_ALL_DAY "http://tizen.org/appcontrol/data/calendar/all_day"
-
-
-/**
- * @brief Definition for app_control data: Start time of event (format: YYYY-MM-DD HH:MM:SS)
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define APP_CONTROL_DATA_CALENDAR_START_TIME "http://tizen.org/appcontrol/data/calendar/start_time"
-
-
-/**
- * @brief Definition for app_control data: End time of event (format: YYYY-MM-DD HH:MM:SS)
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define APP_CONTROL_DATA_CALENDAR_END_TIME "http://tizen.org/appcontrol/data/calendar/end_time"
-
-
-/**
- * @brief Definition for app_control data: E-mail addresses
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define APP_CONTROL_DATA_EMAIL "http://tizen.org/appcontrol/data/email"
-
-
-/**
- * @brief Definition for app_control data: Phone numbers
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define APP_CONTROL_DATA_PHONE "http://tizen.org/appcontrol/data/phone"
-
-
-/**
- * @brief Definition for app_control data: URLs
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define APP_CONTROL_DATA_URL "http://tizen.org/appcontrol/data/url"
-
-
-/**
- * @brief Definition for app_control data: IDs
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define APP_CONTROL_DATA_ID "http://tizen.org/appcontrol/data/id"
-
-
-/**
- * @brief Definition for app_control data: Type
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 2.3.2 @endif
- */
-#define APP_CONTROL_DATA_TYPE "http://tizen.org/appcontrol/data/type"
-
-
-/**
- * @brief Definition for app_control data: Total count
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define APP_CONTROL_DATA_TOTAL_COUNT "http://tizen.org/appcontrol/data/total_count"
-
-
-/**
- * @brief Definition for app_control data: Total size (unit : bytes)
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define APP_CONTROL_DATA_TOTAL_SIZE "http://tizen.org/appcontrol/data/total_size"
-
-
-/**
- * @brief Definition for app_control data: Name
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define APP_CONTROL_DATA_NAME "http://tizen.org/appcontrol/data/name"
-
-
-/**
- * @brief Definition for app_control data: Location
- * @since_tizen 3.0
- */
-#define APP_CONTROL_DATA_LOCATION "http://tizen.org/appcontrol/data/location"
-
-
-/**
- * @brief Definition for app_control data: Select the type of input method.
- * @details Type: "input_voice"       Launch input method with voice type.
- *                "input_emoticon"    Launch input method with emoticon type.
- *                "input_keyboard"    Launch input method with keyboard type.
- * @since_tizen @if WEARABLE 2.3.2 @elseif MOBILE 3.0 @endif
- */
-#define APP_CONTROL_DATA_INPUT_TYPE "http://tizen.org/appcontrol/data/input_type"
-
-
-/**
- * @brief Definition for app_control data: Send the pre input text such as "http://" in web.
- * @since_tizen @if WEARABLE 2.3.2 @elseif MOBILE 3.0 @endif
- */
-#define APP_CONTROL_DATA_INPUT_DEFAULT_TEXT "http://tizen.org/appcontrol/data/input_default_text"
-
-
-/**
- * @brief Definition for app_control data: Send guide text to show the user such as "Input user name".
- * @since_tizen @if WEARABLE 2.3.2 @elseif MOBILE 3.0 @endif
- */
-#define APP_CONTROL_DATA_INPUT_GUIDE_TEXT "http://tizen.org/appcontrol/data/input_guide_text"
-
-
-/**
- * @brief Definition for app_control data: Send text to receive the result from smart reply.
- * @since_tizen @if WEARABLE 2.3.2 @elseif MOBILE 3.0 @endif
- */
-#define APP_CONTROL_DATA_INPUT_PREDICTION_HINT "http://tizen.org/appcontrol/data/input_prediction_hint"
-
-
-/**
- * @brief Definition for app_control data: Send widget instance id to widget setup app.
- * @details The value is the id of the widget instance.
- * @since_tizen 4.0
- */
-#define APP_CONTROL_DATA_WIDGET_INSTANCE_ID "http://tizen.org/appcontrol/data/widget_instance_id"
-
-
-/**
- * @brief Definition for app_control data: Send widget content to widget setup app.
- * @details The value is the content info of the widget instance.
- * @since_tizen 4.0
- */
-#define APP_CONTROL_DATA_WIDGET_CONTENT "http://tizen.org/appcontrol/data/widget_content"
-
-
-/**
- * @brief Definition for app_control data: Send widget appid to widget setup app.
- * @details The value is the appid declared in the widget application manifest file.
- * @since_tizen 4.0
- */
-#define APP_CONTROL_DATA_WIDGET_APP_ID "http://tizen.org/appcontrol/data/widget_app_id"
-
-
-/**
- * @brief Called when the reply of the launch request is delivered.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks The @a request and @a reply must not be deallocated by the application.
- * @param[in] request The app_control handle of the launch request that has been sent
- * @param[in] reply The app_control handle in which the results of the callee are contained
- * @param[in] result The result code of the launch request
- * @param[in] user_data        The user data passed from the callback registration function
- * @pre When the callee replies to the launch request, this callback will be invoked.
- * @pre Since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif, if #APP_CONTROL_RESULT_APP_STARTED event is enabled,
- *            this callback will also be invoked when the callee app actually launched.
- * @see app_control_send_launch_request()
- * @see app_control_reply_to_launch_request()
- * @see app_control_enable_app_started_result_event()
- * @see #APP_CONTROL_RESULT_APP_STARTED
- */
-typedef void (*app_control_reply_cb) (app_control_h request, app_control_h reply, app_control_result_e result, void *user_data);
-
-
-/**
- * @brief Called to retrieve the extra data contained in the app_control.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks The @a key must not be deallocated by the application.
- * @param[in] app_control  The app_control handle
- * @param[in] key The key of the value contained in the app_control
- * @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        app_control_foreach_extra_data() will invoke this callback.
- * @see        app_control_foreach_extra_data()
- */
-typedef bool (*app_control_extra_data_cb)(app_control_h app_control, const char *key, void *user_data);
-
-
-/**
- * @brief Called once for each matched application that can be launched to handle the given app_control request.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] app_control  The app_control handle
- * @param[in] package The package name of the application that can handle the launch request of the given app_control
- * @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        app_control_foreach_app_matched() will invoke this callback.
- * @see app_control_foreach_app_matched()
- */
-typedef bool (*app_control_app_matched_cb)(app_control_h app_control, const char *appid, void *user_data);
-
-
-typedef int (*app_control_host_res_fn)(void *data);
-
-/**
- * @brief Creates an app_control handle.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks The @a app_control must be released using app_control_destroy().
- * @param[out] app_control The app_control handle to be newly created on success
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
- * @see        app_control_destroy()
- */
-int app_control_create(app_control_h *app_control);
-
-
-/**
- * @brief Destroys the app_control handle and releases all its resources.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] app_control The app_control handle
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
- * @see        app_control_create()
- */
-int app_control_destroy(app_control_h app_control);
-
-
-/**
- * @brief Sets the operation to be performed.
- *
- * @details The @a operation is the mandatory information for the launch request.
- *          If the operation is not specified, #APP_CONTROL_OPERATION_DEFAULT is used for the launch request.
- *          If the operation is #APP_CONTROL_OPERATION_DEFAULT, the package information is mandatory to explicitly launch the application.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] app_control The app_control handle
- * @param[in] operation The operation to be performed (if the @a operation is @c NULL, it clears the previous value)
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @see app_control_get_operation()
- * @see APP_CONTROL_OPERATION_DEFAULT
- * @see APP_CONTROL_OPERATION_EDIT
- * @see APP_CONTROL_OPERATION_VIEW
- * @see APP_CONTROL_OPERATION_PICK
- * @see APP_CONTROL_OPERATION_CREATE_CONTENT
- * @see APP_CONTROL_OPERATION_CALL
- * @see APP_CONTROL_OPERATION_SEND
- * @see APP_CONTROL_OPERATION_SEND_TEXT
- * @see APP_CONTROL_OPERATION_DIAL
- * @see APP_CONTROL_OPERATION_SEARCH
- */
-int app_control_set_operation(app_control_h app_control, const char *operation);
-
-
-/**
- * @brief Gets the operation to be performed.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks The @a operation must be released using free().
- * @param[in] app_control The app_control handle
- * @param[out] operation The operation to be performed
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
- * @see        app_control_set_operation()
- */
-int app_control_get_operation(app_control_h app_control, char **operation);
-
-
-/**
- * @brief Sets the URI of the data.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks Since Tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif, if the parameter 'uri' is started with 'file://' and it is a regular file in this application's data path which can be obtained by calling app_get_data_path() function, it will be shared to the callee application. Framework will grant a temporary permission to the callee application for this file and revoke it when the callee application is terminated. The callee application can just read it.
- * @param[in] app_control The app_control handle
- * @param[in] uri The URI of the data this app_control is operating on (if the @a uri is @c NULL, it clears the previous value)
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @see        app_control_get_uri()
- */
-int app_control_set_uri(app_control_h app_control, const char *uri);
-
-
-/**
- * @brief Gets the URI of the data.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks The @a uri must be released using free().
- * @param[in] app_control The app_control handle
- * @param[out] uri The URI of the data this app_control is operating on
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
- * @see        app_control_set_uri()
- */
-int app_control_get_uri(app_control_h app_control, char **uri);
-
-
-/**
- * @brief Sets the explicit MIME type of the data.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] app_control The app_control handle
- * @param[in] mime The explicit MIME type of the data this app_control is operating on (if the @a mime is @c NULL, it clears the previous value)
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @see        app_control_get_mime()
- */
-int app_control_set_mime(app_control_h app_control, const char *mime);
-
-
-/**
- * @brief Gets the explicit MIME type of the data.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks The @a uri must be released using free().
- * @param[in] app_control The app_control handle
- * @param[out] mime The explicit MIME type of the data this app_control is operating on
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
- * @see        app_control_set_mime()
- */
-int app_control_get_mime(app_control_h app_control, char **mime);
-
-
-/**
- * @brief Sets the explicit category.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] app_control The app_control handle
- * @param[in] category The explicit category (if the @a category is @c NULL, it clears the previous value)
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @see        app_control_get_category()
- */
-int app_control_set_category(app_control_h app_control, const char *category);
-
-
-/**
- * @brief Gets the explicit category.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks The @a category must be released using free().
- * @param[in] app_control The app_control handle
- * @param[out] category The explicit category
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
- * @see        app_control_set_category()
- */
-int app_control_get_category(app_control_h app_control, char **category);
-
-
-/**
- * @brief Sets the ID of the application to explicitly launch.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] app_control The app_control handle
- * @param[in] app_id The ID of the application to explicitly launch (if the @a app_id is @c NULL, it clears the previous value)
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
- * @see        app_control_get_app_id()
- */
-int app_control_set_app_id(app_control_h app_control, const char *app_id);
-
-
-/**
- * @brief Gets the ID of the application to explicitly launch.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks The @a app_id must be released with free().
- * @param[in] app_control The app_control handle
- * @param[out] app_id The ID of the application to explicitly launch
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
- * @see        app_control_set_app_id()
- */
-int app_control_get_app_id(app_control_h app_control, char **app_id);
-
-/**
- * @brief Adds extra data to the app_control.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks The function replaces any existing value for the given key.
- * @remarks The function returns #APP_CONTROL_ERROR_INVALID_PARAMETER if @a key or @a value is a zero-length string.
- * @remarks The function returns #APP_CONTROL_ERROR_KEY_REJECTED if the application tries to use the same key with system-defined key.
- * @param[in] app_control The app_control handle
- * @param[in] key The name of the extra data
- * @param[in] value The value associated with the given key
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_CONTROL_ERROR_KEY_REJECTED Key not available
- * @see app_control_add_extra_data_array()
- * @see app_control_remove_extra_data()
- * @see app_control_get_extra_data()
- */
-int app_control_add_extra_data(app_control_h app_control, const char *key, const char *value);
-
-
-/**
- * @brief Adds the extra data array to the app_control.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks The function replaces any existing value for the given key.
- * @remarks The function returns #APP_CONTROL_ERROR_INVALID_PARAMETER if @a key is a zero-length string.
- * @remarks The function returns #APP_CONTROL_ERROR_KEY_REJECTED if the application tries to use the same key with system-defined key.
- * @param[in] app_control The app_control handle
- * @param[in] key The name of the extra data
- * @param[in] value The array value associated with the given key
- * @param[in] length The length of the array
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_CONTROL_ERROR_KEY_REJECTED Key not available
- * @see app_control_add_extra_data()
- * @see app_control_remove_extra_data()
- * @see app_control_get_extra_data()
- */
-int app_control_add_extra_data_array(app_control_h app_control, const char *key, const char* value[], int length);
-
-
-/**
- * @brief Removes the extra data from the app_control.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] app_control The app_control handle
- * @param[in] key The name of the extra data
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_CONTROL_ERROR_KEY_NOT_FOUND Specified key not found
- * @retval #APP_CONTROL_ERROR_KEY_REJECTED Key not available
- * @see app_control_add_extra_data()
- * @see app_control_add_extra_data_array()
- * @see app_control_get_extra_data()
- */
-int app_control_remove_extra_data(app_control_h app_control, const char *key);
-
-
-/**
- * @brief Gets the extra data from the app_control.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks The @a value must be released using free().
- * @remarks The function returns #APP_CONTROL_ERROR_INVALID_DATA_TYPE if @a value is of array data type.
- * @param[in] app_control The app_control handle
- * @param[in] key The name of the extra data
- * @param[out] value The value associated with the given key
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_CONTROL_ERROR_KEY_NOT_FOUND Specified key not found
- * @retval #APP_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #APP_CONTROL_ERROR_INVALID_DATA_TYPE Invalid data type
- * @retval #APP_CONTROL_ERROR_KEY_REJECTED Key not available
- * @see app_control_add_extra_data()
- * @see app_control_add_extra_data_array()
- * @see app_control_get_extra_data()
- * @see app_control_remove_extra_data()
- * @see app_control_foreach_extra_data()
- */
-int app_control_get_extra_data(app_control_h app_control, const char *key, char **value);
-
-
-/**
- * @brief Gets the extra data array from the app_control.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks The @a value must be released using free().
- * @remarks The function returns #APP_CONTROL_ERROR_INVALID_DATA_TYPE if @a value is not of array data type.
- * @param[in] app_control The app_control handle
- * @param[in] key The name of the extra data
- * @param[out] value The array value associated with the given key
- * @param[out] length The length of the array
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_CONTROL_ERROR_KEY_NOT_FOUND Specified key not found
- * @retval #APP_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #APP_CONTROL_ERROR_INVALID_DATA_TYPE Invalid data type
- * @retval #APP_CONTROL_ERROR_KEY_REJECTED Key not available
- * @see app_control_add_extra_data()
- * @see app_control_add_extra_data_array()
- * @see app_control_remove_extra_data()
- * @see app_control_foreach_extra_data()
- */
-int app_control_get_extra_data_array(app_control_h app_control, const char *key, char ***value, int *length);
-
-
-/**
- * @brief Checks whether the extra data associated with the given @a key is of array data type.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] app_control The app_control handle
- * @param[in] key The name of the extra data
- * @param[out] array If @c true the extra data is of array data type,
- *                   otherwise @c false
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @see app_control_add_extra_data()
- * @see app_control_add_extra_data_array()
- * @see app_control_remove_extra_data()
- * @see app_control_foreach_extra_data()
- */
-int app_control_is_extra_data_array(app_control_h app_control, const char *key, bool *array);
-
-
-/**
- * @brief Retrieves all extra data contained in app_control.
- * @details This function calls app_control_extra_data_cb() once for each key-value pair for extra data contained in app_control. \n
- *          If the app_control_extra_data_cb() callback function returns @c false, then iteration will be finished.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] app_control The app_control handle
- * @param[in] callback The iteration callback function
- * @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 #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @post This function invokes app_control_extra_data_cb().
- * @see app_control_extra_data_cb()
- */
-int app_control_foreach_extra_data(app_control_h app_control, app_control_extra_data_cb callback, void *user_data);
-
-
-/**
- * @brief Retrieves all applications that can be launched to handle the given app_control request.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] app_control The app_control handle
- * @param[in] callback The iteration callback function
- * @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 #APP_CONTROL_ERROR_NONE Success
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @post This function invokes app_control_app_matched_cb().
- * @see app_control_app_matched_cb()
- */
-int app_control_foreach_app_matched(app_control_h app_control, app_control_app_matched_cb callback, void *user_data);
-
-
-/**
- * @brief Sends the launch request.
- *
- * @details The operation is mandatory information for the launch request. \n
- *          If the operation is not specified, #APP_CONTROL_OPERATION_DEFAULT is used by default.
- *          If the operation is #APP_CONTROL_OPERATION_DEFAULT, the application ID is mandatory to explicitly launch the application.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @privlevel  public
- * @privilege  %http://tizen.org/privilege/appmanager.launch
- * @remarks The function returns #APP_CONTROL_ERROR_LAUNCH_REJECTED if the operation value is #APP_CONTROL_OPERATION_LAUNCH_ON_EVENT which is only for handling the event from the platform or other application, refer to @a Event module.
- * @remarks Since Tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif, the launch request of the service application over out of packages is restricted by the platform. Also, implicit launch requests are NOT delivered to service applications since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif. To launch a service application, an explicit launch request with application ID given by app_control_set_app_id() MUST be sent.
- * @param[in] app_control The app_control handle
- * @param[in] callback The callback function to be called when the reply is delivered
- * @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 #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #APP_CONTROL_ERROR_APP_NOT_FOUND The application to run the given launch request is not found
- * @retval #APP_CONTROL_ERROR_LAUNCH_REJECTED The application cannot be launched in current context
- * @retval #APP_CONTROL_ERROR_LAUNCH_FAILED Failed to launch the application
- * @retval #APP_CONTROL_ERROR_TIMED_OUT Failed due to timeout. The application that handles @a app_control may be busy
- * @retval #APP_CONTROL_ERROR_PERMISSION_DENIED Permission denied
- * @post If the launch request is sent for the result, the result will come back through app_control_reply_cb() from the callee application. Additional replies may be delivered on app_control_enable_app_started_result_event() called.
- * @see app_control_reply_to_launch_request()
- * @see app_control_reply_cb()
- * @see app_control_enable_app_started_result_event()
- */
-int app_control_send_launch_request(app_control_h app_control, app_control_reply_cb callback, void *user_data);
-
-
-/**
- * @brief Sends the terminate request to the application that is launched by app_control. This API is only effective for some applications that are provided by default for handling platform default app_controls. You are not allowed to terminate other general applications using this API.
- *
- * @remarks Since Tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif, this API can be used to terminate sub-applications which were launched as group mode by caller application.
- *          Once callee application is being terminated by this API, other applications which were launched by callee application as group mode will be terminated as well.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] app_control The app_control handle
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_CONTROL_ERROR_PERMISSION_DENIED Permission denied
- * @see app_control_send_launch_request()
- * @see app_control_set_launch_mode()
- */
-int app_control_send_terminate_request(app_control_h app_control);
-
-
-/**
- * @brief Replies to the launch request sent by the caller.
- * @details If the caller application sent the launch request to receive the result, the callee application can return the result back to the caller.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks The function is not allowed to send reply #APP_CONTROL_RESULT_APP_STARTED as @a result which is reserved for platform developers.
- * @param[in] reply The app_control handle in which the results of the callee are contained
- * @param[in] request The app_control handle sent by the caller
- * @param[in] result  The result code of the launch request
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
- * @see app_control_send_launch_request()
- */
-int app_control_reply_to_launch_request(app_control_h reply, app_control_h request, app_control_result_e result);
-
-
-/**
- * @brief Creates and returns a copy of the given app_control handle.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks A newly created app_control should be destroyed by calling app_control_destroy() if it is no longer needed.
- *
- * @param[out] clone If successful, a newly created app_control handle will be returned
- * @param[in] app_control The app_control handle
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
- * @see        app_control_destroy()
- */
-int app_control_clone(app_control_h *clone, app_control_h app_control);
-
-
-/**
- * @brief Gets the application ID of the caller from the launch request.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks The @a app_control must be the launch request from app_control_cb().
- * @remarks This function returns #APP_CONTROL_ERROR_INVALID_PARAMETER if the given app_control is not the launch request.
- * @remarks The @a id must be released using free().
- * @param[in] app_control The app_control handle from app_control_cb()
- * @param[out] id The application ID of the caller
- * @return @a 0 on success,
- *         otherwise a negative error value
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
- */
-int app_control_get_caller(app_control_h app_control, char **id);
-
-
-/**
- * @brief Checks whether the caller is requesting a reply from the launch request.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks The @a app_control must be the launch request from app_control_cb().
- * @remarks This function returns #APP_CONTROL_ERROR_INVALID_PARAMETER if the given app_control is not the launch request.
- * @param[in] app_control The app_control handle from app_control_cb()
- * @param[out] requested If @c true a reply is requested by the caller,
- *                       otherwise @c false
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
- */
-int app_control_is_reply_requested(app_control_h app_control, bool *requested);
-
-/**
- * @brief Sets the launch mode of the application.
- *
- * @details This function allows callee application to be launched as group or single mode.
- * @remarks Although launch_mode were set as #APP_CONTROL_LAUNCH_MODE_GROUP, callee application would be launched as single mode if the manifest file of callee application defined the launch mode as "single".
- *          This function can just set the preference of caller application to launch an application.
- * @remarks Sub-applications which were launched as group mode always have own process.
- *
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @param[in] app_control The app_control handle
- * @param[in] mode The launch mode of app
- * @return 0 on success, otherwise a negative error value
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @see app_control_set_launch_mode()
- * @see app_control_launch_mode_e
- */
-int app_control_set_launch_mode(app_control_h app_control,
-               app_control_launch_mode_e mode);
-
-/**
- * @brief Gets the launch mode of the application.
- *
- * @remarks Since Tizen 3.0, if launch mode not set in the caller app control,
- *     the function returns #APP_CONTROL_LAUNCH_MODE_SINGLE launch mode.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @param[in] app_control The app_control handle
- * @param[out] mode The launch mode of app
- * @return 0 on success, otherwise a negative error value
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @see        app_control_get_launch_mode()
- * @see app_control_launch_mode_e
- */
-int app_control_get_launch_mode(app_control_h app_control,
-               app_control_launch_mode_e *mode);
-
-/**
- * @brief Enables additional launch result event on launch request.
- *
- * @details The function allows to receive #APP_CONTROL_RESULT_APP_STARTED event on\n
- *         application get launched by app_control.
- * @remarks app_control_reply_cb() will be called on APP_CONTROL_RESULT_APP_STARTED event received.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- * @param[in] app_control The app_control handle
- * @return 0 on success, otherwise a negative error value
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @see app_control_send_launch_request()
- * @see #APP_CONTROL_RESULT_APP_STARTED
- */
-int app_control_enable_app_started_result_event(app_control_h app_control);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __TIZEN_APPFW_APP_CONTROL_H__ */
-
diff --git a/include/app_control_internal.h b/include/app_control_internal.h
deleted file mode 100644 (file)
index afd8399..0000000
+++ /dev/null
@@ -1,242 +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_CONTROL_INTERNAL_H__
-#define __TIZEN_APPFW_APP_CONTROL_INTERNAL_H__
-
-#include <bundle.h>
-
-#include <app_control.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @file app_control_internal.h
- */
-
-/**
- * @addtogroup CAPI_APP_CONTROL_MODULE
- * @{
- */
-
-/**
- * @brief Definition for app_control data: Connect the previous app with the next app when the sub-app is terminated.
- * @details If a sub-app is terminated, framework will connect the previous app with the next app.
- *          By default, this flag is 'false'
- */
-#define APP_CONTROL_DATA_REROUTE "__K_REROUTE__"
-
-/**
- * @brief Definition for app_control data: The flag for attaching app.
- * @details If this flag is set, callee app will be attached to caller app for a while and it will be detached when callee app is lowered.
- *          By default, this flag is 'false'
- */
-#define APP_CONTROL_DATA_SHIFT_WINDOW "__K_SHIFT_WINDOW"
-
-/**
- * @brief Definition for app_control data : The flag for supporting recycling processes.
- * @details By default, this flag is 'false'. Once it is set to 'true', launched sub-app process will be reused even if it was lowered later.
- *
- */
-#define APP_CONTROL_DATA_RECYCLE "__K_RECYCLE"
-
-/**
- * @brief Definition for app_control data : The value for supporting relocating launched app under the callee app.
- * @details By default, this value is NULL. Once it is set to app ID, that application will be relocated under the callee app after callee app is resumed.
- * @remarks The value should be an app ID for main app which has been launched before, otherwise it will be ignored.
- */
-#define APP_CONTROL_DATA_RELOCATE_BELOW "__K_RELOCATE_BELOW"
-
-/**
- * @brief Definition for app_control data: The value for supporting background launch mode.
- * @details By default, this flag is 'disable'. Once it is set to 'enable', A window of callee app doesn't appear on the screen.
- */
-#define APP_CONTROL_DATA_BACKGROUND_LAUNCH "__K_BG_LAUNCH"
-
-/**
- * @brief Replaces all data in the app_control with the bundle
- *
- * @remarks This function clears all data in the app_control and adds all key-value pairs in the bundle into the app_control
- * @param [in] app_control The app_control handle
- * @param [in] data The bundle handle
- * @return 0 on success, otherwise a negative error value.
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @see        app_control_export_as_bundle()
- * @code
- *
- * #include <bundle.h>
- * #include <app_control.h>
- *
- * app_control_h app_control = NULL;
- * app_control_create(&app_control);
- * app_control_import_from_bundle(app_control, b);
- *
- * @endcode
- *
- */
-int app_control_import_from_bundle(app_control_h app_control, bundle *data);
-
-/**
- * @brief Returns a new bundle containing all data contained int the app_control
- *
- * @remarks The @a data must be released with bundle_free() by you.
- * @param [in] app_control The app_control handle
- * @param [out] data The bundle handle
- * @return 0 on success, otherwise a negative error value.
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @see        app_control_import_from_bundle()
- * @code
- *
- * #include <bundle.h>
- * #include <app_control.h>
- *
- * bundle* b = NULL;
- * app_control_export_as_bundle(app_control, &b);
- *
- * @endcode
- */
-int app_control_export_as_bundle(app_control_h app_control, bundle **data);
-
-int app_control_create_request(bundle *data, app_control_h *app_control);
-
-int app_control_create_event(bundle *data, app_control_h *app_control);
-
-int app_control_to_bundle(app_control_h app_control, bundle **data);
-
-/**
- * @brief Sets the window ID of the application.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] app_control The app_control handle
- * @param[in] id The window ID of the caller application (if the @a id is not positive, it clears the previous value)
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
- * @see app_control_get_window()
- */
-int app_control_set_window(app_control_h app_control, unsigned int id);
-
-/**
- * @brief Gets the window ID of the application.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] app_control The app_control handle
- * @param[out] id The window ID of the caller application
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
- * @see app_control_set_app_id()
- */
-int app_control_get_window(app_control_h app_control, unsigned int *id);
-
-/**
- * @brief Requests the specified callee window to be transient for the caller window.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks The @a callee_id window is transient for the top-level caller window and should be handled accordingly.
- * @param[in] app_control The app_control handle
- * @param[in] callee_id The callee window ID
- * @param[in] cbfunc The callback function to be called when the transient is requested
- * @param[in] data A data pointer to pass to the callback function
- * @return @c 0 on success,
- *         otherwise a negative error value.
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- */
-int app_control_request_transient_app(app_control_h app_control, unsigned int callee_id, app_control_host_res_fn cbfunc, void *data);
-
-/**
- * @platform
- * @brief Sets the ID of default application associated with operation, mime-type and uri.
- *
- * @since_tizen 3.0
- * @privlevel platform
- * @privilege %http://tizen.org/privilege/systemsettings.admin
- * @param[in] app_control The app_control handle
- * @param[in] app_id The ID of the application
- *
- * @return 0 on success, otherwise a negative error value
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_PERMISSION_DENIED Permission denied
- * @retval #APP_CONTROL_ERROR_IO_ERROR IO error
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- *
- */
-int app_control_set_defapp(app_control_h app_control, const char *app_id);
-
-/**
- * @platform
- * @brief Unsets default application control setting of an application.
- *
- * @details When an user call this API, all the default application settings for the app_id are unset.
- *
- * @since_tizen 3.0
- * @privlevel platform
- * @privilege %http://tizen.org/privilege/systemsettings.admin
- * @param[in] app_id The ID of the application
- *
- * @return 0 on success, otherwise a negative error value
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_PERMISSION_DENIED Permission denied
- * @retval #APP_CONTROL_ERROR_IO_ERROR IO error
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- *
- */
-int app_control_unset_defapp(const char *app_id);
-
-/**
- * @brief Sets the instance ID of the application
- *
- * @since_tizen tizen_3.0
- * @param[in] app_control The app_control handle
- * @param[in] instance_id The instance ID of the application
- * @return 0 on success, otherwise a negative error value
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_CONTROL_OUT_OF_MEMORY Out of memory
- */
-int app_control_set_instance_id(app_control_h app_control, const char *instance_id);
-
-/**
- * @brief Gets the instance ID of the application
- *
- * @since_tizen tizen_3.0
- * @param[in] app_control The app_control handle
- * @param[out] instance_id The instance ID of the application
- * @return 0 on success, otherwise a negative error value
- * @retval #APP_CONTROL_ERROR_NONE Successful
- * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_CONTROL_OUT_OF_MEMORY Out of memory
- */
-int app_control_get_instance_id(app_control_h app_control, char **instance_id);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __TIZEN_APPFW_APP_CONTROL_INTERNAL_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-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/packaging/capi-appfw-event.spec b/packaging/capi-appfw-event.spec
new file mode 100644 (file)
index 0000000..ea65899
--- /dev/null
@@ -0,0 +1,51 @@
+Name:       capi-appfw-event
+Summary:    App event API
+Version:    0.5.11
+Release:    0
+Group:      System/API
+License:    Apache-2.0
+Source0:    %{name}-%{version}.tar.gz
+Source1001:     capi-appfw-event.manifest
+BuildRequires:  cmake
+BuildRequires:  pkgconfig(dlog)
+BuildRequires:  pkgconfig(bundle)
+BuildRequires:  pkgconfig(eventsystem)
+BuildRequires:  pkgconfig(capi-base-common)
+
+%description
+An Application event library in Tizen C API
+
+%package devel
+Summary:  An Application event library in Tizen C API (Development)
+Group:    System/API
+Requires: %{name} = %{version}-%{release}
+
+%description 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
+
+%files
+%manifest %{name}.manifest
+%{_libdir}/libcapi-appfw-event.so.*
+%license LICENSE
+
+%files 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..2c64151 100644 (file)
@@ -1,5 +1,5 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-SET(fw_name "capi-appfw-application")
+SET(fw_name "capi-appfw-event")
 
 PROJECT(${fw_name})
 
@@ -9,16 +9,16 @@ 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 "glib-2.0 dlog bundle eventsystem 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 "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC")
 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -Wall -Werror")
 
 IF("${ARCH}" STREQUAL "arm")
@@ -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
+               event.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,10 @@ 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)
+
+
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;
-}
-
similarity index 99%
rename from event/event.c
rename to src/event.c
index edb6c16..9f67478 100644 (file)
@@ -20,7 +20,6 @@
 #include <dlog.h>
 #include <app_event.h>
 #include <eventsystem.h>
-#include <app_internal.h>
 
 #ifdef LOG_TAG
 #undef LOG_TAG
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);
-}
-