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 * @if VISPARTNER-MANUFACTURER
\r
19 * @file FWebCtrlGeolocationPermissionManager.h
\r
20 * @brief This is the header file for the %GeolocationPermissionManager class.
\r
21 * @visibility partner-manufacturer
\r
23 * This header file contains the declarations of the %GeolocationPermissionManager class.
\r
27 #ifndef _FWEB_CTRL_GEOLOCATION_PERMISSION_MANAGER_H_
\r
28 #define _FWEB_CTRL_GEOLOCATION_PERMISSION_MANAGER_H_
\r
30 #include <unique_ptr.h>
\r
31 #include <FBaseString.h>
\r
33 namespace Tizen { namespace Base { namespace Collection
\r
36 }}} // Tizen::Base::Collection
\r
38 namespace Tizen { namespace Web { namespace Controls
\r
41 class _GeolocationPermissionManagerImpl;
\r
44 * @if VISPARTNER-MANUFACTURER
\r
45 * @class GeolocationPermissionManager
\r
46 * @brief This class provides methods to manage geolocation permissions.
\r
50 * @visibility partner-manufacturer
\r
51 * @privilege %http://tizen.org/privilege/web.privacy
\r
53 * The %GeolocationPermissionManager class provides methods to manage geolocation permissions decided by a user from origins using html5 JavaScript geolocation APIs.
\r
55 * Origin consists of the scheme, host, and port.
\r
59 class _OSP_EXPORT_ GeolocationPermissionManager
\r
60 : public Tizen::Base::Object
\r
65 * @if VISPARTNER-MANUFACTURER
\r
66 * Gets the origin list stored at the geolocation database.
\r
70 * @visibility partner-manufacturer
\r
71 * @privilege %http://tizen.org/privilege/web.privacy
\r
73 * @return A pointer to IList containing origin(Tizen::Base::String) list, @n
\r
74 * else @c null if no geolocation permission data exists
\r
75 * @exception E_SUCCESS The method is successful.
\r
76 * @exception E_SERVICE_BUSY The dedicated service module is too busy to handle another request.
\r
77 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
\r
78 * @remarks The specific error code can be accessed using the GetLastResult() method.
\r
81 Tizen::Base::Collection::IList* GetOriginListN(void) const;
\r
84 * @if VISPARTNER-MANUFACTURER
\r
85 * Checks whether geolocation permission is allowed or not for the specified @c origin.
\r
89 * @visibility partner-manufacturer
\r
90 * @privilege %http://tizen.org/privilege/web.privacy
\r
92 * @return @c true if geolocation permission is allowed, @n
\r
94 * @param[in] origin The origin
\r
95 * @exception E_SUCCESS The method is successful.
\r
96 * @exception E_DATA_NOT_FOUND There is no permission data for the specified @c origin.
\r
97 * @exception E_SERVICE_BUSY The dedicated service module is too busy to handle another request.
\r
98 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
\r
99 * @remarks The specific error code can be accessed using the GetLastResult() method.
\r
102 bool IsPermissionAllowed(const Tizen::Base::String& origin) const;
\r
105 * @if VISPARTNER-MANUFACTURER
\r
106 * Removes the geolocation data for the specified @c origin.
\r
110 * @visibility partner-manufacturer
\r
111 * @privilege %http://tizen.org/privilege/web.privacy
\r
113 * @return An error code
\r
114 * @param[in] origin The origin
\r
115 * @exception E_SUCCESS The method is successful.
\r
116 * @exception E_DATA_NOT_FOUND There is no permission data for the specified @c origin.
\r
117 * @exception E_SERVICE_BUSY The dedicated service module is too busy to handle another request.
\r
118 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
\r
122 result Remove(const Tizen::Base::String& origin);
\r
125 * @if VISPARTNER-MANUFACTURER
\r
126 * Removes all elements in the list.
\r
130 * @visibility partner-manufacturer
\r
131 * @privilege %http://tizen.org/privilege/web.privacy
\r
133 * @return An error code
\r
134 * @exception E_SUCCESS The method is successful.
\r
135 * @exception E_SERVICE_BUSY The dedicated service module is too busy to handle another request.
\r
136 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
\r
140 result RemoveAll(void);
\r
143 * @if VISPARTNER-MANUFACTURER
\r
144 * Gets the geolocation permission manager instance.
\r
148 * @visibility partner-manufacturer
\r
149 * @privilege %http://tizen.org/privilege/web.privacy
\r
151 * @return A pointer to the %GeolocationPermissionManager instance, @n
\r
152 * else @c null if it fails
\r
153 * @exception E_SUCCESS The method is successful.
\r
154 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
\r
155 * @remarks The specific error code can be accessed using the GetLastResult() method.
\r
158 static GeolocationPermissionManager* GetInstance(void);
\r
162 // This default constructor is intentionally declared as private to implement the Singleton semantic.
\r
164 // @remarks This constructor is hidden.
\r
166 GeolocationPermissionManager(void);
\r
169 // This destructor is intentionally declared as private to implement the Singleton semantic.
\r
171 // @remarks This destructor is hidden.
\r
173 virtual ~GeolocationPermissionManager(void);
\r
176 * Initializes this instance of the %Web control with the specified parameters.
\r
180 * @return An error code
\r
182 result Construct(void);
\r
185 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
\r
187 // @param[in] rhs The instance of the % GeolocationPermissionManager class to copy from
\r
188 // @remarks This constructor is hidden.
\r
190 GeolocationPermissionManager(const GeolocationPermissionManager& rhs);
\r
193 // Initializes the geolocation permission manager instance.
\r
197 static void InitGeolocationPermissionManager(void);
\r
200 // Destroys the geolocation permission manager instance.
\r
204 static void DestroyGeolocationPermissionManager(void);
\r
207 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
\r
209 // @param[in] rhs An instance of % GeolocationPermissionManager to assign from
\r
210 // @remarks This operator is hidden.
\r
212 GeolocationPermissionManager& operator=(const GeolocationPermissionManager& rhs);
\r
216 _GeolocationPermissionManagerImpl* __pGeolocationPermissionManagerImpl;
\r
218 static GeolocationPermissionManager* __pInstance;
\r
220 friend class _GeolocationPermissionManagerImpl;
\r
222 friend struct std::default_delete<GeolocationPermissionManager>;
\r
223 }; // GeolocationPermissionManager
\r
225 }}} // Tizen::Web::Controls
\r
227 #endif // _FWEB_CTRL_GEOLOCATION_PERMISSION_MANAGER_H_
\r