modify doxygen
[platform/framework/native/web.git] / inc / FWebCtrlGeolocationPermissionManager.h
1 // Open Service Platform\r
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.\r
3 //\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
7 //\r
8 //     http://www.apache.org/licenses/LICENSE-2.0\r
9 //\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
15 //\r
16 \r
17 /**\r
18  * @file                FWebCtrlGeolocationPermissionManager.h\r
19  * @brief               This is the header file for the %GeolocationPermissionManager class.\r
20  * @privlevel          platform\r
21  *\r
22  * This header file contains the declarations of the %GeolocationPermissionManager class.\r
23  *\r
24  */\r
25 #ifndef _FWEB_CTRL_GEOLOCATION_PERMISSION_MANAGER_H_\r
26 #define _FWEB_CTRL_GEOLOCATION_PERMISSION_MANAGER_H_\r
27 \r
28 #include <unique_ptr.h>\r
29 #include <FBaseString.h>\r
30 \r
31 namespace Tizen { namespace Base { namespace Collection\r
32 {\r
33 class IList;\r
34 }}} // Tizen::Base::Collection\r
35 \r
36 namespace Tizen { namespace Web { namespace Controls\r
37 {\r
38 \r
39 class _GeolocationPermissionManagerImpl;\r
40 \r
41 /**\r
42  * @class               GeolocationPermissionManager\r
43  * @brief               This class provides methods to manage geolocation permissions.\r
44  *\r
45  * @since               2.0\r
46  *\r
47  * The %GeolocationPermissionManager class provides methods to manage geolocation permissions decided by a user from origins using html5 JavaScript geolocation APIs.\r
48  * @n\r
49  * Origin consists of the scheme, host, and port.\r
50  */\r
51 \r
52 class _OSP_EXPORT_ GeolocationPermissionManager\r
53         : public Tizen::Base::Object\r
54\r
55 public:\r
56 \r
57         /**\r
58          * Gets the origin list stored at the geolocation database.\r
59          *\r
60          * @since               2.0\r
61          *\r
62          * @privlevel           platform\r
63          * @privilege   %http://tizen.org/privilege/geolocationpermission.read\r
64          *\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
71          */\r
72          Tizen::Base::Collection::IList* GetOriginListN(void) const;\r
73 \r
74         /**\r
75          * Checks whether geolocation permission is allowed or not for the specified @c origin.\r
76          *\r
77          * @since               2.0\r
78          *\r
79          * @privlevel   platform\r
80          * @privilege   %http://tizen.org/privilege/geolocationpermission.read\r
81          *\r
82          * @return              @c true if geolocation permission is allowed, @n\r
83          *                                      else @c false\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
90          */\r
91         bool IsPermissionAllowed(const Tizen::Base::String& origin) const;\r
92 \r
93         /**\r
94          * Removes the geolocation data for the specified @c origin.\r
95          *\r
96          * @since               2.0\r
97          *\r
98          * @privlevel   platform\r
99          * @privilege   %http://tizen.org/privilege/geolocationpermission.write\r
100          *\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
107          * @see RemoveAll()\r
108          */\r
109         result Remove(const Tizen::Base::String& origin);\r
110 \r
111         /**\r
112          * Removes all elements in the list.\r
113          * \r
114          * @since               2.0\r
115          *\r
116          * @privlevel   platform\r
117          * @privilege   %http://tizen.org/privilege/geolocationpermission.write\r
118          *\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
123          * @see Remove()\r
124          */\r
125         result RemoveAll(void);\r
126 \r
127         /**\r
128          * Gets the geolocation permission manager instance.\r
129          *\r
130          * @since               2.0\r
131          *\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
138          */\r
139         static GeolocationPermissionManager* GetInstance(void);\r
140 \r
141 private:\r
142         //\r
143         // This default constructor is intentionally declared as private to implement the Singleton semantic.\r
144         //\r
145         // @remarks             This constructor is hidden.\r
146         //\r
147         GeolocationPermissionManager(void);\r
148 \r
149         //\r
150         // This destructor is intentionally declared as private to implement the Singleton semantic.\r
151         //\r
152         // @remarks             This destructor is hidden.\r
153         //\r
154         virtual ~GeolocationPermissionManager(void);\r
155 \r
156         //\r
157         // Initializes this instance of the %Web control with the specified parameters.\r
158         //\r
159         // @since               2.0\r
160         //\r
161         // @return              An error code\r
162         //\r
163         result Construct(void);\r
164 \r
165         //\r
166         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.\r
167         //\r
168         // @param[in]   rhs                     The instance of the % GeolocationPermissionManager class to copy from\r
169         // @remarks             This constructor is hidden.\r
170         //\r
171         GeolocationPermissionManager(const GeolocationPermissionManager& rhs);\r
172 \r
173         //\r
174         // Initializes the geolocation permission manager instance.\r
175         //\r
176         // @since               2.0\r
177         //\r
178         static void InitGeolocationPermissionManager(void);\r
179 \r
180         //\r
181         // Destroys the geolocation permission manager instance.\r
182         //\r
183         // @since               2.0\r
184         //\r
185         static void DestroyGeolocationPermissionManager(void);\r
186 \r
187         //\r
188         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.\r
189         //\r
190         // @param[in]   rhs                     An instance of % GeolocationPermissionManager to assign from\r
191         // @remarks             This operator is hidden.\r
192         //\r
193         GeolocationPermissionManager& operator=(const GeolocationPermissionManager& rhs);\r
194 \r
195 private:\r
196 \r
197         _GeolocationPermissionManagerImpl* __pGeolocationPermissionManagerImpl;\r
198 \r
199         static GeolocationPermissionManager* __pInstance;\r
200 \r
201         friend class _GeolocationPermissionManagerImpl;\r
202 \r
203         friend struct std::default_delete<GeolocationPermissionManager>;\r
204 }; // GeolocationPermissionManager\r
205 \r
206 }}} // Tizen::Web::Controls\r
207 \r
208 #endif // _FWEB_CTRL_GEOLOCATION_PERMISSION_MANAGER_H_\r