Location setting restriction to support DPM
[platform/core/api/location-manager.git] / include / location_batch.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_BATCH_H__
18 #define __TIZEN_LOCATION_BATCH_H__
19
20 #include <locations.h>
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 /**
27  * @internal
28  * @{
29  * @addtogroup CAPI_LOCATION_MANAGER_MODULE
30  * @{
31  */
32
33 /**
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
37  */
38 typedef void(*location_batch_cb)(int num_of_location, void *user_data);
39
40 /**
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()
52  */
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);
54
55 /**
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
62  */
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);
64
65 /**
66  * @brief Unregisters the callback function.
67  * @param[in] manager                   The location manager handle
68  */
69 int location_manager_unset_location_batch_cb(location_manager_h manager);
70
71 /**
72  * @brief Start the location batch mode.
73  * @param[in] manager                   The location manager handle
74  */
75 int location_manager_start_batch(location_manager_h manager);
76
77 /**
78  * @brief Stop the location batch mode.
79  * @param[in] manager           The location manager handle
80  */
81 int location_manager_stop_batch(location_manager_h manager);
82
83 /**
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
89  */
90 int location_manager_foreach_location_batch(location_manager_h manager, location_batch_get_location_cb callback, void *user_data);
91
92 int location_manager_enable_restriction(bool enable);
93
94 /**
95  * @}
96  * @}
97  */
98
99 #ifdef __cplusplus
100 }
101 #endif
102
103 #endif /* __TIZEN_LOCATION_BATCH_H__ */