4 * Copyright (c) 2010-2013 Samsung Electronics Co., Ltd. All rights reserved.
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
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #ifndef __LOCATION_TYPES_H__
20 #define __LOCATION_TYPES_H__
23 #include <glib-object.h>
28 * @file location-types.h
29 * @brief This file contains the Location related structure, enumeration, and asynchronous function definitions.
30 * @addtogroup LocationFW
32 * @defgroup LocationTypes Location Types
33 * @brief This sub module provides structure, enumeration, and asynchronous function definitions.
34 * @addtogroup LocationTypes
39 * @brief This represents the returned error code of used functions.
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. */
57 * @brief This represents location method to be used.
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 */
70 * @brief This represents the update type given by signal callback.
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. */
81 * @brief This represents the state whether an application is able to use location service
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;
90 * @brief This represents the setting type.
95 RESTRICT_GPS = RESTRICT_NONE << 0x01,
96 RESTRICT_WPS = RESTRICT_NONE << 0x02,
97 RESTRICT_HYBRID = RESTRICT_NONE << 0x03,
98 } LocationRestrictType;
101 * @brief Location object redefined by GObject.
103 typedef GObject LocationObject;
106 * @brief This represents position information such as latitude-longitude-altitude values and timestamp.
108 typedef struct _LocationPosition LocationPosition;
111 * @brief This represents last known position information such as latitude-longitude values and accuracy. \n
112 * This would be deprecated soon.
114 typedef struct _LocationLastPosition LocationLastPosition;
117 * @brief This represents location batch information such as Position, Satellite and Accuracy.
119 typedef struct _LocationBatch LocationBatch;
122 * @brief This represents position information such as number of satellites in used or in view.
124 typedef struct _LocationSatellite LocationSatellite;
127 * @brief This represents velocity information such as as speed, direction, climb.
129 typedef struct _LocationVelocity LocationVelocity;
132 * @brief This represents location accuracy information such as accuracy level, horizontal and vertical accuracy.
134 typedef struct _LocationAccuracy LocationAccuracy;
137 * @brief This represents boundary information such as rectangular or circle area.
139 typedef struct _LocationBoundary LocationBoundary;
141 typedef void (*LocationSettingCb)(LocationMethod method, gboolean enable, void *user_data);
149 #endif /* __LOCATION_TYPES_H__ */