update for beta universally
[platform/core/location/lbs-location.git] / location / include / location-types.h
1 /*
2  * libslp-location
3  *
4  * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Youngae Kang <youngae.kang@samsung.com>, Yunhan Kim <yhan.kim@samsung.com>,
7  *          Genie Kim <daejins.kim@samsung.com>, Minjune Kim <sena06.kim@samsung.com>
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21
22 #ifndef __LOCATION_TYPE_H__
23 #define __LOCATION_TYPE_H__
24
25 #include <glib.h>
26 #include <glib-object.h>
27
28 G_BEGIN_DECLS
29
30 #ifndef LOCATION_DEPRECATED_API
31 #define LOCATION_DEPRECATED_API __attribute__ ((deprecated))
32 #endif
33
34 /**
35  * @file location-types.h
36  * @brief This file contains the Location related structure, enumeration, and asynchronous function definitions.
37  * @addtogroup LocationFW
38  * @{
39  * @defgroup LocationTypes Location Types
40  * @brief This sub module provides structure, enumeration, and asynchronous function definitions.
41  * @addtogroup LocationTypes
42  * @{
43  */
44
45 /**
46  * @brief This represents the returned error code of used functions.
47  */
48 typedef enum {
49         LOCATION_ERROR_NONE = 0,       ///< Success.
50         LOCATION_ERROR_NOT_ALLOWED,    ///< Location servie is not allowed.
51         LOCATION_ERROR_NOT_AVAILABLE,  ///< Location service is not available.
52         LOCATION_ERROR_NETWORK_FAILED, ///< Network is not available.
53         LOCATION_ERROR_NETWORK_NOT_CONNECTED, ///< Network is not connected.
54         LOCATION_ERROR_CONFIGURATION,  ///< Configuration setting is not correct.
55         LOCATION_ERROR_PARAMETER,      ///< Input parameter is not correct.
56         LOCATION_ERROR_NOT_FOUND,      ///< Output is not found.
57         LOCATION_ERROR_NOT_SUPPORTED,  ///< Not supported.
58         LOCATION_ERROR_UNKNOWN,        ///< Unknown error.
59 } LocationError;
60
61 /**
62  * @brief This represents location method to be used.
63  */
64 typedef enum
65 {
66         LOCATION_METHOD_NONE = -1,   ///< Undefined method.
67         LOCATION_METHOD_HYBRID = 0,  ///< This method selects best method.
68         LOCATION_METHOD_GPS,         ///< This method uses Global Positioning System.
69         LOCATION_METHOD_WPS,         ///< This method uses Wifi Positioning System.
70         LOCATION_METHOD_CPS,         ///< This method uses cell ID of base station.
71         LOCATION_METHOD_IPS,         ///< This method uses IP address.
72         LOCATION_METHOD_SPS          ///< This method uses sensor.
73 } LocationMethod;
74
75 /**
76  * @brief This represents the update type given by signal callback.
77  */
78 typedef enum {
79         UPDATE_TYPE_NONE = -1,  ///< Undefined update type.
80         POSITION_UPDATED = 0,   ///< This type is used when position information is updated.
81         VELOCITY_UPDATED,       ///< This type is used when velocity information is updated.
82         SATELLITE_UPDATED,              ///< This type is used when satellite information is updated.
83         ADDRESS_UPDATED,        ///< This type is used when address information is updated. This is not implemented yet.
84         GEOCODE_UPDATED,        ///< This type is used when geocode information is updated. This is not implemented yet.
85         REVERSEGEOCODE_UPDATED  ///< This type is used when reverse geocode information is updated. This is not implemented yet.
86 } LocationUpdateType;
87
88 typedef enum {
89         MAP_SERVICE_PREF_LANGUAGE,
90         MAP_SERVICE_PREF_DISTANCE_UNIT,
91
92         MAP_SERVICE_PREF_PROPERTY,
93
94         MAP_SERVICE_GEOCODE_TYPE,
95         MAP_SERVICE_REVERSE_GEOCODE_TYPE,
96
97         MAP_SERVICE_POI_TYPE,
98         MAP_SERVICE_POI_SEARCH_BY_ADDRESS,
99         MAP_SERVICE_POI_SEARCH_BY_FREEFORM_ADDRESS,
100         MAP_SERVICE_POI_SEARCH_BY_CIRCLE_BOUNDARY,
101         MAP_SERVICE_POI_SEARCH_BY_RECT_BOUNDARY,
102         MAP_SERVICE_POI_SEARCH_BY_POLYGON_BOUNDARY,
103         MAP_SERVICE_POI_PREF_SORT_BY,
104         MAP_SERVICE_POI_PREF_PROPERTY,
105         MAP_SERVICE_POI_FILTER,
106         MAP_SERVICE_POI_FILTER_CATEGORY,
107
108         MAP_SERVICE_ROUTE_REQUEST_FREEFORM_ADDR_TO_AVOID,
109         MAP_SERVICE_ROUTE_REQUEST_STRUCTED_ADDR_TO_AVOID,
110         MAP_SERVICE_ROUTE_REQUEST_CIRCLE_AREA_TO_AVOID,
111         MAP_SERVICE_ROUTE_REQUEST_RECT_AREA_TO_AVOID,
112         MAP_SERVICE_ROUTE_REQUEST_POLYGON_AREA_TO_AVOID,
113         MAP_SERVICE_ROUTE_REQUEST_FEATURE_TO_AVOID,
114         MAP_SERVICE_ROUTE_PREF_TYPE,
115         MAP_SERVICE_ROUTE_PREF_TRANSPORT_MODE,
116         MAP_SERVICE_ROUTE_PREF_GEOMETRY_BOUNDING_BOX,
117         MAP_SERVICE_ROUTE_PREF_GEOMETRY_RETRIEVAL,
118         MAP_SERVICE_ROUTE_PREF_INSTRUCTION_GEOMETRY,
119         MAP_SERVICE_ROUTE_PREF_INSTRUCTION_BOUNDING_BOX,
120         MAP_SERVICE_ROUTE_PREF_INSTRUCTION_RETRIEVAL,
121         MAP_SERVICE_ROUTE_PREF_REALTIME_TRAFFIC,
122         MAP_SERVICE_ROUTE_PREF_PROPERTY,
123         MAP_SERVICE_ROUTE_DISTANCE_UNIT,
124         MAP_SERVICE_ROUTE_PROPERTY,
125         MAP_SERVICE_ROUTE_SEGMENT_PROPERTY,
126         MAP_SERVICE_ROUTE_STEP_PROPERTY,
127         MAP_SERVICE_TYPE_MAX
128
129 } LocationMapServiceType;
130
131 /**
132  * @brief Location object redefined by GObject.
133  */
134 typedef GObject LocationObject;
135
136 /**
137  * @brief This represents position information such as latitude-longitude-altitude values and timestamp.
138  */
139 typedef struct _LocationPosition   LocationPosition;
140
141 /**
142  * @brief This represents last known position information such as latitude-longitude values and accuracy. \n
143  *              This would be deprecated soon.
144  */
145 typedef struct _LocationLastPosition   LocationLastPosition;
146
147 /**
148  * @brief This represents position information such as number of satellites in used or in view.
149  */
150 typedef struct _LocationSatellite  LocationSatellite;
151
152 /**
153  * @brief This represents velocity information such as as speed, direction, climb.
154  */
155 typedef struct _LocationVelocity   LocationVelocity;
156
157 /**
158  * @brief This represents location accuracy information such as accuracy level, horizontal and vertical accuracy.
159  */
160 typedef struct _LocationAccuracy   LocationAccuracy;
161
162 /**
163  * @brief This represents boundary information such as rectangular or circle area.
164  */
165 typedef struct _LocationBoundary   LocationBoundary;
166
167 /**
168  * @brief This represents address information such as building number, street name, etc.
169  */
170 typedef struct _LocationAddress    LocationAddress;
171
172 /**
173  * @brief This represents a structure of Location preference.
174  */
175 typedef struct _LocationPreference LocationPreference;
176
177 /**
178  * @brief This represents a structure of Location POI filter.
179  */
180 typedef struct _LocationPOIFilter LocationPOIFilter;
181
182 /**
183  * @brief This represents a structure of Location POI preference.
184  */
185 typedef struct _LocationPOIPreference LocationPOIPreference;
186
187 /**
188  * @brief This represents a structure of Landmark information.
189  */
190 typedef struct _LocationLandmark    LocationLandmark;
191
192 /**
193  * @brief This represents a structure of Landmark Url.
194  */
195 typedef struct _LocationLandmarkUrl    LocationLandmarkUrl;
196
197 /**
198  * @brief This represents a structure of Location route preference.
199  */
200 typedef struct _LocationRoutePreference LocationRoutePreference;
201
202 /**
203  * @brief This represents a structure of Location route.
204  */
205 typedef struct _LocationRoute LocationRoute;
206
207 /**
208  * @brief This represents a structure of Location route segment.
209  */
210 typedef struct _LocationRouteSegment LocationRouteSegment;
211
212 /**
213  * @brief This represents a structure of Location route step.
214  */
215 typedef struct _LocationRouteStep LocationRouteStep;
216
217 /**
218  * @brief This represents callback function which will be called to give position information.
219  */
220 typedef void (*LocationPositionCB)(LocationError error, GList *position_list, GList *accuracy_list, gpointer userdata);
221
222 /**
223  * @brief This represents callback function which will be called to give address information.
224  */
225 typedef void  (*LocationAddressCB)(LocationError error, LocationAddress *address, LocationAccuracy *acc, gpointer userdata);
226
227 /**
228  * @brief This represents callback function which will be called to give POI information.
229  */
230 typedef void (*LocationPOICB)(LocationError error, guint req_id, GList *landmark_list, gchar *error_code, gchar *error_msg, gpointer userdata);
231
232 /**
233  * @brief This represents callback function which will be called to give Route information.
234  */
235 typedef void (*LocationRouteCB)(LocationError error, guint req_id, GList *route_list, gchar *error_code, gchar *error_msg, gpointer userdata);
236
237 /**
238  * @}@}
239  */
240
241 G_END_DECLS
242
243 #endif /* __LOCATION_TYPE_H__ */