2 // Copyright (c) 2013 Samsung Electronics Co., Ltd.
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file FSecPrivacyManager.h
19 * @brief This is the header file for the %PrivacyManager class.
21 * This header file contains the declarations of the %PrivacyManager class.
24 #ifndef _FSEC_PRIVACY_MANAGER_H_
25 #define _FSEC_PRIVACY_MANAGER_H_
27 #include <FBaseObject.h>
28 #include <FAppTypes.h>
30 namespace Tizen { namespace Base { namespace Collection
35 namespace Tizen { namespace Security
41 * @class PrivacyManager
42 * @brief This class gets the privacy information and manages an application's privacy settings.
46 * @final This class is not intended for extension.
48 * The %PrivacyManager class lets an application to get or save application's privacy settings.
51 class _OSP_EXPORT_ PrivacyManager
52 : public Tizen::Base::Object
57 * Gets the privacy manager instance.
61 * @return A pointer to the %PrivacyManager instance, @n
62 * else @c null if it fails
64 * @exception E_SUCCESS The method is successful.
65 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
67 * @remarks The specific error code can be accessed using the GetLastResult() method.
69 static PrivacyManager* GetInstance(void);
72 * Gets a list of packages which access user's privacy information.
76 * @privilege %http://tizen.org/privilege/privacymanager.read
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
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.
85 * @remarks The specific error code can be accessed using the GetLastResult() method.
87 Tizen::Base::Collection::IList* GetPrivacyAppPackageListN(void) const;
90 * Gets a list of privacy information of a package.
94 * @privilege %http://tizen.org/privilege/privacymanager.read
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
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.
104 * @remarks The specific error code can be accessed using the GetLastResult() method.
106 Tizen::Base::Collection::IList* GetPrivacyInfoListN(const Tizen::App::PackageId& packageId) const;
109 * Sets the specific privacy setting of a package
112 * @privlevel platform
113 * @privilege %http://tizen.org/privilege/privacymanager.write
115 * @return An error code
116 * @param[in] packageId The package ID
117 * @param[in] privacyInfo The privacy setting to be set
119 * @exception E_SUCCESS The method is successful.
120 * @exception E_OBJ_NOT_FOUND The specified @c packageId is not found in privacy database or @n
121 * the package did not be defined to access to the privacy information.
122 * @exception E_INVALID_ARG The specified @c packageId length is invalid.
123 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
124 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
127 result SetAppPackagePrivacy(const Tizen::App::PackageId& packageId, const PrivacyInfo& privacyInfo);
132 // This default constructor is intentionally declared as private to implement the %Singleton semantic.
136 PrivacyManager(void);
139 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
143 PrivacyManager(const PrivacyManager& rhs);
146 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
150 PrivacyManager& operator =(const PrivacyManager& rhs);
153 // This destructor is intentionally declared as private to implement the %Singleton semantic.
157 virtual ~PrivacyManager(void);
161 class _PrivacyManagerImpl* __pPrivacyManagerImpl;
162 friend class _PrivacyManagerImpl;
166 }} // Tizen::Security
168 #endif // _FSEC_PRIVACY_MANAGER_H_