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
21 * This header file contains the declarations of the %GeolocationPermissionManager class.
\r
24 #ifndef _FWEB_CTRL_GEOLOCATION_PERMISSION_MANAGER_H_
\r
25 #define _FWEB_CTRL_GEOLOCATION_PERMISSION_MANAGER_H_
\r
27 #include <unique_ptr.h>
\r
28 #include <FBaseString.h>
\r
30 namespace Tizen { namespace Base { namespace Collection
\r
33 }}} // Tizen::Base::Collection
\r
35 namespace Tizen { namespace Web { namespace Controls
\r
38 class _GeolocationPermissionManagerImpl;
\r
41 * @class GeolocationPermissionManager
\r
42 * @brief This class provides methods to manage geolocation permissions.
\r
46 * The %GeolocationPermissionManager class provides methods to manage geolocation permissions decided by a user from origins using html5 JavaScript geolocation APIs. @n
\r
47 * Origin consists of the scheme, host, and port.
\r
50 class _OSP_EXPORT_ GeolocationPermissionManager
\r
51 : public Tizen::Base::Object
\r
56 * Gets the origin list stored at the geolocation database.
\r
59 * @privlevel platform
\r
60 * @privilege %http://tizen.org/privilege/geolocationpermission.read
\r
62 * @return A pointer to Tizen::Base::Collection::IList that contains the origin(Tizen::Base::String) list, @n
\r
63 * else @c null if no geolocation permission data exists
\r
64 * @exception E_SUCCESS The method is successful.
\r
65 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
\r
66 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
\r
67 * @remarks The specific error code can be accessed using the GetLastResult() method.
\r
69 Tizen::Base::Collection::IList* GetOriginListN(void) const;
\r
72 * Checks whether geolocation permission is allowed or not for the specified @c origin.
\r
75 * @privlevel platform
\r
76 * @privilege %http://tizen.org/privilege/geolocationpermission.read
\r
78 * @return @c true if geolocation permission is allowed, @n
\r
80 * @param[in] origin The origin
\r
81 * @exception E_SUCCESS The method is successful.
\r
82 * @exception E_DATA_NOT_FOUND There is no permission data for the specified @c origin.
\r
83 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
\r
84 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
\r
85 * @remarks The specific error code can be accessed using the GetLastResult() method.
\r
87 bool IsPermissionAllowed(const Tizen::Base::String& origin) const;
\r
90 * Removes the geolocation data for the specified @c origin.
\r
93 * @privlevel platform
\r
94 * @privilege %http://tizen.org/privilege/geolocationpermission.write
\r
96 * @return An error code
\r
97 * @param[in] origin The origin
\r
98 * @exception E_SUCCESS The method is successful.
\r
99 * @exception E_DATA_NOT_FOUND There is no permission data for the specified @c origin.
\r
100 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
\r
101 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
\r
104 result Remove(const Tizen::Base::String& origin);
\r
107 * Removes all the elements from the list.
\r
110 * @privlevel platform
\r
111 * @privilege %http://tizen.org/privilege/geolocationpermission.write
\r
113 * @return An error code
\r
114 * @exception E_SUCCESS The method is successful.
\r
115 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
\r
116 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
\r
119 result RemoveAll(void);
\r
122 * Gets a geolocation permission manager instance.
\r
126 * @return A pointer to the %GeolocationPermissionManager instance, @n
\r
127 * else @c null if it fails
\r
128 * @exception E_SUCCESS The method is successful.
\r
129 * @exception E_OUT_OF_MEMORY The memory is insufficient.
\r
130 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
\r
131 * @remarks The specific error code can be accessed using the GetLastResult() method.
\r
133 static GeolocationPermissionManager* GetInstance(void);
\r
137 // This default constructor is intentionally declared as private to implement the Singleton semantic.
\r
139 // @remarks This constructor is hidden.
\r
141 GeolocationPermissionManager(void);
\r
144 // This destructor is intentionally declared as private to implement the Singleton semantic.
\r
146 // @remarks This destructor is hidden.
\r
148 virtual ~GeolocationPermissionManager(void);
\r
151 // Initializes this instance of the %Web control with the specified parameters.
\r
155 // @return An error code
\r
157 result Construct(void);
\r
160 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
\r
162 // @param[in] rhs The instance of the % GeolocationPermissionManager class to copy from
\r
163 // @remarks This constructor is hidden.
\r
165 GeolocationPermissionManager(const GeolocationPermissionManager& rhs);
\r
168 // Initializes the geolocation permission manager instance.
\r
172 static void InitGeolocationPermissionManager(void);
\r
175 // Destroys the geolocation permission manager instance.
\r
179 static void DestroyGeolocationPermissionManager(void);
\r
182 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
\r
184 // @param[in] rhs An instance of % GeolocationPermissionManager to assign from
\r
185 // @remarks This operator is hidden.
\r
187 GeolocationPermissionManager& operator=(const GeolocationPermissionManager& rhs);
\r
191 _GeolocationPermissionManagerImpl* __pGeolocationPermissionManagerImpl;
\r
193 static GeolocationPermissionManager* __pInstance;
\r
195 friend class _GeolocationPermissionManagerImpl;
\r
197 friend struct std::default_delete<GeolocationPermissionManager>;
\r
198 }; // GeolocationPermissionManager
\r
200 }}} // Tizen::Web::Controls
\r
202 #endif // _FWEB_CTRL_GEOLOCATION_PERMISSION_MANAGER_H_
\r