ab0c147f875302a01c65a99a94bf436a2c475717
[framework/location/libslp-location.git] / location / 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_UNKNOWN,        ///< Unknown error.
58 } LocationError;
59
60 /**
61  * @brief This represents location method to be used.
62  */
63 typedef enum
64 {
65         LOCATION_METHOD_NONE = -1,   ///< Undefined method.
66         LOCATION_METHOD_HYBRID = 0,  ///< This method selects best method.
67         LOCATION_METHOD_GPS,         ///< This method uses Global Positioning System.
68         LOCATION_METHOD_WPS,         ///< This method uses Wifi Positioning System.
69         LOCATION_METHOD_CPS,         ///< This method uses cell ID of base station.
70         LOCATION_METHOD_IPS,         ///< This method uses IP address.
71         LOCATION_METHOD_SPS          ///< This method uses sensor.
72 } LocationMethod;
73
74 /**
75  * @brief This represents the update type given by signal callback.
76  */
77 typedef enum {
78         UPDATE_TYPE_NONE = -1,  ///< Undefined update type.
79         POSITION_UPDATED = 0,   ///< This type is used when position information is updated.
80         VELOCITY_UPDATED,       ///< This type is used when velocity information is updated.
81         SATELLITE_UPDATED,      ///< This type is used when satellite information is updated.
82         ADDRESS_UPDATED,        ///< This type is used when address information is updated. This is not implemented yet.
83         GEOCODE_UPDATED,        ///< This type is used when geocode information is updated. This is not implemented yet.
84         REVERSEGEOCODE_UPDATED  ///< This type is used when reverse geocode information is updated. This is not implemented yet.
85 } LocationUpdateType;
86
87 /**
88  * @brief Location object redefined by GObject.
89  */
90 typedef GObject LocationObject;
91
92 /**
93  * @brief This represents position information such as latitude-longitude-altitude values and timestamp.
94  */
95 typedef struct _LocationPosition   LocationPosition;
96
97 /**
98  * @brief This represents last known position information such as latitude-longitude values and accuracy.
99  */
100 typedef struct _LocationLastPosition   LocationLastPosition;
101
102 /**
103  * @brief This represents velocity information such as as speed, direction, climb.
104  */
105 typedef struct _LocationVelocity   LocationVelocity;
106
107 /**
108  * @brief This represents location accuracy information such as accuracy level, horizontal and vertical accuracy.
109  */
110 typedef struct _LocationAccuracy   LocationAccuracy;
111
112 /**
113  * @brief This represents address information such as building number, street name, etc.
114  */
115 typedef struct _LocationAddress    LocationAddress;
116
117 /**
118  * @brief This represents boundary information such as rectangular or circle area.
119  */
120 typedef struct _LocationBoundary   LocationBoundary;
121
122 /**
123  * @brief This represents position information such as number of satellites in used or in view.
124  */
125 typedef struct _LocationSatellite  LocationSatellite;
126
127 /**
128  * @brief This represents a number of POI informations.
129  */
130 typedef struct _LocationPOIInfo    LocationPOIInfo;
131
132 /**
133  * @brief This represents callback function which will be called to give position information.
134  */
135 typedef void (*LocationPositionCB)(LocationError error, GList *position_list, GList *accuracy_list, gpointer userdata);
136
137 /**
138  * @brief This represents callback function which will be called to give address information.
139  */
140 typedef void (*LocationAddressCB)(LocationError error, LocationAddress *address, LocationAccuracy *acc, gpointer userdata);
141
142 /**
143  * @brief This represents callback function which will be called to give POI information.
144  */
145 typedef void (*LocationPOICB)(LocationError error, LocationPOIInfo *poi, gpointer userdata);
146
147 /**
148  * @}@}
149  */
150
151 G_END_DECLS
152
153 #endif /* __LOCATION_TYPE_H__ */