Git init
[framework/location/libslp-location.git] / location / location-velocity.h
1 /*
2  * libslp-location
3  *
4  * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
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>
8  *
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
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
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.
20  */
21
22 #ifndef __LOCATION_VELOCITY_H_
23 #define __LOCATION_VELOCITY_H_
24
25 #include <location/location-types.h>
26
27 /**
28  * @file location-velocity.h
29  * @brief This file contains the internal definitions and structures related to velocity information.
30  * @addtogroup LocationTypes
31  * @{
32  */
33
34 G_BEGIN_DECLS
35
36 /**
37  * @brief This represents velocity information such as as speed, direction, climb.
38  */
39 struct _LocationVelocity
40 {
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)
46 };
47
48 GType location_velocity_get_type (void);
49 #define LOCATION_TYPE_VELOCITY          (location_velocity_get_type ())
50
51 /**
52  * @brief   Create a new #LocationVelocity with given information.
53  * @remarks None.
54  * @pre     #location_init should be called before.\n
55  * @post    None.
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
62  */
63 LocationVelocity *location_velocity_new (guint timestamp, gdouble speed, gdouble direction,     gdouble climb);
64
65 /**
66  * @brief   Free a #LocationVelocity.
67  * @remarks None.
68  * @pre     #location_init should be called before.\n
69  * @post    None.
70  * @param [in] velocity - a #LocationVelocity.
71  * @return None.
72  */
73 void location_velocity_free (LocationVelocity *velocity);
74
75 /**
76  * @brief   Compares two velocities for equality, returning TRUE if they are equal.
77  * @remarks None.
78  * @pre     #location_init should be called before.\n
79  * @post    None.
80  * @param [in]  velocity1 - a #LocationVelocity
81  * @param [in]  velocity2 - a #LocationVelocity
82  * @return gboolean
83  * @retval\n
84  * TRUE - if equal\n
85  * FALSE - if not equal\n
86  */
87 gboolean location_velocity_equal (const LocationVelocity *velocity1, const LocationVelocity *velocity2);
88
89 /**
90  * @brief   Makes a copy of #LocationVelocity
91  * @remarks None.
92  * @pre     #location_init should be called before.\n
93  * @post    None.
94  * @param [in]  velocity - a #LocationVelocity
95  * @return a new #LocationVelocity
96  * @retval NULL if error occured
97  */
98 LocationVelocity *location_velocity_copy (const LocationVelocity *velocity);
99
100 /**
101  * @}
102  */
103
104 G_END_DECLS
105
106 #endif