2 * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __MAPS_SERVICE_SESSION_COMMANDS_H__
18 #define __MAPS_SERVICE_SESSION_COMMANDS_H__
21 #include "maps_view.h"
26 /*----------------------------------------------------------------------------*/
27 /*typedef int (*maps_plugin_geocode_f)(maps_service_h maps,
28 * const char *address, maps_service_geocode_cb callback,
29 * void *user_data, int* request_id); */
30 class command_geocode : public command
34 maps_item_hashtable_h preference;
35 maps_service_geocode_cb callback;
39 command_geocode(maps_service_h ms,
41 const maps_item_hashtable_h preference,
42 maps_service_geocode_cb callback,
43 void *user_data, int *request_id);
44 virtual ~command_geocode();
46 command_geocode() : command(NULL)
49 command_geocode(const command_geocode &src) : command(NULL)
52 command_geocode &operator=(const command_geocode &src)
60 class command_geocode_handler : public command_handler
62 maps_service_geocode_cb callback;
64 command_geocode_handler(plugin::plugin_s *plugin,
65 maps_service_geocode_cb callback,
68 virtual ~command_geocode_handler()
72 command_geocode_handler() : command_handler(NULL, NULL, 0) {}
73 command_geocode_handler(const command_geocode_handler &src) :
74 command_handler(NULL, NULL, 0)
77 command_geocode_handler &operator=(
78 const command_geocode_handler &src)
83 static bool foreach_geocode_cb(maps_error_e result,
84 int request_id, int index,
86 maps_coordinates_h coordinates,
88 friend class command_geocode;
89 friend class command_geocode_inside_bounds;
90 friend class command_geocode_by_structured_address;
93 /*----------------------------------------------------------------------------*/
95 /* TODO: rename to command_geocode_inside_area */
97 /*typedef int (*maps_plugin_geocode_inside_area_f)(maps_service_h maps,
98 * const char *address, maps_area_h bounds,
99 * maps_service_geocode_cb callback, void *user_data,
100 * int* request_id); */
101 class command_geocode_inside_bounds : public command
106 maps_item_hashtable_h preference;
107 maps_service_geocode_cb callback;
111 command_geocode_inside_bounds(maps_service_h ms,
113 const maps_area_h bounds,
114 const maps_item_hashtable_h preference,
115 maps_service_geocode_cb callback,
118 virtual ~command_geocode_inside_bounds();
120 command_geocode_inside_bounds() : command(NULL)
123 command_geocode_inside_bounds(
124 const command_geocode_inside_bounds &src)
128 command_geocode_inside_bounds &operator=(
129 const command_geocode_inside_bounds &src)
137 /*----------------------------------------------------------------------------*/
138 /*typedef int (*maps_plugin_geocode_by_structured_address_f)(
139 * maps_service_h maps, maps_address_h address,
140 * maps_preference_h preference, maps_service_geocode_cb callback,
141 * void *user_data, int *request_id); */
142 class command_geocode_by_structured_address : public command
145 maps_address_h address;
146 maps_item_hashtable_h preference;
147 maps_service_geocode_cb callback;
151 command_geocode_by_structured_address(maps_service_h ms,
152 const maps_address_h address,
153 const maps_item_hashtable_h preference,
154 maps_service_geocode_cb callback,
157 virtual ~command_geocode_by_structured_address();
159 command_geocode_by_structured_address() : command(NULL)
162 command_geocode_by_structured_address(
163 const command_geocode_by_structured_address &src)
167 command_geocode_by_structured_address &operator=(
168 const command_geocode_by_structured_address &src)
176 /*----------------------------------------------------------------------------*/
177 /*typedef int (*maps_plugin_reverse_geocode_f)(maps_service_h maps,
178 * double latitude, double longitude,
179 * maps_service_reverse_geocode_cb callback, void *user_data,
180 * int *request_id); */
181 class command_reverse_geocode : public command
184 const string address;
187 maps_item_hashtable_h preference;
188 maps_service_reverse_geocode_cb callback;
192 command_reverse_geocode(maps_service_h ms,
193 double latitude, double longitude,
194 const maps_item_hashtable_h preference,
195 maps_service_reverse_geocode_cb callback,
196 void *user_data, int *request_id);
197 virtual ~command_reverse_geocode();
199 command_reverse_geocode() : command(NULL)
202 command_reverse_geocode(const command_reverse_geocode &src)
206 command_reverse_geocode& operator=(
207 const command_reverse_geocode &src)
215 class command_reverse_geocode_handler : public command_handler
217 maps_service_reverse_geocode_cb callback;
219 command_reverse_geocode_handler(plugin::plugin_s *plugin,
220 maps_service_reverse_geocode_cb callback,
223 virtual ~command_reverse_geocode_handler()
227 command_reverse_geocode_handler()
228 : command_handler(NULL, NULL, 0)
231 command_reverse_geocode_handler(
232 command_reverse_geocode_handler &src)
233 : command_handler(NULL, NULL, 0)
236 command_reverse_geocode_handler &operator=(
237 const command_reverse_geocode_handler &src)
242 static void foreach_reverse_geocode_cb(maps_error_e result,
244 int index, int total,
245 maps_address_h address,
247 friend class command_reverse_geocode;
250 /*----------------------------------------------------------------------------*/
251 /*typedef int (*maps_plugin_multi_reverse_geocode_f)(maps_service_h maps,
252 * maps_maps_h maps_list, maps_preference_h preference,
253 * maps_service_multi_reverse_geocode_cb callback, void *user_data, * int *request_id); */
254 class command_multi_reverse_geocode : public command
257 const string address;
258 maps_coordinates_list_h maps_list;
259 maps_item_hashtable_h preference;
260 maps_service_multi_reverse_geocode_cb callback;
264 command_multi_reverse_geocode(maps_service_h ms,
265 const maps_coordinates_list_h maps_list,
266 const maps_item_hashtable_h preference,
267 maps_service_multi_reverse_geocode_cb callback,
268 void *user_data, int *request_id);
269 virtual ~command_multi_reverse_geocode();
271 command_multi_reverse_geocode() : command(NULL)
274 command_multi_reverse_geocode(const command_multi_reverse_geocode &src)
278 command_multi_reverse_geocode &operator=(
279 const command_multi_reverse_geocode &src)
287 class command_multi_reverse_geocode_handler : public command_handler
289 maps_service_multi_reverse_geocode_cb callback;
291 command_multi_reverse_geocode_handler(plugin::plugin_s *plugin,
292 maps_service_multi_reverse_geocode_cb callback,
295 virtual ~command_multi_reverse_geocode_handler()
299 command_multi_reverse_geocode_handler()
300 : command_handler(NULL, NULL, 0)
303 command_multi_reverse_geocode_handler(
304 command_multi_reverse_geocode_handler &src)
305 : command_handler(NULL, NULL, 0)
308 command_multi_reverse_geocode_handler &operator=(
309 const command_multi_reverse_geocode_handler &src)
314 static bool foreach_multi_reverse_geocode_cb(maps_error_e result,
317 maps_coordinates_list_h address_list,
319 friend class command_multi_reverse_geocode;
322 /*----------------------------------------------------------------------------*/
323 /*typedef int (*maps_plugin_search_place_f)(maps_service_h maps,
324 * maps_coordinates_h position, int distance,
325 * maps_item_hashtable_h preference, maps_place_filter_h filter,
326 * maps_service_search_place_cb callback, void *user_data,
327 * int *request_id); */
328 class command_search_place : public command
331 maps_coordinates_h position;
333 maps_item_hashtable_h preference;
334 maps_place_filter_h filter;
335 maps_service_search_place_cb callback;
340 command_search_place(maps_service_h ms,
341 const maps_coordinates_h position,
343 const maps_item_hashtable_h preference,
344 const maps_place_filter_h filter,
345 maps_service_search_place_cb callback,
346 void *user_data, int *request_id);
347 virtual ~command_search_place();
349 command_search_place() : command(NULL)
352 command_search_place(const command_search_place &src)
356 command_search_place &operator=(
357 const command_search_place &src)
365 class command_search_place_handler : public command_handler
367 maps_service_search_place_cb callback;
369 command_search_place_handler(plugin::plugin_s *plugin,
370 maps_service_search_place_cb
372 void *user_data, int user_req_id);
373 virtual ~command_search_place_handler()
377 command_search_place_handler()
378 : command_handler(NULL, NULL, 0)
381 command_search_place_handler(
382 const command_search_place_handler &src)
383 : command_handler(NULL, NULL, 0)
386 command_search_place_handler &operator=(
387 const command_search_place_handler &src)
391 static bool foreach_place_cb(maps_error_e error, int request_id,
392 int index, int length,
395 friend class command_search_place;
396 friend class command_search_by_area_place;
397 friend class command_search_by_address_place;
400 /*----------------------------------------------------------------------------*/
401 /*typedef int (*maps_plugin_search_place_by_area_f)(maps_service_h maps,
402 * maps_area_h boundary , maps_item_hashtable_h preference,
403 * maps_place_filter_h filter, maps_service_search_place_cb callback,
404 * void *user_data, int *request_id); */
405 class command_search_by_area_place : public command
408 maps_area_h boundary;
409 maps_item_hashtable_h preference;
410 maps_place_filter_h filter;
411 maps_service_search_place_cb callback;
416 command_search_by_area_place(maps_service_h ms,
417 const maps_area_h boundary,
418 const maps_item_hashtable_h preference,
419 const maps_place_filter_h filter,
420 maps_service_search_place_cb
422 void *user_data, int *request_id);
423 virtual ~command_search_by_area_place();
425 command_search_by_area_place() : command(NULL)
428 command_search_by_area_place(
429 const command_search_by_area_place &src)
433 command_search_by_area_place &operator=(
434 const command_search_by_area_place &src)
442 /*----------------------------------------------------------------------------*/
443 /*typedef int (*maps_plugin_search_place_by_address_f)(
444 * maps_service_h maps, const char *address, maps_area_h boundary,
445 * maps_place_preference_h preference, maps_place_filter_h filter,
446 * maps_service_search_place_cb callback, void *user_data,
447 * int *request_id); */
448 class command_search_by_address_place : public command
451 const string address;
452 maps_area_h boundary;
453 maps_item_hashtable_h preference;
454 maps_place_filter_h filter;
455 maps_service_search_place_cb callback;
460 command_search_by_address_place(maps_service_h ms,
462 const maps_area_h boundary,
463 const maps_item_hashtable_h preference,
464 const maps_place_filter_h filter,
465 maps_service_search_place_cb callback,
466 void *user_data, int *request_id);
467 virtual ~command_search_by_address_place();
469 command_search_by_address_place() : command(NULL)
472 command_search_by_address_place(
473 const command_search_by_address_place &src)
477 command_search_by_address_place &operator=(
478 const command_search_by_address_place &src)
486 /*----------------------------------------------------------------------------*/
487 /*typedef int (*maps_plugin_search_place_list_f)(maps_service_h maps,
488 * maps_area_h boundary, maps_item_hashtable_h preference, maps_place_filter_h filter,
489 * maps_service_search_place_list_cb callback, void *user_data,
490 * int *request_id); */
491 class command_search_place_list : public command
494 maps_area_h boundary;
495 maps_item_hashtable_h preference;
496 maps_place_filter_h filter;
497 maps_service_search_place_list_cb callback;
502 command_search_place_list(maps_service_h ms,
503 const maps_area_h boundary,
504 const maps_item_hashtable_h preference,
505 const maps_place_filter_h filter,
506 maps_service_search_place_list_cb callback,
507 void *user_data, int *request_id);
508 virtual ~command_search_place_list();
510 command_search_place_list() : command(NULL)
513 command_search_place_list(const command_search_place_list &src)
517 command_search_place_list &operator=(
518 const command_search_place_list &src)
526 class command_search_place_list_handler : public command_handler
528 maps_service_search_place_list_cb callback;
530 command_search_place_list_handler(plugin::plugin_s *plugin,
531 maps_service_search_place_list_cb callback,
532 void *user_data, int user_req_id);
533 virtual ~command_search_place_list_handler()
537 command_search_place_list_handler()
538 : command_handler(NULL, NULL, 0)
541 command_search_place_list_handler(const command_search_place_list_handler &src)
542 : command_handler(NULL, NULL, 0)
545 command_search_place_list_handler &operator=(const command_search_place_list_handler &src)
549 static void foreach_place_list_cb(maps_error_e error, int request_id,
550 int total, maps_place_list_h place, void *user_data);
551 friend class command_search_place_list;
554 /*----------------------------------------------------------------------------*/
555 /*typedef int (*maps_plugin_get_place_details_f) */
556 class command_get_place_details : public command
560 maps_service_get_place_details_cb callback;
565 command_get_place_details(maps_service_h ms, const char *url,
566 maps_service_get_place_details_cb callback, void *user_data, int *request_id);
567 virtual ~command_get_place_details();
569 command_get_place_details() : command(NULL)
572 command_get_place_details(const command_get_place_details &src)
576 command_get_place_details &operator=(const command_get_place_details &src)
584 class command_get_place_details_handler : public command_handler
586 maps_service_get_place_details_cb callback;
588 command_get_place_details_handler(plugin::plugin_s *plugin,
589 maps_service_get_place_details_cb callback,
590 void *user_data, int user_req_id);
591 virtual ~command_get_place_details_handler()
595 command_get_place_details_handler()
596 : command_handler(NULL, NULL, 0)
599 command_get_place_details_handler(const command_get_place_details_handler &src)
600 : command_handler(NULL, NULL, 0)
603 command_get_place_details_handler &operator=(const command_get_place_details_handler &src)
607 static void foreach_place_details_cb(maps_error_e error, int request_id,
608 maps_place_h place, void *user_data);
609 friend class command_get_place_details;
612 /*----------------------------------------------------------------------------*/
613 /*typedef int (*maps_plugin_search_route_f)(
614 * maps_service_h maps, maps_item_hashtable_h preference,
615 * maps_coordinates_h origin, maps_coordinates_h destination,
616 * maps_service_search_route_cb callback, void *user_data,
617 * int *request_id); */
618 class command_search_route_handler : public command_handler
620 maps_service_search_route_cb callback;
622 command_search_route_handler(plugin::plugin_s *plugin,
623 maps_service_search_route_cb
625 void *user_data, int user_req_id);
626 virtual ~command_search_route_handler()
630 command_search_route_handler()
631 : command_handler(NULL, NULL, 0)
634 command_search_route_handler(
635 const command_search_route_handler &src)
636 : command_handler(NULL, NULL, 0)
639 command_search_route_handler &operator=(
640 const command_search_route_handler &src)
645 static bool foreach_route_cb(maps_error_e error, int request_id,
646 int index, int length,
649 friend class command_search_route;
650 friend class command_search_route_waypoints;
653 class command_search_route : public command
656 maps_item_hashtable_h preference;
657 maps_coordinates_h origin;
658 maps_coordinates_h destination;
659 maps_service_search_route_cb callback;
664 command_search_route(maps_service_h ms,
665 const maps_item_hashtable_h preference,
666 const maps_coordinates_h origin,
667 const maps_coordinates_h destination,
668 maps_service_search_route_cb callback,
669 void *user_data, int *request_id);
670 virtual ~command_search_route();
672 command_search_route() : command(NULL)
675 command_search_route(const command_search_route &src)
679 command_search_route &operator=(const command_search_route &src)
687 /*----------------------------------------------------------------------------*/
688 /*typedef int (*maps_plugin_search_route_f)(maps_service_h maps,
689 * maps_item_hashtable_h preference, maps_coordinates_h *waypoint_list,
690 * int waypoint_num, maps_service_search_route_cb callback,
691 * void *user_data, int *request_id); */
692 class command_search_route_waypoints:public command
695 maps_item_hashtable_h preference;
696 maps_coordinates_h *waypoint_list;
698 maps_service_search_route_cb callback;
703 command_search_route_waypoints(maps_service_h ms,
704 const maps_item_hashtable_h preference,
705 const maps_coordinates_h *waypoint_list,
707 maps_service_search_route_cb callback,
708 void *user_data, int *request_id);
709 virtual ~command_search_route_waypoints();
711 command_search_route_waypoints() : command(NULL)
714 command_search_route_waypoints(const command_search_route_waypoints &src)
718 command_search_route_waypoints &operator=(const command_search_route_waypoints &src)
726 /*----------------------------------------------------------------------------*/
727 /*typedef int (*maps_plugin_cancel_request_f)(maps_service_h maps,
728 * int request_id); */
729 class command_cancel_request : public command
734 command_cancel_request(maps_service_h ms, int rid)
739 virtual ~command_cancel_request()
743 command_cancel_request() : command(NULL)
746 command_cancel_request(const command_cancel_request &src)
750 command_cancel_request &operator=(const command_cancel_request &src)
759 /*----------------------------------------------------------------------------*/
761 * Mapping API commands
763 /*----------------------------------------------------------------------------*/
765 class command_view_set_center : public command {
769 maps_coordinates_h c;
771 command_view_set_center(maps_service_h ms, maps_view_h view,
772 const maps_coordinates_h coords);
773 virtual ~command_view_set_center();
777 virtual command_type_e get_type() const;
778 virtual int get_priority() const;
779 virtual void merge(const command *c);
782 class command_view_move_center : public command {
789 command_view_move_center(maps_service_h ms, maps_view_h view,
790 const int delta_x, const int delta_y);
791 virtual ~command_view_move_center();
795 virtual command_type_e get_type() const;
796 virtual int get_priority() const;
797 virtual void merge(const command *c);
800 class command_view_zoom : public command {
806 command_view_zoom(maps_service_h ms, maps_view_h view,
807 const double &factor) :
808 command(ms), v(view), zoom_factor(factor)
811 virtual ~command_view_zoom()
817 virtual command_type_e get_type() const;
818 virtual int get_priority() const;
819 virtual void merge(const command *c);
822 class command_view_rotate : public command {
826 double rotation_angle;
828 command_view_rotate(maps_service_h ms, maps_view_h view,
829 const double &angle) :
830 command(ms), v(view), rotation_angle(angle)
833 virtual ~command_view_rotate()
839 virtual command_type_e get_type() const;
840 virtual int get_priority() const;
841 virtual void merge(const command *c);
844 class command_view_zoom_rotate : public command {
849 double rotation_angle;
851 command_view_zoom_rotate(maps_service_h ms, maps_view_h view,
852 const double &factor,
856 , zoom_factor(factor)
857 , rotation_angle(angle)
860 virtual ~command_view_zoom_rotate()
866 virtual command_type_e get_type() const;
867 virtual int get_priority() const;
868 virtual void merge(const command *c);
873 #endif /* __MAPS_SERVICE_SESSION_COMMANDS_H__ */