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__
25 /*----------------------------------------------------------------------------*/
26 /*typedef int (*maps_plugin_geocode_f)(maps_service_h maps,
27 * const char *address, maps_service_geocode_cb callback,
28 * void *user_data, int* request_id); */
29 class command_geocode : public command
33 maps_item_hashtable_h preference;
34 maps_service_geocode_cb callback;
38 command_geocode(maps_service_h ms,
40 const maps_item_hashtable_h preference,
41 maps_service_geocode_cb callback,
42 void *user_data, int *request_id);
43 virtual ~command_geocode();
45 command_geocode() : command(NULL)
48 command_geocode(const command_geocode &src) : command(NULL)
51 command_geocode &operator=(const command_geocode &src)
59 class command_geocode_handler : public command_handler
61 maps_service_geocode_cb callback;
63 command_geocode_handler(plugin::plugin_s *plugin,
64 maps_service_geocode_cb callback,
67 virtual ~command_geocode_handler()
71 command_geocode_handler() : command_handler(NULL, NULL, 0) {}
72 command_geocode_handler(const command_geocode_handler &src) :
73 command_handler(NULL, NULL, 0)
76 command_geocode_handler &operator=(
77 const command_geocode_handler &src)
82 static bool foreach_geocode_cb(maps_error_e result,
83 int request_id, int index,
85 maps_coordinates_h coordinates,
87 friend class command_geocode;
88 friend class command_geocode_inside_bounds;
89 friend class command_geocode_by_structured_address;
92 /*----------------------------------------------------------------------------*/
94 /* TODO: rename to command_geocode_inside_area */
96 /*typedef int (*maps_plugin_geocode_inside_area_f)(maps_service_h maps,
97 * const char *address, maps_area_h bounds,
98 * maps_service_geocode_cb callback, void *user_data,
99 * int* request_id); */
100 class command_geocode_inside_bounds : public command
105 maps_item_hashtable_h preference;
106 maps_service_geocode_cb callback;
110 command_geocode_inside_bounds(maps_service_h ms,
112 const maps_area_h bounds,
113 const maps_item_hashtable_h
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,
155 maps_item_hashtable_h
157 maps_service_geocode_cb
161 virtual ~command_geocode_by_structured_address();
163 command_geocode_by_structured_address() : command(NULL)
166 command_geocode_by_structured_address(
167 const command_geocode_by_structured_address &src)
171 command_geocode_by_structured_address &operator=(
172 const command_geocode_by_structured_address &src)
180 /*----------------------------------------------------------------------------*/
181 /*typedef int (*maps_plugin_reverse_geocode_f)(maps_service_h maps,
182 * double latitude, double longitude,
183 * maps_service_reverse_geocode_cb callback, void *user_data,
184 * int *request_id); */
185 class command_reverse_geocode : public command
188 const string address;
191 maps_item_hashtable_h preference;
192 maps_service_reverse_geocode_cb callback;
196 command_reverse_geocode(maps_service_h ms,
197 double latitude, double longitude,
198 const maps_item_hashtable_h preference,
199 maps_service_reverse_geocode_cb
201 void *user_data, int *request_id);
202 virtual ~command_reverse_geocode();
204 command_reverse_geocode() : command(NULL)
207 command_reverse_geocode(const command_reverse_geocode &src)
211 command_reverse_geocode& operator=(
212 const command_reverse_geocode &src)
220 class command_reverse_geocode_handler : public command_handler
222 maps_service_reverse_geocode_cb callback;
224 command_reverse_geocode_handler(plugin::plugin_s *plugin,
225 maps_service_reverse_geocode_cb
229 virtual ~command_reverse_geocode_handler()
233 command_reverse_geocode_handler()
234 : command_handler(NULL, NULL, 0)
237 command_reverse_geocode_handler(
238 command_reverse_geocode_handler &src)
239 : command_handler(NULL, NULL, 0)
242 command_reverse_geocode_handler &operator=(
243 const command_reverse_geocode_handler &src)
248 static void foreach_reverse_geocode_cb(maps_error_e result,
250 int index, int total,
251 maps_address_h address,
253 friend class command_reverse_geocode;
256 /*----------------------------------------------------------------------------*/
257 /*typedef int (*maps_plugin_search_place_f)(maps_service_h maps,
258 * maps_coordinates_h position, int distance,
259 * maps_item_hashtable_h preference, maps_place_filter_h filter,
260 * maps_service_search_place_cb callback, void *user_data,
261 * int *request_id); */
262 class command_search_place : public command
265 maps_coordinates_h position;
267 maps_item_hashtable_h preference;
268 maps_place_filter_h filter;
269 maps_service_search_place_cb callback;
274 command_search_place(maps_service_h ms,
275 const maps_coordinates_h position,
277 const maps_item_hashtable_h preference,
278 const maps_place_filter_h filter,
279 maps_service_search_place_cb callback,
280 void *user_data, int *request_id);
281 virtual ~command_search_place();
283 command_search_place() : command(NULL)
286 command_search_place(const command_search_place &src)
290 command_search_place &operator=(
291 const command_search_place &src)
299 class command_search_place_handler : public command_handler
301 maps_service_search_place_cb callback;
303 command_search_place_handler(plugin::plugin_s *plugin,
304 maps_service_search_place_cb
306 void *user_data, int user_req_id);
307 virtual ~command_search_place_handler()
311 command_search_place_handler()
312 : command_handler(NULL, NULL, 0)
315 command_search_place_handler(
316 const command_search_place_handler &src)
317 : command_handler(NULL, NULL, 0)
320 command_search_place_handler &operator=(
321 const command_search_place_handler &src)
325 static bool foreach_place_cb(maps_error_e error, int request_id,
326 int index, int length,
329 void set_supported_data(maps_place_h place);
330 friend class command_search_place;
331 friend class command_search_by_area_place;
332 friend class command_search_by_address_place;
335 /*----------------------------------------------------------------------------*/
336 /*typedef int (*maps_plugin_search_place_by_area_f)(maps_service_h maps,
337 * maps_area_h boundary , maps_item_hashtable_h preference,
338 * maps_place_filter_h filter, maps_service_search_place_cb callback,
339 * void *user_data, int *request_id); */
340 class command_search_by_area_place : public command
343 maps_area_h boundary;
344 maps_item_hashtable_h preference;
345 maps_place_filter_h filter;
346 maps_service_search_place_cb callback;
351 command_search_by_area_place(maps_service_h ms,
352 const maps_area_h boundary,
353 const maps_item_hashtable_h
355 const maps_place_filter_h filter,
356 maps_service_search_place_cb
358 void *user_data, int *request_id);
359 virtual ~command_search_by_area_place();
361 command_search_by_area_place() : command(NULL)
364 command_search_by_area_place(
365 const command_search_by_area_place &src)
369 command_search_by_area_place &operator=(
370 const command_search_by_area_place &src)
378 /*----------------------------------------------------------------------------*/
379 /*typedef int (*maps_plugin_search_place_by_address_f)(
380 * maps_service_h maps, const char *address, maps_area_h boundary,
381 * maps_place_preference_h preference, maps_place_filter_h filter,
382 * maps_service_search_place_cb callback, void *user_data,
383 * int *request_id); */
384 class command_search_by_address_place : public command
387 const string address;
388 maps_area_h boundary;
389 maps_item_hashtable_h preference;
390 maps_place_filter_h filter;
391 maps_service_search_place_cb callback;
396 command_search_by_address_place(maps_service_h ms,
398 const maps_area_h boundary,
399 const maps_item_hashtable_h preference,
400 const maps_place_filter_h filter,
401 maps_service_search_place_cb callback,
402 void *user_data, int *request_id);
403 virtual ~command_search_by_address_place();
405 command_search_by_address_place() : command(NULL)
408 command_search_by_address_place(
409 const command_search_by_address_place &src)
413 command_search_by_address_place &operator=(
414 const command_search_by_address_place &src)
422 /*----------------------------------------------------------------------------*/
423 /*typedef int (*maps_plugin_search_route_f)(
424 * maps_service_h maps, maps_item_hashtable_h preference,
425 * maps_coordinates_h origin, maps_coordinates_h destination,
426 * maps_service_search_route_cb callback, void *user_data,
427 * int *request_id); */
428 class command_search_route_handler : public command_handler
430 maps_service_search_route_cb callback;
432 command_search_route_handler(plugin::plugin_s *plugin,
433 maps_service_search_route_cb
435 void *user_data, int user_req_id);
436 virtual ~command_search_route_handler()
440 command_search_route_handler()
441 : command_handler(NULL, NULL, 0)
444 command_search_route_handler(
445 const command_search_route_handler &src)
446 : command_handler(NULL, NULL, 0)
449 command_search_route_handler &operator=(
450 const command_search_route_handler &src)
455 static bool foreach_route_cb(maps_error_e error, int request_id,
456 int index, int length,
459 void set_supported_data(maps_route_h route);
460 friend class command_search_route;
461 friend class command_search_route_waypoints;
464 class command_search_route : public command
467 maps_item_hashtable_h preference;
468 maps_coordinates_h origin;
469 maps_coordinates_h destination;
470 maps_service_search_route_cb callback;
475 command_search_route(maps_service_h ms,
476 const maps_item_hashtable_h preference,
477 const maps_coordinates_h origin,
478 const maps_coordinates_h destination,
479 maps_service_search_route_cb callback,
480 void *user_data, int *request_id);
481 virtual ~command_search_route();
483 command_search_route() : command(NULL)
486 command_search_route(
487 const command_search_route &src)
491 command_search_route &operator=(
492 const command_search_route &src)
500 /*----------------------------------------------------------------------------*/
501 /*typedef int (*maps_plugin_search_route_f)(maps_service_h maps,
502 * maps_item_hashtable_h preference, maps_coordinates_h *waypoint_list,
503 * int waypoint_num, maps_service_search_route_cb callback,
504 * void *user_data, int *request_id); */
505 class command_search_route_waypoints:public command
508 maps_item_hashtable_h preference;
509 maps_coordinates_h *waypoint_list;
511 maps_service_search_route_cb callback;
516 command_search_route_waypoints(maps_service_h ms,
517 const maps_item_hashtable_h preference,
518 const maps_coordinates_h *waypoint_list,
520 maps_service_search_route_cb callback,
521 void *user_data, int *request_id);
522 virtual ~command_search_route_waypoints();
524 command_search_route_waypoints() : command(NULL)
527 command_search_route_waypoints(
528 const command_search_route_waypoints &src)
532 command_search_route_waypoints &operator=(
533 const command_search_route_waypoints &src)
541 /*----------------------------------------------------------------------------*/
542 /*typedef int (*maps_plugin_cancel_request_f)(maps_service_h maps,
543 * int request_id); */
544 class command_cancel_request : public command
549 command_cancel_request(maps_service_h ms, int rid)
554 virtual ~command_cancel_request()
558 command_cancel_request() : command(NULL)
561 command_cancel_request(const command_cancel_request &src)
565 command_cancel_request &operator=(
566 const command_cancel_request &src)
575 #endif /* __MAPS_SERVICE_SESSION_COMMANDS_H__ */