removed wrong contacts, added authors
[platform/core/location/lbs-location.git] / location / include / location-types.h
1 /*
2  * libslp-location
3  *
4  * Copyright (c) 2010-2013 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18
19 #ifndef __LOCATION_TYPES_H__
20 #define __LOCATION_TYPES_H__
21
22 #include <glib.h>
23 #include <glib-object.h>
24
25 G_BEGIN_DECLS
26
27 /**
28  * @file location-types.h
29  * @brief This file contains the Location related structure, enumeration, and asynchronous function definitions.
30  * @addtogroup LocationFW
31  * @{
32  * @defgroup LocationTypes Location Types
33  * @brief This sub module provides structure, enumeration, and asynchronous function definitions.
34  * @addtogroup LocationTypes
35  * @{
36  */
37
38 /**
39  * @brief This represents the returned error code of used functions.
40  */
41 typedef enum {
42         LOCATION_ERROR_NONE = 0,                /*/< Success. */
43         LOCATION_ERROR_NOT_ALLOWED,             /*/< Location servie is not allowed from privacy settings. */
44         LOCATION_ERROR_NOT_AVAILABLE,           /*/< Location service is not available. */
45         LOCATION_ERROR_NETWORK_FAILED,          /*/< Network is not available. */
46         LOCATION_ERROR_NETWORK_NOT_CONNECTED,   /*/< Network is not connected. */
47         LOCATION_ERROR_CONFIGURATION,           /*/< Configuration setting is not correct. */
48         LOCATION_ERROR_PARAMETER,               /*/< Input parameter is not correct. */
49         LOCATION_ERROR_NOT_FOUND,               /*/< Output is not found. */
50         LOCATION_ERROR_NOT_SUPPORTED,           /*/< Not supported. */
51         LOCATION_ERROR_UNKNOWN,                 /*/< Unknown error. */
52         LOCATION_ERROR_SETTING_OFF,             /*/< Location service(GPS/WPS) is off in location settings. */
53         LOCATION_ERROR_SECURITY_DENIED,         /*/< System disables location service. */
54 } LocationError;
55
56 /**
57  * @brief This represents location method to be used.
58  */
59 typedef enum {
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_PASSIVE,                        /* < This method is for passive method */
65         INTERNAL_METHOD_MOCK,                           /*/< This method uses mock location. */
66         LOCATION_METHOD_MAX,                            /*/< The numer of methods */
67 } LocationMethod;
68
69 /**
70  * @brief This represents the update type given by signal callback.
71  */
72 typedef enum {
73         POSITION_UPDATED        = 0x01,                                         /*/< This type is used when position information is updated. */
74         VELOCITY_UPDATED        = POSITION_UPDATED << 0x01,     /*/< This type is used when velocity information is updated. */
75         SATELLITE_UPDATED       = POSITION_UPDATED << 0x02,     /*/< This type is used when satellite information is updated. */
76         DISTANCE_UPDATED        = POSITION_UPDATED << 0x03,     /*/< This type is used when distance information is updated. */
77         LOCATION_CHANGED        = POSITION_UPDATED << 0x04,     /*/< This type is used when location information is updated. */
78 } LocationUpdateType;
79
80 /**
81  * @brief This represents the state whether an application is able to use location service
82  */
83 typedef enum {
84         LOCATION_ACCESS_NONE,           /*/< An application is not registered. */
85         LOCATION_ACCESS_DENIED,         /*/< An application is not permited to use location service. */
86         LOCATION_ACCESS_ALLOWED,        /*/< An application is able to use location service. */
87 } LocationAccessState;
88
89 /**
90  * @brief This represents the setting type.
91  */
92 typedef enum {
93         RESTRICT_OFF    = 0,
94         RESTRICT_NONE   = 0x01,
95         RESTRICT_GPS    = RESTRICT_NONE << 0x01,
96         RESTRICT_WPS    = RESTRICT_NONE << 0x02,
97         RESTRICT_HYBRID = RESTRICT_NONE << 0x03,
98 } LocationRestrictType;
99
100 /**
101  * @brief Location object redefined by GObject.
102  */
103 typedef GObject LocationObject;
104
105 /**
106  * @brief This represents position information such as latitude-longitude-altitude values and timestamp.
107  */
108 typedef struct _LocationPosition        LocationPosition;
109
110 /**
111  * @brief This represents last known position information such as latitude-longitude values and accuracy. \n
112  *              This would be deprecated soon.
113  */
114 typedef struct _LocationLastPosition    LocationLastPosition;
115
116 /**
117  * @brief This represents location batch information such as Position, Satellite and Accuracy.
118  */
119 typedef struct _LocationBatch           LocationBatch;
120
121 /**
122  * @brief This represents position information such as number of satellites in used or in view.
123  */
124 typedef struct _LocationSatellite       LocationSatellite;
125
126 /**
127  * @brief This represents velocity information such as as speed, direction, climb.
128  */
129 typedef struct _LocationVelocity        LocationVelocity;
130
131 /**
132  * @brief This represents location accuracy information such as accuracy level, horizontal and vertical accuracy.
133  */
134 typedef struct _LocationAccuracy        LocationAccuracy;
135
136 /**
137  * @brief This represents boundary information such as rectangular or circle area.
138  */
139 typedef struct _LocationBoundary        LocationBoundary;
140
141 typedef void (*LocationSettingCb)(LocationMethod method, gboolean enable, void *user_data);
142
143 /**
144  * @}@}
145  */
146
147 G_END_DECLS
148
149 #endif /* __LOCATION_TYPES_H__ */