2 * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __TIZEN_SECURITY_PRIVILEGE_INFO_H
18 #define __TIZEN_SECURITY_PRIVILEGE_INFO_H
27 * @addtogroup CAPI_SECURITY_FRAMEWORK_PRIVILEGE_INFO_MODULE
32 * @brief Enumerations of error code for Privilege Information.
37 PRVINFO_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
38 PRVINFO_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid function parameter */
39 PRVINFO_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
40 PRVINFO_ERROR_INTERNAL_ERROR = TIZEN_ERROR_UNKNOWN, /**< Unknown error */
41 } privilege_info_error_e;
45 * @brief Gets the display name of the given privilege.
47 * @remarks @a display_name must be released with free() by you.
48 * @param [in] api_version The version of API
49 * @param [in] privilege The privilege
50 * @param [out] display_name The display name of the privilege
51 * @return 0 on success, otherwise a negative error value.
52 * @retval #PRVINFO_ERROR_NONE Successful
53 * @retval #PRVINFO_ERROR_OUT_OF_MEMORY Out of memory
54 * @retval #PRVINFO_ERROR_INVALID_PARAMETER Invalid function parameter
55 * @retval #PRVINFO_ERROR_INTERNAL_ERROR Unknown error
57 int privilege_info_get_display_name(const char* api_version, const char* privilege, char **display_name);
60 * @brief Gets the display name of the given privilege.
62 * @remarks @a display_name must be released with free() by you.
63 * @remarks package_type must be one of followings: PRVINFO_PACKAGE_TYPE_NATIVE, PRVINFO_PACKAGE_TYPE_WEB
64 * @param [in] package_type The type of application package
65 * @param [in] api_version The version of API
66 * @param [in] privilege The privilege
67 * @param [out] display_name The display name of the privilege
68 * @return 0 on success, otherwise a negative error value.
69 * @retval #PRVINFO_ERROR_NONE Successful
70 * @retval #PRVINFO_ERROR_OUT_OF_MEMORY Out of memory
71 * @retval #PRVINFO_ERROR_INVALID_PARAMETER Invalid function parameter
72 * @retval #PRVINFO_ERROR_INTERNAL_ERROR Unknown error
74 int privilege_info_get_display_name_by_pkgtype(const char* package_type, const char* api_version, const char* privilege, char **display_name);
77 * @brief Gets the description of the given privilege.
79 * @remarks @a description must be released with free() by you.
80 * @param [in] api_version The version of API
81 * @param [in] privilege The privilege
82 * @param [out] description The description of the privilege
83 * @return 0 on success, otherwise a negative error value.
84 * @retval #PRVINFO_ERROR_NONE Successful
85 * @retval #PRVINFO_ERROR_OUT_OF_MEMORY Out of memory
86 * @retval #PRVINFO_ERROR_INVALID_PARAMETER Invalid function parameter
87 * @retval #PRVINFO_ERROR_INTERNAL_ERROR Unknown error
89 int privilege_info_get_description(const char* api_version, const char *privilege, char **description);
92 * @brief Gets the description of the given privilege.
94 * @remarks @a description must be released with free() by you.
95 * @remarks package_type must be one of followings: PRVINFO_PACKAGE_TYPE_NATIVE, PRVINFO_PACKAGE_TYPE_WEB
96 * @param [in] package_type The type of application package
97 * @param [in] api_version The version of API
98 * @param [in] privilege The privilege
99 * @param [out] description The description of the privilege
100 * @return 0 on success, otherwise a negative error value.
101 * @retval #PRVINFO_ERROR_NONE Successful
102 * @retval #PRVINFO_ERROR_OUT_OF_MEMORY Out of memory
103 * @retval #PRVINFO_ERROR_INVALID_PARAMETER Invalid function parameter
104 * @retval #PRVINFO_ERROR_INTERNAL_ERROR Unknown error
106 int privilege_info_get_description_by_pkgtype(const char* package_type, const char* api_version, const char *privilege, char **description);
115 #endif // __TIZEN_SECURITY_PRIVILEGE_INFO_H