325ff6d515ea340b2f27de5849c75ab855fc5dad
[platform/core/location/lbs-location.git] / location / manager / location-ielement.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_IELEMENT_H__
23 #define __LOCATION_IELEMENT_H__
24
25 #include <glib-object.h>
26 #include <location-types.h>
27 #include <location-position.h>
28 #include <location-velocity.h>
29 #include <location-accuracy.h>
30 #include <location-address.h>
31 #include <location-boundary.h>
32 #include <location-satellite.h>
33 #include <location-poi.h>
34
35 /**
36  * @file location-ielement.h
37  * @brief This file contains the internal definitions and structures related to location interface.
38  */
39
40 G_BEGIN_DECLS
41
42 enum {
43         SERVICE_ENABLED,
44         SERVICE_DISABLED,
45         SERVICE_UPDATED,
46         ZONE_IN,
47         ZONE_OUT,
48         LAST_SIGNAL
49 };
50
51 #define LOCATION_TYPE_IELEMENT                  (location_ielement_get_type ())
52 #define LOCATION_IELEMENT(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), LOCATION_TYPE_IELEMENT, LocationIElement))
53 #define LOCATION_IS_IELEMENT(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LOCATION_TYPE_IELEMENT))
54 #define LOCATION_IELEMENT_GET_INTERFACE(obj)    (G_TYPE_INSTANCE_GET_INTERFACE ((obj), LOCATION_TYPE_IELEMENT, LocationIElementInterface))
55
56 typedef struct _LocationIElement          LocationIElement;
57 typedef struct _LocationIElementInterface LocationIElementInterface;
58
59 typedef int (*TYPE_START_FUNC)(LocationIElement *self);
60 typedef int (*TYPE_STOP_FUNC) (LocationIElement *self);
61 typedef int (*TYPE_GET_POSITION)(LocationIElement *self, LocationPosition **position, LocationAccuracy **accuracy);
62 typedef int (*TYPE_GET_VELOCITY)(LocationIElement *self, LocationVelocity **velocity, LocationAccuracy **accuracy);
63 typedef int (*TYPE_GET_SATELLITE)(LocationIElement *self, LocationSatellite **satellite);
64 typedef int (*TYPE_GET_GEOCODE)(LocationIElement *self, const LocationAddress *address, GList **position_list, GList **accuracy_list);
65 typedef int (*TYPE_GET_GEOCODE_FREEFORM)(LocationIElement *self, const gchar *address, GList **position_list, GList **accuracy_list);
66 typedef int (*TYPE_GET_REVERSEGEOCODE)(LocationIElement *self, const LocationPosition *position, LocationAddress **address, LocationAccuracy **accuracy);
67 typedef int (*TYPE_GET_GEOCODE_ASYNC)(LocationIElement *self, const LocationAddress *address, LocationPositionCB callback, gpointer userdata);
68 typedef int (*TYPE_GET_GEOCODE_FREEFORM_ASYNC)(LocationIElement *self, const gchar *address,  LocationPositionCB callback, gpointer userdata);
69 typedef int (*TYPE_GET_REVERSEGEOCODE_ASYNC)(LocationIElement *self, const LocationPosition *position, LocationAddressCB callback, gpointer userdata);
70 typedef int (*TYPE_SEARCH_POI) (LocationIElement *self, const LocationPOIFilter * filter, const LocationPosition *position, const LocationPreference *svc_pref, const LocationPOIPreference * pref, LocationPOICB cb, const gpointer user_data, guint *req_id);
71 typedef int (*TYPE_SEARCH_POI_BY_AREA) (LocationIElement *self, const LocationPOIFilter *filter, const LocationBoundary * boundary, const LocationPreference *svc_pref, const LocationPOIPreference * pref, LocationPOICB cb, const gpointer user_data, guint *req_id);
72 typedef int (*TYPE_SEARCH_POI_BY_ADDR) (LocationIElement *self, const LocationPOIFilter *filter, const LocationAddress * address, const LocationPreference *svc_pref, const LocationPOIPreference * pref, LocationPOICB cb, const gpointer user_data, guint *req_id);
73 typedef int (*TYPE_SEARCH_POI_BY_FREEFORM) (LocationIElement *self, const LocationPOIFilter *filter, const gchar *freeform, const LocationPreference *svc_pref, const LocationPOIPreference * pref, LocationPOICB cb, const gpointer user_data, guint *req_id);
74 typedef int (*TYPE_CANCEL_POI_REQUEST) (LocationIElement *self, guint req_id);
75 typedef int (*TYPE_REQUEST_ROUTE) (LocationIElement *self, const LocationPosition *origin, const LocationPosition *destination, GList *waypoint, const LocationPreference *svc_pref, const LocationRoutePreference *pref, LocationRouteCB cb, const gpointer user_data, guint *req_id);
76 typedef int (*TYPE_CANCEL_ROUTE_REQUEST) (LocationIElement *self, guint req_id);
77 typedef gboolean (*TYPE_IS_SUPPORTED_MAP_PROVIDER_CAPABILITY) (LocationIElement *self, LocationMapServiceType type);
78 typedef int (*TYPE_GET_MAP_PROVIDER_CAPABILITY_KEY)(LocationIElement *self, LocationMapServiceType type, GList **key);
79
80 struct _LocationIElementInterface
81 {
82         GTypeInterface parent_iface;
83
84         TYPE_START_FUNC start;
85         TYPE_STOP_FUNC stop;
86         TYPE_GET_POSITION get_position;
87         TYPE_GET_POSITION get_last_position;
88         TYPE_GET_VELOCITY get_velocity;
89         TYPE_GET_VELOCITY get_last_velocity;
90         TYPE_GET_SATELLITE get_satellite;
91         TYPE_GET_SATELLITE get_last_satellite;
92         TYPE_GET_GEOCODE get_geocode;
93         TYPE_GET_GEOCODE_FREEFORM get_geocode_freeform;
94         TYPE_GET_REVERSEGEOCODE get_reversegeocode;
95         TYPE_GET_GEOCODE_ASYNC get_geocode_async;
96         TYPE_GET_GEOCODE_FREEFORM_ASYNC get_geocode_freeform_async;
97         TYPE_GET_REVERSEGEOCODE_ASYNC get_reversegeocode_async;
98         TYPE_SEARCH_POI search_poi;
99         TYPE_SEARCH_POI_BY_AREA search_poi_by_area;
100         TYPE_SEARCH_POI_BY_ADDR search_poi_by_address;
101         TYPE_SEARCH_POI_BY_FREEFORM search_poi_by_freeform;
102         TYPE_CANCEL_POI_REQUEST cancel_poi_request;
103         TYPE_REQUEST_ROUTE request_route;
104         TYPE_CANCEL_ROUTE_REQUEST cancel_route_request;
105         TYPE_IS_SUPPORTED_MAP_PROVIDER_CAPABILITY is_supported_map_provider_capability;
106         TYPE_GET_MAP_PROVIDER_CAPABILITY_KEY get_map_provider_capability_key;
107
108 };
109
110 GType location_ielement_get_type (void);
111
112 int location_ielement_start (LocationIElement *self);
113 int location_ielement_stop(LocationIElement *self);
114 int location_ielement_get_position (LocationIElement *self, LocationPosition **position, LocationAccuracy **accuracy);
115 int location_ielement_get_last_position (LocationIElement *self, LocationPosition **position, LocationAccuracy **accuracy);
116 int location_ielement_get_velocity (LocationIElement *self, LocationVelocity **velocity, LocationAccuracy **accuracy);
117 int location_ielement_get_last_velocity (LocationIElement *self, LocationVelocity **velocity, LocationAccuracy **accuracy);
118 int location_ielement_get_satellite (LocationIElement *self, LocationSatellite **satellite);
119 int location_ielement_get_last_satellite (LocationIElement *self, LocationSatellite **satellite);
120 int location_ielement_get_geocode (LocationIElement *self, const LocationAddress *address, GList **position_list, GList **accuracy_list);
121 int location_ielement_get_geocode_freeform (LocationIElement *self, const gchar *address, GList **position_list, GList **accuracy_list);
122 int location_ielement_get_reversegeocode (LocationIElement *self, const LocationPosition *position, LocationAddress **address, LocationAccuracy **accuracy);
123 int location_ielement_get_geocode_async (LocationIElement *self, const LocationAddress *address, LocationPositionCB callback, gpointer userdata);
124 int location_ielement_get_geocode_freeform_async (LocationIElement *self, const gchar *address, LocationPositionCB callback, gpointer userdata);
125 int location_ielement_get_reversegeocode_async (LocationIElement *self, const LocationPosition *position, LocationAddressCB callback, gpointer userdata);
126 int location_ielement_search_poi (LocationIElement *self, const LocationPOIFilter * filter, const LocationPosition *position, const LocationPreference *svc_pref, const LocationPOIPreference * pref, LocationPOICB cb, const gpointer user_data, guint * req_id);
127 int location_ielement_search_poi_by_area (LocationIElement *self, const LocationPOIFilter * filter, const LocationBoundary * boundary, const LocationPreference *svc_pref, const LocationPOIPreference * pref, LocationPOICB cb, const gpointer user_data, guint * req_id);
128 int location_ielement_search_poi_by_address (LocationIElement *self, const LocationPOIFilter * filter, const LocationAddress * address, const LocationPreference *svc_pref, const LocationPOIPreference * pref, LocationPOICB cb, const gpointer user_data, guint * req_id);
129 int location_ielement_search_poi_by_freeform (LocationIElement *self, const LocationPOIFilter * filter, const gchar * freeform, const LocationPreference *svc_pref, const LocationPOIPreference * pref, LocationPOICB cb, const gpointer user_data, guint * req_id);
130 int location_ielement_cancel_poi_request (LocationIElement *self, guint req_id);
131 int location_ielement_request_route (LocationIElement *self, const LocationPosition *origin, const LocationPosition *destination, GList *waypoint, const LocationPreference *svc_pref, const LocationRoutePreference * pref, LocationRouteCB cb, const gpointer user_data, guint * req_id);
132 int location_ielement_cancel_route_request (LocationIElement *self, guint req_id);
133 gboolean location_ielement_is_supported_map_provider_capability (LocationIElement *self, LocationMapServiceType type);
134 int location_ielement_get_map_provider_capability_key (LocationIElement *self, LocationMapServiceType type, GList **key);
135
136 G_END_DECLS
137
138 #endif