Add new api for .net 44/152844/1 submit/tizen/20170927.081645 submit/tizen/20170927.082353 submit/tizen/20170928.003449
authorSunggyu Choi <sunggyu.choi@samsung.com>
Wed, 27 Sep 2017 08:13:23 +0000 (17:13 +0900)
committerSunggyu Choi <sunggyu.choi@samsung.com>
Wed, 27 Sep 2017 08:13:23 +0000 (17:13 +0900)
Change-Id: Ibf67da5f9e8b6870877b445a1c2bc2b241fb81de
Signed-off-by: Sunggyu Choi <sunggyu.choi@samsung.com>
CMakeLists.txt
doc/tizen_doc.h
include/tizen_dotnet.h [new file with mode: 0644]
packaging/capi-base-common.spec
src/tizen_dotnet.c [new file with mode: 0644]
tool/CMakeLists.txt_coverage

index e5bebed..706ab3a 100644 (file)
@@ -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})
index eb25593..236eae6 100755 (executable)
  * 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 <tizen_dotnet.h>
+ * @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 (file)
index 0000000..334999e
--- /dev/null
@@ -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 <tizen.h>
+
+
+#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__ */
index 3b51904..9e39ef4 100644 (file)
@@ -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 (file)
index 0000000..f334e16
--- /dev/null
@@ -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;
+}
+
index 8ae6e76..f36cb74 100644 (file)
@@ -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})