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_VELOCITY_H_
20 #define __LOCATION_VELOCITY_H_
22 #include <location-types.h>
26 GType location_velocity_get_type(void);
27 #define LOCATION_TYPE_VELOCITY (location_velocity_get_type())
30 * @file location-velocity.h
31 * @brief This file contains the internal definitions and structures related to velocity information.
34 * @addtogroup LocationAPI
36 * @defgroup LocationAPIVelocity Location Velocity
37 * @breif This provides APIs related to Location Velocity
38 * @addtogroup LocationAPIVelocity
43 * @brief This represents velocity information such as as speed, direction, climb.
45 struct _LocationVelocity {
46 guint timestamp; /*/< Time stamp. */
47 gdouble speed; /*/< The speed over ground. (km/h) */
48 gdouble direction; /*/< The course made in degrees relative to true north. The value is always in the range [0.0, 360.0] degree. */
49 gdouble climb; /*/< The vertical speed. (km/h) */
53 * @brief Create a new #LocationVelocity with given information.
55 * @pre #location_init should be called before.\n
57 * @param [in] timestamp - Time stamp.
58 * @param [in] speed - The speed over ground. (km/h)
59 * @param [in] direction - The course made in degrees relative to true north. The value is always in the range [0.0, 360.0] degree.
60 * @param [in] climb - The vertical speed. (km/h)
61 * @return a new #LocationVelocity
62 * @retval NULL if error occured
64 LocationVelocity *location_velocity_new(guint timestamp, gdouble speed, gdouble direction, gdouble climb);
67 * @brief Free a #LocationVelocity.
69 * @pre #location_init should be called before.\n
71 * @param [in] velocity - a #LocationVelocity.
74 void location_velocity_free(LocationVelocity *velocity);
77 * @brief Compares two velocities for equality, returning TRUE if they are equal.
79 * @pre #location_init should be called before.\n
81 * @param [in] velocity1 - a #LocationVelocity
82 * @param [in] velocity2 - a #LocationVelocity
86 * FALSE - if not equal\n
88 gboolean location_velocity_equal(const LocationVelocity *velocity1, const LocationVelocity *velocity2);
91 * @brief Makes a copy of #LocationVelocity
93 * @pre #location_init should be called before.\n
95 * @param [in] velocity - a #LocationVelocity
96 * @return a new #LocationVelocity
97 * @retval NULL if error occured
99 LocationVelocity *location_velocity_copy(const LocationVelocity *velocity);