fix gbs/obs build failure
[framework/osp/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          * @privlevel           platform\r
62          * @privilege   %http://tizen.org/privilege/geolocationpermission.read\r
63          *\r
64          * @return      A pointer to Tizen::Base::Collection::IList containing origin(Tizen::Base::String) list, @n\r
65          *                              else @c null if no geolocation permission data exists\r
66          * @exception   E_SUCCESS               The method is successful.\r
67          * @exception   E_SYSTEM                The method cannot proceed due to a severe system error.\r
68          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.\r
69          * @remarks     The specific error code can be accessed using the GetLastResult() method.\r
70          */\r
71          Tizen::Base::Collection::IList* GetOriginListN(void) const;\r
72 \r
73         /**\r
74          * Checks whether geolocation permission is allowed or not for the specified @c origin.\r
75          *\r
76          * @since               2.0\r
77          * @privlevel   platform\r
78          * @privilege   %http://tizen.org/privilege/geolocationpermission.read\r
79          *\r
80          * @return              @c true if geolocation permission is allowed, @n\r
81          *                                      else @c false\r
82          * @param[in]   origin                  The origin\r
83          * @exception   E_SUCCESS                       The method is successful.\r
84          * @exception   E_DATA_NOT_FOUND        There is no permission data for the specified @c origin.\r
85          * @exception   E_SYSTEM                        The method cannot proceed due to a severe system error.\r
86          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.\r
87          * @remarks             The specific error code can be accessed using the GetLastResult() method.\r
88          */\r
89         bool IsPermissionAllowed(const Tizen::Base::String& origin) const;\r
90 \r
91         /**\r
92          * Removes the geolocation data for the specified @c origin.\r
93          *\r
94          * @since               2.0\r
95          * @privlevel   platform\r
96          * @privilege   %http://tizen.org/privilege/geolocationpermission.write\r
97          *\r
98          * @return              An error code\r
99          * @param[in]   origin                  The origin\r
100          * @exception   E_SUCCESS                       The method is successful.\r
101          * @exception   E_DATA_NOT_FOUND        There is no permission data for the specified @c origin.\r
102          * @exception   E_SYSTEM                        The method cannot proceed due to a severe system error.\r
103          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.\r
104          * @see RemoveAll()\r
105          */\r
106         result Remove(const Tizen::Base::String& origin);\r
107 \r
108         /**\r
109          * Removes all elements in the list.\r
110          * \r
111          * @since               2.0\r
112          * @privlevel   platform\r
113          * @privilege   %http://tizen.org/privilege/geolocationpermission.write\r
114          *\r
115          * @return              An error code\r
116          * @exception   E_SUCCESS                       The method is successful.\r
117          * @exception   E_SYSTEM                        The method cannot proceed due to a severe system error.\r
118          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.\r
119          * @see Remove()\r
120          */\r
121         result RemoveAll(void);\r
122 \r
123         /**\r
124          * Gets the geolocation permission manager instance.\r
125          *\r
126          * @since               2.0\r
127          *\r
128          * @return              A pointer to the %GeolocationPermissionManager instance, @n\r
129          *                                      else @c null if it fails\r
130          * @exception   E_SUCCESS                       The method is successful.\r
131          * @exception   E_OUT_OF_MEMORY The memory is insufficient.\r
132          * @exception   E_SYSTEM                        The method cannot proceed due to a severe system error.\r
133          * @remarks             The specific error code can be accessed using the GetLastResult() method.\r
134          */\r
135         static GeolocationPermissionManager* GetInstance(void);\r
136 \r
137 private:\r
138         //\r
139         // This default constructor is intentionally declared as private to implement the Singleton semantic.\r
140         //\r
141         // @remarks             This constructor is hidden.\r
142         //\r
143         GeolocationPermissionManager(void);\r
144 \r
145         //\r
146         // This destructor is intentionally declared as private to implement the Singleton semantic.\r
147         //\r
148         // @remarks             This destructor is hidden.\r
149         //\r
150         virtual ~GeolocationPermissionManager(void);\r
151 \r
152         //\r
153         // Initializes this instance of the %Web control with the specified parameters.\r
154         //\r
155         // @since               2.0\r
156         //\r
157         // @return              An error code\r
158         //\r
159         result Construct(void);\r
160 \r
161         //\r
162         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.\r
163         //\r
164         // @param[in]   rhs                     The instance of the % GeolocationPermissionManager class to copy from\r
165         // @remarks             This constructor is hidden.\r
166         //\r
167         GeolocationPermissionManager(const GeolocationPermissionManager& rhs);\r
168 \r
169         //\r
170         // Initializes the geolocation permission manager instance.\r
171         //\r
172         // @since               2.0\r
173         //\r
174         static void InitGeolocationPermissionManager(void);\r
175 \r
176         //\r
177         // Destroys the geolocation permission manager instance.\r
178         //\r
179         // @since               2.0\r
180         //\r
181         static void DestroyGeolocationPermissionManager(void);\r
182 \r
183         //\r
184         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.\r
185         //\r
186         // @param[in]   rhs                     An instance of % GeolocationPermissionManager to assign from\r
187         // @remarks             This operator is hidden.\r
188         //\r
189         GeolocationPermissionManager& operator=(const GeolocationPermissionManager& rhs);\r
190 \r
191 private:\r
192 \r
193         _GeolocationPermissionManagerImpl* __pGeolocationPermissionManagerImpl;\r
194 \r
195         static GeolocationPermissionManager* __pInstance;\r
196 \r
197         friend class _GeolocationPermissionManagerImpl;\r
198 \r
199         friend struct std::default_delete<GeolocationPermissionManager>;\r
200 }; // GeolocationPermissionManager\r
201 \r
202 }}} // Tizen::Web::Controls\r
203 \r
204 #endif // _FWEB_CTRL_GEOLOCATION_PERMISSION_MANAGER_H_\r