Release Tizen2.0 beta
[platform/core/location/lbs-location.git] / location / map-service / location-map-service.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
23 #ifndef __LOCATION_MAP_SERVICE_H__
24 #define __LOCATION_MAP_SERVICE_H__
25
26
27 #include <glib.h>
28 #include <location-map-pref.h>
29 #include <location-map-types.h>
30 #include <location-address.h>
31 #include <location-poi.h>
32 #include <location-route.h>
33 #include <location-landmark.h>
34
35 G_BEGIN_DECLS
36
37 /**
38  * @file location-map-service.h
39  * @brief This file contains the Location API and related structure and enumeration.
40  */
41 /**
42  * @addtogroup LocationFW
43  * @{
44  * @defgroup LocationMapService Location Map Service API
45  * @brief This sub module provides the Location Map Service API.
46  * @addtogroup LocationMapService
47  * @{
48  */
49
50 /**
51 * @brief
52 * Create Map Object.
53 * @remarks location_init should be called before.
54 * @pre None.
55 * @post None.
56 * @param [in]
57 * provider - map provider. A default provider will be provided if NULL.
58 */
59 LocationMapObject *location_map_new (const char *provider);
60
61 /**
62 * @brief
63 * Free Map Object.
64 * @remarks location_map_new should be called before.
65 */
66 int location_map_free (LocationMapObject *obj);
67
68 /**
69  * @brief
70  * Get current position information with estimate of the accuracy by using given address information.
71  * @remarks Out parameters are should be freed.
72  * @pre
73  * #location_init should be called before.\n
74  * Calling application must have an active data connection.
75  * @post None.
76  * @param [in]
77  * obj - a #LocationMapObject created by #location_map_new
78  * @param [in]
79  * address - a #LocationAddress
80  * @param [out]
81  * position_list - a list of #LocationPosition
82  * @param [out]
83  * accuracy_list - a list of #LocationAccuracy
84  * @return int
85  * @retval 0                              Success.
86  *
87  * Please refer #LocationError for more information.
88  * @see
89  * location_map_get_position_from_address_async\n
90  * @par Example
91  * @code
92 #include <location.h>
93 #include <location-map-service.h>
94
95 static void PrintPos (gpointer data, gpointer user_data)
96 {
97        LocationPosition *pos = (LocationPosition *)data;
98
99        if (pos) {
100            g_debug("time: [%d], latitude: [%f], longitude: [%f], altitude: [%f]\n", pos->timestamp, pos->latitude, pos->longitude, pos->altitude);
101            location_position_free (pos);
102       }
103 }
104
105 static void PrintAcc (gpointer data, gpointer user_data)
106 {
107        LocationAccuracy *acc = (LocationAccuracy *)data;
108
109        if (acc) {
110               g_debug("level: [%d], horizontal_accuracy: [%f], vertical_accuracy: [%f]\n", acc->level, acc->horizontal_accuracy, acc->vertical_accuracy);
111               location_accuracy_free (acc);
112        }
113
114 }
115
116 static void PrintPos (gpointer data, gpointer user_data)
117 {
118         LocationPosition *pos = (LocationPosition *)data;
119
120         if (pos) {
121                 g_debug("time: [%d], latitude: [%f], longitude: [%f], altitude: [%f]\n", pos->timestamp, pos->latitude, pos->longitude, pos->altitude);
122                 location_position_free (pos);
123         }
124 }
125
126 static void PrintAcc (gpointer data, gpointer user_data)
127 {
128         LocationAccuracy *acc = (LocationAccuracy *)data;
129
130         if (acc) {
131                 g_debug("level: [%d], horizontal_accuracy: [%f], vertical_accuracy: [%f]\n", acc->level, acc->horizontal_accuracy, acc->vertical_accuracy);
132                 location_accuracy_free (acc);
133         }
134 }
135
136 int main (int argc, char *argv[])
137 {
138         LocationMapObject *loc = NULL;
139         int ret = LOCATION_ERROR_NONE;
140
141         location_init ();
142         loc  = location_map_new (NULL);
143         if(!loc){
144                 g_debug("location_map_new failed");
145                 return -1;
146         }
147
148         GList *pos_list = NULL;
149         GList *acc_list = NULL;
150         LocationAddress *addr = NULL;
151
152         addr = location_address_new ("1", "Post Street", NULL, "san jose", "ca", NULL, "95113");
153         if (LOCATION_ERROR_NONE == location_map_get_position_from_address(loc, addr, &pos_list, &acc_list)) {
154
155         } else g_warning ("SYNC>> position from address> failed");
156         location_address_free (addr);
157         g_list_foreach (pos_list, PrintPos, NULL);
158         g_list_foreach (acc_list, PrintAcc, NULL);
159         g_list_free (pos_list);
160         g_list_free (acc_list);
161         location_map_free (loc);
162         return 0;
163 }
164  * @endcode
165  */
166 int location_map_get_position_from_address (LocationMapObject *obj, const LocationAddress *address, GList **position_list, GList **accuracy_list);
167
168 /**
169  * @brief
170  * Get current position information asynchronously with estimate of the accuracy by using given address information.
171  * @remarks None.
172  * @pre
173  * #location_init should be called before.\n
174  * Calling application must have glib or ecore main loop.\n
175  * Calling application must have an active data connection.
176  * @post None.
177  * @param [in]
178  * obj - a #LocationMapObject created by #location_map_new
179  * @param [in]
180  * address - a #LocationAddress
181  * @param [in]
182  * callback - A pointer of function which will be called after position is gained or when an error occurs.
183  * @param [in]
184  * userdata - data to pass to function
185  * @return int
186  * @retval 0                              Success.
187  *
188  * Please refer #LocationError for more information.
189  * @see
190  * location_map_get_position_from_address\n
191  * @par Example
192  * @code
193 #include <location-map-service.h>
194
195 static void PrintPos (gpointer data, gpointer user_data)
196 {
197         LocationPosition *pos = (LocationPosition *)data;
198
199         if (pos) {
200                 g_debug("time: [%d], latitude: [%f], longitude: [%f], altitude: [%f]\n", pos->timestamp, pos->latitude, pos->longitude, pos->altitude);
201         }
202 }
203
204 static void PrintAcc (gpointer data, gpointer user_data)
205 {
206         LocationAccuracy *acc = (LocationAccuracy *)data;
207
208         if (acc) {
209                 g_debug("level: [%d], horizontal_accuracy: [%f], vertical_accuracy: [%f]\n", acc->level, acc->horizontal_accuracy, acc->vertical_accuracy);
210         }
211 }
212 static void
213 cb_position_from_address (LocationError error, GList *position_list, GList *accuracy_list, gpointer userdata)
214 {
215         if (position_list && accuracy_list) {
216                 g_list_foreach (position_list, PrintPos);
217                 g_list_foreach (accuracy_list, PrintAcc);
218         }
219 }
220
221 void get_position_from_address(LocationMapObject* loc)
222 {
223         LocationAddress *addr = location_address_new ("1", "Post Street", NULL, "san jose", "ca", NULL, "95113");
224         //Calling application must have an active data connection before using this function.
225         if (LOCATION_ERROR_NONE == location_map_get_position_from_address_async(loc, addr, cb_position_from_address, loc))
226                 g_debug("location_map_get_position_from_address_async() success");
227         else g_warning ("location_map_get_position_from_address_async() failed");
228         location_address_free (addr);
229 }
230  * @endcode
231  */
232 int location_map_get_position_from_address_async (LocationMapObject *obj, const LocationAddress *address, LocationPositionCB callback, gpointer userdata);
233
234 /**
235  * @brief
236  * Get current position information with estimate of the accuracy by using given free-formed address string.
237  * @remarks Out parameters are should be freed.
238  * @pre
239  * #location_init should be called before.\n
240  * Calling application must have an active data connection.
241  * @post None.
242  * @param [in]
243  * obj - a #LocationMapObject created by #location_map_new
244  * @param [in]
245  * address - Free-formed address string to be used
246  * @param [out]
247  * position_list - a list of #LocationPosition
248  * @param [out]
249  * accuracy_list - a list of #LocationAccuracy
250  * @return int
251  * @retval 0                              Success
252  *
253  * Please refer #LocationError for more information.
254  * @see
255  * location_map_get_position_from_freeformed_address_async\n
256  * @par Example
257  * @code
258 #include <location.h>
259 #include <location-map-service.h>
260
261 static void PrintPos (gpointer data, gpointer user_data)
262 {
263         LocationPosition *pos = (LocationPosition *)data;
264
265         if (pos) {
266                 g_debug("time: [%d], latitude: [%f], longitude: [%f], altitude: [%f]\n", pos->timestamp, pos->latitude, pos->longitude, pos->altitude);
267                 location_position_free (pos);
268         }
269 }
270
271 static void PrintAcc (gpointer data, gpointer user_data)
272 {
273         LocationAccuracy *acc = (LocationAccuracy *)data;
274
275         if (acc) {
276                 g_debug("level: [%d], horizontal_accuracy: [%f], vertical_accuracy: [%f]\n", acc->level, acc->horizontal_accuracy, acc->vertical_accuracy);
277                 location_accuracy_free (acc);
278         }
279 }
280
281 static void PrintPos (gpointer data, gpointer user_data)
282 {
283         LocationPosition *pos = (LocationPosition *)data;
284
285         if (pos) {
286                 g_debug("time: [%d], latitude: [%f], longitude: [%f], altitude: [%f]\n", pos->timestamp, pos->latitude, pos->longitude, pos->altitude);
287                 location_position_free (pos);
288         }
289 }
290
291 static void PrintAcc (gpointer data, gpointer user_data)
292 {
293         LocationAccuracy *acc = (LocationAccuracy *)data;
294
295         if (acc) {
296                 g_debug("level: [%d], horizontal_accuracy: [%f], vertical_accuracy: [%f]\n", acc->level, acc->horizontal_accuracy, acc->vertical_accuracy);
297                 location_accuracy_free (acc);
298         }
299 }
300
301 int main (int argc, char *argv[])
302 {
303         LocationMapObject *loc = NULL;
304         int ret = LOCATION_ERROR_NONE;
305
306         location_init ();
307         loc  = location_map_new (NULL);
308         if(!loc){
309                 g_debug("location_map_new failed");
310                 return -1;
311         }
312
313         GList *pos_list = NULL;
314         GList *acc_list = NULL;
315         char* addr_str = g_strdup("4 N 2nd Street 95113");
316
317         //Calling application must have an active data connection before using this function.
318         if (LOCATION_ERROR_NONE == location_map_get_position_from_freeformed_address(loc, addr_str, &pos_list, &acc_list)) {
319                 g_list_foreach (pos_list, PrintPos, NULL);
320                 g_list_foreach (acc_list, PrintAcc, NULL);
321                 g_list_free (pos_list);
322                 g_list_free (acc_list);
323         } else g_warning ("SYNC>> position from freeformed address> failed");
324         g_free(addr_str);
325
326         location_free (loc);
327         return 0;
328 }
329  * @endcode
330  */
331 int location_map_get_position_from_freeformed_address (LocationMapObject *obj, const gchar *address, GList **position_list, GList **accuracy_list);
332
333 /**
334  * @brief
335  * Get current position information asynchronously with estimate of the accuracy by using given free-formed address string.
336  * @remarks None.
337  * @pre
338  * #location_init should be called before.\n
339  * Calling application must have glib or ecore main loop.\n
340  * Calling application must have an active data connection.
341  * @post None.
342  * @param [in]
343  * obj - a #LocationMapObject created by #location_map_new
344  * @param [in]
345  * address - Free-formed address string to be used
346  * @param [in]
347  * callback - A pointer of function which will be called after position is gained or when an error occurs.
348  * @param [in]
349  * userdata - data to pass to function
350  * @return int
351  * @retval 0                              Success
352  *
353  * Please refer #LocationError for more information.
354  * @see
355  * location_map_get_position_from_freeformed_address\n
356  * @par Example
357  * @code
358 #include <location.h>
359 #include <location-map-service.h>
360
361 static void PrintPos (gpointer data, gpointer user_data)
362 {
363         LocationPosition *pos = (LocationPosition *)data;
364
365         if (pos) {
366                 g_debug("time: [%d], latitude: [%f], longitude: [%f], altitude: [%f]\n", pos->timestamp, pos->latitude, pos->longitude, pos->altitude);
367         }
368 }
369
370 static void PrintAcc (gpointer data, gpointer user_data)
371 {
372         LocationAccuracy *acc = (LocationAccuracy *)data;
373
374         if (acc) {
375                 g_debug("level: [%d], horizontal_accuracy: [%f], vertical_accuracy: [%f]\n", acc->level, acc->horizontal_accuracy, acc->vertical_accuracy);
376         }
377 }
378
379 static void
380 cb_position_from_freeformed_address (LocationError error, GList *position_list, GList *accuracy_list, gpointer userdata)
381 {
382         if (position_list && accuracy_list) {
383                 g_list_foreach (position_list, PrintPos);
384                 g_list_foreach (accuracy_list, PrintAcc);
385         }
386 }
387
388 void get_position_from_address(LocationMapObject* loc)
389 {
390         gchar *addr_str = g_strdup("4 N 2nd Street 95113");
391         //Calling application must have an active data connection before using this function.
392         if (LOCATION_ERROR_NONE == location_map_get_position_from_freeformed_address_async(loc, addr_str, cb_position_from_freeformed_address, loc))
393                 g_debug("location_map_get_position_from_freeformed_address_async() success");
394         else g_warning ("location_map_get_position_from_freeformed_address_async() failed");
395         g_free(addr_str);
396
397 }
398  * @endcode
399  */
400 int location_map_get_position_from_freeformed_address_async (LocationMapObject *obj, const gchar *address, LocationPositionCB callback, gpointer userdata);
401
402 /**
403  * @brief
404  * Get current address information with estimate of the accuracy by using given position information.
405  * @remarks Out parameters are should be freed.
406  * @pre
407  * #location_init should be called before.\n
408  * Calling application must have an active data connection.
409  * @post None.
410  * @param [in]
411  * obj - a #LocationMapObject created by #location_map_new
412  * @param [in]
413  * position - a #LocationPosition
414  * @param [out]
415  * address - a new #LocationAddress
416  * @param [out]
417  * accuracy - a new #LocationAccuracy
418  * @return int
419  * @retval 0                              Success
420  *
421  * Please refer #LocationError for more information.
422  * @see
423  * location_map_get_address_from_position_async\n
424  * @par Example
425  * @code
426 #include <location.h>
427 #include <location-map-service.h>
428 static GMainLoop *loop = NULL;
429
430 int
431 main (int argc, char *argv[])
432 {
433         LocationMapObject *loc = NULL;
434         int ret = LOCATION_ERROR_NONE;
435
436         location_init ();
437
438         loop = g_main_loop_new (NULL, TRUE);
439
440         loc  = location_map_new (NULL);
441         if(!loc){
442                 g_debug("location_map_new failed");
443                 return -1;
444         }
445
446         LocationPosition *pos = NULL;
447         LocationAccuracy *acc = NULL;
448         LocationAddress *addr = NULL;
449
450         //Calling application must have an active data connection before using this function.
451         pos = location_position_new (0, 37.257809, 127.056383, 0, LOCATION_STATUS_2D_FIX);
452         if (LOCATION_ERROR_NONE == location_map_get_address_from_position(loc, pos, &addr, &acc)) {
453                 g_debug ("SYNC>> address from position> %s %s %s %s %s %s %s",
454                         addr->building_number, addr->street, addr->district, addr->city, addr->state, addr->postal_code, addr->country_code);
455                 g_debug ("\tAccuracy level %d (%.0f meters %.0f meters)", acc->level, acc->horizontal_accuracy, acc->vertical_accuracy);
456                 location_address_free(addr);
457                 location_accuracy_free(acc);
458         } else g_warning ("SYNC>> address from position> failed");
459         location_position_free (pos);
460         location_map_free (loc);
461 }
462  * @endcode
463  */
464 int location_map_get_address_from_position (LocationMapObject *obj, const LocationPosition *position, LocationAddress **address, LocationAccuracy **accuracy);
465
466 /**
467  * @brief
468  * Get current address information asynchronously with estimate of the accuracy by using given position information.
469  * @remarks None.
470  * @pre
471  * #location_init should be called before.\n
472  * Calling application must have glib or ecore main loop.\n
473  * Calling application must have an active data connection.
474  * @post None.
475  * @param [in]
476  * obj - a #LocationMapObject created by #location_map_new
477  * @param [in]
478  * position - a #LocationPosition
479  * @param [in]
480  * callback - A pointer of function which will be called after address is gained or when an error occurs.
481  * @param [in]
482  * userdata - data to pass to function
483  * @return int
484  * @retval 0                              Success
485  *
486  * Please refer #LocationError for more information.
487  * @see
488  * location_map_get_address_from_position\n
489  * @par Example
490  * @code
491 #include <location.h>
492 #include <location-map-service.h>
493 static GMainLoop *loop = NULL;
494
495 static void
496 cb_address_from_position (LocationError error, LocationAddress *addr, LocationAccuracy *acc, gpointer userdata)
497 {
498         g_debug ("ASYNC>> location_map_get_address_from_position_async> %s %s %s %s %s %s %s",
499                         addr->building_number, addr->street, addr->district, addr->city, addr->state, addr->postal_code, addr->country_code);
500         g_debug ("\tAccuracy level %d (%.0f meters %.0f meters)", acc->level, acc->horizontal_accuracy, acc->vertical_accuracy);
501 }
502
503 void get_address_from_position(LocationMapObject* loc)
504 {
505         LocationPosition *pos = location_position_new (0, 37.257809, 127.056383, 0, LOCATION_STATUS_2D_FIX);
506         //Calling application must have an active data connection before using this function.
507         if (LOCATION_ERROR_NONE == location_map_get_address_from_position_async(loc, pos, cb_address_from_position, loc))
508                 g_debug("location_map_get_address_from_position_async() success");
509         else g_warning ("location_map_get_address_from_position_async() failed");
510         location_position_free (pos);
511 }
512  * @endcode
513  */
514 int location_map_get_address_from_position_async (LocationMapObject *obj, const LocationPosition *position,     LocationAddressCB callback, gpointer userdata);
515
516 /**
517  * @brief Request a search service from service provider.
518  * @remarks refer #LocationLandmark
519  * @pre #location_init should be called before.\n
520  *      #location_poi_pref_new should be set before.
521  * @post None.
522  * @param [in] obj - a #LocationMapObject created by #location_map_new
523  * @param [in] filter - a #LocaitonPOIFilter created by #location_poi_filter_new
524  * @param [in] position - a #LocationPosition
525  * @param [in] pref - a #LocationPOIPreference created by #location_poi_pref_new
526  * @param [in] cb - #LocationPOICB
527  * @param [in] user_data - data to pass to function
528  * @param [out] req_id - a guint
529  * @return int
530  * @retval 0                              Success
531  * Please refer #LocationError for more information.
532  * @par Example
533  * @code
534 #include <location.h>
535 #include <location-map-service.h>
536
537 static GMainLoop *loop = NULL;
538
539 void PrintLandmarkCb (gpointer data, gpointer user_data)
540 {
541         g_return_if_fail (data);
542
543         LocationLandmark *landmark = (LocationLandmark *)data;
544
545         g_debug ("id[%d], Priority[%d], Name:[%s], Author[%s], Phone[%s], Category[%s]\n", location_landmark_get_id (landmark),
546                                   location_landmark_get_priority(landmark),
547                                   location_landmark_get_name(landmark),
548                                   location_landmark_get_author(landmark),
549                                   location_landmark_get_phone_number(landmark),
550                                   location_landmark_get_category(landmark));
551 }
552
553 static void poi_cb(LocationError error, guint req_id, GList * landmark_list, gchar * error_code, gchar * error_msg, gpointer userdata)
554 {
555         if (error != LOCATION_ERROR_NONE || landmark_list == NULL) {
556                 g_debug ("Fail to get poi. Error[%d], ErrCode[%s], ErrMsg[%s]", error, error_code, error_msg);
557                 return;
558         }
559         g_list_foreach (landmark_list, PrintLandmarkCb, NULL);
560 }
561
562 void search_poi(LocationMapObject* loc)
563 {
564         int ret = 0;
565         guint req_id = 0;
566         LocationPosition *pos = location_position_new (0, 37.257809, 127.056383, 0, LOCATION_STATUS_2D_FIX);
567         LocationPOIFilter *filter = location_poi_filter_new();
568         LocationPOIPreference *pref = location_poi_pref_new();
569
570         location_poi_filter_set(filter, "CATEGORY", "restaurant");
571
572         location_poi_pref_set_max_result(pref, 5);
573         location_poi_pref_set_sort_by(pref, "name");
574         location_poi_pref_set_sort_order(pref, LOCATION_POI_PREF_SO_ASC);
575
576         ret = location_map_search_poi (loc, filter, pos, pref, poi_cb, loc, &req_id);
577         if (ret != LOCATION_ERROR_NONE) {
578                 g_debug("Fail to get poi. Error[%d]", ret);
579         }
580
581         location_poi_filter_free(filter);
582         location_poi_pref_free(pref);
583         location_position_free(pos);
584
585 }
586  * @endcode
587  */
588 int location_map_search_poi (LocationMapObject *obj, const LocationPOIFilter * filter, const LocationPosition *position, const LocationPOIPreference * pref, LocationPOICB cb, gpointer user_data, guint * req_id);
589
590 /**
591  * @brief Request a search service with area filter from service provider.
592  * @remarks refer #LocationLandmark
593  * @pre #location_init should be called before.\n
594  *      #location_poi_pref_new should be set before.
595  * @post None.
596  * @param [in] obj - a #LocationMapObject created by #location_map_new
597  * @param [in] filter - a #LocaitonPOIFilter created by #location_poi_filter_new
598  * @param [in] boundary - a #LocationBoundary
599  * @param [in] pref - a #LocationPOIPreference created by #location_poi_pref_new
600  * @param [in] cb - #LocationPOICB
601  * @param [in] user_data - data to pass to function
602  * @param [out] req_id - a guint
603  * @return int
604  * @retval 0                              Success
605  * Please refer #LocationError for more information.
606  * @par Example
607  * @code
608 #include <location.h>
609 #include <location-map-service.h>
610
611 static GMainLoop *loop = NULL;
612
613 void PrintLandmarkCb (gpointer data, gpointer user_data)
614 {
615         g_return_if_fail (data);
616
617         LocationLandmark *landmark = (LocationLandmark *)data;
618
619         g_debug ("id[%d], Priority[%d], Name:[%s], Author[%s], Phone[%s], Category[%s]\n", location_landmark_get_id (landmark),
620                                   location_landmark_get_priority(landmark),
621                                   location_landmark_get_name(landmark),
622                                   location_landmark_get_author(landmark),
623                                   location_landmark_get_phone_number(landmark),
624                                   location_landmark_get_category(landmark));
625 }
626
627 static void poi_cb(LocationError error, guint req_id, GList * landmark_list, gchar * error_code, gchar * error_msg, gpointer userdata)
628 {
629         if (error != LOCATION_ERROR_NONE || landmark_list == NULL) {
630                 g_debug ("Fail to get poi. Error[%d], ErrCode[%s], ErrMsg[%s]", error, error_code, error_msg);
631                 return;
632         }
633         g_list_foreach (landmark_list, PrintLandmarkCb, NULL);
634 }
635
636 void search_poi(LocationMapObject* loc)
637 {
638         int ret = 0;
639         guint req_id = 0;
640
641         LocationPosition* rb = location_position_new (0, 37.300, -121.86, 0, LOCATION_STATUS_2D_FIX);
642         LocationPosition* lt = location_position_new (0, 37.360, -121.92, 0, LOCATION_STATUS_2D_FIX);
643         LocationBoundary *bbox = location_boundary_new_for_rect (lt, rb);
644         LocationPOIFilter *filter = location_poi_filter_new();
645         LocationPOIPreference *pref = location_poi_pref_new();
646
647         location_poi_filter_set(filter, "CATEGORY", "restaurant");
648
649         location_poi_pref_set_max_result(pref, 5);
650         location_poi_pref_set_sort_by(pref, "name");
651         location_poi_pref_set_sort_order(pref, LOCATION_POI_PREF_SO_ASC);
652
653         ret = location_map_search_poi_by_area (loc, filter, bbox, pref, poi_cb, loc, &req_id);
654         if (ret != LOCATION_ERROR_NONE) {
655                 g_debug("Fail to get poi. Error[%d]", ret);
656         }
657
658         location_poi_filter_free(filter);
659         location_poi_pref_free(pref);
660         location_boundary_free (bbox);
661 }
662  * @endcode
663  */
664 int location_map_search_poi_by_area (LocationMapObject *obj, const LocationPOIFilter * filter, const LocationBoundary * boundary, const LocationPOIPreference * pref, LocationPOICB cb, gpointer user_data, guint * req_id);
665
666 /**
667  * @brief Request a search service with address filter from service provider.
668  * @remarks refer #LocationLandmark
669  * @pre #location_init should be called before.\n
670  *      #location_poi_pref_new should be set before.
671  * @post None.
672  * @param [in] obj - a #LocationMapObject created by #location_map_new
673  * @param [in] filter - a #LocaitonPOIFilter created by #location_poi_filter_new
674  * @param [in] address - a #LocationAddress
675  * @param [in] pref - a #LocationPOIPreference created by #location_poi_pref_new
676  * @param [in] cb - #LocationPOICB
677  * @param [in] user_data - data to pass to function
678  * @param [out] req_id - a guint
679  * @return int
680  * @retval 0                              Success
681  * Please refer #LocationError for more information.
682  * @par Example
683  * @code
684 #include <location.h>
685 #include <location-map-service.h>
686
687 static GMainLoop *loop = NULL;
688
689 void PrintLandmarkCb (gpointer data, gpointer user_data)
690 {
691         g_return_if_fail (data);
692
693         LocationLandmark *landmark = (LocationLandmark *)data;
694
695         g_debug ("id[%d], Priority[%d], Name:[%s], Author[%s], Phone[%s], Category[%s]\n", location_landmark_get_id (landmark),
696                                   location_landmark_get_priority(landmark),
697                                   location_landmark_get_name(landmark),
698                                   location_landmark_get_author(landmark),
699                                   location_landmark_get_phone_number(landmark),
700                                   location_landmark_get_category(landmark));
701 }
702
703 static void poi_cb(LocationError error, guint req_id, GList * landmark_list, gchar * error_code, gchar * error_msg, gpointer userdata)
704 {
705         if (error != LOCATION_ERROR_NONE || landmark_list == NULL) {
706                 g_debug ("Fail to get poi. Error[%d], ErrCode[%s], ErrMsg[%s]", error, error_code, error_msg);
707                 return;
708         }
709         g_list_foreach (landmark_list, PrintLandmarkCb, NULL);
710 }
711
712 void search_poi(LocationMapObject* loc)
713 {
714         int ret = 0;
715         guint req_id = 0;
716
717         LocationAddress *addr = location_address_new ("1", "Post Street", NULL, "san jose", "ca", NULL, "95113");
718         LocationPOIFilter *filter = location_poi_filter_new();
719         LocationPOIPreference *pref = location_poi_pref_new();
720
721         location_poi_filter_set(filter, "CATEGORY", "restaurant");
722
723         location_poi_pref_set_max_result(pref, 5);
724         location_poi_pref_set_sort_by(pref, "name");
725         location_poi_pref_set_sort_order(pref, LOCATION_POI_PREF_SO_ASC);
726
727         ret = location_map_search_poi_by_address (loc, filter, addr, pref, poi_cb, loc, &req_id);
728         if (ret != LOCATION_ERROR_NONE) {
729                 g_debug("Fail to get poi. Error[%d]", ret);
730         }
731
732         location_poi_filter_free(filter);
733         location_poi_pref_free(pref);
734         location_address_free (addr);
735 }
736  * @endcode
737  */
738 int location_map_search_poi_by_address (LocationMapObject *obj, const LocationPOIFilter * filter, const LocationAddress * addr, const LocationPOIPreference * pref, LocationPOICB cb, gpointer user_data, guint * req_id);
739
740 /**
741  * @brief Request a search service with area filter from service provider.
742  * @remarks refer #LocationLandmark
743  * @pre #location_init should be called before.\n
744  *      #location_poi_pref_new should be set before.
745  * @post None.
746  * @param [in] obj - a #LocationMapObject created by #location_map_new
747  * @param [in] filter - a #LocaitonPOIFilter created by #location_poi_filter_new
748  * @param [in] address - a freeformed address
749  * @param [in] pref - a #LocationPOIPreference created by #location_poi_pref_new
750  * @param [in] cb - #LocationPOICB
751  * @param [in] user_data - data to pass to function
752  * @param [out] req_id - a guint
753  * @return int
754  * @retval 0                              Success
755  * Please refer #LocationError for more information.
756  * @par Example
757  * @code
758 #include <location.h>
759 #include <location-map-service.h>
760
761 static GMainLoop *loop = NULL;
762
763 void PrintLandmarkCb (gpointer data, gpointer user_data)
764 {
765         g_return_if_fail (data);
766
767         LocationLandmark *landmark = (LocationLandmark *)data;
768
769         g_debug ("id[%d], Priority[%d], Name:[%s], Author[%s], Phone[%s], Category[%s]\n", location_landmark_get_id (landmark),
770                                   location_landmark_get_priority(landmark),
771                                   location_landmark_get_name(landmark),
772                                   location_landmark_get_author(landmark),
773                                   location_landmark_get_phone_number(landmark),
774                                   location_landmark_get_category(landmark));
775 }
776
777 static void poi_cb(LocationError error, guint req_id, GList * landmark_list, gchar * error_code, gchar * error_msg, gpointer userdata)
778 {
779         if (error != LOCATION_ERROR_NONE || landmark_list == NULL) {
780                 g_debug ("Fail to get poi. Error[%d], ErrCode[%s], ErrMsg[%s]", error, error_code, error_msg);
781                 return;
782         }
783         g_list_foreach (landmark_list, PrintLandmarkCb, NULL);
784 }
785
786 void search_poi(LocationMapObject* loc)
787 {
788         int ret = 0;
789         guint req_id = 0;
790
791         gchar *addr = g_strdup("4 N 2nd Street 95113");
792         LocationPOIFilter *filter = location_poi_filter_new();
793         LocationPOIPreference *pref = location_poi_pref_new();
794
795         location_poi_filter_set(filter, "CATEGORY", "restaurant");
796
797         location_poi_pref_set_max_result(pref, 5);
798         location_poi_pref_set_sort_by(pref, "name");
799         location_poi_pref_set_sort_order(pref, LOCATION_POI_PREF_SO_ASC);
800
801         ret = location_map_search_poi_by_freeformed_address (loc, filter, addr, pref, poi_cb, loc, &req_id);
802         if (ret != LOCATION_ERROR_NONE) {
803                 g_debug("Fail to get poi. Error[%d]", ret);
804         }
805
806         location_poi_filter_free(filter);
807         location_poi_pref_free(pref);
808         g_free (addr);
809 }
810  * @endcode
811  */
812 int location_map_search_poi_by_freeformed_address (LocationMapObject *obj, const LocationPOIFilter * filter, const gchar * address, const LocationPOIPreference * pref, LocationPOICB cb, gpointer user_data, guint * req_id);
813
814 /**
815  * @brief Cancel the previous poi search.
816  * @remarks refer #LocationLandmark
817  * @pre #location_map_search_poi should be called before.
818  * @post None.
819  * @param [in] obj - a #LocationMapObject created by #location_map_new
820  * @param [in] req_id - a poi request id returned by location_map_search_poi
821  * @return int
822  * @retval 0                              Success
823  * Please refer #LocationError for more information.
824  * @par Example
825  * @code
826 #include <location.h>
827 #include <location-map-service.h>
828
829 static GMainLoop *loop = NULL;
830
831 void PrintLandmarkCb (gpointer data, gpointer user_data)
832 {
833         g_return_if_fail (data);
834
835         LocationLandmark *landmark = (LocationLandmark *)data;
836
837         g_debug ("id[%d], Priority[%d], Name:[%s], Author[%s], Phone[%s], Category[%s]\n", location_landmark_get_id (landmark),
838                                   location_landmark_get_priority(landmark),
839                                   location_landmark_get_name(landmark),
840                                   location_landmark_get_author(landmark),
841                                   location_landmark_get_phone_number(landmark),
842                                   location_landmark_get_category(landmark));
843 }
844
845 static void poi_cb(LocationError error, guint req_id, GList * landmark_list, gchar * error_code, gchar * error_msg, gpointer userdata)
846 {
847         if (error != LOCATION_ERROR_NONE || landmark_list == NULL) {
848                 g_debug ("Fail to get poi. Error[%d], ErrCode[%s], ErrMsg[%s]", error, error_code, error_msg);
849                 return;
850         }
851         g_list_foreach (landmark_list, PrintLandmarkCb, NULL);
852 }
853
854 void search_poi(LocationMapObject* loc)
855 {
856         int ret = 0;
857         guint req_id = 0;
858
859         gchar *addr = g_strdup("4 N 2nd Street 95113");
860         LocationPOIFilter *filter = location_poi_filter_new();
861         LocationPOIPreference *pref = location_poi_pref_new();
862
863         location_poi_filter_set(filter, "CATEGORY", "restaurant");
864
865         location_poi_pref_set_max_result(pref, 5);
866         location_poi_pref_set_sort_by(pref, "name");
867         location_poi_pref_set_sort_order(pref, LOCATION_POI_PREF_SO_ASC);
868
869         ret = location_map_search_poi (loc, filter, addr, pref, poi_cb, loc, &req_id);
870         if (ret != LOCATION_ERROR_NONE) {
871                 g_debug("Fail to get poi. Error[%d]", ret);
872         }
873
874         ret = location_map_cancel_poi_request (loc, req_id);
875         if (ret != LOCATION_ERROR_NONE) {
876                 g_debug("Fail to cancel poi request. Err[%d]", ret);
877         }
878
879         location_poi_filter_free(filter);
880         location_poi_pref_free(pref);
881         g_free (addr);
882 }
883  * @endcode
884  */
885 int location_map_cancel_poi_request (LocationMapObject *obj, guint req_id);
886
887 /**
888  * @brief Request a route service from service provider.
889  * @remarks refer #LocationRoute, #LocationRouteSegment and #LocationRouteStep
890  * @pre #location_map_new should be called before.
891  * @post None.
892  * @param [in] obj - a #LocationMapObject created by #location_map_new
893  * @param [in] origin - a #LocationPosition
894  * @param [in] destination - a #LocationPosition
895  * @param [in] waypoint - a list of #LocationPosition
896  * const LocationRoutePreference * pref, LocationRouteCB cb, gpointer user_data, guint * req_id);
897  * @param [in] pref - a #LocationRoutePreference created by #location_route_pref_new
898  * @param [in] cb - a #LocationRouteCB
899  * @param [in] user_data - a gpointer
900  * @param [out] req_id - a guint
901  * @return int
902  * @retval 0                              Success
903  * Please refer #LocationError for more information.
904  * @par Example
905  * @code
906 #include <location.h>
907 #include <location-map-service.h>
908
909 static void free_waypoint (gpointer data)
910 {
911         LocationPosition *pos = (LocationPosition *)data;
912
913         if (pos) location_position_free(pos);
914 }
915
916 static void __print_route_step (gpointer data, gpointer user_data)
917 {
918         g_printf("+++Step begin\n");
919         LocationRouteStep *step = (LocationRouteStep *)data;
920
921         const LocationPosition *start = location_route_step_get_start_point(step);
922         gdouble start_lat = 0;
923         gdouble start_lon = 0;
924         if (start) {
925                 start_lat = start->latitude;
926                 start_lon = start->longitude;
927         } else {
928                 g_printf("Step start position NULL\n");
929         }
930         const LocationPosition *end = location_route_step_get_end_point(step);
931         gdouble end_lat = 0;
932         gdouble end_lon = 0;
933         if (end) {
934                 end_lat = end->latitude;
935                 end_lon = end->longitude;
936         } else {
937                 g_printf("Step end postion NULL\n");
938         }
939         const gchar *inst = location_route_step_get_instruction(step);
940
941         g_printf("Step: start(%f/%f), end(%f/%f), instruction(%s)\n", start_lat, start_lon, end_lat, end_lon, inst);
942
943         g_printf("---Step end\n");
944 }
945
946 static void print_route_segment (gpointer data, gpointer user_data)
947 {
948         g_printf("++Segment begin\n");
949         LocationRouteSegment *seg = (LocationRouteSegment *)data;
950         gdouble seg_dist = location_route_segment_get_distance(seg);
951         glong seg_duration = location_route_segment_get_duration(seg);
952         const LocationPosition *start = location_route_segment_get_start_point(seg);
953         gdouble start_lat = 0;
954         gdouble start_lon = 0;
955         if (start) {
956                 start_lat = start->latitude;
957                 start_lon = start->longitude;
958         } else {
959                 g_printf("Segment start postion NULL\n");
960         }
961         const LocationPosition *end = location_route_segment_get_end_point(seg);
962         gdouble end_lat = 0;
963         gdouble end_lon = 0;
964         if (end) {
965                 end_lat = end->latitude;
966                 end_lon = end->longitude;
967         } else {
968                 g_printf("Segment end postion NULL\n");
969         }
970         g_printf("Segment info: Distance[%f], Duration[%ld], start(%f/%f), end(%f/%f)\n", seg_dist, seg_duration,
971                         start_lat, start_lon, end_lat, end_lon);
972
973         GList *step_list = location_route_segment_get_route_step(seg);
974         GList *tmp_list = (GList *)step_list;
975         if (tmp_list) {
976                 g_list_foreach(tmp_list, print_route_step, NULL);
977         }
978         g_printf("--Segment end\n");
979 }
980
981
982 static void print_route_list (gpointer data, gpointer user_data)
983 {
984         g_printf("+Route begin\n");
985         LocationRoute *route = (LocationRoute *)data;
986
987         const LocationPosition *start = location_route_get_origin(route);
988         gdouble start_lat = 0;
989         gdouble start_lon = 0;
990         if (start) {
991                 start_lat = start->latitude;
992                 start_lon = start->longitude;
993         } else {
994                 g_printf("Route start position NULL\n");
995         }
996         const LocationPosition *end = location_route_get_destination(route);
997         gdouble end_lat = 0;
998         gdouble end_lon = 0;
999         if (end) {
1000                 end_lat = end->latitude;
1001                 end_lon = end->longitude;
1002         } else {
1003                 g_printf("Route end position NULL\n");
1004         }
1005         g_printf("Route: start(%f/%f), end(%f/%f)\n", start_lat, start_lon, end_lat, end_lon);
1006
1007         gdouble distance = location_route_get_total_distance(route);
1008         const gchar *dis_unit = location_route_get_distance_unit(route);
1009         glong duration = location_route_get_total_duration(route);
1010         const LocationBoundary *bound = location_route_get_bounding_box(route);
1011         if (bound && bound->type == LOCATION_BOUNDARY_RECT) {
1012                 g_printf("RECT left top[%f-%f], right bottom[%f-%f]\n", bound->rect.left_top->latitude, bound->rect.left_top->longitude,
1013                         bound->rect.right_bottom->latitude, bound->rect.right_bottom->longitude);
1014         } else {
1015                 g_printf("route boundary not exist, or not RECT\n");
1016         }
1017         g_printf ("Distance[%f], Distance unit[%s], Duration[%ld]\n", distance, dis_unit, duration);
1018
1019         GList *seg_list = location_route_get_route_segment(route);
1020         if (seg_list) {
1021                 g_list_foreach(seg_list, print_route_segment, NULL);
1022         }
1023
1024         g_printf("-Route end\n");
1025 }
1026
1027 static void cb_route(LocationError error, guint req_id, GList * route_list, gchar * error_code, gchar * error_msg, gpointer userdata)
1028 {
1029         if (error != LOCATION_ERROR_NONE) {
1030                 g_printf("Failed :%d\n", error);
1031                 return;
1032         }
1033
1034         g_printf("Success, poi_list[0x%x] user_data[0x%x] req_id[%d]\n", (unsigned int)route_list, (unsigned int)userdata, req_id);
1035         g_list_foreach (route_list, print_route_list, NULL);
1036
1037         if (error_code && error_msg) {
1038                 g_printf("cb_route: error_code[%s], error_msg[%s]\n", error_code, error_msg);
1039         }
1040 }
1041
1042 int request_route(LocationMapObject *loc)
1043 {
1044         int ret = 0;
1045         LocationPosition *origin = location_position_new(0, 37.564263, 126.974676, 0, LOCATION_STATUS_2D_FIX);  // Seoul city hall
1046         LocationPosition *destination = location_position_new(0, 37.557120, 126.992410, 0, LOCATION_STATUS_2D_FIX);     // NamSan
1047
1048         GList *waypoint = NULL;
1049         LocationPosition *via_pos = location_position_new(0, 37.560950, 126.986240, 0, LOCATION_STATUS_2D_FIX); // Wangsimli
1050         waypoint = g_list_append (waypoint, (gpointer)via_pos);
1051
1052         LocationRoutePreference *pref = location_route_pref_new();
1053         gchar *type = g_strdup("FASTEST");
1054         location_route_pref_set_route_type(pref, type);
1055
1056         ret = location_request_route(loc, origin, destination, waypoint, pref, cb_route, NULL, &req_id);
1057         if (ret != LOCATION_ERROR_NONE) {
1058                         g_printf("Fail to search route by address. Error[%d]\n", ret);
1059         } else {
1060                         g_printf("Search Route successfully, req_id %d\n", req_id);
1061         }
1062
1063         g_free(type);
1064         g_list_free_full (waypoint, free_waypoint);
1065         location_position_free(origin);
1066         location_position_free(destination);
1067         location_route_pref_free(pref);
1068
1069         return ret;
1070  }
1071  * @endcode
1072  */
1073 int location_map_request_route (LocationMapObject *obj, LocationPosition *origin, LocationPosition *destination, GList *waypoint, const LocationRoutePreference * pref, LocationRouteCB cb, gpointer user_data, guint * req_id);
1074
1075 /**
1076  * @brief Cancel the previous route request.
1077  * @remarks None
1078  * @pre #location_map_request_route should be called before.
1079  * @post None.
1080  * @param [in] obj - a #LocationMapObject created by #location_map_new
1081  * @param [in] req_id - a route request id returned by location_map_search_route
1082  * @return int
1083  * @retval 0                              Success
1084  * Please refer #LocationError for more information.
1085  * @par Example
1086  * @code
1087 #include <location.h>
1088 #include <location-map-service.h>
1089
1090 int cancel_route_request (LocationMapObject *loc, guint req_id)
1091 {
1092         g_printf("cancel_route_request\n");
1093
1094         int ret = LOCATION_ERROR_NONE;
1095
1096         ret = location_map_cancel_route_request(loc, req_id);
1097         if (ret != LOCATION_ERROR_NONE) {
1098                 g_printf("Fail to cancel route request. Error[%d]\n", ret);
1099         }
1100         else {
1101                 g_printf("location_map_cancel_route_request, req_id %d\n", req_id);
1102         }
1103 }
1104  * @endcode
1105  */
1106 int location_map_cancel_route_request (LocationMapObject *obj, guint req_id);
1107
1108 /**
1109  * @brief Check wheither a map service is available on a service provider
1110  * @remarks None
1111  * @pre #location_map_new should be called before.
1112  * @post None.
1113  * @param [in] obj - a #LocationMapObject created by #location_map_new
1114  * @param [in] type - a #LocationMapService
1115  * @return gboolean
1116  * @retval TRUE if supported
1117  * @par Example
1118  * @code
1119 #include <location.h>
1120 #include <location-map-service.h>
1121
1122 int check_map_service (LocationMapObject *loc)
1123 {
1124         g_printf("check_map_service\n");
1125
1126         gboolean is_supported = FALSE;
1127
1128         is_supported = location_map_is_supported_provider_capability(loc, MAP_SERVICE_ROUTE_REQUEST_FEATURE_TO_AVOID);
1129         if (is_supported == TRUE) {
1130                 g_printf("Map Service(MAP_SERVICE_ROUTE_REQUEST_FEATURE_TO_AVOID) is supported.\n");
1131         }
1132         else {
1133                 g_printf("Map Service(MAP_SERVICE_ROUTE_REQUEST_FEATURE_TO_AVOID) is not supported.\n");
1134         }
1135 }
1136  * @endcode
1137  */
1138 gboolean location_map_is_supported_provider_capability (LocationMapObject *obj, LocationMapServiceType type);
1139
1140 /**
1141  * @brief Get Map service key on a service provider
1142  * @remarks None
1143  * @pre #location_map_new should be called before.
1144  * @post None.
1145  * @param [in] obj - a #LocationMapObject created by #location_map_new
1146  * @param [in] type - a #LocationMapService
1147  * @return GList
1148  * @retval a list of keys
1149  * @par Example
1150  * @code
1151 #include <location.h>
1152 #include <location-map-service.h>
1153
1154 static void _print_keys(gpointer data)
1155 {
1156         g_return_if_fail(data);
1157         gchar *key = (gchar *)data;
1158
1159         g_printf("Key[%s] is available now\n", key);
1160 }
1161
1162 int get_map_service_key (LocationMapObject *loc)
1163 {
1164         g_printf("check_map_service\n");
1165
1166         GList *keys = NULL;
1167
1168         keys = location_map_get_provider_capability_key(loc, MAP_SERVICE_ROUTE_REQUEST_FEATURE_TO_AVOID);
1169         if (keys) {
1170                 g_list_foreach (keys, _print_keys, NULL);
1171                 g_list_free_full (keys, g_free);
1172         }
1173         else {
1174                 g_printf("Map Service(MAP_SERVICE_ROUTE_REQUEST_FEATURE_TO_AVOID) does not have keys. Need to check whether its service is supported.\n");
1175         }
1176 }
1177  * @endcode
1178  */
1179 int location_map_get_provider_capability_key (LocationMapObject *obj, LocationMapServiceType type, GList **key);
1180
1181 /**
1182  * @brief Get Map service Preference on a service provider
1183  * @remarks None
1184  * @pre #location_map_new should be called before.
1185  * @post None.
1186  * @param [in] obj - a #LocationMapObject created by #location_map_new
1187  * @return #LocationMapPref
1188  * @retval a preference
1189  * @par Example
1190  * @code
1191 #include <location.h>
1192 #include <location-map-service.h>
1193         int get_map_service_pref (LocationMapObject loc)
1194         {
1195                 if (!loc) return -1;
1196
1197                 LocationMapPref *svc_pref = location_map_get_service_pref (loc);
1198                 if (!svc_pref) return -1;
1199
1200                 gchar *name = location_map_pref_get_provider (svc_pref);
1201                 gchar *unit = location_map_pref_get_distance_unit (svc_pref);
1202                 gchar *language = location_map_pref_get_language (svc_pref);
1203
1204                 g_printf("provider [%s]: distance unit [%s], languange [%s]\n", name, unit, language);
1205
1206                 return 0;
1207         }
1208
1209  * @endcode
1210  */
1211 LocationMapPref *location_map_get_service_pref (LocationMapObject *obj);
1212
1213 /**
1214  * @brief Set Map service preference on a service provider
1215  * @remarks None
1216  * @pre #location_map_new should be called before.
1217  * @post None.
1218  * @param [in] obj - a #LocationMapObject created by #location_map_new
1219  * @param [in] pref = a #LocationMapPref
1220  * @return gboolean
1221  * @retval TRUE if success
1222  * @par Example
1223  * @code
1224 #include <location.h>
1225 #include <location-map-service.h>
1226
1227 int set_map_service_pref (LocationMapObject *loc)
1228 {
1229         if (!loc) return -1;
1230
1231         LocationMapPref *svc_pref = location_map_pref_new();
1232         location_map_pref_set_language (svc_pref, "en");
1233         location_map_pref_set_distance_unit (svc_pref, "MI");
1234
1235         gboolean ret = location_map_set_service_pref (loc, svc_pref);
1236         if (!ret) {
1237                 location_map_pref_pref (svc_pref);
1238                 return -1;
1239         }
1240         location_map_pref_pref (svc_pref);
1241         return 0;
1242 }
1243  * @endcode
1244  */
1245 gboolean location_map_set_service_pref (LocationMapObject *obj, LocationMapPref *pref);
1246
1247 /**
1248  * @brief Get supported map providers
1249  * @remarks LocationMapObject should be created before.
1250  * @pre None.
1251  * @post None.
1252  * @param [in] obj - #LocationMapObject
1253  * @return Glist
1254  * @retval a list of providers
1255 */
1256 GList *location_map_get_supported_providers (LocationMapObject *obj);
1257
1258 /**
1259  * @brief Get current default provider
1260  * @remarks LocationMapObject should be created before.
1261  * @pre None.
1262  * @post None.
1263  * @param [in] obj - LocationMapObject
1264  * @return gchar
1265  * @retval provider name
1266  */
1267 gchar *location_map_get_default_provider (LocationMapObject *obj);
1268
1269 /**
1270  * @brief Set current provider
1271  * @remarks LocationMapObject should be created before.
1272  * @pre None.
1273  * @post None.
1274  * @param [in] obj - LocationMapObject
1275  * @param [in] provider - gchar
1276  * @return gboolean
1277  * @retval TRUE if success
1278  */
1279 gboolean location_map_set_provider (LocationMapObject *obj, gchar *provider);
1280
1281 /**
1282  * @} @}
1283  */
1284
1285 G_END_DECLS
1286
1287 #endif /* __LOCATION_MAP_SERVICE_H__ */