diff options
Diffstat (limited to 'src/mapquest/mapquest_queue.h')
-rw-r--r-- | src/mapquest/mapquest_queue.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/src/mapquest/mapquest_queue.h b/src/mapquest/mapquest_queue.h new file mode 100644 index 0000000..587dbb6 --- /dev/null +++ b/src/mapquest/mapquest_queue.h @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _MAPQUEST_QUEUE_H_ +#define _MAPQUEST_QUEUE_H_ + +#include <glib.h> +#include "mapquest_server_private.h" + +typedef struct { + mapquest_req_type type; + void *request; +} mapquest_request_s; + +typedef struct { + mapquest_geocode_req_s *req_details; + int requestId; + mapquest_geocode_cb geocode_cb; + void *user_data; +} mapquest_geocode_req; + +typedef struct { + mapquest_revgeocode_req_s *req_details; + int requestId; + mapquest_reverse_geocode_cb revgeocode_cb; + void *user_data; +} mapquest_revgeocode_req; + +typedef struct { + mapquest_route_req_s *req_details; + mapquest_route_cb route_cb; + int requestId; + void *user_data; +} mapquest_route_req; + +typedef struct { + mapquest_search_req_s *req_details; + mapquest_place_search_cb search_place_cb; + int requestId; + void *user_data; +} mapquest_search_place_req; + +int add_to_geocode_list(mapquest_geocode_req_s *req_details, mapquest_geocode_cb callback, int request_id, void *user_data); +int add_to_revgeocode_list(mapquest_revgeocode_req_s *req_details, mapquest_reverse_geocode_cb callback, int request_id, void *user_data); +int add_to_route_list(mapquest_route_req_s *req_details, mapquest_route_cb callback, int request_id, void *user_data); +int add_to_places_list(mapquest_search_req_s *req_details, mapquest_place_search_cb callback, int request_id, void *user_data); + +int remove_from_request_list(int request_id); + +int start_geocode_service(mapquest_geocode_req_s *req_details, mapquest_geocode_cb callback, int request_id, void *user_data); +int start_reversegeocode_service(mapquest_revgeocode_req_s *req_details, mapquest_reverse_geocode_cb callback, int request_id, void *user_data); +int start_route_service(mapquest_route_req_s *req_details, mapquest_route_cb callback, int request_id, void *user_data); +int start_places_service(mapquest_search_req_s *req_details, mapquest_place_search_cb callback, int request_id, void *user_data); + +int mapquest_init_queue(); +int mapquest_deinit_queue(); +int mapquest_push_to_queue(mapquest_resp_type type, gpointer data); + +#endif /* _MAPQUEST_QUEUE_H_ */ |