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-types.h>
29 GType location_accuracy_get_type(void);
30 #define LOCATION_TYPE_ACCURACY (location_accuracy_get_type())
33 * @file location-accuracy.h
34 * @brief This file contains the definitions, structures, and functions related to accuracy information.
38 * @addtogroup LocationAPI
40 * @defgroup LocationAPIAccuracy Location Accuracy
41 * @breif This provides APIs related to Location Accuracy.
42 * @addtogroup LocationAPIAccuracy
47 * @brief This represents the approximate accuracy level of given information.
50 LOCATION_ACCURACY_LEVEL_NONE = 0, ///< Invalid data.
51 LOCATION_ACCURACY_LEVEL_COUNTRY, ///< Country accuracy level->
52 LOCATION_ACCURACY_LEVEL_REGION, ///< Regional accuracy level->
53 LOCATION_ACCURACY_LEVEL_LOCALITY, ///< Local accuracy level->
54 LOCATION_ACCURACY_LEVEL_POSTALCODE, ///< Postal accuracy level->
55 LOCATION_ACCURACY_LEVEL_STREET, ///< Street accuracy level->
56 LOCATION_ACCURACY_LEVEL_DETAILED, ///< Detailed accuracy level->
57 } LocationAccuracyLevel;
60 * @brief This represents location accuracy information such as accuracy level, horizontal and vertical accuracy.
62 struct _LocationAccuracy
64 LocationAccuracyLevel level; ///< The accuracy level of the location information.
65 gdouble horizontal_accuracy; ///< The horizontal position uncertainty of the location in meters.
66 gdouble vertical_accuracy; ///< The vertical position uncertainty of the location in meters.
70 * @brief Create a new #LocationAccuracy with given information.
72 * @pre #location_init should be called before.\n
74 * @param [in] level - The accuracy level of the location information.
75 * @param [in] horizontal_accuracy - The horizontal position uncertainty of the location in meters.
76 * @param [in] vertical_accuracy - The vertical position uncertainty of the location in meters.
77 * @return a new #LocationAccuracy
78 * @retval NULL if error occured
80 LocationAccuracy *location_accuracy_new (LocationAccuracyLevel level, gdouble horizontal_accuracy, gdouble vertical_accuracy);
83 * @brief Free a #LocationAccuracy.
85 * @pre #location_init should be called before.\n
87 * @param [in] accuracy - a #LocationAccuracy.
90 void location_accuracy_free (LocationAccuracy *accuracy);
93 * @brief Compare for two accuracys.
95 * @pre #location_init should be called before.\n
97 * @param [in] accuracy1 - a #LocationAccuracy
98 * @param [in] accuracy2 - another #LocationAccuracy
101 * 0 - if the accuracy match\n
102 * positive value - if accuracy of accuracy1 is better than accuracy of accuracy2\n
103 * negative value - if accuracy of accuracy1 is worse than accuracy of accuracy2
105 int location_accuracy_compare (const LocationAccuracy *accuracy1, const LocationAccuracy *accuracy2);
108 * @brief Compare for two accuracys' level.
110 * @pre #location_init should be called before.\n
112 * @param [in] accuracy1 - a #LocationAccuracy
113 * @param [in] accuracy2 - another #LocationAccuracy
116 * 0 - if the accuracy match\n
117 * positive value - if accuracy1's level is better than accuracy2's level\n
118 * negative value - if accuracy1's level is worse than accuracy2's level
120 int location_accuracy_level_compare(const LocationAccuracy *accuracy1, const LocationAccuracy *accuracy2);
123 * @brief Makes a copy of #LocationAccuracy
125 * @pre #location_init should be called before.\n
127 * @param [in] accuracy - a #LocationAccuracy
128 * @return a new #LocationAccuracy
129 * @retval NULL if error occured
131 LocationAccuracy *location_accuracy_copy (const LocationAccuracy *accuracy);