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"
27 /*----------------------------------------------------------------------------*/
28 /*typedef int (*maps_plugin_geocode_f)(maps_service_h maps,
29 * const char *address, maps_service_geocode_cb callback,
30 * void *user_data, int* request_id); */
31 class command_geocode : public command
35 maps_item_hashtable_h preference;
36 maps_service_geocode_cb callback;
40 command_geocode(maps_service_h ms,
42 const maps_item_hashtable_h preference,
43 maps_service_geocode_cb callback,
44 void *user_data, int *request_id);
45 virtual ~command_geocode();
47 command_geocode() : command(NULL)
50 command_geocode(const command_geocode &src) : command(NULL)
53 command_geocode &operator=(const command_geocode &src)
61 class command_geocode_handler : public command_handler
63 maps_service_geocode_cb callback;
65 command_geocode_handler(plugin::plugin_s *plugin,
66 maps_service_geocode_cb callback,
69 virtual ~command_geocode_handler()
73 command_geocode_handler() : command_handler(NULL, NULL, 0) {}
74 command_geocode_handler(const command_geocode_handler &src) :
75 command_handler(NULL, NULL, 0)
78 command_geocode_handler &operator=(
79 const command_geocode_handler &src)
84 static bool foreach_geocode_cb(maps_error_e result,
85 int request_id, int index,
87 maps_coordinates_h coordinates,
89 friend class command_geocode;
90 friend class command_geocode_inside_bounds;
91 friend class command_geocode_by_structured_address;
94 /*----------------------------------------------------------------------------*/
96 /* TODO: rename to command_geocode_inside_area */
98 /*typedef int (*maps_plugin_geocode_inside_area_f)(maps_service_h maps,
99 * const char *address, maps_area_h bounds,
100 * maps_service_geocode_cb callback, void *user_data,
101 * int* request_id); */
102 class command_geocode_inside_bounds : public command
107 maps_item_hashtable_h preference;
108 maps_service_geocode_cb callback;
112 command_geocode_inside_bounds(maps_service_h ms,
114 const maps_area_h bounds,
115 const maps_item_hashtable_h preference,
116 maps_service_geocode_cb callback,
119 virtual ~command_geocode_inside_bounds();
121 command_geocode_inside_bounds() : command(NULL)
124 command_geocode_inside_bounds(
125 const command_geocode_inside_bounds &src)
129 command_geocode_inside_bounds &operator=(
130 const command_geocode_inside_bounds &src)
138 /*----------------------------------------------------------------------------*/
139 /*typedef int (*maps_plugin_geocode_by_structured_address_f)(
140 * maps_service_h maps, maps_address_h address,
141 * maps_preference_h preference, maps_service_geocode_cb callback,
142 * void *user_data, int *request_id); */
143 class command_geocode_by_structured_address : public command
146 maps_address_h address;
147 maps_item_hashtable_h preference;
148 maps_service_geocode_cb callback;
152 command_geocode_by_structured_address(maps_service_h ms,
153 const maps_address_h address,
154 const maps_item_hashtable_h preference,
155 maps_service_geocode_cb callback,
158 virtual ~command_geocode_by_structured_address();
160 command_geocode_by_structured_address() : command(NULL)
163 command_geocode_by_structured_address(
164 const command_geocode_by_structured_address &src)
168 command_geocode_by_structured_address &operator=(
169 const command_geocode_by_structured_address &src)
177 /*----------------------------------------------------------------------------*/
178 /*typedef int (*maps_plugin_reverse_geocode_f)(maps_service_h maps,
179 * double latitude, double longitude,
180 * maps_service_reverse_geocode_cb callback, void *user_data,
181 * int *request_id); */
182 class command_reverse_geocode : public command
185 const string address;
188 maps_item_hashtable_h preference;
189 maps_service_reverse_geocode_cb callback;
193 command_reverse_geocode(maps_service_h ms,
194 double latitude, double longitude,
195 const maps_item_hashtable_h preference,
196 maps_service_reverse_geocode_cb callback,
197 void *user_data, int *request_id);
198 virtual ~command_reverse_geocode();
200 command_reverse_geocode() : command(NULL)
203 command_reverse_geocode(const command_reverse_geocode &src)
207 command_reverse_geocode& operator=(
208 const command_reverse_geocode &src)
216 class command_reverse_geocode_handler : public command_handler
218 maps_service_reverse_geocode_cb callback;
220 command_reverse_geocode_handler(plugin::plugin_s *plugin,
221 maps_service_reverse_geocode_cb callback,
224 virtual ~command_reverse_geocode_handler()
228 command_reverse_geocode_handler()
229 : command_handler(NULL, NULL, 0)
232 command_reverse_geocode_handler(
233 command_reverse_geocode_handler &src)
234 : command_handler(NULL, NULL, 0)
237 command_reverse_geocode_handler &operator=(
238 const command_reverse_geocode_handler &src)
243 static void foreach_reverse_geocode_cb(maps_error_e result,
245 int index, int total,
246 maps_address_h address,
248 friend class command_reverse_geocode;
251 /*----------------------------------------------------------------------------*/
252 /*typedef int (*maps_plugin_multi_reverse_geocode_f)(maps_service_h maps,
253 * maps_maps_h maps_list, maps_preference_h preference,
254 * maps_service_multi_reverse_geocode_cb callback, void *user_data, * int *request_id); */
255 class command_multi_reverse_geocode : public command
258 const string address;
259 maps_coordinates_list_h maps_list;
260 maps_item_hashtable_h preference;
261 maps_service_multi_reverse_geocode_cb callback;
265 command_multi_reverse_geocode(maps_service_h ms,
266 const maps_coordinates_list_h maps_list,
267 const maps_item_hashtable_h preference,
268 maps_service_multi_reverse_geocode_cb callback,
269 void *user_data, int *request_id);
270 virtual ~command_multi_reverse_geocode();
272 command_multi_reverse_geocode() : command(NULL)
275 command_multi_reverse_geocode(const command_multi_reverse_geocode &src)
279 command_multi_reverse_geocode &operator=(
280 const command_multi_reverse_geocode &src)
288 class command_multi_reverse_geocode_handler : public command_handler
290 maps_service_multi_reverse_geocode_cb callback;
292 command_multi_reverse_geocode_handler(plugin::plugin_s *plugin,
293 maps_service_multi_reverse_geocode_cb callback,
296 virtual ~command_multi_reverse_geocode_handler()
300 command_multi_reverse_geocode_handler()
301 : command_handler(NULL, NULL, 0)
304 command_multi_reverse_geocode_handler(
305 command_multi_reverse_geocode_handler &src)
306 : command_handler(NULL, NULL, 0)
309 command_multi_reverse_geocode_handler &operator=(
310 const command_multi_reverse_geocode_handler &src)
315 static bool foreach_multi_reverse_geocode_cb(maps_error_e result,
318 maps_coordinates_list_h address_list,
320 friend class command_multi_reverse_geocode;
323 /*----------------------------------------------------------------------------*/
324 /*typedef int (*maps_plugin_search_place_f)(maps_service_h maps,
325 * maps_coordinates_h position, int distance,
326 * maps_item_hashtable_h preference, maps_place_filter_h filter,
327 * maps_service_search_place_cb callback, void *user_data,
328 * int *request_id); */
329 class command_search_place : public command
332 maps_coordinates_h position;
334 maps_item_hashtable_h preference;
335 maps_place_filter_h filter;
336 maps_service_search_place_cb callback;
341 command_search_place(maps_service_h ms,
342 const maps_coordinates_h position,
344 const maps_item_hashtable_h preference,
345 const maps_place_filter_h filter,
346 maps_service_search_place_cb callback,
347 void *user_data, int *request_id);
348 virtual ~command_search_place();
350 command_search_place() : command(NULL)
353 command_search_place(const command_search_place &src)
357 command_search_place &operator=(
358 const command_search_place &src)
366 class command_search_place_handler : public command_handler
368 maps_service_search_place_cb callback;
370 command_search_place_handler(plugin::plugin_s *plugin,
371 maps_service_search_place_cb
373 void *user_data, int user_req_id);
374 virtual ~command_search_place_handler()
378 command_search_place_handler()
379 : command_handler(NULL, NULL, 0)
382 command_search_place_handler(
383 const command_search_place_handler &src)
384 : command_handler(NULL, NULL, 0)
387 command_search_place_handler &operator=(
388 const command_search_place_handler &src)
392 static bool foreach_place_cb(maps_error_e error, int request_id,
393 int index, int length,
396 friend class command_search_place;
397 friend class command_search_by_area_place;
398 friend class command_search_by_address_place;
401 /*----------------------------------------------------------------------------*/
402 /*typedef int (*maps_plugin_search_place_by_area_f)(maps_service_h maps,
403 * maps_area_h boundary , maps_item_hashtable_h preference,
404 * maps_place_filter_h filter, maps_service_search_place_cb callback,
405 * void *user_data, int *request_id); */
406 class command_search_by_area_place : public command
409 maps_area_h boundary;
410 maps_item_hashtable_h preference;
411 maps_place_filter_h filter;
412 maps_service_search_place_cb callback;
417 command_search_by_area_place(maps_service_h ms,
418 const maps_area_h boundary,
419 const maps_item_hashtable_h preference,
420 const maps_place_filter_h filter,
421 maps_service_search_place_cb
423 void *user_data, int *request_id);
424 virtual ~command_search_by_area_place();
426 command_search_by_area_place() : command(NULL)
429 command_search_by_area_place(
430 const command_search_by_area_place &src)
434 command_search_by_area_place &operator=(
435 const command_search_by_area_place &src)
443 /*----------------------------------------------------------------------------*/
444 /*typedef int (*maps_plugin_search_place_by_address_f)(
445 * maps_service_h maps, const char *address, maps_area_h boundary,
446 * maps_place_preference_h preference, maps_place_filter_h filter,
447 * maps_service_search_place_cb callback, void *user_data,
448 * int *request_id); */
449 class command_search_by_address_place : public command
452 const string address;
453 maps_area_h boundary;
454 maps_item_hashtable_h preference;
455 maps_place_filter_h filter;
456 maps_service_search_place_cb callback;
461 command_search_by_address_place(maps_service_h ms,
463 const maps_area_h boundary,
464 const maps_item_hashtable_h preference,
465 const maps_place_filter_h filter,
466 maps_service_search_place_cb callback,
467 void *user_data, int *request_id);
468 virtual ~command_search_by_address_place();
470 command_search_by_address_place() : command(NULL)
473 command_search_by_address_place(
474 const command_search_by_address_place &src)
478 command_search_by_address_place &operator=(
479 const command_search_by_address_place &src)
487 /*----------------------------------------------------------------------------*/
488 /*typedef int (*maps_plugin_search_place_list_f)(maps_service_h maps,
489 * maps_area_h boundary, maps_item_hashtable_h preference, maps_place_filter_h filter,
490 * maps_service_search_place_list_cb callback, void *user_data,
491 * int *request_id); */
492 class command_search_place_list : public command
495 maps_area_h boundary;
496 maps_item_hashtable_h preference;
497 maps_place_filter_h filter;
498 maps_service_search_place_list_cb callback;
503 command_search_place_list(maps_service_h ms,
504 const maps_area_h boundary,
505 const maps_item_hashtable_h preference,
506 const maps_place_filter_h filter,
507 maps_service_search_place_list_cb callback,
508 void *user_data, int *request_id);
509 virtual ~command_search_place_list();
511 command_search_place_list() : command(NULL)
514 command_search_place_list(const command_search_place_list &src)
518 command_search_place_list &operator=(
519 const command_search_place_list &src)
527 class command_search_place_list_handler : public command_handler
529 maps_service_search_place_list_cb callback;
531 command_search_place_list_handler(plugin::plugin_s *plugin,
532 maps_service_search_place_list_cb callback,
533 void *user_data, int user_req_id);
534 virtual ~command_search_place_list_handler()
538 command_search_place_list_handler()
539 : command_handler(NULL, NULL, 0)
542 command_search_place_list_handler(const command_search_place_list_handler &src)
543 : command_handler(NULL, NULL, 0)
546 command_search_place_list_handler &operator=(const command_search_place_list_handler &src)
550 static void foreach_place_list_cb(maps_error_e error, int request_id,
551 int total, maps_place_list_h place, void *user_data);
552 friend class command_search_place_list;
555 /*----------------------------------------------------------------------------*/
556 /*typedef int (*maps_plugin_get_place_details_f) */
557 class command_get_place_details : public command
561 maps_service_get_place_details_cb callback;
566 command_get_place_details(maps_service_h ms, const char *url,
567 maps_service_get_place_details_cb callback, void *user_data, int *request_id);
568 virtual ~command_get_place_details();
570 command_get_place_details() : command(NULL)
573 command_get_place_details(const command_get_place_details &src)
577 command_get_place_details &operator=(const command_get_place_details &src)
585 class command_get_place_details_handler : public command_handler
587 maps_service_get_place_details_cb callback;
589 command_get_place_details_handler(plugin::plugin_s *plugin,
590 maps_service_get_place_details_cb callback,
591 void *user_data, int user_req_id);
592 virtual ~command_get_place_details_handler()
596 command_get_place_details_handler()
597 : command_handler(NULL, NULL, 0)
600 command_get_place_details_handler(const command_get_place_details_handler &src)
601 : command_handler(NULL, NULL, 0)
604 command_get_place_details_handler &operator=(const command_get_place_details_handler &src)
608 static void foreach_place_details_cb(maps_error_e error, int request_id,
609 maps_place_h place, void *user_data);
610 friend class command_get_place_details;
613 /*----------------------------------------------------------------------------*/
614 /*typedef int (*maps_plugin_search_route_f)(
615 * maps_service_h maps, maps_item_hashtable_h preference,
616 * maps_coordinates_h origin, maps_coordinates_h destination,
617 * maps_service_search_route_cb callback, void *user_data,
618 * int *request_id); */
619 class command_search_route_handler : public command_handler
621 maps_service_search_route_cb callback;
623 command_search_route_handler(plugin::plugin_s *plugin,
624 maps_service_search_route_cb
626 void *user_data, int user_req_id);
627 virtual ~command_search_route_handler()
631 command_search_route_handler()
632 : command_handler(NULL, NULL, 0)
635 command_search_route_handler(
636 const command_search_route_handler &src)
637 : command_handler(NULL, NULL, 0)
640 command_search_route_handler &operator=(
641 const command_search_route_handler &src)
646 static bool foreach_route_cb(maps_error_e error, int request_id,
647 int index, int length,
650 friend class command_search_route;
651 friend class command_search_route_waypoints;
654 class command_search_route : public command
657 maps_item_hashtable_h preference;
658 maps_coordinates_h origin;
659 maps_coordinates_h destination;
660 maps_service_search_route_cb callback;
665 command_search_route(maps_service_h ms,
666 const maps_item_hashtable_h preference,
667 const maps_coordinates_h origin,
668 const maps_coordinates_h destination,
669 maps_service_search_route_cb callback,
670 void *user_data, int *request_id);
671 virtual ~command_search_route();
673 command_search_route() : command(NULL)
676 command_search_route(const command_search_route &src)
680 command_search_route &operator=(const command_search_route &src)
688 /*----------------------------------------------------------------------------*/
689 /*typedef int (*maps_plugin_search_route_f)(maps_service_h maps,
690 * maps_item_hashtable_h preference, maps_coordinates_h *waypoint_list,
691 * int waypoint_num, maps_service_search_route_cb callback,
692 * void *user_data, int *request_id); */
693 class command_search_route_waypoints:public command
696 maps_item_hashtable_h preference;
697 maps_coordinates_h *waypoint_list;
699 maps_service_search_route_cb callback;
704 command_search_route_waypoints(maps_service_h ms,
705 const maps_item_hashtable_h preference,
706 const maps_coordinates_h *waypoint_list,
708 maps_service_search_route_cb callback,
709 void *user_data, int *request_id);
710 virtual ~command_search_route_waypoints();
712 command_search_route_waypoints() : command(NULL)
715 command_search_route_waypoints(const command_search_route_waypoints &src)
719 command_search_route_waypoints &operator=(const command_search_route_waypoints &src)
727 /*----------------------------------------------------------------------------*/
728 /*typedef int (*maps_plugin_cancel_request_f)(maps_service_h maps,
729 * int request_id); */
730 class command_cancel_request : public command
735 command_cancel_request(maps_service_h ms, int rid)
740 virtual ~command_cancel_request()
744 command_cancel_request() : command(NULL)
747 command_cancel_request(const command_cancel_request &src)
751 command_cancel_request &operator=(const command_cancel_request &src)
760 /*----------------------------------------------------------------------------*/
762 * Mapping API commands
764 /*----------------------------------------------------------------------------*/
766 class command_view_set_center : public command {
770 maps_coordinates_h c;
772 command_view_set_center(maps_service_h ms, maps_view_h view,
773 const maps_coordinates_h coords);
774 virtual ~command_view_set_center();
778 virtual command_type_e get_type() const;
779 virtual int get_priority() const;
780 virtual void merge(const command *c);
783 class command_view_move_center : public command {
790 command_view_move_center(maps_service_h ms, maps_view_h view,
791 const int delta_x, const int delta_y);
792 virtual ~command_view_move_center();
796 virtual command_type_e get_type() const;
797 virtual int get_priority() const;
798 virtual void merge(const command *c);
801 class command_view_zoom : public command {
807 command_view_zoom(maps_service_h ms, maps_view_h view,
808 const double &factor) :
809 command(ms), v(view), zoom_factor(factor)
812 virtual ~command_view_zoom()
818 virtual command_type_e get_type() const;
819 virtual int get_priority() const;
820 virtual void merge(const command *c);
823 class command_view_rotate : public command {
827 double rotation_angle;
829 command_view_rotate(maps_service_h ms, maps_view_h view,
830 const double &angle) :
831 command(ms), v(view), rotation_angle(angle)
834 virtual ~command_view_rotate()
840 virtual command_type_e get_type() const;
841 virtual int get_priority() const;
842 virtual void merge(const command *c);
845 class command_view_zoom_rotate : public command {
850 double rotation_angle;
852 command_view_zoom_rotate(maps_service_h ms, maps_view_h view,
853 const double &factor,
857 , zoom_factor(factor)
858 , rotation_angle(angle)
861 virtual ~command_view_zoom_rotate()
867 virtual command_type_e get_type() const;
868 virtual int get_priority() const;
869 virtual void merge(const command *c);
875 #endif /* __MAPS_SERVICE_SESSION_COMMANDS_H__ */