removed wrong contacts, added authors
[platform/core/location/lbs-location.git] / location / module / location-module.h
1 /*
2  * libslp-location
3  *
4  * Copyright (c) 2010-2013 Samsung Electronics Co., Ltd. All rights reserved.
5  *
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
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
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.
17  */
18
19 #ifndef __LOCATION_MODULE_H__
20 #define __LOCATION_MODULE_H__
21
22 #include <gmodule.h>
23 #include <location-types.h>
24 #include <location-position.h>
25 #include <location-batch.h>
26 #include <location-velocity.h>
27 #include <location-accuracy.h>
28 #include <location-satellite.h>
29
30 G_BEGIN_DECLS
31
32 /**
33  * @file location-module.h
34  * @brief This file contains the structure and enumeration for location plug-in development.
35  */
36
37 /**
38  * @addtogroup LocationFW
39  * @{
40  * @defgroup LocationModules Location Modules
41  * @brief  This sub module provides the definitions and structrues for 3rd party plugin modules.
42  * @addtogroup LocationModules
43  * @{
44  */
45
46
47 /**
48 * @brief This represents a enabled/disabled callback function for a plug-in.
49 */
50 typedef void (*LocModStatusCB)(gboolean enabled, LocationStatus status, gpointer userdata);
51
52 /**
53  * @brief This represents a position callback function for a plug-in.
54  */
55 typedef void (*LocModPositionExtCB)(gboolean enabled, LocationPosition *position, LocationVelocity *velocity, LocationAccuracy *accuracy, gpointer userdata);
56
57 /**
58  * @brief This represents a batch callback function for a plug-in.
59  */
60 typedef void (*LocModBatchExtCB)(gboolean enabled, guint num_of_location, gpointer userdata);
61
62 /**
63  * @brief This represents a velocity callback function for a plug-in.
64  */
65 typedef void (*LocModSatelliteCB)(gboolean enabled, LocationSatellite *satellite, gpointer userdata);
66
67 /**
68  * @brief This represents APIs declared in a GPS plug-in for location GPS modules.
69  */
70 typedef struct {
71         int (*start)(gpointer handle, guint pos_update_interval, LocModStatusCB status_cb, LocModPositionExtCB pos_ext_cb, LocModSatelliteCB sat_cb, gpointer userdata);
72         int (*start_batch)(gpointer handle, LocModBatchExtCB batch_ext_cb, guint batch_interval, guint batch_period, gpointer userdata);
73         int (*stop)(gpointer handle);
74         int (*stop_batch)(gpointer handle);
75         int (*get_position)(gpointer handle, LocationPosition **position, LocationVelocity **velocity, LocationAccuracy **accuracy);
76         int (*get_last_position)(gpointer handle, LocationPosition **position, LocationVelocity **velocity, LocationAccuracy **accuracy);
77         int (*get_nmea)(gpointer handle, gchar **nmea_data);
78         int (*get_satellite)(gpointer handle, LocationSatellite **satellite);
79         int (*get_last_satellite)(gpointer handle, LocationSatellite **satellite);
80         int (*set_option)(gpointer handle, const char *option);
81         int (*set_position_update_interval)(gpointer handle, guint interval);
82         int (*set_mock_location)(gpointer handle, LocationPosition *position, LocationVelocity *velocity, LocationAccuracy *accuracy, LocModStatusCB status_cb, gpointer userdata);
83         int (*clear_mock_location)(gpointer handle, LocModStatusCB status_cb, gpointer userdata);
84 } LocModGpsOps;
85
86 /**
87  * @brief This represents APIs declared in a WPS plug-in for location WPS modules.
88  */
89 typedef struct {
90         int (*start)(gpointer handle, LocModStatusCB status_cb, LocModPositionExtCB pos_ext_cb, gpointer userdata);
91         int (*stop)(gpointer handle);
92         int (*get_position)(gpointer handle, LocationPosition **position, LocationVelocity **velocity, LocationAccuracy **accuracy);
93         int (*get_last_position)(gpointer handle, LocationPosition **position, LocationVelocity **velocity, LocationAccuracy **accuracy);
94         int (*set_option)(gpointer handle, const char *option);
95         int (*set_mock_location)(gpointer handle, LocationPosition *position, LocationVelocity *velocity, LocationAccuracy *accuracy, LocModStatusCB status_cb, gpointer userdata);
96         int (*clear_mock_location)(gpointer handle, LocModStatusCB status_cb, gpointer userdata);
97 } LocModWpsOps;
98
99 typedef struct {
100         int (*start)(gpointer handle, guint pos_update_interval, LocModStatusCB status_cb, LocModPositionExtCB pos_cb, LocModSatelliteCB sat_cb, gpointer userdata);
101         int (*stop)(gpointer handle);
102         int (*get_last_position)(gpointer handle, LocationPosition **position, LocationVelocity **velocity, LocationAccuracy **accuracy);
103         int (*get_last_wps_position)(gpointer handle, LocationPosition **position, LocationVelocity **velocity, LocationAccuracy **accuracy);
104         int (*get_satellite)(gpointer handle, LocationSatellite **satellite);
105 } LocModPassiveOps;
106
107 /**
108  * @brief This is used for exported APIs in a plug-in for a location framework.
109  */
110 #define LOCATION_MODULE_API __attribute__((visibility("default"))) G_MODULE_EXPORT
111
112 /**
113  * @} @}
114  */
115 G_END_DECLS
116
117 #endif