4 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. All rights reserved.
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>
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
13 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #ifndef __LOCATION_ACCURACY_H_
23 #define __LOCATION_ACCURACY_H_
25 #include <location/location-types.h>
30 * @file location-accuracy.h
31 * @brief This file contains the definitions, structures, and functions related to accuracy information.
32 * @addtogroup LocationTypes
37 * @brief This represents the approximate accuracy level of given information.
40 LOCATION_ACCURACY_LEVEL_NONE = 0, ///< Invalid data.
41 LOCATION_ACCURACY_LEVEL_COUNTRY, ///< Country accuracy level->
42 LOCATION_ACCURACY_LEVEL_REGION, ///< Regional accuracy level->
43 LOCATION_ACCURACY_LEVEL_LOCALITY, ///< Local accuracy level->
44 LOCATION_ACCURACY_LEVEL_POSTALCODE, ///< Postal accuracy level->
45 LOCATION_ACCURACY_LEVEL_STREET, ///< Street accuracy level->
46 LOCATION_ACCURACY_LEVEL_DETAILED, ///< Detailed accuracy level->
47 } LocationAccuracyLevel;
50 * @brief This represents location accuracy information such as accuracy level, horizontal and vertical accuracy.
52 struct _LocationAccuracy
54 LocationAccuracyLevel level; ///< The accuracy level of the location information.
55 gdouble horizontal_accuracy; ///< The horizontal position uncertainty of the location in meters.
56 gdouble vertical_accuracy; ///< The vertical position uncertainty of the location in meters.
59 GType location_accuracy_get_type(void);
60 #define LOCATION_TYPE_ACCURACY (location_accuracy_get_type())
63 * @brief Create a new #LocationAccuracy with given information.
65 * @pre #location_init should be called before.\n
67 * @param [in] level - The accuracy level of the location information.
68 * @param [in] horizontal_accuracy - The horizontal position uncertainty of the location in meters.
69 * @param [in] vertical_accuracy - The vertical position uncertainty of the location in meters.
70 * @return a new #LocationAccuracy
71 * @retval NULL if error occured
73 LocationAccuracy *location_accuracy_new (LocationAccuracyLevel level, gdouble horizontal_accuracy, gdouble vertical_accuracy);
76 * @brief Free a #LocationAccuracy.
78 * @pre #location_init should be called before.\n
80 * @param [in] accuracy - a #LocationAccuracy.
83 void location_accuracy_free (LocationAccuracy *accuracy);
86 * @brief Compare for two accuracys.
88 * @pre #location_init should be called before.\n
90 * @param [in] accuracy1 - a #LocationAccuracy
91 * @param [in] accuracy2 - another #LocationAccuracy
94 * 0 - if the accuracy match\n
95 * positive value - if accuracy of accuracy1 is better than accuracy of accuracy2\n
96 * negative value - if accuracy of accuracy1 is worse than accuracy of accuracy2
98 int location_accuracy_compare (const LocationAccuracy *accuracy1, const LocationAccuracy *accuracy2);
101 * @brief Compare for two accuracys' level.
103 * @pre #location_init should be called before.\n
105 * @param [in] accuracy1 - a #LocationAccuracy
106 * @param [in] accuracy2 - another #LocationAccuracy
109 * 0 - if the accuracy match\n
110 * positive value - if accuracy1's level is better than accuracy2's level\n
111 * negative value - if accuracy1's level is worse than accuracy2's level
113 int location_accuracy_level_compare(const LocationAccuracy *accuracy1, const LocationAccuracy *accuracy2);
116 * @brief Makes a copy of #LocationAccuracy
118 * @pre #location_init should be called before.\n
120 * @param [in] accuracy - a #LocationAccuracy
121 * @return a new #LocationAccuracy
122 * @retval NULL if error occured
124 LocationAccuracy *location_accuracy_copy (const LocationAccuracy *accuracy);