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