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