1 // Open Service Platform
\r
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
\r
4 // Licensed under the Apache License, Version 2.0 (the License);
\r
5 // you may not use this file except in compliance with the License.
\r
6 // You may obtain a copy of the License at
\r
8 // http://www.apache.org/licenses/LICENSE-2.0
\r
10 // Unless required by applicable law or agreed to in writing, software
\r
11 // distributed under the License is distributed on an "AS IS" BASIS,
\r
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 // See the License for the specific language governing permissions and
\r
14 // limitations under the License.
\r
18 * @file FWebCtrlGeolocationPermissionManager.h
\r
19 * @brief This is the header file for the %GeolocationPermissionManager class.
\r
20 * @privlevel platform
\r
22 * This header file contains the declarations of the %GeolocationPermissionManager class.
\r
25 #ifndef _FWEB_CTRL_GEOLOCATION_PERMISSION_MANAGER_H_
\r
26 #define _FWEB_CTRL_GEOLOCATION_PERMISSION_MANAGER_H_
\r
28 #include <unique_ptr.h>
\r
29 #include <FBaseString.h>
\r
31 namespace Tizen { namespace Base { namespace Collection
\r
34 }}} // Tizen::Base::Collection
\r
36 namespace Tizen { namespace Web { namespace Controls
\r
39 class _GeolocationPermissionManagerImpl;
\r
42 * @class GeolocationPermissionManager
\r
43 * @brief This class provides methods to manage geolocation permissions.
\r
47 * The %GeolocationPermissionManager class provides methods to manage geolocation permissions decided by a user from origins using html5 JavaScript geolocation APIs.
\r
49 * Origin consists of the scheme, host, and port.
\r
52 class _OSP_EXPORT_ GeolocationPermissionManager
\r
53 : public Tizen::Base::Object
\r
58 * Gets the origin list stored at the geolocation database.
\r
62 * @privlevel platform
\r
63 * @privilege %http://tizen.org/privilege/geolocationpermission.read
\r
65 * @return A pointer to Tizen::Base::Collection::IList containing origin(Tizen::Base::String) list, @n
\r
66 * else @c null if no geolocation permission data exists
\r
67 * @exception E_SUCCESS The method is successful.
\r
68 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
\r
69 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
\r
70 * @remarks The specific error code can be accessed using the GetLastResult() method.
\r
72 Tizen::Base::Collection::IList* GetOriginListN(void) const;
\r
75 * Checks whether geolocation permission is allowed or not for the specified @c origin.
\r
79 * @privlevel platform
\r
80 * @privilege %http://tizen.org/privilege/geolocationpermission.read
\r
82 * @return @c true if geolocation permission is allowed, @n
\r
84 * @param[in] origin The origin
\r
85 * @exception E_SUCCESS The method is successful.
\r
86 * @exception E_DATA_NOT_FOUND There is no permission data for the specified @c origin.
\r
87 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
\r
88 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
\r
89 * @remarks The specific error code can be accessed using the GetLastResult() method.
\r
91 bool IsPermissionAllowed(const Tizen::Base::String& origin) const;
\r
94 * Removes the geolocation data for the specified @c origin.
\r
98 * @privlevel platform
\r
99 * @privilege %http://tizen.org/privilege/geolocationpermission.write
\r
101 * @return An error code
\r
102 * @param[in] origin The origin
\r
103 * @exception E_SUCCESS The method is successful.
\r
104 * @exception E_DATA_NOT_FOUND There is no permission data for the specified @c origin.
\r
105 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
\r
106 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
\r
109 result Remove(const Tizen::Base::String& origin);
\r
112 * Removes all elements in the list.
\r
116 * @privlevel platform
\r
117 * @privilege %http://tizen.org/privilege/geolocationpermission.write
\r
119 * @return An error code
\r
120 * @exception E_SUCCESS The method is successful.
\r
121 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
\r
122 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
\r
125 result RemoveAll(void);
\r
128 * Gets the geolocation permission manager instance.
\r
132 * @return A pointer to the %GeolocationPermissionManager instance, @n
\r
133 * else @c null if it fails
\r
134 * @exception E_SUCCESS The method is successful.
\r
135 * @exception E_OUT_OF_MEMORY The memory is insufficient.
\r
136 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
\r
137 * @remarks The specific error code can be accessed using the GetLastResult() method.
\r
139 static GeolocationPermissionManager* GetInstance(void);
\r
143 // This default constructor is intentionally declared as private to implement the Singleton semantic.
\r
145 // @remarks This constructor is hidden.
\r
147 GeolocationPermissionManager(void);
\r
150 // This destructor is intentionally declared as private to implement the Singleton semantic.
\r
152 // @remarks This destructor is hidden.
\r
154 virtual ~GeolocationPermissionManager(void);
\r
157 // Initializes this instance of the %Web control with the specified parameters.
\r
161 // @return An error code
\r
163 result Construct(void);
\r
166 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
\r
168 // @param[in] rhs The instance of the % GeolocationPermissionManager class to copy from
\r
169 // @remarks This constructor is hidden.
\r
171 GeolocationPermissionManager(const GeolocationPermissionManager& rhs);
\r
174 // Initializes the geolocation permission manager instance.
\r
178 static void InitGeolocationPermissionManager(void);
\r
181 // Destroys the geolocation permission manager instance.
\r
185 static void DestroyGeolocationPermissionManager(void);
\r
188 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
\r
190 // @param[in] rhs An instance of % GeolocationPermissionManager to assign from
\r
191 // @remarks This operator is hidden.
\r
193 GeolocationPermissionManager& operator=(const GeolocationPermissionManager& rhs);
\r
197 _GeolocationPermissionManagerImpl* __pGeolocationPermissionManagerImpl;
\r
199 static GeolocationPermissionManager* __pInstance;
\r
201 friend class _GeolocationPermissionManagerImpl;
\r
203 friend struct std::default_delete<GeolocationPermissionManager>;
\r
204 }; // GeolocationPermissionManager
\r
206 }}} // Tizen::Web::Controls
\r
208 #endif // _FWEB_CTRL_GEOLOCATION_PERMISSION_MANAGER_H_
\r