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_MODULE_H__
20 #define __LOCATION_MODULE_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>
33 * @file location-module.h
34 * @brief This file contains the structure and enumeration for location plug-in development.
38 * @addtogroup LocationFW
40 * @defgroup LocationModules Location Modules
41 * @brief This sub module provides the definitions and structrues for 3rd party plugin modules.
42 * @addtogroup LocationModules
48 * @brief This represents a enabled/disabled callback function for a plug-in.
50 typedef void (*LocModStatusCB)(gboolean enabled, LocationStatus status, gpointer userdata);
53 * @brief This represents a position callback function for a plug-in.
55 typedef void (*LocModPositionExtCB)(gboolean enabled, LocationPosition *position, LocationVelocity *velocity, LocationAccuracy *accuracy, gpointer userdata);
58 * @brief This represents a batch callback function for a plug-in.
60 typedef void (*LocModBatchExtCB)(gboolean enabled, guint num_of_location, gpointer userdata);
63 * @brief This represents a velocity callback function for a plug-in.
65 typedef void (*LocModSatelliteCB)(gboolean enabled, LocationSatellite *satellite, gpointer userdata);
68 * @brief This represents APIs declared in a GPS plug-in for location GPS modules.
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);
87 * @brief This represents APIs declared in a WPS plug-in for location WPS modules.
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);
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);
108 * @brief This is used for exported APIs in a plug-in for a location framework.
110 #define LOCATION_MODULE_API __attribute__((visibility("default"))) G_MODULE_EXPORT