Merge "[Native][25/11/2013][Add]Adding BigInteger class" into tizen
[platform/framework/native/appfw.git] / inc / FSecPrivacyManager.h
1 //
2 // Copyright (c) 2013 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
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.
15 //
16  
17 /**
18 * @file         FSecPrivacyManager.h
19 * @brief        This is the header file for the %PrivacyManager class.
20 *
21 * This header file contains the declarations of the %PrivacyManager class.
22 */
23  
24 #ifndef _FSEC_PRIVACY_MANAGER_H_
25 #define _FSEC_PRIVACY_MANAGER_H_
26  
27 #include <FBaseObject.h>
28 #include <FAppTypes.h>
29
30 namespace Tizen { namespace Base { namespace Collection
31 {
32 class IList;
33 }}}
34
35 namespace Tizen { namespace Security
36 {
37  
38 class PrivacyInfo;
39  
40 /**
41  * @class         PrivacyManager
42  * @brief         This class gets the privacy information and manages an application's privacy settings.
43  *
44  * @since   2.1
45  *
46  * @final   This class is not intended for extension.
47  *
48  * The %PrivacyManager class lets an application to get or save application's privacy settings.
49  */
50  
51 class _OSP_EXPORT_ PrivacyManager
52         : public Tizen::Base::Object
53 {
54 public:
55  
56         /**
57          * Gets the privacy manager instance.
58          *
59          * @since               2.1
60          *
61          * @return              A pointer to the %PrivacyManager instance, @n
62          *                              else @c null if it fails
63          *
64          * @exception   E_SUCCESS                 The method is successful.
65          * @exception   E_SYSTEM                   The method cannot proceed due to a severe system error.
66          *
67          * @remarks             The specific error code can be accessed using the GetLastResult() method.
68          */
69         static PrivacyManager* GetInstance(void);
70  
71         /**
72          * Gets a list of packages which access user's privacy information.
73          *
74          * @since               2.1
75          * @privlevel   platform
76          * @privilege   %http://tizen.org/privilege/privacymanager.read
77          *
78          * @return              A pointer to the list of application packages (PackageId) which access user's privacy information, @n
79          *                              else @c null if an error occurs
80          *
81          * @exception   E_SUCCESS                               The method is successful.
82          * @exception   E_PRIVILEGE_DENIED              The application does not have the privilege to call this method.
83          * @exception   E_SYSTEM                                The method cannot proceed due to a severe system error.
84          *
85          * @remarks             The specific error code can be accessed using the GetLastResult() method.
86          */
87         Tizen::Base::Collection::IList* GetPrivacyAppPackageListN(void) const;
88  
89         /**
90          * Gets a list of privacy information of a package.
91          *
92          * @since               2.1
93          * @privlevel   platform
94          * @privilege   %http://tizen.org/privilege/privacymanager.read
95          *
96          * @return              A pointer to the privacy information list (Privacyinfo), @n
97          *                              else @c null if an error occurs
98          * @param[in]   packageId                               The package ID
99          *
100          * @exception   E_SUCCESS                               The method is successful.
101          * @exception   E_PRIVILEGE_DENIED              The application does not have the privilege to call this method.
102          * @exception   E_SYSTEM                                The method cannot proceed due to a severe system error.
103          *
104          * @remarks              The specific error code can be accessed using the GetLastResult() method.
105          */
106         Tizen::Base::Collection::IList* GetPrivacyInfoListN(const Tizen::App::PackageId& packageId) const;
107
108         /**
109          * Sets a specific privacy setting of a package.
110          *
111          * @since               2.1
112          * @privlevel   platform
113          * @privilege   %http://tizen.org/privilege/privacymanager.write
114          *
115          * @return              An error code
116          * @param[in]   packageId                               The package ID
117          * @param[in]   privacyInfo                             The privacy information to set
118          * @exception   E_SUCCESS                               The method is successful.
119          * @exception   E_OBJ_NOT_FOUND                 The specified @c packageId is not found in privacy database or @n
120          *                                                                              the package is not defined to access the privacy information.
121          * @exception   E_INVALID_ARG                   The specified @c packageId length is invalid.
122          * @exception   E_PRIVILEGE_DENIED              The application does not have the privilege to call this method.
123          * @exception   E_SYSTEM                                The method cannot proceed due to a severe system error.
124          *
125          */
126         result SetAppPackagePrivacy(const Tizen::App::PackageId& packageId, const PrivacyInfo& privacyInfo);
127  
128 private:
129  
130         //
131         // This default constructor is intentionally declared as private to implement the %Singleton semantic.
132         //
133         // @since                  2.1
134         //
135         PrivacyManager(void);
136  
137         //
138         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
139         //
140         // @since                  2.1
141         //
142         PrivacyManager(const PrivacyManager& rhs);
143  
144         //
145         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
146         //
147         // @since                  2.1
148         //
149         PrivacyManager& operator =(const PrivacyManager& rhs);
150  
151         //
152         // This destructor is intentionally declared as private to implement the %Singleton semantic.
153         //
154         // @since                  2.1
155         //
156         virtual ~PrivacyManager(void);
157  
158 private:
159  
160         class _PrivacyManagerImpl* __pPrivacyManagerImpl;
161         friend class _PrivacyManagerImpl;
162  
163 }; // PrivacyManager
164  
165 }} // Tizen::Security
166  
167 #endif // _FSEC_PRIVACY_MANAGER_H_