sync with master
[platform/framework/native/appfw.git] / inc / FSecPrivilegeInfo.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17
18 /**
19  * @file        FSecPrivilegeInfo.h
20  * @brief       This is the header file for the %PrivilegeInfo class.
21  *
22  * This header file contains the declarations of the %PrivilegeInfo class.
23  */
24
25 #ifndef _FSEC_PRIVILEGE_INFO_H_
26 #define _FSEC_PRIVILEGE_INFO_H_
27  
28 #include <FBaseObject.h>
29  
30 namespace Tizen { namespace Security
31 {
32
33 class _PrivilegeInfoImpl;
34
35 /**
36 * @class        PrivilegeInfo
37 * @brief        This class represents the privilege information.
38 *
39 * @since        2.1
40 *
41 * @final        This class is not intended for extension.
42 *
43 * The %PrivilegeInfo class represents the privilege information.
44 * %PrivilegeInfo provides methods to retrieve the name and description of privilege.
45 *
46 */
47
48 class _OSP_EXPORT_ PrivilegeInfo
49         : public Tizen::Base::Object
50 {
51 public:
52
53         /**
54          * Gets the name of a privilege.
55          *
56          * @since       2.1
57          *
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.
64          */
65         static Tizen::Base::String GetName(const Tizen::Base::String& privilege);
66
67         /**
68          * Gets the description of a privilege.
69          *
70          * @since               2.1
71          *
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.
78          */
79         static Tizen::Base::String GetDescription(const Tizen::Base::String& privilege);
80
81         /**
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.
84          *
85          * @since       2.1
86          *
87          * @remarks  After creating an instance of this class, the Construct() method must be called explicitly to initialize this instance.
88          */
89         PrivilegeInfo(void);
90
91         /**
92          * This destructor overrides Tizen::Base::Object::~Object().
93          *
94          * @since 2.1
95          *
96          */
97         virtual ~PrivilegeInfo(void);
98
99         /**
100          * Initializes this instance of %PrivilegeInfo with the specified parameters.
101          *
102          * @since         2.1
103          *
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.
108          *
109          */
110         result Construct(const Tizen::Base::String& privilegeId);
111
112         /**
113          * Gets a privilege ID.
114          *
115          * @since              2.1
116          *
117          * @return            The privilege ID.
118          *
119          */
120         Tizen::Base::String GetId(void) const;
121
122         /**
123          * Gets the localized display name of privilege.
124          *
125          * @since              2.1
126          *
127          * @return            The display name of privilege, else an empty string is returned if there is no value.
128          *
129          */
130         Tizen::Base::String GetDisplayName(void) const;
131
132         /**
133          * Gets the localized description of privilege.
134          *
135          * @since              2.1
136          *
137          * @return            The description of privilege, else an empty string is returned if there is no value.
138          *
139          */
140         Tizen::Base::String GetDescription(void) const;
141
142 private:
143
144         //
145         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
146         //
147         // @param[in]   rhs         An instance of %PrivilegeInfo
148         //
149         PrivilegeInfo(const PrivilegeInfo& rhs);
150
151         //
152         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
153         //
154         // @param[in]   rhs An instance of %PrivilegeInfo
155         //
156         PrivilegeInfo& operator =(const PrivilegeInfo& rhs);
157
158 private:
159         static class _PrivilegeInfoImpl* __pPrivilegeInfoImpl;
160         class _PrivilegeInfoImpl * __pImpl;
161         friend class _PrivilegeInfoImpl;
162
163 }; // PrivilegeInfo
164
165 } } // Tizen::Security::PrivilegeInfo
166
167 #endif // _FSEC_PRIVILEGE_INFO_H_