From 70810c705c1d23ad336287b07fa8cbda1e000ab1 Mon Sep 17 00:00:00 2001 From: Sunggyu Choi Date: Wed, 27 Sep 2017 17:13:23 +0900 Subject: [PATCH] Add new api for .net Change-Id: Ibf67da5f9e8b6870877b445a1c2bc2b241fb81de Signed-off-by: Sunggyu Choi --- CMakeLists.txt | 2 ++ doc/tizen_doc.h | 8 +++++ include/tizen_dotnet.h | 67 +++++++++++++++++++++++++++++++++++++++++ packaging/capi-base-common.spec | 2 +- src/tizen_dotnet.c | 33 ++++++++++++++++++++ tool/CMakeLists.txt_coverage | 2 ++ 6 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 include/tizen_dotnet.h create mode 100644 src/tizen_dotnet.c diff --git a/CMakeLists.txt b/CMakeLists.txt index e5bebed..706ab3a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,12 +12,14 @@ SET(INC_DIR "include") INSTALL(FILES ${INC_DIR}/tizen.h DESTINATION ${INCLUDE_INSTALL_DIR}) INSTALL(FILES ${INC_DIR}/tizen_type.h DESTINATION ${INCLUDE_INSTALL_DIR}) INSTALL(FILES ${INC_DIR}/tizen_error.h DESTINATION ${INCLUDE_INSTALL_DIR}) +INSTALL(FILES ${INC_DIR}/tizen_dotnet.h DESTINATION ${INCLUDE_INSTALL_DIR}) INCLUDE_DIRECTORIES(${INC_DIR}) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/capi-base-common.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) SET(SOURCES src/tizen_error.c + src/tizen_dotnet.c ) ADD_LIBRARY(${fw_name} SHARED ${SOURCES}) diff --git a/doc/tizen_doc.h b/doc/tizen_doc.h index eb25593..236eae6 100755 --- a/doc/tizen_doc.h +++ b/doc/tizen_doc.h @@ -26,5 +26,13 @@ * This file declares common errors and provides following features for handling the error. * - Getting/Setting the error value. * - Retrieving the error messages with error value. + * + * @defgroup CAPI_COMMON_DOTNET_UTIL .NET util + * @brief The .NET util API provides functions to get proper information of Tizen .NET. + * @section CAPI_COMMON_DOTNET_UTIL_HEADER Required Header + * \#include + * @ingroup CAPI_BASE_FRAMEWORK + * @section CAPI_COMMON_DOTNET_OVERVIEW Overview + * You can get information regarding Tizen .NET via .Net util API. */ diff --git a/include/tizen_dotnet.h b/include/tizen_dotnet.h new file mode 100644 index 0000000..334999e --- /dev/null +++ b/include/tizen_dotnet.h @@ -0,0 +1,67 @@ +/* + * 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_DOTNET_UTIL_H__ +#define __TIZEN_DOTNET_UTIL_H__ + + +#include + + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @addtogroup CAPI_COMMON_DOTNET_UTIL + * @{ + */ + + +/** + * @brief Enumeration for dotnet util error code. + * @since_tizen 4.0 + */ +typedef enum { + DOTNET_UTIL_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */ + DOTNET_UTIL_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */ + DOTNET_UTIL_ERROR_OPERATION_FAILED = TIZEN_ERROR_NOT_PERMITTED /**< Operation not permitted */ +} dotnet_util_error_e; + + +/** + * @brief Gets the version of Tizen .NET API. + * @details The returned value means available version in the device. + * @since_tizen 4.0 + * @param[out] version The Tizen .NET API version + * @return @c 0 on success, + * otherwise a negative error value + * @retval #DOTNET_UTIL_ERROR_NONE Successful + * @retval #DOTNET_UTIL_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #DOTNET_UTIL_ERROR_OPERATION_FAILED Operation failed +*/ +int dotnet_util_get_tizen_api_version(int *version); + + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /**<__TIZEN_DOTNET_UTIL_H__ */ diff --git a/packaging/capi-base-common.spec b/packaging/capi-base-common.spec index 3b51904..9e39ef4 100644 --- a/packaging/capi-base-common.spec +++ b/packaging/capi-base-common.spec @@ -1,6 +1,6 @@ Name: capi-base-common Summary: Common header files of Tizen Native API -Version: 0.4.16 +Version: 0.4.18 Release: 1 Group: Base License: Apache-2.0 diff --git a/src/tizen_dotnet.c b/src/tizen_dotnet.c new file mode 100644 index 0000000..f334e16 --- /dev/null +++ b/src/tizen_dotnet.c @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2014 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 "tizen_dotnet.h" + +int dotnet_util_get_tizen_api_version(int *version) +{ + int ret, val = 0; + + if (!version) + return DOTNET_UTIL_ERROR_INVALID_PARAMETER; + + ret = vconf_get_int("db/dotnet/tizen_api_version", &val); + if (ret < 0) + return DOTNET_UTIL_ERROR_OPERATION_FAILED; + + *version = val; + return DOTNET_UTIL_ERROR_NONE; +} + diff --git a/tool/CMakeLists.txt_coverage b/tool/CMakeLists.txt_coverage index 8ae6e76..f36cb74 100644 --- a/tool/CMakeLists.txt_coverage +++ b/tool/CMakeLists.txt_coverage @@ -13,12 +13,14 @@ SET(INC_DIR "include") INSTALL(FILES ${INC_DIR}/tizen.h DESTINATION ${INCLUDE_INSTALL_DIR}) INSTALL(FILES ${INC_DIR}/tizen_type.h DESTINATION ${INCLUDE_INSTALL_DIR}) INSTALL(FILES ${INC_DIR}/tizen_error.h DESTINATION ${INCLUDE_INSTALL_DIR}) +INSTALL(FILES ${INC_DIR}/tizen_dotnet.h DESTINATION ${INCLUDE_INSTALL_DIR}) INCLUDE_DIRECTORIES(${INC_DIR}) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/capi-base-common.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) SET(SOURCES src/tizen_error.c + src/tizen_dotnet.c ) ADD_LIBRARY(${fw_name} SHARED ${SOURCES}) -- 2.7.4