fb74707dad5ba9831aff85da5c6f143acee22389
[platform/core/location/lbs-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 /**
31  * @file location-types.h
32  * @brief This file contains the Location related structure, enumeration, and asynchronous function definitions.
33  * @addtogroup LocationFW
34  * @{
35  * @defgroup LocationTypes Location Types
36  * @brief This sub module provides structure, enumeration, and asynchronous function definitions.
37  * @addtogroup LocationTypes
38  * @{
39  */
40
41 /**
42  * @brief This represents the returned error code of used functions.
43  */
44 typedef enum {
45         LOCATION_ERROR_NONE = 0,       ///< Success.
46         LOCATION_ERROR_NOT_ALLOWED,    ///< Location servie is not allowed.
47         LOCATION_ERROR_NOT_AVAILABLE,  ///< Location service is not available.
48         LOCATION_ERROR_NETWORK_FAILED, ///< Network is not available.
49         LOCATION_ERROR_NETWORK_NOT_CONNECTED, ///< Network is not connected.
50         LOCATION_ERROR_CONFIGURATION,  ///< Configuration setting is not correct.
51         LOCATION_ERROR_PARAMETER,      ///< Input parameter is not correct.
52         LOCATION_ERROR_UNKNOWN,        ///< Unknown error.
53 } LocationError;
54
55 /**
56  * @brief This represents location method to be used.
57  */
58 typedef enum
59 {
60         LOCATION_METHOD_NONE = -1,   ///< Undefined method.
61         LOCATION_METHOD_HYBRID = 0,  ///< This method selects best method.
62         LOCATION_METHOD_GPS,         ///< This method uses Global Positioning System.
63         LOCATION_METHOD_WPS,         ///< This method uses Wifi Positioning System.
64         LOCATION_METHOD_CPS,         ///< This method uses cell ID of base station.
65         LOCATION_METHOD_IPS,         ///< This method uses IP address.
66         LOCATION_METHOD_SPS          ///< This method uses sensor.
67 } LocationMethod;
68
69 /**
70  * @brief This represents the update type given by signal callback.
71  */
72 typedef enum {
73         UPDATE_TYPE_NONE = -1,  ///< Undefined update type.
74         POSITION_UPDATED = 0,   ///< This type is used when position information is updated.
75         VELOCITY_UPDATED,       ///< This type is used when velocity information is updated.
76         ADDRESS_UPDATED,        ///< This type is used when address information is updated. This is not implemented yet.
77         GEOCODE_UPDATED,        ///< This type is used when geocode information is updated. This is not implemented yet.
78         REVERSEGEOCODE_UPDATED  ///< This type is used when reverse geocode information is updated. This is not implemented yet.
79 } LocationUpdateType;
80
81 /**
82  * @brief Location object redefined by GObject.
83  */
84 typedef GObject LocationObject;
85
86 /**
87  * @brief This represents position information such as latitude-longitude-altitude values and timestamp.
88  */
89 typedef struct _LocationPosition   LocationPosition;
90
91 /**
92  * @brief This represents last known position information such as latitude-longitud values and accuracy.
93  */
94 typedef struct _LocationLastPosition   LocationLastPosition;
95
96 /**
97  * @brief This represents velocity information such as as speed, direction, climb.
98  */
99 typedef struct _LocationVelocity   LocationVelocity;
100
101 /**
102  * @brief This represents location accuracy information such as accuracy level, horizontal and vertical accuracy.
103  */
104 typedef struct _LocationAccuracy   LocationAccuracy;
105
106 /**
107  * @brief This represents address information such as building number, street name, etc.
108  */
109 typedef struct _LocationAddress    LocationAddress;
110
111 /**
112  * @brief This represents boundary information such as rectagular or circle area.
113  */
114 typedef struct _LocationBoundary   LocationBoundary;
115
116 /**
117  * @brief This represents position information such as number of satelltes in used or in view.
118  */
119 typedef struct _LocationSatellite  LocationSatellite;
120
121 /**
122  * @brief This represents a number of POI informations.
123  */
124 typedef struct _LocationPOIInfo    LocationPOIInfo;
125
126 /**
127  * @brief This represents callback function which will be called to give postiion information.
128  */
129 typedef void (*LocationPositionCB)(LocationError error, LocationPosition *position, LocationAccuracy *acc, gpointer userdata);
130
131 /**
132  * @brief This represents callback function which will be called to give address information.
133  */
134 typedef void (*LocationAddressCB)(LocationError error, LocationAddress *address, LocationAccuracy *acc, gpointer userdata);
135
136 /**
137  * @brief This represents callback function which will be called to give POI information.
138  */
139 typedef void (*LocationPOICB)(LocationError error, LocationPOIInfo *poi, gpointer userdata);
140
141 /**
142  * @}@}
143  */
144
145 G_END_DECLS
146
147 #endif /* __LOCATION_TYPE_H__ */