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_VELOCITY_H_
23 #define __LOCATION_VELOCITY_H_
25 #include <location-types.h>
29 GType location_velocity_get_type (void);
30 #define LOCATION_TYPE_VELOCITY (location_velocity_get_type ())
33 * @file location-velocity.h
34 * @brief This file contains the internal definitions and structures related to velocity information.
37 * @addtogroup LocationAPI
39 * @defgroup LocationAPIVelocity Location Velocity
40 * @breif This provides APIs related to Location Velocity
41 * @addtogroup LocationAPIVelocity
46 * @brief This represents velocity information such as as speed, direction, climb.
48 struct _LocationVelocity
50 guint timestamp; ///< Time stamp.
51 guint updated_timestamp; ///< The latest updated time stamp.
52 gdouble speed; ///< The speed over ground. (km/h)
53 gdouble direction; ///< The course made in degrees relative to true north. The value is always in the range [0.0, 360.0] degree.
54 gdouble climb; ///< The vertical speed. (km/h)
58 * @brief Create a new #LocationVelocity with given information.
60 * @pre #location_init should be called before.\n
62 * @param [in] timestamp - Time stamp.
63 * @param [in] speed - The speed over ground. (km/h)
64 * @param [in] direction - The course made in degrees relative to true north. The value is always in the range [0.0, 360.0] degree.
65 * @param [in] climb - The vertical speed. (km/h)
66 * @return a new #LocationVelocity
67 * @retval NULL if error occured
69 LocationVelocity *location_velocity_new (guint timestamp, gdouble speed, gdouble direction, gdouble climb);
72 * @brief Free a #LocationVelocity.
74 * @pre #location_init should be called before.\n
76 * @param [in] velocity - a #LocationVelocity.
79 void location_velocity_free (LocationVelocity *velocity);
82 * @brief Compares two velocities for equality, returning TRUE if they are equal.
84 * @pre #location_init should be called before.\n
86 * @param [in] velocity1 - a #LocationVelocity
87 * @param [in] velocity2 - a #LocationVelocity
91 * FALSE - if not equal\n
93 gboolean location_velocity_equal (const LocationVelocity *velocity1, const LocationVelocity *velocity2);
96 * @brief Makes a copy of #LocationVelocity
98 * @pre #location_init should be called before.\n
100 * @param [in] velocity - a #LocationVelocity
101 * @return a new #LocationVelocity
102 * @retval NULL if error occured
104 LocationVelocity *location_velocity_copy (const LocationVelocity *velocity);