5112298349eb5634c104aaa1aff81f1faa50a776
[framework/location/libslp-location.git] / location / manager / 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-types.h>
26
27 G_BEGIN_DECLS
28
29 GType location_velocity_get_type (void);
30 #define LOCATION_TYPE_VELOCITY          (location_velocity_get_type ())
31
32 /**
33  * @file location-velocity.h
34  * @brief This file contains the internal definitions and structures related to velocity information.
35  */
36 /**
37  * @addtogroup LocationAPI
38  * @{
39  * @defgroup LocationAPIVelocity Location Velocity
40  * @breif This provides APIs related to Location Velocity
41  * @addtogroup LocationAPIVelocity
42  * @{
43  */
44
45 /**
46  * @brief This represents velocity information such as as speed, direction, climb.
47  */
48 struct _LocationVelocity
49 {
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)
55 };
56
57 /**
58  * @brief   Create a new #LocationVelocity with given information.
59  * @remarks None.
60  * @pre     #location_init should be called before.\n
61  * @post    None.
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
68  */
69 LocationVelocity *location_velocity_new (guint timestamp, gdouble speed, gdouble direction,     gdouble climb);
70
71 /**
72  * @brief   Free a #LocationVelocity.
73  * @remarks None.
74  * @pre     #location_init should be called before.\n
75  * @post    None.
76  * @param [in] velocity - a #LocationVelocity.
77  * @return None.
78  */
79 void location_velocity_free (LocationVelocity *velocity);
80
81 /**
82  * @brief   Compares two velocities for equality, returning TRUE if they are equal.
83  * @remarks None.
84  * @pre     #location_init should be called before.\n
85  * @post    None.
86  * @param [in]  velocity1 - a #LocationVelocity
87  * @param [in]  velocity2 - a #LocationVelocity
88  * @return gboolean
89  * @retval\n
90  * TRUE - if equal\n
91  * FALSE - if not equal\n
92  */
93 gboolean location_velocity_equal (const LocationVelocity *velocity1, const LocationVelocity *velocity2);
94
95 /**
96  * @brief   Makes a copy of #LocationVelocity
97  * @remarks None.
98  * @pre     #location_init should be called before.\n
99  * @post    None.
100  * @param [in]  velocity - a #LocationVelocity
101  * @return a new #LocationVelocity
102  * @retval NULL if error occured
103  */
104 LocationVelocity *location_velocity_copy (const LocationVelocity *velocity);
105
106 /**
107  * @} @}
108  */
109
110 G_END_DECLS
111
112 #endif