4 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. All rights reserved.
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>
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
13 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #ifndef __LOCATION_MODULE_H__
23 #define __LOCATION_MODULE_H__
26 #include <location/location-types.h>
27 #include <location/location-position.h>
28 #include <location/location-velocity.h>
29 #include <location/location-accuracy.h>
30 #include <location/location-address.h>
31 #include <location/location-satellite.h>
32 #include <location/location-poi-info.h>
37 * @file location-module.h
38 * @brief This file contains the structure and enumeration for location plug-in development.
42 * @addtogroup LocationFW
44 * @defgroup LocationModules Location Moduels
45 * @brief This sub module provides the definitions and structrues for 3rd party plugin modules.
46 * @addtogroup LocationModules
51 * @brief This represents APIs declared in a geocode plug-in for location geocode modules.
54 int (*get_service_name)(gpointer handle, gchar **servicename); ///< This is used for getting a service name from a plug-in.
55 int (*get_geocode)(gpointer handle, const LocationAddress *address, GList **position_list, GList **accuracy_list); ///< This is used for getting a geocode from a plug-in.
56 int (*get_geocode_freetext)(gpointer handle, const gchar *address, GList **position_list, GList **accuracy_list); ///< This is used for getting a geocode by using a free-fromed address from a plug-in.
57 int (*get_reverse_geocode)(gpointer handle, const LocationPosition *position, LocationAddress **address, LocationAccuracy **accuracy); ///< This is used for getting a reverse geocode from a plug-in.
58 int (*get_geocode_async)(gpointer handle, const LocationAddress *address, LocationPositionCB callback, gpointer userdata); ///< This is used for getting a geocode from a plug-in asynchronously.
59 int (*get_geocode_freetext_async)(gpointer handle, const gchar *address, LocationPositionCB callback, gpointer userdata); ///< This is used for getting a geocode by using a free-fromed address from a plug-in asynchronously.
60 int (*get_reverse_geocode_async)(gpointer handle, const LocationPosition *position, LocationAddressCB callback, gpointer userdata); ///< This is used for getting a reverse geocode from a plug-in asynchronously.
64 * @brief This represents APIs declared in a POI plug-in for location POI modules.
67 int (*get_service_name)(gpointer handle, gchar** servicename); ///< This is used for getting a service name from a plug-in.
68 int (*get_poi)(gpointer handle, gdouble radius, const gchar* keyword, LocationPOIInfo **poi); ///< This is used for getting a POI from a plug-in.
69 int (*get_poi_from_address)(gpointer handle, const LocationAddress *address, gdouble radius, const gchar* keyword, LocationPOIInfo **poi); ///< This is used for getting a POI by using a address from a plug-in.
70 int (*get_poi_from_position)(gpointer handle, const LocationPosition *position, gdouble radius, const gchar* keyword, LocationPOIInfo **poi); ///< This is used for getting a POI by using a position from a plug-in.
71 int (*get_poi_async)(gpointer handle, gdouble radius, const gchar* keyword, LocationPOICB callback, gpointer userdata); ///< This is used for getting a POI from a plug-in asynchronously.
72 int (*get_poi_from_address_async)(gpointer handle, const LocationAddress *address, gdouble radius, const gchar* keyword, LocationPOICB callback, gpointer userdata); ///< This is used for getting a POI by using a address from a plug-in asynchronously.
73 int (*get_poi_from_position_async)(gpointer handle, const LocationPosition *position, gdouble radius, const gchar* keyword, LocationPOICB callback, gpointer userdata); ///< This is used for getting a POI by using a position from a plug-in asynchronously.
77 * @brief This represents a enabled/disabled callback function for a plug-in.
79 typedef void (*LocModStatusCB)(gboolean enabled, LocationStatus status, gpointer userdata);
82 * @brief This represents a position callback function for a plug-in.
84 typedef void (*LocModPositionCB) (gboolean enabled, LocationPosition *position, LocationAccuracy *accuracy, gpointer userdata);
87 * @brief This represents a velocity callback function for a plug-in.
89 typedef void (*LocModVelocityCB) (gboolean enabled, LocationVelocity *velocity, LocationAccuracy *accuracy, gpointer userdata);
92 * @brief This represents APIs declared in a GPS plug-in for location GPS modules.
95 int (*start)(gpointer handle, LocModStatusCB status_cb, LocModPositionCB pos_cb, LocModVelocityCB vel_cb, gpointer userdata); ///< This is used for starting a GPS device from a plug-in. #LocModStatusCB, #LocModPositionCB, and #LocModVelocityCB are given from a location framework to a plug-in for asynchronous signaling.
96 int (*stop)(gpointer handle); ///< This is used for stopping a GPS device name from a plug-in.
97 int (*get_position)(gpointer handle, LocationPosition **position, LocationAccuracy **accuracy); ///< This is used for getting a position from a plug-in.
98 int (*get_velocity)(gpointer handle, LocationVelocity **velocity, LocationAccuracy **accuracy); ///< This is used for getting a velocity from a plug-in.
99 int (*get_nmea)(gpointer handle, gchar** nmea_data); ///< This is used for getting a nmea string from a plug-in.
100 int (*get_satellite)(gpointer handle, LocationSatellite **satellite); ///< This is used for getting a satellite information from a plug-in.
101 int (*set_devname)(gpointer handle, const gchar *devname); ///< This is used for setting a device name from a plug-in.
102 int (*get_devname)(gpointer handle, gchar **devname); ///< This is used for getting a device name from a plug-in.
106 * @brief This represents APIs declared in a WPS plug-in for location WPS modules.
109 int (*start)(gpointer handle, LocModStatusCB status_cb, LocModPositionCB pos_cb, LocModVelocityCB vel_cb, gpointer userdata); ///< This is used for starting a WPS service from a plug-in. #LocModStatusCB, #LocModPositionCB, and #LocModVelocityCB are given from a location framework to a plug-in for asynchronous signaling.
110 int (*stop)(gpointer handle); ///< This is used for stopping a WPS service from a plug-in.
111 int (*get_position)(gpointer handle, LocationPosition **position, LocationAccuracy **accuracy); ///< This is used for getting a position from a plug-in.
112 int (*get_velocity)(gpointer handle, LocationVelocity **velocity, LocationAccuracy **accuracy); ///< This is used for getting a velocity from a plug-in.
116 * @brief This represents APIs declared in a SPS plug-in for location SPS modules.
119 int (*start)(gpointer handle, LocModStatusCB status_cb, LocModPositionCB pos_cb, LocModVelocityCB vel_cb, gpointer userdata); ///< This is used for starting a SPS service from a plug-in. #LocModStatusCB, #LocModPositionCB and #LocModVelocityCB are given from a location framework to a plug-in for asynchronous signaling.
120 int (*stop)(gpointer handle); ///< This is used for stopping a SPS service from a plug-in.
121 int (*get_position)(gpointer handle, LocationPosition **position, LocationAccuracy **accuracy); ///< This is used for getting a position from a plug-in.
122 int (*get_velocity)(gpointer handle, LocationVelocity **velocity, LocationAccuracy **accuracy); ///< This is used for getting a velocity from a plug-in.
123 int (*update_data)(gpointer handle, const LocationPosition *position, const LocationVelocity *velocity, const LocationAccuracy *accuracy, const LocationSatellite *satellite); ///< This is used for updating compensated position/velocity data for a plug-in.
127 * @brief This represents APIs declared in a IPS plug-in for location IPS modules.
130 int (*get_position)(gpointer handle, LocationPosition **position, LocationAccuracy **accuracy); ///< This is used for getting a position from a plug-in.
134 * @brief This represents APIs declared in a CPS plug-in for location CPS modules.
137 int (*get_position)(gpointer handle, LocationPosition **position, LocationAccuracy **accuracy); ///< This is used for getting a position from a plug-in.
141 * @brief This is used for exported APIs in a plug-in for a location framework.
143 #define LOCATION_MODULE_API __attribute__((visibility("default"))) G_MODULE_EXPORT