2 * Copyright (c) 2011-2013 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef __TIZEN_LOCATION_BATCH_H__
18 #define __TIZEN_LOCATION_BATCH_H__
20 #include <locations.h>
29 * @addtogroup CAPI_LOCATION_MANAGER_MODULE
34 * @brief Called when the batch interval is expired.
35 * @param[in] num_of_location The number of location batch data
36 * @param[in] user_data The user data passed from the callback registration function
38 typedef void(*location_batch_cb)(int num_of_location, void *user_data);
41 * @brief Gets called iteratively to receive location batch data.
42 * @param[in] latitude The updated latitude [-90.0 ~ 90.0] (degrees)
43 * @param[in] longitude The updated longitude [-180.0 ~ 180.0] (degrees)
44 * @param[in] altitude The updated altitude (meters)
45 * @param[in] speed The updated speed (km/h)
46 * @param[in] direction The updated direction (in degrees from the north)
47 * @param[in] horizontal The horizontal accuracy (meters)
48 * @param[in] vertical The vertical accuracy (meters)
49 * @param[in] timestamp The timestamp (time when measurement took place or @c 0 if valid)
50 * @param[in] user_data The user data passed from the callback registration function
51 * @pre location_batch_get_location_cb() will invoke this callback if you register this callback using location_manager_foreach_location_batch()
53 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);
56 * @brief Registers a callback function to be invoked when batch_period is expired.
57 * @param[in] manager The location manager handle
58 * @param[in] callback The callback function to register
59 * @param[in] batch_interval The batch smpling interval
60 * @param[in] batch_period The batch period
61 * @post location_batch_cb() will be invoked
63 int location_manager_set_location_batch_cb(location_manager_h manager, location_batch_cb callback, int batch_interval, int batch_period, void *user_data);
66 * @brief Unregisters the callback function.
67 * @param[in] manager The location manager handle
69 int location_manager_unset_location_batch_cb(location_manager_h manager);
72 * @brief Start the location batch mode.
73 * @param[in] manager The location manager handle
75 int location_manager_start_batch(location_manager_h manager);
78 * @brief Stop the location batch mode.
79 * @param[in] manager The location manager handle
81 int location_manager_stop_batch(location_manager_h manager);
84 * @brief Retrieves all location information by invoking a specific callback for each location data.
85 * @param[in] manager The location manager handle
86 * @param[in] callback The iteration callback function
87 * @param[in] user_data The user data passed from the callback registration function
88 * @post location_batch_get_location_cb() will be invoked
90 int location_manager_foreach_location_batch(location_manager_h manager, location_batch_get_location_cb callback, void *user_data);
92 int location_manager_enable_restriction(bool enable);
103 #endif /* __TIZEN_LOCATION_BATCH_H__ */