[ACR-716] Mock location
[platform/core/api/location-manager.git] / include / locations.h
1 /*
2  * Copyright (c) 2011-2013 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef __TIZEN_LOCATION_LOCATIONS_H__
18 #define __TIZEN_LOCATION_LOCATIONS_H__
19
20 #include <tizen_type.h>
21 #include <tizen_error.h>
22 #include <time.h>
23 #include <location_bounds.h>
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 /**
30  * @addtogroup CAPI_LOCATION_MANAGER_MODULE
31  * @{
32  */
33
34 /**
35  * @brief Enumeration for error code for Location manager.
36  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
37  */
38 typedef enum {
39         LOCATIONS_ERROR_NONE                                            = TIZEN_ERROR_NONE,                                             /**< Successful */
40         LOCATIONS_ERROR_OUT_OF_MEMORY                           = TIZEN_ERROR_OUT_OF_MEMORY,                    /**< Out of memory */
41         LOCATIONS_ERROR_INVALID_PARAMETER                       = TIZEN_ERROR_INVALID_PARAMETER,                /**< Invalid parameter */
42         LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED       = TIZEN_ERROR_PERMISSION_DENIED,                /**< Permission denied */
43         LOCATIONS_ERROR_NOT_SUPPORTED                           = TIZEN_ERROR_NOT_SUPPORTED,                    /**< Not supported */
44         LOCATIONS_ERROR_INCORRECT_METHOD                        = TIZEN_ERROR_LOCATION_MANAGER | 0x01,  /**< Location manager contains incorrect method for a given call */
45         LOCATIONS_ERROR_NETWORK_FAILED                          = TIZEN_ERROR_LOCATION_MANAGER | 0x02,  /**< Network unavailable */
46         LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE           = TIZEN_ERROR_LOCATION_MANAGER | 0x03,  /**< Location service is not available */
47         LOCATIONS_ERROR_GPS_SETTING_OFF                         = TIZEN_ERROR_LOCATION_MANAGER | 0x04,  /**< Setting for GPS, WPS, or MOCK is turned off */
48         LOCATIONS_ERROR_SECURITY_RESTRICTED                     = TIZEN_ERROR_LOCATION_MANAGER | 0x05,  /**< Restricted by security system policy */
49         LOCATIONS_ERROR_SETTING_OFF                                     = LOCATIONS_ERROR_GPS_SETTING_OFF,              /**< Setting for GPS, WPS, or MOCK is turned off (Since 3.0) */
50 } location_error_e;
51
52
53 /**
54  * @brief Enumeration for Location method type.
55  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
56  */
57 typedef enum {
58         LOCATIONS_METHOD_NONE = -1,     /**< Undefined method */
59         LOCATIONS_METHOD_HYBRID,        /**< This method selects the best method available at the moment */
60         LOCATIONS_METHOD_GPS,           /**< This method uses Global Positioning System */
61         LOCATIONS_METHOD_WPS,           /**< This method uses WiFi Positioning System */
62 } location_method_e;
63
64 /**
65  * @brief Enumeration for Approximate accuracy level of given information.
66  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
67  */
68 typedef enum {
69         LOCATIONS_ACCURACY_NONE = 0,    /**< Invalid data */
70         LOCATIONS_ACCURACY_COUNTRY,             /**< Country accuracy level */
71         LOCATIONS_ACCURACY_REGION,              /**< Regional accuracy level */
72         LOCATIONS_ACCURACY_LOCALITY,    /**< Local accuracy level */
73         LOCATIONS_ACCURACY_POSTALCODE,  /**< Postal accuracy level */
74         LOCATIONS_ACCURACY_STREET,              /**< Street accuracy level */
75         LOCATIONS_ACCURACY_DETAILED,    /**< Detailed accuracy level */
76 } location_accuracy_level_e;
77
78 /**
79  * @brief Enumeration for the state of the location service.
80  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
81  */
82 typedef enum {
83         LOCATIONS_SERVICE_DISABLED,                     /**< Service is disabled */
84         LOCATIONS_SERVICE_ENABLED,                      /**< Service is enabled */
85 } location_service_state_e;
86
87 /**
88  * @deprecated Deprecated since 3.0
89  * @brief Enumeration for the location service accessibility state.
90  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
91  */
92 typedef enum {
93         LOCATIONS_ACCESS_STATE_NONE,            /**< Access state is not determined */
94         LOCATIONS_ACCESS_STATE_DENIED,          /**< Access denied */
95         LOCATIONS_ACCESS_STATE_ALLOWED,         /**< Access authorized */
96 } location_accessibility_state_e;
97
98 /**
99  * @brief The location manager handle.
100  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
101  */
102 typedef struct location_manager_s *location_manager_h;
103
104 /**
105  * @}
106  */
107 /*
108  * Location Manager
109 */
110 /**
111  * @addtogroup CAPI_LOCATION_MANAGER_MODULE
112  * @{
113  */
114 /**
115  * @brief Called at defined interval with updated position information.
116  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
117  * @param[in] latitude          The updated latitude [-90.0 ~ 90.0] (degrees)
118  * @param[in] longitude         The updated longitude [-180.0 ~ 180.0] (degrees)
119  * @param[in] altitude          The updated altitude (meters)
120  * @param[in] timestamp         The timestamp (time when measurement took place or @c 0 if valid)
121  * @param[in] user_data         The user data passed from the call registration function
122  * @pre location_manager_start() will invoke this callback if you register this callback using location_manager_set_position_updated_cb().
123  * @see location_manager_start()
124  * @see location_manager_set_position_updated_cb()
125  */
126 typedef void(*location_position_updated_cb)(double latitude, double longitude, double altitude, time_t timestamp, void *user_data);
127
128 /**
129  * @brief Called at defined interval with updated velocity information.
130  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
131  * @param[in] speed                     The updated speed (km/h)
132  * @param[in] direction         The updated direction (in degrees from the north)
133  * @param[in] climb                     The updated climb (km/h)
134  * @param[in] timestamp         The timestamp (time when measurement took place or @c 0 if valid)
135  * @param[in] user_data         The user data passed from the callback registration function
136  * @pre location_manager_start() will invoke this callback if you register this callback using location_manager_set_velocity_updated_cb().
137  * @see location_manager_start()
138  * @see location_manager_set_velocity_updated_cb()
139  */
140 typedef void(*location_velocity_updated_cb)(double speed, double direction, double climb, time_t timestamp, void *user_data);
141
142 /**
143  * @brief Called at defined interval with updated location information.
144  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
145  * @param[in] error                     #LOCATIONS_ERROR_NONE Successful
146  * @param[in] latitude          The updated latitude [-90.0 ~ 90.0] (degrees)
147  * @param[in] longitude         The updated longitude [-180.0 ~ 180.0] (degrees)
148  * @param[in] altitude          The updated altitude (meters)
149  * @param[in] timestamp         The timestamp (time when measurement took place or @c 0 if valid)
150  * @param[in] speed                     The updated speed (km/h)
151  * @param[in] direction         The updated direction (in degrees from the north)
152  * @param[in] climb                     The updated climb (km/h)
153  * @param[in] user_data         The user data passed from the callback registration function
154  * @pre location_manager_request_single_location() will invoke this callback.
155  * @see location_manager_request_single_location()
156  */
157 typedef void(*location_updated_cb)(location_error_e error, double latitude, double longitude, double altitude, time_t timestamp, double speed, double direction, double climb, void *user_data);
158
159 /**
160  * @brief Called when the state of location service is changed from enabled to disabled or vice versa.
161  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
162  * @param[in] state                     The service state
163  * @param[in] user_data         The user data passed from the callback registration function
164  * @pre Either location_manager_start() or location_manager_stop() will invoke this callback if you register this callback using location_manager_set_service_state_changed_cb()
165  * @see location_manager_start()
166  * @see location_manager_stop()
167  * @see location_manager_set_service_state_changed_cb()
168  * @see #location_service_state_e
169  */
170 typedef void(*location_service_state_changed_cb)(location_service_state_e state, void *user_data);
171
172 /**
173  * @brief Called when the user defined zones are entered or exited.
174  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
175  * @param[in] state                     The boundary state
176  * @param[in] latitude          The updated latitude [-90.0 ~ 90.0] (degrees)
177  * @param[in] longitude         The updated longitude [-180.0 ~ 180.0] (degrees)
178  * @param[in] altitude          The updated altitude (meters)
179  * @param[in] timestamp         The timestamp (time when measurement took place or @c 0 if valid)
180  * @param[in] user_data         The user data passed from the callback registration function
181  * @pre location_manager_start() will invoke this callback if you register this callback using location_manager_set_zone_changed_cb().
182  * @see #location_boundary_state_e
183  * @see location_manager_start()
184  * @see location_manager_set_zone_changed_cb()
185  */
186 typedef void(*location_zone_changed_cb)(location_boundary_state_e state, double latitude, double longitude, double altitude, time_t timestamp, void *user_data);
187
188 /**
189  * @brief Called when the state of location method is changed.
190  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
191  * @param[in] method            The method changed on setting
192  * @param[in] enable            The setting value changed
193  * @param[in] user_data         The user data passed from the callback registration function
194  * @pre location_setting_changed_cb() will invoke this callback if you register this callback using location_manager_set_setting_changed_cb()
195  * @see location_manager_set_setting_changed_cb()
196  * @see location_manager_unset_setting_changed_cb()
197  */
198 typedef void(*location_setting_changed_cb)(location_method_e method, bool enable, void *user_data);
199
200 /**
201  * @brief Called once for each location bound.
202  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
203  * @param[in] bounds            The location bounds handle
204  * @param[in] user_data         The user data passed from the callback registration function
205  * @return @c true to continue with the next iteration of the loop, otherwise @c false to break out of the loop.
206  * @pre location_manager_foreach_boundary() will invoke this callback.
207  * @see location_manager_foreach_boundary()
208  */
209 typedef bool(*location_bounds_cb)(location_bounds_h bounds, void *user_data);
210
211 /**
212  * @brief Called at defined interval with updated location information.
213  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
214  * @param[in] latitude          The updated latitude [-90.0 ~ 90.0] (degrees)
215  * @param[in] longitude         The updated longitude [-180.0 ~ 180.0] (degrees)
216  * @param[in] altitude          The updated altitude (meters)
217  * @param[in] speed                     The updated speed (km/h)
218  * @param[in] direction         The updated direction (in degrees from the north)
219  * @param[in] horizontal_accuracy               The horizontal accuracy (meters)
220  * @param[in] timestamp         The timestamp (time when measurement took place or @c 0 if valid)
221  * @param[in] user_data         The user data passed from the callback registration function
222  * @pre location_manager_start() will invoke this callback if you register this callback using location_manager_set_position_updated_cb()
223  * @see location_manager_start()
224  * @see location_manager_set_distance_based_location_changed_cb()
225  * @see location_manager_set_location_changed_cb()
226  */
227 typedef void(*location_changed_cb)(double latitude, double longitude, double altitude, double speed, double direction, double horizontal_accuracy, time_t timestamp, void *user_data);
228
229 /**
230  * @brief Called when the batch interval is expired.
231  * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
232  * @param[in] num_of_location   The number of location batch data
233  * @param[in] user_data                 The user data passed from the callback registration function
234  * @pre location_manager_start_batch() will invoke this callback if you register this callback using location_manager_set_location_batch_cb()
235  * @see location_manager_start_batch()
236  * @see location_manager_set_location_batch_cb()
237  */
238 typedef void(*location_batch_cb)(int num_of_location, void *user_data);
239
240 /**
241  * @brief Gets iteratively to receive location batch data.
242  * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
243  * @param[in] latitude          The updated latitude [-90.0 ~ 90.0] (degrees)
244  * @param[in] longitude         The updated longitude [-180.0 ~ 180.0] (degrees)
245  * @param[in] altitude          The updated altitude (meters)
246  * @param[in] speed                     The updated speed (km/h)
247  * @param[in] direction         The updated direction (in degrees from the north)
248  * @param[in] horizontal        The horizontal accuracy (meters)
249  * @param[in] vertical          The vertical accuracy (meters)
250  * @param[in] timestamp         The timestamp (time when measurement took place or @c 0 if valid)
251  * @param[in] user_data         The user data passed from the callback registration function
252  * @return @c true to continue with the next iteration of the loop, otherwise @c false to break out of the loop.
253  * @pre location_manager_foreach_location_batch() will invoke this callback
254  * @see location_manager_foreach_location_batch()
255  */
256 typedef bool(*location_batch_get_location_cb)(double latitude, double longitude, double altitude, double speed, double direction, double horizontal, double vertical, time_t timestamp, void *user_data);
257
258 /**
259  * @brief Checks whether the given location method is available.
260  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
261  * @remark The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
262  * @param[in] method The location method to be checked
263  * @return @c true if the specified location method is supported, otherwise @c false if it is not available
264  * @retval #LOCATIONS_ERROR_NONE Successful
265  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED Not supported
266  * @retval #LOCATIONS_ERROR_INCORRECT_METHOD Incorrect method
267  * @see location_manager_create()
268  * @see location_manager_get_method()
269  */
270 bool location_manager_is_supported_method(location_method_e method);
271
272 /**
273  * @brief Checks whether the given location method is enabled or not on setting.
274  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
275  * @param[in] method            The location method to be checked
276  * @param[out] enable           The result value of checking the given location method
277  * @return 0 on success, otherwise a negative error value
278  * @retval #LOCATIONS_ERROR_NONE Successful
279  * @retval #LOCATIONS_ERROR_INCORRECT_METHOD Incorrect method
280  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER   Invalid parameter
281  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED       Not supported
282  * @see location_manager_create()
283  * @see location_manager_set_setting_changed_cb()
284  * @see location_manager_unset_setting_changed_cb()
285  */
286 int location_manager_is_enabled_method(location_method_e method, bool *enable);
287
288 /**
289  * @platform
290  * @brief Enables the given location method.
291  * @since_tizen 2.3.1
292  * @privlevel platform
293  * @privilege %http://tizen.org/privilege/location.enable
294  * @param[in] method            The location method to be checked
295  * @param[in] enable            The value to set
296  * @return 0 on success, otherwise a negative error value
297  * @retval #LOCATIONS_ERROR_NONE Successful
298  * @retval #LOCATIONS_ERROR_INCORRECT_METHOD Incorrect method
299  * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED Permission denied
300  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED       Not supported
301  * @see location_manager_is_enabled_method()
302  * @see location_manager_create()
303  */
304 int location_manager_enable_method(const location_method_e method, const bool enable);
305
306 /**
307  * @brief Creates a new location manager.
308  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
309  * @remarks You must release @a manager using location_manager_destroy().
310  * @param[in] method            The location method
311  * @param[out] manager          The location manager handle that is newly created
312  * @return @c 0 on success, otherwise a negative error value
313  * @retval #LOCATIONS_ERROR_NONE                                Successful
314  * @retval #LOCATIONS_ERROR_OUT_OF_MEMORY               Out of memory
315  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER   Invalid parameter
316  * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE Service not available
317  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED       Not supported
318  * @see location_manager_destroy()
319  */
320 int location_manager_create(location_method_e method, location_manager_h *manager);
321
322 /**
323  * @brief Releases the location manager.
324  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
325  * @param[in] manager The location manager handle
326  * @return @c 0 on success, otherwise a negative error value
327  * @retval #LOCATIONS_ERROR_NONE                                Successful
328  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER   Invalid parameter
329  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED       Not supported
330  * @see location_manager_create()
331 */
332 int location_manager_destroy(location_manager_h manager);
333
334 /**
335  * @brief Request to update current location once.
336  * @remarks Do not request to start the location service using the same manager handler
337  * Calling this function invokes a location service event. When the location service is updated, location_updated_cb
338  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
339  * @privlevel public
340  * @privilege %http://tizen.org/privilege/location
341  * @param[in] manager           The location manager handle
342  * @param[in] timeout           Timeout to stop requesting single location after
343  * @param[in] callback          The location callback function to register
344  * @param[in] user_data         The user data to be passed to the callback function
345  * @retval #LOCATIONS_ERROR_NONE                                                Successful
346  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER                   Invalid parameter
347  * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE               Service not available
348  * @retval #LOCATIONS_ERROR_NETWORK_FAILED                              Network failed
349  * @retval #LOCATIONS_ERROR_GPS_SETTING_OFF                             GPS is not enabled
350  * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED   The application does not have the privilege to call this method
351  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED                               Not supported
352  * @post It invokes location_updated_cb().
353  */
354 int location_manager_request_single_location(location_manager_h manager, int timeout, location_updated_cb callback, void *user_data);
355
356 /**
357  * @brief Starts the location service.
358  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
359  * @privlevel public
360  * @privilege %http://tizen.org/privilege/location
361  *
362  * @remarks There is no limit on number of location managers for which this function was called.
363  *
364  * @remarks Calling this function invokes a location service event. When the location service is enabled, the service state change callback
365  *              (set using location_manager_set_service_state_changed_cb()) notifies the user with #LOCATIONS_SERVICE_ENABLED as
366  *              the first argument, and the service starts.
367  *
368  * @remarks The started service is a requirement for calling these functions:
369  *              location_manager_get_position(), location_manager_get_velocity(), location_manager_get_accuracy(),
370  *              gps_status_get_nmea(), gps_status_get_satellite(), gps_status_foreach_satellites_in_view().
371  *
372  * @remarks Once you stop the service using location_manager_stop(), you can no longer call the functions listed above.
373  *
374  * @remarks Starting and stopping the service is in the scope of the given location manager only (if there is more than one manager,
375  *              starting and stopping should be executed for each of them separately).
376  *
377  * @param[in] manager           The location manager handle
378  * @return 0 on success, otherwise a negative error value
379  * @retval #LOCATIONS_ERROR_NONE                                        Successful
380  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER           Invalid parameter
381  * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE       Service not available
382  * @retval #LOCATIONS_ERROR_NETWORK_FAILED                      Network failed
383  * @retval #LOCATIONS_ERROR_GPS_SETTING_OFF                     GPS is not enabled
384  * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
385  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED                       Not supported
386  * @post It invokes location_position_updated_cb(), location_velocity_updated_cb(), location_zone_changed_cb(), and location_service_state_changed_cb().
387  * @see location_manager_stop()
388  * @see location_manager_get_position()
389  * @see location_manager_get_velocity()
390  * @see location_manager_get_accuracy()
391  * @see location_manager_set_service_state_changed_cb()
392  * @see location_manager_set_position_updated_cb()
393  * @see location_position_updated_cb()
394  * @see location_manager_set_velocity_updated_cb()
395  * @see location_velocity_updated_cb()
396  * @see location_manager_set_zone_changed_cb()
397  * @see location_zone_changed_cb()
398  */
399 int location_manager_start(location_manager_h manager);
400
401 /**
402  * @brief Stops the location service.
403  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
404  * @remarks This function initiates the process of stopping the service. When the process is finished, callback set using
405  * #location_manager_set_service_state_changed_cb() will be called, with #LOCATIONS_SERVICE_DISABLED as first argument.
406  * When that happens, the service is stopped and the user is notified.
407  *
408  * @remarks You can stop and start the location manager as needed.
409  *
410  * @param[in] manager           The location manager handle
411  * @return 0 on success, otherwise a negative error value
412  * @retval #LOCATIONS_ERROR_NONE                                                Successful
413  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER                   Invalid parameter
414  * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE               Service not available
415  * @retval #LOCATIONS_ERROR_NETWORK_FAILED                              Network failed
416  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED                               Not supported
417  * @see location_manager_start()
418  * @see location_manager_set_service_state_changed_cb()
419  * @see location_service_state_changed_cb()
420  */
421 int location_manager_stop(location_manager_h manager);
422
423 /**
424  * @brief Adds a bounds for a given location manager.
425  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
426  * @param[in] manager           The location manager handle
427  * @param[in] bounds            The location bounds handle
428  * @return @c 0 on success, otherwise a negative error value
429  * @retval #LOCATIONS_ERROR_NONE Successful
430  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER                   Invalid parameter
431  * @retval #LOCATIONS_ERROR_OUT_OF_MEMORY                               Out of memory
432  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED                               Not supported
433  * @post It invokes location_manager_set_zone_changed_cb() when a boundary is entered or exited, if you set a callback with location_manager_set_zone_changed_cb().
434  * @see location_manager_remove_boundary()
435  * @see location_manager_set_zone_changed_cb()
436  */
437 int location_manager_add_boundary(location_manager_h manager, const location_bounds_h bounds);
438
439 /**
440  * @brief Deletes a bounds for a given location manager.
441  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
442  * @param[in] manager           The location manager handle
443  * @param[in] bounds            The location bounds handle
444  * @return @c 0 on success, otherwise a negative error value
445  * @retval #LOCATIONS_ERROR_NONE                                                Successful
446  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER                   Invalid parameter
447  * @retval #LOCATIONS_ERROR_OUT_OF_MEMORY                               Out of memory
448  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED                               Not supported
449  * @see location_manager_add_boundary()
450  */
451 int location_manager_remove_boundary(location_manager_h manager, const location_bounds_h bounds);
452
453 /**
454  * @brief Retrieves all location bounds by invoking a specific callback for each location bounds
455  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
456  * @param[in] manager           The location manager handle
457  * @param[in] callback          The iteration callback
458  * @param[in] user_data         The user data to be passed to the callback function
459  * @return      @c 0 on success, otherwise a negative error value
460  * @retval #LOCATIONS_ERROR_NONE                                                Successful
461  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER                   Invalid parameter
462  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED                               Not supported
463  * @post location_bounds_cb() will be invoked
464  * @see location_manager_add_boundary()
465  * @see location_manager_remove_boundary()
466  * @see location_bounds_cb()
467  */
468 int location_manager_foreach_boundary(location_manager_h manager, location_bounds_cb callback, void *user_data);
469
470 /**
471  * @brief Gets the given location manager's method.
472  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
473  * @param[in] manager           The location manager handle
474  * @param[out] method           The location method
475  * @return @c 0 on success, otherwise a negative error value
476  * @retval #LOCATIONS_ERROR_NONE                                Successful
477  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER   Invalid parameter
478  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED               Not supported
479  * @see location_manager_create()
480  */
481 int location_manager_get_method(location_manager_h manager, location_method_e *method);
482
483 /**
484  * @brief Gets the current position information.
485  * @details The result contains the current altitude, latitude, and longitude, with a measurement timestamp.
486  *
487  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
488  * @privlevel public
489  * @privilege %http://tizen.org/privilege/location
490  * @param[in] manager           The location manager handle
491  * @param[out] altitude         The current altitude (meters)
492  * @param[out] latitude         The current latitude [-90.0 ~ 90.0] (degrees)
493  * @param[out] longitude        The current longitude [-180.0 ~ 180.0] (degrees)
494  * @param[out] timestamp        The timestamp (time when measurement took place or @c 0 if valid)
495  * @return 0 on success, otherwise a negative error value
496  * @retval #LOCATIONS_ERROR_NONE                                        Successful
497  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER           Invalid argument
498  * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE       Service not available
499  * @retval #LOCATIONS_ERROR_GPS_SETTING_OFF                     GPS is not enabled
500  * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
501  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED                       Not supported
502  * @pre The location service state must be #LOCATIONS_SERVICE_ENABLED with location_manager_start()
503  */
504 int location_manager_get_position(location_manager_h manager, double *altitude, double *latitude, double *longitude, time_t *timestamp);
505
506 /**
507  * @brief Gets the current position information.
508  * @details The result contains the current altitude, latitude, longitude, climb, direction, speed, level, horizontal and vertical with a measurement timestamp.
509  *
510  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
511  * @privlevel public
512  * @privilege %http://tizen.org/privilege/location
513  * @param[in] manager           The location manager handle
514  * @param[out] altitude         The current altitude (meters)
515  * @param[out] latitude         The current latitude [-90.0 ~ 90.0] (degrees)
516  * @param[out] longitude        The current longitude [-180.0 ~ 180.0] (degrees)
517  * @param[out] climb            The climb (km/h)
518  * @param[out] direction        The direction, degrees from the north
519  * @param[out] speed            The speed (km/h)
520  * @param[out] level            The accuracy level
521  * @param[out] horizontal       The horizontal accuracy (meters)
522  * @param[out] vertical         The vertical accuracy (meters)
523  * @param[out] timestamp        The timestamp (time when measurement took place or @c 0 if valid)
524  * @return 0 on success, otherwise a negative error value
525  * @retval #LOCATIONS_ERROR_NONE                                        Successful
526  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER           Invalid argument
527  * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE       Service not available
528  * @retval #LOCATIONS_ERROR_GPS_SETTING_OFF                     GPS is not enabled
529  * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
530  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED                       Not supported
531  * @pre The location service state must be #LOCATIONS_SERVICE_ENABLED with location_manager_start()
532  */
533 int location_manager_get_location(location_manager_h manager, double *altitude, double *latitude, double *longitude, double *climb, double *direction, double *speed, location_accuracy_level_e *level, double *horizontal, double *vertical, time_t *timestamp);
534
535 /**
536  * @brief Gets the current velocity information.
537  * @details The result contains the current climb, direction, and speed, with a measurement timestamp.
538  *
539  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
540  * @privlevel public
541  * @privilege %http://tizen.org/privilege/location
542  * @param[in] manager           The location manager handle
543  * @param[out] climb            The climb (km/h)
544  * @param[out] direction        The direction, degrees from the north
545  * @param[out] speed            The speed (km/h)
546  * @param[out] timestamp        The timestamp (time when measurement took place or @c 0 if valid)
547  * @return @c 0 on success, otherwise a negative error value
548  * @retval #LOCATIONS_ERROR_NONE                                        Successful
549  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER           Invalid argument
550  * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE       Service not available
551  * @retval #LOCATIONS_ERROR_GPS_SETTING_OFF                     GPS is not enabled
552  * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
553  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED                       Not supported
554  * @pre The location service state must be #LOCATIONS_SERVICE_ENABLED with location_manager_start()
555  */
556 int location_manager_get_velocity(location_manager_h manager, double *climb, double *direction, double *speed, time_t *timestamp);
557
558 /**
559  * @brief Gets the current accuracy information.
560  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
561  * @privlevel public
562  * @privilege %http://tizen.org/privilege/location
563  * @param[in] manager           The location manager handle
564  * @param[out] level            The accuracy level
565  * @param[out] horizontal       The horizontal accuracy (meters)
566  * @param[out] vertical         The vertical accuracy (meters)
567  * @return 0 on success, otherwise a negative error value
568  * @retval #LOCATIONS_ERROR_NONE                                        Successful
569  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER           Invalid argument
570  * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE       Service not available
571  * @retval #LOCATIONS_ERROR_GPS_SETTING_OFF                     GPS is not enabled
572  * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
573  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED                       Not supported
574  * @pre The location service state must be #LOCATIONS_SERVICE_ENABLED with location_manager_start()
575  */
576 int location_manager_get_accuracy(location_manager_h manager, location_accuracy_level_e *level, double *horizontal, double *vertical);
577
578 /**
579  * @brief Gets the last position information which is recorded.
580  * @details The @a altitude, @a latitude, @a longitude, and @c timestamp values should be 0, if there is no record of any previous position information.
581  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
582  * @privlevel public
583  * @privilege %http://tizen.org/privilege/location
584  * @param[in] manager           The location manager handle
585  * @param[out] altitude         The last altitude (meters)
586  * @param[out] latitude         The last latitude [-90.0 ~ 90.0] (degrees)
587  * @param[out] longitude        The last longitude [-180.0 ~ 180.0] (degrees)
588  * @param[out] timestamp        The timestamp (time when measurement took place or @c 0 if valid)
589  * @return @c 0 on success, otherwise a negative error value
590  * @retval #LOCATIONS_ERROR_NONE                                Successful
591  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER   Invalid argument
592  * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
593  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED               Not supported
594  * @pre The location manager handle must be created by location_manager_create()
595  */
596 int location_manager_get_last_position(location_manager_h manager, double *altitude, double *latitude, double *longitude, time_t *timestamp);
597
598 /**
599  * @brief Gets the last location information.
600  * @details The @a altitude, @a latitude, @a longitude, @a climb, @a direction, @a speed and @c timestamp values should be 0, if there is no record of any previous position information.
601  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
602  * @privlevel public
603  * @privilege %http://tizen.org/privilege/location
604  * @param[in] manager           The location manager handle
605  * @param[out] altitude         The current altitude (meters)
606  * @param[out] latitude         The current latitude [-90.0 ~ 90.0] (degrees)
607  * @param[out] longitude        The current longitude [-180.0 ~ 180.0] (degrees)
608  * @param[out] climb            The climb (km/h)
609  * @param[out] direction        The direction, degrees from the north
610  * @param[out] speed            The speed (km/h)
611  * @param[out] level            The accuracy level
612  * @param[out] horizontal       The horizontal accuracy (meters)
613  * @param[out] vertical         The vertical accuracy (meters)
614  * @param[out] timestamp        The timestamp (time when measurement took place or @c 0 if valid)
615  * @return @c 0 on success, otherwise a negative error value
616  * @retval #LOCATIONS_ERROR_NONE                                Successful
617  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER   Invalid argument
618  * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
619  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED               Not supported
620  * @pre The location manager handle must be created by location_manager_create()
621  */
622 int location_manager_get_last_location(location_manager_h manager, double *altitude, double *latitude, double *longitude, double *climb, double *direction, double *speed, location_accuracy_level_e *level, double *horizontal, double *vertical, time_t *timestamp);
623
624
625 /**
626  * @brief Gets the last velocity information which is recorded.
627  * @details The @a climb, @a direction and @a speed values should be @c 0, if there is no record of any previous velocity information.
628  *
629  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
630  * @privlevel public
631  * @privilege %http://tizen.org/privilege/location
632  * @param[in] manager           The location manager handle
633  * @param[out] climb            The last climb (km/h)
634  * @param[out] direction        The last direction, degrees from the north
635  * @param[out] speed            The last speed (km/h)
636  * @param[out] timestamp        The timestamp (time when measurement took place or @c 0 if valid)
637  * @return @c 0 on success, otherwise a negative error value
638  * @retval #LOCATIONS_ERROR_NONE                                Successful
639  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER   Invalid argument
640  * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
641  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED               Not supported
642  * @pre The location manager handle must be created by location_manager_create()
643  */
644 int location_manager_get_last_velocity(location_manager_h manager, double *climb, double *direction, double *speed, time_t *timestamp);
645
646 /**
647  * @brief Gets the last accuracy information which is recorded.
648  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
649  * @privlevel public
650  * @privilege %http://tizen.org/privilege/location
651  * @param[in] manager           The location manager handle
652  * @param[out] level            The last accuracy level
653  * @param[out] horizontal       The last horizontal accuracy (meters)
654  * @param[out] vertical         The last vertical accuracy (meters)
655  * @return 0 on success, otherwise a negative error value
656  * @retval #LOCATIONS_ERROR_NONE                                Successful
657  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER   Invalid argument
658  * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
659  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED       Not supported
660  * @pre The location manager handle must be created by location_manager_create()
661  */
662 int location_manager_get_last_accuracy(location_manager_h manager, location_accuracy_level_e *level, double *horizontal, double *vertical);
663
664 /**
665  * @deprecated Deprecated since 3.0
666  * @brief Gets the current application's location accessibility status.
667  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
668  * @param[out] state            The current location service accessibility status.
669  * @return 0 on success, otherwise a negative error value
670  * @retval #LOCATIONS_ERROR_NONE                                        Successful
671  * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE       Service not available
672  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER           Invalid argument
673  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED                       Not supported
674  */
675 int location_manager_get_accessibility_state(location_accessibility_state_e *state);
676
677 /**
678  * @brief Registers a callback function to be invoked at defined interval with updated position information.
679  *
680  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
681  * @param[in] manager           The location manager handle
682  * @param[in] callback          The callback function to register
683  * @param[in] interval          The interval [1 ~ 120] (seconds)
684  * @param[in] user_data         The user data to be passed to the callback function
685  * @return @c 0 on success, otherwise a negative error value
686  * @retval #LOCATIONS_ERROR_NONE                                Successful
687  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER   Invalid parameter
688  * @retval      #LOCATIONS_ERROR_NOT_SUPPORTED          Not supported
689  * @post location_position_updated_cb() will be invoked
690  * @see location_manager_unset_position_updated_cb()
691  * @see location_position_updated_cb()
692  */
693 int location_manager_set_position_updated_cb(location_manager_h manager, location_position_updated_cb callback, int interval, void *user_data);
694
695 /**
696  * @brief       Unregisters the callback function.
697  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
698  * @param[in] manager           The location manager handle
699  * @return @c 0 on success, otherwise a negative error value
700  * @retval #LOCATIONS_ERROR_NONE                                Successful
701  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER   Invalid parameter
702  * @retval      #LOCATIONS_ERROR_NOT_SUPPORTED          Not supported
703  * @see location_manager_set_position_updated_cb()
704  */
705 int location_manager_unset_position_updated_cb(location_manager_h manager);
706
707 /**
708  * @brief Registers a callback function to be invoked at defined interval with updated velocity information.
709  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
710  * @param[in] manager           The location manager handle
711  * @param[in] callback          The callback function to register
712  * @param[in] interval          The interval [1 ~ 120] (seconds)
713  * @param[in] user_data         The user data to be passed to the callback function
714  * @return @c 0 on success, otherwise a negative error value
715  * @retval #LOCATIONS_ERROR_NONE                                Successful
716  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER   Invalid parameter
717  * @retval      #LOCATIONS_ERROR_NOT_SUPPORTED          Not supported
718  * @post location_velocity_updated_cb() will be invoked
719  * @see location_manager_unset_velocity_updated_cb()
720  * @see location_velocity_updated_cb()
721  */
722 int location_manager_set_velocity_updated_cb(location_manager_h manager, location_velocity_updated_cb callback, int interval, void *user_data);
723
724 /**
725  * @brief       Unregisters the callback function.
726  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
727  * @param[in] manager           The location manager handle
728  * @return @c 0 on success, otherwise a negative error value
729  * @retval #LOCATIONS_ERROR_NONE                                Successful
730  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER   Invalid parameter
731  * @retval      #LOCATIONS_ERROR_NOT_SUPPORTED          Not supported
732  * @see location_manager_set_velocity_updated_cb()
733  */
734 int location_manager_unset_velocity_updated_cb(location_manager_h manager);
735
736 /**
737  * @brief Registers a callback function to be invoked when the location service state is changed.
738  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
739  * @param[in] manager           The location manager handle
740  * @param[in] callback          The callback function to register
741  * @param[in] user_data         The user data to be passed to the callback function
742  * @return @c 0 on success, otherwise a negative error value
743  * @retval #LOCATIONS_ERROR_NONE                                Successful
744  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER   Invalid parameter
745  * @retval      #LOCATIONS_ERROR_NOT_SUPPORTED          Not supported
746  * @post location_service_state_changed_cb() will be invoked
747  * @see location_manager_unset_service_state_changed_cb()
748  * @see location_service_state_changed_cb()
749  * @see location_manager_start()
750  * @see location_manager_stop()
751  * @see #location_service_state_e
752 */
753 int location_manager_set_service_state_changed_cb(location_manager_h manager, location_service_state_changed_cb callback, void *user_data);
754
755 /**
756  * @brief       Unregisters the callback function.
757  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
758  * @param[in] manager           The location manager handle
759  * @return @c 0 on success, otherwise a negative error value
760  * @retval #LOCATIONS_ERROR_NONE                                Successful
761  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER   Invalid parameter
762  * @retval      #LOCATIONS_ERROR_NOT_SUPPORTED          Not supported
763  * @see location_manager_set_service_state_changed_cb()
764  */
765 int location_manager_unset_service_state_changed_cb(location_manager_h manager);
766
767 /**
768  * @brief Registers a callback function to be invoked when the previously set boundary area is entered or left.
769  *
770  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
771  * @param[in] manager           The location manager handle
772  * @param[in] callback          The callback function to register
773  * @param[in] user_data         The user data to be passed to the callback function
774  * @return @c 0 on success, otherwise a negative error value
775  * @retval #LOCATIONS_ERROR_NONE                                Successful
776  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER   Invalid parameter
777  * @retval      #LOCATIONS_ERROR_NOT_SUPPORTED          Not supported
778  * @pre         location_manager_add_boundary() is called before.
779  * @post location_zone_changed_cb() will be invoked
780  * @see location_manager_unset_zone_changed_cb()
781  * @see location_zone_changed_cb()
782  */
783 int location_manager_set_zone_changed_cb(location_manager_h manager, location_zone_changed_cb callback, void *user_data);
784
785 /**
786  * @brief       Unregisters the callback function.
787  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
788  * @param[in] manager           The location manager handle
789  * @return 0 on success, otherwise a negative error value
790  * @retval #LOCATIONS_ERROR_NONE                                Successful
791  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER   Invalid parameter
792  * @retval      #LOCATIONS_ERROR_NOT_SUPPORTED          Not supported
793  * @see location_manager_set_zone_changed_cb()
794  */
795 int location_manager_unset_zone_changed_cb(location_manager_h manager);
796
797 /**
798  * @brief Registers a callback function to be invoked when the location setting is changed.
799  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
800  * @param[in] method            The method to observe
801  * @param[in] callback          The callback function to register
802  * @param[in] user_data         The user data to be passed to the callback function
803  * @return 0 on success, otherwise a negative error value
804  * @retval #LOCATIONS_ERROR_NONE                                Successful
805  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER   Invalid parameter
806  * @retval      #LOCATIONS_ERROR_NOT_SUPPORTED          Not supported
807  * @post location_setting_changed_cb() will be invoked
808  * @see location_manager_unset_setting_changed_cb()
809  * @see location_setting_changed_cb()
810  */
811 int location_manager_set_setting_changed_cb(location_method_e method, location_setting_changed_cb callback, void *user_data);
812
813 /**
814  * @brief Unregisters the callback function.
815  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
816  * @param[in] method            The method to observe
817  * @return 0 on success, otherwise a negative error value
818  * @retval #LOCATIONS_ERROR_NONE                                Successful
819  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER   Invalid parameter
820  * @retval      #LOCATIONS_ERROR_NOT_SUPPORTED          Not supported
821  * @see location_manager_set_setting_changed_cb()
822  */
823 int location_manager_unset_setting_changed_cb(location_method_e method);
824
825 /**
826  * @brief Gets the distance in meters between two locations.
827  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
828  * @param[in] start_latitude            The starting latitude [-90.0 ~ 90.0] (degrees)
829  * @param[in] start_longitude           The starting longitude [-180.0 ~ 180.0] (degrees)
830  * @param[in] end_latitude                      The ending latitude [-90.0 ~ 90.0] (degrees)
831  * @param[in] end_longitude                     The ending longitude [-180.0 ~ 180.0] (degrees)
832  * @param[out] distance                         The distance between two locations (meters)
833  * @return 0 on success, otherwise a negative error value
834  * @retval #LOCATIONS_ERROR_NONE                                Successful
835  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER   Invalid argument
836  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED               Not supported
837  */
838 int location_manager_get_distance(double start_latitude, double start_longitude, double end_latitude, double end_longitude, double *distance);
839
840 /**
841  * @brief Registers a callback function to be invoked at minimum interval or minimum distance with updated position information.
842  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
843  * @param[in] manager           The location manager handle
844  * @param[in] callback          The callback function to register
845  * @param[in] interval          The minimum interval between position updates [1 ~ 120] (seconds)
846  * @param[in] distance          The minimum distance between position updates [1 ~ 120] (meters)
847  * @param[in] user_data         The user data to be passed to the callback function
848  * @return @c 0 on success, otherwise a negative error value
849  * @retval #LOCATIONS_ERROR_NONE                                Successful
850  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER   Invalid parameter
851  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED               Not supported
852  * @post location_changed_cb() will be invoked
853  * @see location_manager_unset_distance_based_location_changed_cb()
854  * @see location_changed_cb()
855  */
856 int location_manager_set_distance_based_location_changed_cb(location_manager_h manager, location_changed_cb callback, int interval, double distance, void *user_data);
857
858 /**
859  * @brief Unregisters the callback function.
860  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
861  * @param[in] manager           The location manager handle
862  * @return @c 0 on success, otherwise a negative error value
863  * @retval #LOCATIONS_ERROR_NONE                                Successful
864  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER   Invalid parameter
865  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED               Not supported
866  * @see location_manager_set_distance_based_location_changed_cb()
867  */
868 int location_manager_unset_distance_based_location_changed_cb(location_manager_h manager);
869
870 /**
871  * @brief Registers a callback function to be invoked at defined interval with updated location information.
872  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
873  * @param[in] manager           The location manager handle
874  * @param[in] callback          The callback function to register
875  * @param[in] interval          The interval [1 ~ 120] (seconds)
876  * @param[in] user_data         The user data to be passed to the callback function
877  * @return @c 0 on success, otherwise a negative error value
878  * @retval #LOCATIONS_ERROR_NONE                                Successful
879  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER   Invalid parameter
880  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED               Not supported
881  * @post location_changed_cb() will be invoked
882  * @see location_manager_unset_location_changed_cb()
883  * @see location_changed_cb()
884  */
885 int location_manager_set_location_changed_cb(location_manager_h manager, location_changed_cb callback, int interval, void *user_data);
886
887 /**
888  * @brief       Unregisters the callback function.
889  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
890  * @param[in] manager           The location manager handle
891  * @return @c 0 on success, otherwise a negative error value
892  * @retval #LOCATIONS_ERROR_NONE                                Successful
893  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER   Invalid parameter
894  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED               Not supported
895  * @see location_manager_set_location_changed_cb()
896  */
897 int location_manager_unset_location_changed_cb(location_manager_h manager);
898
899 /**
900  * @brief Registers a callback function to be invoked when batch_period is expired.
901  * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
902  * @remarks The batch_period should be greater than or equal to the batch_interval.
903  * @param[in] manager                   The location manager handle
904  * @param[in] callback                  The callback function to register
905  * @param[in] batch_interval    The batch sampling interval [1 ~ 255] (seconds)
906  * @param[in] batch_period              The batch period [1 ~ 60000] (seconds)
907  * @param[in] user_data                 The user data to be passed to the callback function
908  * @return @c 0 on success, otherwise a negative error value
909  * @retval #LOCATIONS_ERROR_NONE                                Successful
910  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER   Invalid parameter
911  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED               Not supported
912  * @post location_batch_cb() will be invoked
913  * @see location_manager_start_batch()
914  * @see location_batch_cb()
915  * @see location_manager_unset_location_batch_cb()
916  */
917 int location_manager_set_location_batch_cb(location_manager_h manager, location_batch_cb callback, int batch_interval, int batch_period, void *user_data);
918
919 /**
920  * @brief Unregisters the callback function.
921  * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
922  * @param[in] manager                   The location manager handle
923  * @return @c 0 on success, otherwise a negative error value
924  * @retval #LOCATIONS_ERROR_NONE                                Successful
925  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER   Invalid parameter
926  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED               Not supported
927  * @see location_manager_set_location_batch_cb()
928  */
929 int location_manager_unset_location_batch_cb(location_manager_h manager);
930
931 /**
932  * @brief Starts the location batch service.
933  * @details Calling this function starts location batch service, location_batch_cb() will be invoked every @a batch_period seconds.
934                         After that, you can obtain all locations with location_manager_foreach_location_batch().
935  * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
936  * @privlevel public
937  * @privilege %http://tizen.org/privilege/location
938  * @remarks Calling this function invokes a location service event. When the location service is enabled, the service state change callback
939  *              (set using location_manager_set_service_state_changed_cb()) notifies the user with #LOCATIONS_SERVICE_ENABLED as the first argument, and the service starts.
940  * @param[in] manager                   The location manager handle
941  * @return 0 on success, otherwise a negative error value
942  * @retval #LOCATIONS_ERROR_NONE                                        Successful
943  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER           Invalid parameter
944  * @retval #LOCATIONS_ERROR_INCORRECT_METHOD            Incorrect method
945  * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE       Service not available
946  * @retval #LOCATIONS_ERROR_NETWORK_FAILED                      Network failed
947  * @retval #LOCATIONS_ERROR_GPS_SETTING_OFF                     GPS is not enabled
948  * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
949  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED                       Not supported
950  * @pre location_manager_set_location_batch_cb()
951  * @see location_manager_set_service_state_changed_cb()
952  * @see location_service_state_changed_cb()
953  * @see location_manager_foreach_location_batch()
954  * @see location_manager_stop_batch()
955  */
956 int location_manager_start_batch(location_manager_h manager);
957
958 /**
959  * @brief Stops the location batch service.
960  * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
961  * @remarks This function initiates the process of stopping the service. When the process is finished, callback set using
962  * #location_manager_set_service_state_changed_cb() will be called, with #LOCATIONS_SERVICE_DISABLED as first argument.
963  * @param[in] manager           The location manager handle
964  * @return 0 on success, otherwise a negative error value
965  * @retval #LOCATIONS_ERROR_NONE                                                Successful
966  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER                   Invalid parameter
967  * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE               Service not available
968  * @retval #LOCATIONS_ERROR_NETWORK_FAILED                              Network failed
969  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED                               Not supported
970  * @see location_manager_start_batch()
971  * @see location_manager_set_service_state_changed_cb()
972  * @see location_service_state_changed_cb()
973  */
974 int location_manager_stop_batch(location_manager_h manager);
975
976 /**
977  * @brief Retrieves all location information by invoking a specific callback for each location data.
978  * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
979  * @privlevel public
980  * @privilege %http://tizen.org/privilege/location
981  * @param[in] manager           The location manager handle
982  * @param[in] callback          The iteration callback function
983  * @param[in] user_data         The user data to be passed to the callback function
984  * @return      @c 0 on success, otherwise a negative error value
985  * @retval #LOCATIONS_ERROR_NONE                                                Successful
986  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER                   Invalid parameter
987  * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED   The application does not have the privilege to call this method
988  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED                               Not supported
989  * @pre location_manager_foreach_location_batch() is available after location_batch_cb() is invoked
990  * @post location_batch_get_location_cb() will be invoked
991  * @see location_manager_start_batch()
992  * @see location_batch_cb()
993  * @see location_batch_get_location_cb()
994  */
995 int location_manager_foreach_location_batch(location_manager_h manager, location_batch_get_location_cb callback, void *user_data);
996
997 /**
998  * @brief Checks whether the mock location is enabled.
999  * @since_tizen 3.0
1000  * @param[out] enabled          Indicates whether the mock location is enabled
1001  * @return 0 on success, otherwise a negative error value
1002  * @retval #LOCATIONS_ERROR_NONE Successful
1003  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER   Invalid parameter
1004  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED       Not supported
1005  * @see location_manager_enable_mock_location()
1006  * @see location_manager_set_mock_location()
1007  * @see location_manager_clear_mock_location()
1008  */
1009 int location_manager_is_enabled_mock_location(bool *enabled);
1010
1011 /**
1012  * @brief Enables mock location.
1013  * @details The mock location is a testing function to make location API and callback deliver a mock location
1014  * set by location_manager_set_mock_location() instead of real positioning data even in the other applications.
1015  * @remarks The mock location can only be enabled if developer mode is enabled.
1016  * @since_tizen 3.0
1017  * @privlevel public
1018  * @privilege %http://tizen.org/privilege/location
1019  * @param[in] enable            The value to set
1020  * @return 0 on success, otherwise a negative error value
1021  * @retval #LOCATIONS_ERROR_NONE Successful
1022  * @retval #LOCATIONS_ERROR_SETTING_OFF MOCK location is not enabled
1023  * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED Permission denied
1024  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED       Not supported
1025  * @see location_manager_is_enabled_mock_location()
1026  * @see location_manager_set_mock_location()
1027  * @see location_manager_clear_mock_location()
1028  */
1029 int location_manager_enable_mock_location(const bool enable);
1030
1031 /**
1032  * @brief Sets a mock location for the given location method.
1033  * @details The location sets the given altitude, latitude, longitude, climb, direction, speed, level, horizontal and vertical accuracy.
1034  * @since_tizen 3.0
1035  * @privlevel public
1036  * @privilege %http://tizen.org/privilege/location
1037  * @param[in] manager           The location manager handle
1038  * @param[in] latitude          The current latitude [-90.0 ~ 90.0] (degrees)
1039  * @param[in] longitude         The current longitude [-180.0 ~ 180.0] (degrees)
1040  * @param[in] altitude          The current altitude (meters)
1041  * @param[in] speed                     The speed (km/h)
1042  * @param[in] direction         The direction, degrees from the north [0.0 ~ 360.0]
1043  * @param[in] accuracy          The horizontal accuracy (meters)
1044  * @return 0 on success, otherwise a negative error value
1045  * @retval #LOCATIONS_ERROR_NONE                                        Successful
1046  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER           Invalid argument
1047  * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE       Service not available
1048  * @retval #LOCATIONS_ERROR_SETTING_OFF                         MOCK location is not enabled
1049  * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
1050  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED                       Not supported
1051  * @see location_manager_create()
1052  * @see location_manager_is_enabled_mock_location()
1053  * @see location_manager_enable_mock_location()
1054  * @see location_manager_clear_mock_location()
1055  */
1056 int location_manager_set_mock_location(location_manager_h manager, const double latitude, const double longitude, const double altitude, const double speed, const double direction, const double accuracy);
1057
1058 /**
1059  * @brief Clears a mock location.
1060  * @since_tizen 3.0
1061  * @privlevel public
1062  * @privilege %http://tizen.org/privilege/location
1063  * @param[in] manager           The location manager handle
1064  * @return 0 on success, otherwise a negative error value
1065  * @retval #LOCATIONS_ERROR_NONE                                        Successful
1066  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER           Invalid argument
1067  * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE       Service not available
1068  * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
1069  * @retval #LOCATIONS_ERROR_SETTING_OFF                         MOCK location is not enabled
1070  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED                       Not supported
1071  * @see location_manager_create()
1072  * @see location_manager_is_enabled_mock_location()
1073  * @see location_manager_enable_mock_location()
1074  * @see location_manager_set_mock_location()
1075  */
1076 int location_manager_clear_mock_location(location_manager_h manager);
1077
1078 /**
1079  * @}
1080  */
1081
1082 /*
1083  * GPS Status & Satellites
1084  */
1085
1086 /**
1087  * @addtogroup CAPI_LOCATION_GPS_STATUS_MODULE
1088  * @{
1089  */
1090
1091 /**
1092  * @brief Called once for each satellite in range.
1093  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1094  * @param[in] azimuth           The azimuth of the satellite (degrees)
1095  * @param[in] elevation         The elevation of the satellite (meters)
1096  * @param[in] prn                       The PRN of the satellite
1097  * @param[in] snr                       The SNR of the satellite [dB]
1098  * @param[in] is_active         The flag signaling if satellite is in use
1099  * @param[in] user_data         The user data passed from the foreach function
1100  * @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop
1101  * @pre gps_status_foreach_satellites_in_view() will invoke this callback.
1102  * @pre gps_status_foreach_last_satellites_in_view() will invoke this callback.
1103  * @see gps_status_foreach_satellites_in_view()
1104  */
1105 typedef bool(*gps_status_get_satellites_cb)(unsigned int azimuth, unsigned int elevation, unsigned int prn, int snr, bool is_active, void *user_data);
1106
1107 /**
1108  * @brief Called at defined interval with updated satellite information.
1109  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1110  * @param[out] num_of_active    The last number of active satellites
1111  * @param[out] num_of_inview    The last number of satellites in view
1112  * @param[out] timestamp                The last timestamp (time when measurement took place or @c 0 if valid)
1113  * @param[in] user_data                 The user data passed from the call registration function
1114  * @pre location_manager_start() will invoke this callback if you register this callback using location_manager_set_position_updated_cb()
1115  * @see location_manager_start()
1116  * @see location_manager_set_position_updated_cb()
1117  */
1118 typedef void(*gps_status_satellite_updated_cb)(int num_of_active, int num_of_inview, time_t timestamp, void *user_data);
1119
1120 /**
1121  * @brief Gets the GPS NMEA data.
1122  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1123  * @remarks This call is valid only for location managers with #LOCATIONS_METHOD_GPS method.
1124  *               You must release @a nmea using @c free().
1125  * @param[in] manager   The location manager handle
1126  * @param[out] nmea             The NMEA data
1127  * @return @c 0 on success, otherwise a negative error value
1128  * @retval #LOCATIONS_ERROR_NONE                                        Successful
1129  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER           Invalid argument
1130  * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE       Service not available
1131  * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
1132  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED                       Not supported
1133  * @pre The location service state must be #LOCATIONS_SERVICE_ENABLED with location_manager_start()
1134  * @see location_manager_start()
1135  */
1136 int gps_status_get_nmea(location_manager_h manager, char **nmea);
1137
1138 /**
1139  * @brief Gets the information of satellites.
1140  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1141  * @privlevel public
1142  * @privilege %http://tizen.org/privilege/location
1143  * @remarks This call is valid only for location managers with #LOCATIONS_METHOD_GPS method.
1144  * @param[in] manager                   The location manager handle
1145  * @param[out] num_of_active    The number of active satellites
1146  * @param[out] num_of_inview    The number of satellites in view
1147  * @param[out] timestamp                The timestamp (time when measurement took place or @c 0 if valid)
1148  * @return @c 0 on success, otherwise a negative error value
1149  * @retval #LOCATIONS_ERROR_NONE                                        Successful
1150  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER           Invalid argument
1151  * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE       Service not available
1152  * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
1153  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED                       Not supported
1154  * @pre The location service state must be #LOCATIONS_SERVICE_ENABLED with location_manager_start()
1155  * @pre The gps_status_satellite_updated_cb must be set with gps_status_set_satellite_updated_cb()
1156  * @see gps_status_foreach_satellites_in_view()
1157  */
1158 int gps_status_get_satellite(location_manager_h manager, int *num_of_active, int *num_of_inview, time_t *timestamp);
1159
1160 /**
1161  * @brief Registers a callback function to be invoked at defined interval with updated satellite information.
1162  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1163  * @privlevel public
1164  * @privilege %http://tizen.org/privilege/location
1165  * @param[in] manager           The location manager handle
1166  * @param[in] callback          The callback function to register
1167  * @param[in] interval          The interval [1 ~ 120] (seconds)
1168  * @param[in] user_data         The user data to be passed to the callback function
1169  * @return 0 on success, otherwise a negative error value
1170  * @retval #LOCATIONS_ERROR_NONE                                Successful
1171  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER   Invalid parameter
1172  * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
1173  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED               Not supported
1174  * @post gps_status_satellite_updated_cb() will be invoked
1175  * @see gps_status_unset_satellite_updated_cb()
1176  * @see gps_status_satellite_updated_cb()
1177  * @see gps_status_get_satellite()
1178  * @see gps_status_foreach_satellites_in_view()
1179  * @see gps_status_get_last_satellite()
1180  * @see gps_status_foreach_last_satellites_in_view()
1181  */
1182 int gps_status_set_satellite_updated_cb(location_manager_h manager, gps_status_satellite_updated_cb callback, int interval, void *user_data);
1183
1184 /**
1185  * @brief       Unregisters the callback function.
1186  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1187  * @param[in] manager           The location manager handle
1188  * @return @c 0 on success, otherwise a negative error value
1189  * @retval #LOCATIONS_ERROR_NONE                                Successful
1190  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER   Invalid parameter
1191  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED               Not supported
1192  * @see gps_status_set_satellite_updated_cb()
1193  */
1194 int gps_status_unset_satellite_updated_cb(location_manager_h manager);
1195
1196 /**
1197  * @brief Invokes the callback function for each satellite.
1198  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1199  * @privlevel public
1200  * @privilege %http://tizen.org/privilege/location
1201  * @remarks This function is valid only for location managers with the #LOCATIONS_METHOD_GPS method.
1202  * @param[in] manager           The location manager handle
1203  * @param[in] callback          The iteration callback function
1204  * @param[in] user_data         The user data to be passed to the callback function
1205  * @return @c 0 on success, otherwise a negative error value
1206  * @retval #LOCATIONS_ERROR_NONE                                        Successful
1207  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER           Invalid argument
1208  * @retval #LOCATIONS_ERROR_INCORRECT_METHOD            Incorrect method
1209  * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE       Service not available
1210  * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
1211  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED                       Not supported
1212  * @pre The location service state must be #LOCATIONS_SERVICE_ENABLED with location_manager_start()
1213  * @pre The gps_status_satellite_updated_cb must be set with gps_status_set_satellite_updated_cb()
1214  * @post It invokes gps_status_get_satellites_cb().
1215  * @see gps_status_get_satellite()
1216  * @see gps_status_get_satellites_cb()
1217  */
1218 int gps_status_foreach_satellites_in_view(location_manager_h manager, gps_status_get_satellites_cb callback, void *user_data);
1219
1220 /**
1221  * @brief Gets the last information of satellites.
1222  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1223  * @privlevel public
1224  * @privilege %http://tizen.org/privilege/location
1225  * @remarks This call is valid only for location managers with #LOCATIONS_METHOD_GPS method.
1226  * @param[in] manager                   The location manager handle
1227  * @param[out] num_of_active    The last number of active satellites
1228  * @param[out] num_of_inview    The last number of satellites in view
1229  * @param[out] timestamp                The last timestamp (time when last measurement took place or @c 0 if valid)
1230  * @return @c 0 on success, otherwise a negative error value
1231  * @retval #LOCATIONS_ERROR_NONE                                        Successful
1232  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER           Invalid argument
1233  * @retval #LOCATIONS_ERROR_INCORRECT_METHOD            Incorrect method
1234  * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE       Service not available
1235  * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
1236  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED                       Not supported
1237  * @pre The location service state must be #LOCATIONS_SERVICE_ENABLED with location_manager_start()
1238  * @pre The gps_status_satellite_updated_cb must be set with gps_status_set_satellite_updated_cb()
1239  * @see gps_status_foreach_satellites_in_view()
1240  */
1241 int gps_status_get_last_satellite(location_manager_h manager, int *num_of_active, int *num_of_inview, time_t *timestamp);
1242
1243 /**
1244  * @brief Invokes the callback function for each last satellite which is recorded.
1245  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1246  * @privlevel public
1247  * @privilege %http://tizen.org/privilege/location
1248  * @remarks This function is valid only for location managers with the #LOCATIONS_METHOD_GPS method.
1249  * @param[in] manager           The location manager handle
1250  * @param[in] callback          The iteration callback function
1251  * @param[in] user_data         The user data to be passed to the callback function
1252  * @return @c 0 on success, otherwise a negative error value
1253  * @retval #LOCATIONS_ERROR_NONE                                        Successful
1254  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER           Invalid argument
1255  * @retval #LOCATIONS_ERROR_INCORRECT_METHOD            Incorrect method
1256  * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE       Service not available
1257  * @retval #LOCATIONS_ERROR_ACCESSIBILITY_NOT_ALLOWED The application does not have the privilege to call this method
1258  * @retval #LOCATIONS_ERROR_NOT_SUPPORTED                       Not supported
1259  * @pre The location service state must be #LOCATIONS_SERVICE_ENABLED with location_manager_start()
1260  * @pre The gps_status_satellite_updated_cb must be set with gps_status_set_satellite_updated_cb()
1261  * @post It invokes gps_status_get_satellites_cb().
1262  * @see gps_status_get_last_satellite()
1263  * @see gps_status_get_satellites_cb()
1264  */
1265 int gps_status_foreach_last_satellites_in_view(location_manager_h manager, gps_status_get_satellites_cb callback, void *user_data);
1266
1267 /**
1268  * @}
1269  */
1270 #ifdef __cplusplus
1271 }
1272 #endif
1273
1274 #endif /* __TIZEN_LOCATION_LOCATIONS_H__ */