2 // Open Service Platform
3 // Copyright (c) 2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FSecPrivilegeInfo.h
20 * @brief This is the header file for the %PrivilegeInfo class.
22 * This header file contains the declarations of the %PrivilegeInfo class.
25 #ifndef _FSEC_PRIVILEGE_INFO_H_
26 #define _FSEC_PRIVILEGE_INFO_H_
28 #include <FBaseObject.h>
30 namespace Tizen { namespace Security
33 class _PrivilegeInfoImpl;
36 * @class PrivilegeInfo
37 * @brief This class represents the privilege information.
41 * @final This class is not intended for extension.
43 * The %PrivilegeInfo class represents the privilege information.
44 * %PrivilegeInfo provides methods to retrieve the name and description of privilege.
48 class _OSP_EXPORT_ PrivilegeInfo
49 : public Tizen::Base::Object
54 * Gets the name of a privilege.
58 * @return The name of a privilege, else an empty string is returned if there is no value.
59 * @exception E_SUCCESS The method is successful.
60 * @exception E_SYSTEM An unexpected system error occurred.
61 * @exception E_INVALID_ARG The specified input privilege string is invalid.
62 * @exception E_DATA_NOT_FOUND The privilege information does not exist.
63 * @remarks The specific error code can be accessed using the GetLastResult() method.
65 static Tizen::Base::String GetName(const Tizen::Base::String& privilege);
68 * Gets the description of a privilege.
72 * @return The description of a privilege, else an empty string is returned if there is no value.
73 * @exception E_SUCCESS The method is successful.
74 * @exception E_SYSTEM An unexpected system error occurred.
75 * @exception E_INVALID_ARG The specified input privilege string is invalid.
76 * @exception E_DATA_NOT_FOUND The privilege information does not exist.
77 * @remarks The specific error code can be accessed using the GetLastResult() method.
79 static Tizen::Base::String GetDescription(const Tizen::Base::String& privilege);
82 * The object is not fully constructed after this constructor is called. @n
83 * For full construction, the Construct() method must be called right after calling this constructor.
87 * @remarks After creating an instance of this class, the Construct() method must be called explicitly to initialize this instance.
92 * This destructor overrides Tizen::Base::Object::~Object().
97 virtual ~PrivilegeInfo(void);
100 * Initializes this instance of %PrivilegeInfo with the specified parameters.
104 * @return An error code
105 * @param[in] privilegeId The privilege ID
106 * @exception E_SUCCESS The method is successful.
107 * @exception E_INVALID_ARG The specified @c privilegeId is invalid.
110 result Construct(const Tizen::Base::String& privilegeId);
113 * Gets a privilege ID.
117 * @return The privilege ID.
120 Tizen::Base::String GetId(void) const;
123 * Gets the localized display name of privilege.
127 * @return The display name of privilege, else an empty string is returned if there is no value.
130 Tizen::Base::String GetDisplayName(void) const;
133 * Gets the localized description of privilege.
137 * @return The description of privilege, else an empty string is returned if there is no value.
140 Tizen::Base::String GetDescription(void) const;
145 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
147 // @param[in] rhs An instance of %PrivilegeInfo
149 PrivilegeInfo(const PrivilegeInfo& rhs);
152 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
154 // @param[in] rhs An instance of %PrivilegeInfo
156 PrivilegeInfo& operator =(const PrivilegeInfo& rhs);
159 static class _PrivilegeInfoImpl* __pPrivilegeInfoImpl;
160 class _PrivilegeInfoImpl * __pImpl;
161 friend class _PrivilegeInfoImpl;
165 } } // Tizen::Security::PrivilegeInfo
167 #endif // _FSEC_PRIVILEGE_INFO_H_