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/location-types.h>
28 * @file location-velocity.h
29 * @brief This file contains the internal definitions and structures related to velocity information.
30 * @addtogroup LocationTypes
37 * @brief This represents velocity information such as as speed, direction, climb.
39 struct _LocationVelocity
41 guint timestamp; ///< Time stamp.
42 guint updated_timestamp; ///< The latest updated time stamp.
43 gdouble speed; ///< The speed over ground. (km/h)
44 gdouble direction; ///< The course made in degrees relative to true north. The value is always in the range [0.0, 360.0] degree.
45 gdouble climb; ///< The vertical speed. (km/h)
48 GType location_velocity_get_type (void);
49 #define LOCATION_TYPE_VELOCITY (location_velocity_get_type ())
52 * @brief Create a new #LocationVelocity with given information.
54 * @pre #location_init should be called before.\n
56 * @param [in] timestamp - Time stamp.
57 * @param [in] speed - The speed over ground. (km/h)
58 * @param [in] direction - The course made in degrees relative to true north. The value is always in the range [0.0, 360.0] degree.
59 * @param [in] climb - The vertical speed. (km/h)
60 * @return a new #LocationVelocity
61 * @retval NULL if error occured
63 LocationVelocity *location_velocity_new (guint timestamp, gdouble speed, gdouble direction, gdouble climb);
66 * @brief Free a #LocationVelocity.
68 * @pre #location_init should be called before.\n
70 * @param [in] velocity - a #LocationVelocity.
73 void location_velocity_free (LocationVelocity *velocity);
76 * @brief Compares two velocities for equality, returning TRUE if they are equal.
78 * @pre #location_init should be called before.\n
80 * @param [in] velocity1 - a #LocationVelocity
81 * @param [in] velocity2 - a #LocationVelocity
85 * FALSE - if not equal\n
87 gboolean location_velocity_equal (const LocationVelocity *velocity1, const LocationVelocity *velocity2);
90 * @brief Makes a copy of #LocationVelocity
92 * @pre #location_init should be called before.\n
94 * @param [in] velocity - a #LocationVelocity
95 * @return a new #LocationVelocity
96 * @retval NULL if error occured
98 LocationVelocity *location_velocity_copy (const LocationVelocity *velocity);