+[Version] capi-maps-service_0.5.3
+[Date] 22 January 2016
+[Title] Added place list API.
+[Developer] Kyoungjun Sung <kj7.sung@samsung.com>
+
[Version] capi-maps-service_0.5.0
[Date] 21 October 2015
[Title] Added coordinates address list API.
*/
typedef void *maps_place_h;
+/**
+ * @brief The Place list handle
+ * @details The handle of Place list instance.
+ * @since_tizen 3.0
+ *
+ * @see maps_place_list_foreach()
+ */
+typedef void *maps_place_list_h;
+
/*----------------------------------------------------------------------------*/
/**
maps_place_review_h review,
void *user_data);
+/**
+ * @brief Called when requesting the list of Place.
+ * @details This callback is invoked while iterating through the list of Place.
+ * @since_tizen 3.0
+ * @remarks @a place is valid only in this function and must be released using
+ * maps_place_destroy().
+ *
+ * @param[in] index The current index of review
+ * @param[in] total The total amount of reviews
+ * @param[in] place The place handle
+ * @param[in] uesr_data The user data passed from the maps_place_list_foreach()
+ * @return @c true to continue with the next iteration of the loop,
+ * \n @c false to break out of the loop
+ *
+ * @pre maps_place_list_foreach() will invoke this callback.
+ *
+ * @see maps_place_list_foreach()
+ * @see maps_place_get_id()
+ * @see maps_place_get_name()
+ * @see maps_place_get_uri()
+ * @see maps_place_get_location()
+ * @see maps_place_get_distance()
+ * @see maps_place_get_rating()
+ * @see maps_place_foreach_category()
+ */
+typedef bool(*maps_place_cb) (int index, int total, maps_place_h place, void *user_data);
+
/*----------------------------------------------------------------------------*/
/**
int maps_place_get_related_link(const maps_place_image_h place,
maps_place_link_object_h *related);
+/**
+ * @brief Retrieves all places.
+ * @details This function retrieves all places.
+ * @since_tizen 3.0
+ * @remarks The places will be delivered via maps_place_cb().
+ *
+ * @param[in] place_list The place list handle
+ * @param[in] callback The callback function to invoke
+ * @param[in] user_data The user data to be passed to the callback function
+ * @return 0 on success, otherwise a negative error value
+ * @retval #MAPS_ERROR_NONE Successful
+ * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MAPS_ERROR_NOT_FOUND Result not found
+ * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @post This function invokes maps_place_cb() repeatedly to retrieve each place.
+ *
+ * @see maps_place_cb()
+ */
+int maps_place_list_foreach(const maps_place_list_h place_list,
+ maps_place_cb callback, void *user_data);
+
#ifdef __cplusplus
}
#endif
maps_place_filter_properties_cb
callback, void *user_data);
+/**
+ * @brief Gets the place address.
+ * @details This function gets the place address.
+ * @since_tizen 3.0
+ * @remarks @a place_address must be released using free().
+ *
+ * @param[in] filter The handle of the place filter
+ * @param[out] place_address The place address
+ * @return 0 on success, otherwise a negative error value
+ * @retval #MAPS_ERROR_NONE Successful
+ * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @pre @a filter is created using maps_place_filter_create().
+ *
+ * @see maps_place_filter_set_place_address()
+ * @see maps_place_filter_create()
+ */
+int maps_place_filter_get_place_address(const maps_place_filter_h filter,
+ char **place_address);
+
/*----------------------------------------------------------------------------*/
/**
int maps_place_filter_set_category(maps_place_filter_h filter,
const maps_place_category_h category);
+/**
+ * @brief Sets the place address.
+ * @details This function sets the place address.
+ * @since_tizen 3.0
+ *
+ * @param[in] filter The handle of the place filter
+ * @param[in] place_address The place address
+ * @return 0 on success, otherwise a negative error value
+ * @retval #MAPS_ERROR_NONE Successful
+ * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @pre @a filter is created using maps_place_filter_create().
+ *
+ * @see maps_place_filter_get_place_address()
+ * @see maps_place_filter_create()
+ */
+int maps_place_filter_set_place_address(maps_place_filter_h filter,
+ const char *place_address);
+
#ifdef __cplusplus
}
#endif
maps_service_search_place_cb callback,
void *user_data, int *request_id);
+/**
+ * @brief Queries a brief Place information by a coordinates boundary.
+ * @details This function obtains the brief Place information for a specified coordinates boundary.
+ * @since_tizen 3.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/mapservice
+ * @remarks This function requires network access.
+ * \n To cancel the search request use maps_plugin_cancel_request().
+ * \n To check if Maps Provider is capable of Place Search and which Place
+ * preferences are supported, see the lists of capacities and preferences above.
+ *
+ * @param[in] maps The Maps Service handle
+ * @param[in] boundary The interested area
+ * @param[in] filter The filter handle
+ * @param[in] preference The place preference handle
+ * @param[in] callback The result callback
+ * @param[in] user_data The user data to be passed to the callback function
+ * @param[out] request_id The request id
+ * @return 0 on success, otherwise a negative error value
+ * @retval #MAPS_ERROR_NONE Successful
+ * @retval #MAPS_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MAPS_ERROR_SERVICE_NOT_AVAILABLE Service not available
+ * @retval #MAPS_ERROR_PERMISSION_DENIED Permission Denied
+ * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported
+ * @retval #MAPS_ERROR_CONNECTION_TIME_OUT Timeout error, no answer
+ * @retval #MAPS_ERROR_INVALID_OPERATION Operation is not valid
+ * @retval #MAPS_ERROR_NOT_FOUND Result not found
+ * @retval #MAPS_ERROR_KEY_NOT_AVAILABLE Invalid key
+ * @retval #MAPS_ERROR_RESOURCE_BUSY Places service busy
+ * @retval #MAPS_ERROR_CANCELED Places service aborted
+ * @retval #MAPS_ERROR_UNKNOWN Unknown error
+ *
+ * @post It invokes maps_service_search_place_list_cb() to deliver obtained Place information.
+ *
+ * @see maps_plugin_cancel_request()
+ * @see maps_service_search_place_list_cb()
+ */
+int maps_plugin_search_place_list(const maps_area_h boundary,
+ const maps_place_filter_h filter,
+ maps_preference_h preference,
+ maps_service_search_place_list_cb callback,
+ void *user_data, int *request_id);
+
+/**
+ * @brief Queries a Detail place information by a place uri.
+ * @details This function obtains the Detail place information for a specified place uri
+ * @since_tizen 3.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/mapservice
+ * @remarks This function requires network access.
+ * \n To cancel the search request use maps_plugin_cancel_request().
+ * \n To check if Maps Provider is capable of Place Search and which Place
+ * preferences are supported, see the lists of capacities and preferences above.
+ *
+ * @param[in] maps The Maps Service handle
+ * @param[in] uri The interested place uri
+ * @param[in] preference The place preference handle
+ * @param[in] callback The result callback
+ * @param[in] user_data The user data to be passed to the callback function
+ * @param[out] request_id The request id
+ * @return 0 on success, otherwise a negative error value
+ * @retval #MAPS_ERROR_NONE Successful
+ * @retval #MAPS_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MAPS_ERROR_SERVICE_NOT_AVAILABLE Service not available
+ * @retval #MAPS_ERROR_PERMISSION_DENIED Permission Denied
+ * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported
+ * @retval #MAPS_ERROR_CONNECTION_TIME_OUT Timeout error, no answer
+ * @retval #MAPS_ERROR_INVALID_OPERATION Operation is not valid
+ * @retval #MAPS_ERROR_NOT_FOUND Result not found
+ * @retval #MAPS_ERROR_KEY_NOT_AVAILABLE Invalid key
+ * @retval #MAPS_ERROR_RESOURCE_BUSY Places service busy
+ * @retval #MAPS_ERROR_CANCELED Places service aborted
+ * @retval #MAPS_ERROR_UNKNOWN Unknown error
+ *
+ * @pre @a uri is obtained from maps_plugin_search_place_list()
+ * @post It invokes maps_service_get_place_details_cb() to deliver obtained Place information.
+ *
+ * @see maps_plugin_search_place_list()
+ * @see maps_plugin_cancel_request()
+ * @see maps_service_get_place_details_cb()
+ */
+int maps_plugin_get_place_details(const char *url,
+ maps_service_get_place_details_cb callback,
+ void *user_data, int *request_id);
+
/*----------------------------------------------------------------------------*/
/*
* Route
maps_service_search_route_waypoints() service is allowed */
MAPS_SERVICE_CANCEL_REQUEST, /**< Indicates that
maps_service_cancel_request() service is allowed */
- MAPS_SERVICE_MULTI_REVERSE_GEOCODE /**< Indicates that
+ MAPS_SERVICE_MULTI_REVERSE_GEOCODE, /**< Indicates that
maps_service_multi_reverse_geocode() service is allowed (Since 3.0)*/
+ MAPS_SERVICE_SEARCH_PLACE_LIST /** Indicates that
+ maps_service_search_place_list() service is allowed (Since 3.0) */
} maps_service_e;
/**
* @since_tizen 2.4
* @remarks The parameter @a coordinates must be released using
* maps_coordinates_destroy().
+ * \n This error code will be reported. \n
+ * #MAPS_ERROR_NONE \n
+ * #MAPS_ERROR_OUT_OF_MEMORY \n
+ * #MAPS_ERROR_INVALID_PARAMETER \n
+ * #MAPS_ERROR_NOT_FOUND.
*
* @param[in] result The result of request
* @param[in] request_id The id of request
* \n If search is failed, the value of @a total is 0 and @a address is NULL
* @remarks The parameter @a address must be released using
* maps_address_destroy().
+ * \n This error code will be reported. \n
+ * #MAPS_ERROR_NONE \n
+ * #MAPS_ERROR_OUT_OF_MEMORY \n
+ * #MAPS_ERROR_INVALID_PARAMETER \n
+ * #MAPS_ERROR_NOT_FOUND.
* @since_tizen 2.4
*
* @param[in] result The result of request
* @privilege %http://tizen.org/privilege/mapservice \n
* %http://tizen.org/privilege/internet \n
* %http://tizen.org/privilege/network.get
- * @remarks %http://tizen.org/privilege/internet is needed to access internet.
- * \n To cancel the request, use maps_service_cancel_request().
+ * @remarks To cancel the request, use maps_service_cancel_request().
* \n To check if Maps Provider is capable of geocoding,
* use maps_service_provider_is_service_supported() with
* #MAPS_SERVICE_GEOCODE passed as @a service parameter.
* @privilege %http://tizen.org/privilege/mapservice \n
* %http://tizen.org/privilege/internet \n
* %http://tizen.org/privilege/network.get
- * @remarks %http://tizen.org/privilege/internet is needed to access internet.
- * \n Polygonal bounding box is not supported.
+ * @remarks Polygonal bounding box is not supported.
* \n To cancel the request, use maps_service_cancel_request().
* \n To check if Maps Provider is capable of geocoding inside area,
* use maps_service_provider_is_service_supported() with
* @privilege %http://tizen.org/privilege/mapservice \n
* %http://tizen.org/privilege/internet \n
* %http://tizen.org/privilege/network.get
- * @remarks %http://tizen.org/privilege/internet is needed to access internet.
- * \n To cancel the request, use maps_service_cancel_request().
+ * @remarks To cancel the request, use maps_service_cancel_request().
* \n To check if Maps Provider is capable of geocoding by structured address,
* use maps_service_provider_is_service_supported() with
* #MAPS_SERVICE_GEOCODE_BY_STRUCTURED_ADDRESS passed as @a service parameter.
* @privilege %http://tizen.org/privilege/mapservice \n
* %http://tizen.org/privilege/internet \n
* %http://tizen.org/privilege/network.get
- * @remarks %http://tizen.org/privilege/internet is needed to access internet.
- * \n To cancel the request, use maps_service_cancel_request().
+ * @remarks To cancel the request, use maps_service_cancel_request().
* \n To check if Maps Provider is capable of reverse geocoding,
* use maps_service_provider_is_service_supported() with
* #MAPS_SERVICE_REVERSE_GEOCODE passed as @a service parameter.
* @since_tizen 3.0
* @remarks You can get the respective address information of @a address_list
* using maps_address_list_foreach().
+ * \n This error code will be reported. \n
+ * #MAPS_ERROR_NONE \n
+ * #MAPS_ERROR_OUT_OF_MEMORY \n
+ * #MAPS_ERROR_INVALID_PARAMETER \n
+ * #MAPS_ERROR_NOT_FOUND.
*
* @param[in] result The result of request
* @param[in] request_id The id of request
* @privilege %http://tizen.org/privilege/mapservice \n
* %http://tizen.org/privilege/internet \n
* %http://tizen.org/privilege/network.get
- * @remarks %http://tizen.org/privilege/internet is needed to access internet.
- * \n To cancel the request, use maps_service_cancel_request().
+ * @remarks To cancel the request, use maps_service_cancel_request().
* \n To check if Maps Provider is capable of multi reverse geocoding,
* use maps_service_provider_is_service_supported() with
* #MAPS_SERVICE_MULTI_REVERSE_GEOCODE passed as @a service parameter.
* \n If search is failed, the value of @a total is 0 and @a place is NULL
* @since_tizen 2.4
* @remarks The parameter @a place must be released using maps_place_destroy().
+ * \n This error code will be reported. \n
+ * #MAPS_ERROR_NONE \n
+ * #MAPS_ERROR_OUT_OF_MEMORY \n
+ * #MAPS_ERROR_INVALID_PARAMETER \n
+ * #MAPS_ERROR_NOT_FOUND.
*
* @param[in] error The result of request
* @param[in] request_id The request id
void *user_data);
/**
+ * @brief Called for Place list of Place Search request
+ * @details The Maps Service invokes this callback when the Place data obtained
+ * from the specified coordinates.
+ * \n If search is failed, the value of @a total is 0 and @a place_list is NULL
+ * @since_tizen 3.0
+ * @remarks This error code will be reported. \n
+ * #MAPS_ERROR_NONE \n
+ * #MAPS_ERROR_OUT_OF_MEMORY \n
+ * #MAPS_ERROR_INVALID_PARAMETER \n
+ * #MAPS_ERROR_NOT_FOUND.
+ *
+ * @param[in] error The result of request
+ * @param[in] request_id The request id
+ * @param[in] place_list The resulting Place list data
+ * @param[in] uesr_data The user data passed from maps_service_search_place_list()
+ *
+ * @pre maps_service_search_place_list() will invoke this callback.
+ *
+ * @see maps_service_search_place_list()
+ * @see maps_place_list_foreach()
+ */
+typedef void(*maps_service_search_place_list_cb) (maps_error_e error,
+ int request_id, maps_place_list_h place_list, void *user_data);
+
+/**
+ * @brief Called for Place datail information of Place Search request
+ * @details The Maps Service invokes this callback when the Place detail data
+ * obtained from the specified uri.
+ * \n If search is failed, @a place is NULL
+ * @since_tizen 3.0
+ * @remarks This error code will be reported. \n
+ * #MAPS_ERROR_NONE \n
+ * #MAPS_ERROR_OUT_OF_MEMORY \n
+ * #MAPS_ERROR_INVALID_PARAMETER \n
+ * #MAPS_ERROR_NOT_FOUND.
+ *
+ * @param[in] error The result of request
+ * @param[in] request_id The request id
+ * @param[in] place The resulting Place data
+ * @param[in] uesr_data The user data passed from maps_service_get_place_details()
+ *
+ * @pre maps_service_get_place_details() will invoke this callback.
+ *
+ * @see maps_service_get_place_details()
+ */
+typedef void(*maps_service_get_place_details_cb) (maps_error_e error,
+ int request_id, maps_place_h place, void *user_data);
+
+/**
* @brief Queries a Place information by a coordinates position and a
* distance.
* \n The request is asynchronous.
* @privilege %http://tizen.org/privilege/mapservice \n
* %http://tizen.org/privilege/internet \n
* %http://tizen.org/privilege/network.get
- * @remarks %http://tizen.org/privilege/internet is needed to access internet.
- * \n To cancel the search request, use maps_service_cancel_request().
+ * @remarks To cancel the search request, use maps_service_cancel_request().
* \n To check if Maps Provider is capable of searching places, use
* maps_service_provider_is_service_supported() with
* #MAPS_SERVICE_SEARCH_PLACE passed as @a service parameter.
* @privilege %http://tizen.org/privilege/mapservice \n
* %http://tizen.org/privilege/internet \n
* %http://tizen.org/privilege/network.get
- * @remarks %http://tizen.org/privilege/internet is needed to access internet.
- * \n @a boundary is supporting only circle type bounds for search.
+ * @remarks @a boundary is supporting only circle type bounds for search.
* \n To cancel the search request, use maps_service_cancel_request().
* \n To check if Maps Provider is capable of searching places by coordinates
* boundaries, use maps_service_provider_is_service_supported() with
* @privilege %http://tizen.org/privilege/mapservice \n
* %http://tizen.org/privilege/internet \n
* %http://tizen.org/privilege/network.get
- * @remarks %http://tizen.org/privilege/internet is needed to access internet.
- * \n @a boundary is supporting only circle type bounds for search.
+ * @remarks @a boundary is supporting only circle type bounds for search.
* \n To cancel the search request, use maps_service_cancel_request().
* \n To check if Maps Provider is capable of searching places by free-formed
* address, use maps_service_provider_is_service_supported() with
int *request_id);
/**
+ * @brief Queries a brief Place information by a coordinates boundary.
+ * /n The request is asynchronous.
+ * @details This function obtains the brief Place information for a specified coordinates boundary.
+ * @since_tizen 3.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/mapservice \n
+ * %http://tizen.org/privilege/internet \n
+ * %http://tizen.org/privilege/network.get
+ * @remarks To cancel the search request use maps_service_cancel_request().
+ * \n To check if Maps Provider is capable of Place Search and which Place preferences are supported,
+ * see the lists of capacities and preferences above.
+ *
+ * @param[in] maps The Maps Service handle
+ * @param[in] boundary The interested area
+ * @param[in] filter The filter handle
+ * @param[in] preference The place preference handle
+ * @param[in] callback The result callback
+ * @param[in] user_data The user data to be passed to the callback function
+ * @param[out] request_id The request id
+ * @return 0 on success, otherwise a negative error value
+ * @retval #MAPS_ERROR_NONE Successful
+ * @retval #MAPS_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MAPS_ERROR_SERVICE_NOT_AVAILABLE Service not available
+ * @retval #MAPS_ERROR_PERMISSION_DENIED Permission Denied
+ * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported
+ * @retval #MAPS_ERROR_CONNECTION_TIME_OUT Timeout error, no answer
+ * @retval #MAPS_ERROR_INVALID_OPERATION Operation is not valid
+ * @retval #MAPS_ERROR_NOT_FOUND Result not found
+ * @retval #MAPS_ERROR_KEY_NOT_AVAILABLE Invalid key
+ * @retval #MAPS_ERROR_RESOURCE_BUSY Places service busy
+ * @retval #MAPS_ERROR_CANCELED Places service aborted
+ * @retval #MAPS_ERROR_UNKNOWN Unknown error
+ *
+ * @pre Call maps_service_create() to create Maps Service and obtain its handle.
+ * @post It invokes maps_service_search_place_list_cb() to deliver obtained Place information.
+ *
+ * @see maps_service_get_place_details()
+ * @see maps_service_search_place_list_cb()
+ * @see maps_service_cancel_request()
+ * @see maps_service_provider_is_service_supported()
+ */
+int maps_service_search_place_list(const maps_service_h maps,
+ const maps_area_h boundary,
+ const maps_place_filter_h filter,
+ maps_preference_h preference,
+ maps_service_search_place_list_cb callback,
+ void *user_data, int *request_id);
+
+/**
+ * @brief Queries a Detail place information by a place uri.
+ * \n The request is asynchronous.
+ * @details This function obtains the Detail place information for a specified place uri
+ * @since_tizen 3.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/mapservice \n
+ * %http://tizen.org/privilege/internet \n
+ * %http://tizen.org/privilege/network.get
+ * @remarks To cancel the search request use maps_service_cancel_request().
+ * \n To check if Maps Provider is capable of Place Search and which Place preferences are supported,
+ * see the lists of capacities and preferences above.
+ *
+ * @param[in] maps The Maps Service handle
+ * @param[in] uri The interested place uri
+ * @param[in] callback The result callback
+ * @param[in] user_data The user data to be passed to the callback function
+ * @param[out] request_id The request id
+ * @return 0 on success, otherwise a negative error value
+ * @retval #MAPS_ERROR_NONE Successful
+ * @retval #MAPS_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MAPS_ERROR_SERVICE_NOT_AVAILABLE Service not available
+ * @retval #MAPS_ERROR_PERMISSION_DENIED Permission Denied
+ * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported
+ * @retval #MAPS_ERROR_CONNECTION_TIME_OUT Timeout error, no answer
+ * @retval #MAPS_ERROR_INVALID_OPERATION Operation is not valid
+ * @retval #MAPS_ERROR_NOT_FOUND Result not found
+ * @retval #MAPS_ERROR_KEY_NOT_AVAILABLE Invalid key
+ * @retval #MAPS_ERROR_RESOURCE_BUSY Places service busy
+ * @retval #MAPS_ERROR_CANCELED Places service aborted
+ * @retval #MAPS_ERROR_UNKNOWN Unknown error
+ *
+ * @pre Call maps_service_create() to create Maps Service and obtain its handle.
+ * @pre @a uri is obtained from maps_service_search_place_list()
+ * @post It invokes maps_service_get_place_details_cb() to deliver obtained Place information.
+ *
+ * @see maps_service_search_place_list()
+ * @see maps_service_get_place_details_cb()
+ * @see maps_service_cancel_request()
+ * @see maps_service_provider_is_service_supported()
+ */
+int maps_service_get_place_details(const maps_service_h maps,
+ const char *uri, maps_service_get_place_details_cb callback,
+ void *user_data, int *request_id);
+
+/**
* @}
*/
* \n If search is failed, the value of @a total is 0 and @a route is NULL.
* @since_tizen 2.4
* @remarks The parameter @a route must be released using maps_route_destroy().
+ * \n This error code will be reported. \n
+ * #MAPS_ERROR_NONE \n
+ * #MAPS_ERROR_OUT_OF_MEMORY \n
+ * #MAPS_ERROR_INVALID_PARAMETER \n
+ * #MAPS_ERROR_NOT_FOUND.
*
* @param[in] error The result of request
* @param[in] request_id The id of request
* @privilege %http://tizen.org/privilege/mapservice \n
* %http://tizen.org/privilege/internet \n
* %http://tizen.org/privilege/network.get
- * @remarks %http://tizen.org/privilege/internet is needed to access internet.
- * \n To cancel the search request, use maps_service_cancel_request().
+ * @remarks To cancel the search request, use maps_service_cancel_request().
* \n To check if Maps Provider is capable of searching routes, use
* maps_service_provider_is_service_supported() with
* #MAPS_SERVICE_SEARCH_ROUTE passed as @a service parameter.
* @privilege %http://tizen.org/privilege/mapservice \n
* %http://tizen.org/privilege/internet \n
* %http://tizen.org/privilege/network.get
- * @remarks %http://tizen.org/privilege/internet is needed to access internet.
- * \n To cancel the search request, use maps_service_cancel_request().
+ * @remarks To cancel the search request, use maps_service_cancel_request().
* \n To check if Maps Provider is capable of searching the route passing
* through the specified way points, use
* maps_service_provider_is_service_supported() with
Name: capi-maps-service
Summary: Tizen Maps Service API
-Version: 0.5.2
+Version: 0.5.3
Release: 1
Group: Location/API
License: Apache-2.0
} maps_place_s;
/* TODO: extract all such constants to the dedcated header file */
-const gsize _MAPS_PLACE_ID_MAX_LENGTH = 32;
+const gsize _MAPS_PLACE_ID_MAX_LENGTH = 64;
const gsize _MAPS_PLACE_NAME_MAX_LENGTH = 64;
-const gsize _MAPS_PLACE_URI_MAX_LENGTH = 128;
+const gsize _MAPS_PLACE_URI_MAX_LENGTH = 256;
/*----------------------------------------------------------------------------*/
maps_string_hashtable_destroy(p->supported_data);
return maps_string_hashtable_clone(supported_data, &p->supported_data);
}
+
+EXPORT_API int maps_place_list_foreach(const maps_place_list_h place_list,
+ maps_place_cb callback, void *user_data)
+{
+ if (!place_list || !callback)
+ return MAPS_ERROR_INVALID_PARAMETER;
+
+ return maps_item_list_foreach((maps_item_list_h) place_list, maps_place_clone, callback, user_data);
+}
"MAPS_PLACE_FILTER_CATEGORY", (void **) category);
}
+EXPORT_API int maps_place_filter_get_place_address(const maps_place_filter_h filter,
+ char **place_address)
+{
+ if (!filter || !place_address)
+ return MAPS_ERROR_INVALID_PARAMETER;
+ return maps_item_hashtable_get_string(((maps_place_filter_s *) filter)->
+ table, "MAPS_PLACE_FILTER_PLACE_ADDRESS", place_address);
+}
+
/*----------------------------------------------------------------------------*/
EXPORT_API int maps_place_filter_set(maps_place_filter_h filter,
"MAPS_PLACE_FILTER_CATEGORY", (void **) category,
maps_place_category_clone, maps_place_category_destroy);
}
+
+EXPORT_API int maps_place_filter_set_place_address(maps_place_filter_h filter,
+ const char *place_address)
+{
+ if (!filter || !place_address)
+ return MAPS_ERROR_INVALID_PARAMETER;
+ return maps_item_hashtable_set_string(((maps_place_filter_s *) filter)->
+ table, "MAPS_PLACE_FILTER_PLACE_ADDRESS", place_address);
+}
if (!maps || !supported)
return MAPS_ERROR_INVALID_PARAMETER;
if ((service < MAPS_SERVICE_GEOCODE)
- || (service > MAPS_SERVICE_MULTI_REVERSE_GEOCODE))
+ || (service > MAPS_SERVICE_SEARCH_PLACE_LIST))
return MAPS_ERROR_INVALID_PARAMETER;
const plugin::plugin_s *p = __extract_plugin(maps);
if (!p)
EXPORT_API int maps_service_search_place_by_area(const maps_service_h maps,
const maps_area_h boundary,
- const maps_place_filter_h
- filter,
+ const maps_place_filter_h filter,
maps_preference_h preference,
- maps_service_search_place_cb
- callback,
+ maps_service_search_place_cb callback,
void *user_data,
int *request_id)
{
}
EXPORT_API int maps_service_search_place_by_address(const maps_service_h maps,
- const char *address,
- const maps_area_h boundary,
- const maps_place_filter_h
- filter,
- maps_preference_h
- preference,
- maps_service_search_place_cb
- callback,
- void *user_data,
- int *request_id)
+ const char *address,
+ const maps_area_h boundary,
+ const maps_place_filter_h filter,
+ maps_preference_h preference,
+ maps_service_search_place_cb callback,
+ void *user_data,
+ int *request_id)
{
/* Check if the handle of the Maps Service is valid */
if (!maps)
user_data, request_id));
}
+EXPORT_API int maps_service_search_place_list(const maps_service_h maps,
+ const maps_area_h boundary,
+ const maps_place_filter_h filter,
+ maps_preference_h preference,
+ maps_service_search_place_list_cb callback,
+ void *user_data, int *request_id)
+{
+ if (!maps)
+ return MAPS_ERROR_INVALID_PARAMETER;
+
+ if (!__maps_provider_supported(maps, MAPS_SERVICE_SEARCH_PLACE_LIST))
+ return MAPS_ERROR_NOT_SUPPORTED;
+
+ if (!boundary || !filter || !callback || !request_id)
+ return MAPS_ERROR_INVALID_PARAMETER;
+
+ if (!__has_maps_service_privilege())
+ return MAPS_ERROR_PERMISSION_DENIED;
+
+ return q()->push(new session::command_search_place_list(maps,
+ boundary, preference, filter, callback, user_data, request_id));
+}
+
+EXPORT_API int maps_service_get_place_details(const maps_service_h maps,
+ const char *url, maps_service_get_place_details_cb callback,
+ void *user_data, int *request_id)
+{
+ if (!maps)
+ return MAPS_ERROR_INVALID_PARAMETER;
+
+ if (!__maps_provider_supported(maps, MAPS_SERVICE_SEARCH_PLACE_LIST))
+ return MAPS_ERROR_NOT_SUPPORTED;
+
+ if (!url || !callback || !request_id)
+ return MAPS_ERROR_INVALID_PARAMETER;
+
+ if (!__has_maps_service_privilege())
+ return MAPS_ERROR_PERMISSION_DENIED;
+
+ return q()->push(new session::command_get_place_details(maps,
+ url, callback, user_data, request_id));
+}
+
/*----------------------------------------------------------------------------*/
/* */
/* Route Service */
}
EXPORT_API int maps_service_search_route_waypoints(const maps_service_h maps,
- const maps_coordinates_h *
- waypoint_list,
+ const maps_coordinates_h *waypoint_list,
int waypoint_num,
maps_preference_h preference,
- maps_service_search_route_cb
- callback,
+ maps_service_search_route_cb callback,
void *user_data,
int *request_id)
{
return 0;
}
+int maps_plugin_search_place_list_empty(const maps_area_h boundary,
+ const maps_place_filter_h filter,
+ maps_preference_h preference,
+ maps_service_search_place_list_cb callback,
+ void *user_data, int *request_id)
+{
+ return 0;
+}
+
+int maps_plugin_get_place_details_empty(const char *url,
+ maps_service_get_place_details_cb callback,
+ void *user_data, int *request_id)
+{
+ return 0;
+}
+
/* Route */
int maps_plugin_search_route_empty(const maps_coordinates_h origin,
const maps_coordinates_h destination,
maps_plugin_search_place_empty,
maps_plugin_search_place_by_area_empty,
maps_plugin_search_place_by_address_empty,
+ maps_plugin_search_place_list_empty,
+ maps_plugin_get_place_details_empty,
/* Route */
maps_plugin_search_route_empty,
(maps_plugin_search_place_by_address_f)
gmod_find_sym(plugin,
"maps_plugin_search_place_by_address");
+ new_plugin->interface.maps_plugin_search_place_list =
+ (maps_plugin_search_place_list_f) gmod_find_sym(plugin,
+ "maps_plugin_search_place_list");
+ new_plugin->interface.maps_plugin_get_place_details =
+ (maps_plugin_get_place_details_f) gmod_find_sym(plugin,
+ "maps_plugin_get_place_details");
/* Route */
new_plugin->interface.maps_plugin_search_route =
itf->maps_plugin_search_place_by_area);
MAPS_LOGD("maps_plugin_search_place_by_address:\t%p",
itf->maps_plugin_search_place_by_address);
+ MAPS_LOGD("maps_plugin_search_place_list:\t\t%p",
+ itf->maps_plugin_search_place_list);
+ MAPS_LOGD("maps_plugin_get_place_details:\t%p",
+ itf->maps_plugin_get_place_details);
MAPS_LOGD("maps_plugin_search_route:\t\t%p",
itf->maps_plugin_search_route);
callback,
void *user_data,
int *request_id);
+typedef int (*maps_plugin_search_place_list_f) (const maps_area_h boundary,
+ const maps_place_filter_h filter,
+ maps_preference_h preference,
+ maps_service_search_place_list_cb callback,
+ void *user_data, int *request_id);
+typedef int (*maps_plugin_get_place_details_f) (const char *url,
+ maps_service_get_place_details_cb callback,
+ void *user_data, int *request_id);
/* Route */
typedef int (*maps_plugin_search_route_f) (const maps_coordinates_h origin,
maps_plugin_search_place_by_area;
maps_plugin_search_place_by_address_f
maps_plugin_search_place_by_address;
+ maps_plugin_search_place_list_f maps_plugin_search_place_list;
+ maps_plugin_get_place_details_f maps_plugin_get_place_details;
/* Route */
maps_plugin_search_route_f maps_plugin_search_route;
};
};
-#endif /* __MAPS_SERVICE_PLUGIN_MODULE_H__ */
\ No newline at end of file
+#endif /* __MAPS_SERVICE_PLUGIN_MODULE_H__ */
}
/*----------------------------------------------------------------------------*/
+/*typedef int (*maps_plugin_search_place_list_f)(maps_service_h maps,
+* maps_item_hashtable_h preference, maps_place_filter_h filter,
+* maps_service_search_place_list_cb callback, void* user_data, int* request_id); */
+session::command_search_place_list::command_search_place_list(maps_service_h ms,
+ const maps_area_h b,
+ const maps_item_hashtable_h pref,
+ const maps_place_filter_h flt,
+ maps_service_search_place_list_cb cb,
+ void *ud, int *request_id)
+ : command(ms)
+ , boundary(NULL)
+ , preference(NULL)
+ , filter(NULL)
+ , callback(cb)
+ , user_data(ud)
+ , error(MAPS_ERROR_NONE)
+{
+ *request_id = command::command_request_id++;
+ my_req_id = *request_id;
+
+ if (maps_area_clone(b, &boundary) != MAPS_ERROR_NONE)
+ error = MAPS_ERROR_INVALID_PARAMETER;
+
+ if (pref && (maps_item_hashtable_clone(pref, &preference) != MAPS_ERROR_NONE))
+ error = MAPS_ERROR_INVALID_PARAMETER;
+
+ if (maps_place_filter_clone(flt, &filter) != MAPS_ERROR_NONE)
+ error = MAPS_ERROR_INVALID_PARAMETER;
+}
+
+session::command_search_place_list::~command_search_place_list()
+{
+ maps_area_destroy(boundary);
+ maps_item_hashtable_destroy(preference);
+ maps_place_filter_destroy(filter);
+}
+
+int session::command_search_place_list::run()
+{
+ if (error != MAPS_ERROR_NONE)
+ return error;
+
+ pending_request pr(plugin());
+
+ /* Get the plugin interface function */
+ maps_plugin_search_place_list_f func = interface()->maps_plugin_search_place_list;
+ command_search_place_list_handler *handler = NULL;
+ if (func) {
+ /* No need to create the handler when the function is NULL */
+ pr.add(my_req_id);
+ handler = new command_search_place_list_handler(plugin(),
+ callback,
+ user_data,
+ my_req_id);
+ if (handler) {
+ /* Run the plugin interface function */
+ error = func(boundary, filter, preference,
+ command_search_place_list_handler::foreach_place_around_cb, handler,
+ &handler->plg_req_id);
+
+ pr.update(my_req_id, handler);
+
+ MAPS_LOGD("session::command_search_place_list::run: %d", my_req_id);
+ }
+ else {
+ error = MAPS_ERROR_OUT_OF_MEMORY;
+ }
+ }
+ else {
+ /* Plugin Function is NULL: use default empty function */
+ /*
+ func = plugin::get_empty_interface().maps_plugin_search_place_list;
+ */
+ MAPS_LOGE("MAPS_ERROR_NOT_SUPPORTED: Can't get any plugin");
+ error = MAPS_ERROR_NOT_SUPPORTED;
+ }
+
+ const int ret = error;
+ destroy();
+ return ret;
+}
+
+session::command_search_place_list_handler::command_search_place_list_handler(
+ plugin::plugin_s* p,
+ maps_service_search_place_list_cb cb,
+ void *ud, int urid)
+ : command_handler(p, ud, urid)
+ , callback(cb)
+{
+}
+
+void session::command_search_place_list_handler::foreach_place_around_cb(maps_error_e error,
+ int request_id,
+ maps_place_list_h place_list,
+ void *user_data)
+{
+ command_search_place_list_handler *handler =
+ (command_search_place_list_handler *) user_data;
+
+ if (request_id != handler->plg_req_id) {
+ MAPS_LOGE("\n\nERROR! Incorrect request id [%d] come from the plugin; expected [%d]\n\n",
+ request_id, handler->plg_req_id);
+ }
+
+ /* Send data to user */
+ handler->callback(error, handler->user_req_id, place_list, handler->user_data);
+
+ pending_request pr(handler->plugin());
+ pr.remove(handler->user_req_id);
+}
+
+/*----------------------------------------------------------------------------*/
+/*typedef int (*maps_plugin_get_place_details_f) */
+session::command_get_place_details::command_get_place_details(
+ maps_service_h ms, const char *a,
+ maps_service_get_place_details_cb cb,
+ void *ud, int *request_id)
+ : command(ms)
+ , url(a)
+ , callback(cb)
+ , user_data(ud)
+ , error(MAPS_ERROR_NONE)
+{
+ *request_id = command::command_request_id++;
+ my_req_id = *request_id;
+}
+
+session::command_get_place_details::~command_get_place_details()
+{
+}
+
+int session::command_get_place_details::run()
+{
+ if (error != MAPS_ERROR_NONE)
+ return error;
+
+ pending_request pr(plugin());
+
+ /* Get the plugin interface function */
+ maps_plugin_get_place_details_f func =
+ interface()->maps_plugin_get_place_details;
+ command_get_place_details_handler *handler = NULL;
+ if (func) {
+ /* No need to create the handler when the function is NULL */
+ pr.add(my_req_id);
+ handler = new command_get_place_details_handler(plugin(),
+ callback, user_data, my_req_id);
+ if (handler) {
+ /* Run the plugin interface function */
+ error = func(url.c_str(),
+ command_get_place_details_handler::foreach_place_details_cb,
+ handler, &handler->plg_req_id);
+
+ pr.update(my_req_id, handler);
+
+ MAPS_LOGD("session::command_get_place_details::run: %d",
+ my_req_id);
+ }
+ else {
+ error = MAPS_ERROR_OUT_OF_MEMORY;
+ }
+ }
+ else {
+ /* Plugin Function is NULL: use default empty function */
+ /*
+ func = plugin::get_empty_interface().
+ maps_plugin_get_place_details;
+ */
+ MAPS_LOGE("MAPS_ERROR_NOT_SUPPORTED: Can't get any plugin");
+ error = MAPS_ERROR_NOT_SUPPORTED;
+ }
+
+ const int ret = error;
+ destroy();
+ return ret;
+}
+
+session::command_get_place_details_handler::command_get_place_details_handler(
+ plugin::plugin_s* p,
+ maps_service_get_place_details_cb cb,
+ void *ud, int urid)
+ : command_handler(p, ud, urid)
+ , callback(cb)
+{
+}
+
+void session::command_get_place_details_handler::foreach_place_details_cb(maps_error_e error,
+ int request_id, maps_place_h place, void *user_data)
+{
+
+ command_get_place_details_handler *handler =
+ (command_get_place_details_handler *) user_data;
+
+ if (request_id != handler->plg_req_id) {
+ MAPS_LOGE("\n\nERROR! Incorrect request id [%d] come from the plugin; expected [%d]\n\n",
+ request_id, handler->plg_req_id);
+ }
+
+ /* Make a user's copy of result data */
+ maps_place_h cloned_result = NULL;
+ if (error == MAPS_ERROR_NONE)
+ error = (maps_error_e) maps_place_clone(place, &cloned_result);
+ maps_place_destroy(place);
+
+ /* Send data to user */
+ handler->callback(error, handler->user_req_id, cloned_result, handler->user_data);
+
+ pending_request pr(handler->plugin());
+ pr.remove(handler->user_req_id);
+}
+
+/*----------------------------------------------------------------------------*/
/*typedef int (*maps_plugin_search_route_f)(maps_service_h maps,
* maps_item_hashtable_h preference, maps_coordinates_h origin,
* maps_coordinates_h destination, maps_service_search_route_cb callback,
};
/*----------------------------------------------------------------------------*/
+ /*typedef int (*maps_plugin_search_place_list_f)(maps_service_h maps,
+ * maps_area_h boundary, maps_item_hashtable_h preference, maps_place_filter_h filter,
+ * maps_service_search_place_list_cb callback, void *user_data,
+ * int *request_id); */
+ class command_search_place_list : public command
+ {
+ public:
+ maps_area_h boundary;
+ maps_item_hashtable_h preference;
+ maps_place_filter_h filter;
+ maps_service_search_place_list_cb callback;
+ void *user_data;
+
+ int error;
+ public:
+ command_search_place_list(maps_service_h ms,
+ const maps_area_h boundary,
+ const maps_item_hashtable_h preference,
+ const maps_place_filter_h filter,
+ maps_service_search_place_list_cb callback,
+ void *user_data, int *request_id);
+ virtual ~command_search_place_list();
+ private:
+ command_search_place_list() : command(NULL)
+ {
+ }
+ command_search_place_list(const command_search_place_list &src)
+ : command(NULL)
+ {
+ }
+ command_search_place_list &operator=(
+ const command_search_place_list &src)
+ {
+ return *this;
+ }
+ private:
+ virtual int run();
+ };
+
+ class command_search_place_list_handler : public command_handler
+ {
+ maps_service_search_place_list_cb callback;
+ public:
+ command_search_place_list_handler(plugin::plugin_s *plugin,
+ maps_service_search_place_list_cb callback,
+ void *user_data, int user_req_id);
+ virtual ~command_search_place_list_handler()
+ {
+ };
+ private:
+ command_search_place_list_handler()
+ : command_handler(NULL, NULL, 0)
+ {
+ }
+ command_search_place_list_handler(
+ const command_search_place_list_handler &src)
+ : command_handler(NULL, NULL, 0)
+ {
+ }
+ command_search_place_list_handler &operator=(
+ const command_search_place_list_handler &src)
+ { return *this;
+ }
+ private:
+ static void foreach_place_around_cb(maps_error_e error, int request_id,
+ maps_place_list_h place, void *user_data);
+ friend class command_search_place_list;
+ };
+
+/*----------------------------------------------------------------------------*/
+ /*typedef int (*maps_plugin_get_place_details_f) */
+ class command_get_place_details : public command
+ {
+ public:
+ const string url;
+ maps_service_get_place_details_cb callback;
+ void *user_data;
+
+ int error;
+ public:
+ command_get_place_details(maps_service_h ms, const char *url,
+ maps_service_get_place_details_cb callback, void *user_data, int *request_id);
+ virtual ~command_get_place_details();
+ private:
+ command_get_place_details() : command(NULL)
+ {
+ }
+ command_get_place_details(
+ const command_get_place_details &src)
+ : command(NULL)
+ {
+ }
+ command_get_place_details &operator=(
+ const command_get_place_details &src)
+ {
+ return *this;
+ }
+ private:
+ virtual int run();
+ };
+
+ class command_get_place_details_handler : public command_handler
+ {
+ maps_service_get_place_details_cb callback;
+ public:
+ command_get_place_details_handler(plugin::plugin_s *plugin,
+ maps_service_get_place_details_cb callback,
+ void *user_data, int user_req_id);
+ virtual ~command_get_place_details_handler()
+ {
+ };
+ private:
+ command_get_place_details_handler()
+ : command_handler(NULL, NULL, 0)
+ {
+ }
+ command_get_place_details_handler(
+ const command_get_place_details_handler &src)
+ : command_handler(NULL, NULL, 0)
+ {
+ }
+ command_get_place_details_handler &operator=(
+ const command_get_place_details_handler &src)
+ { return *this;
+ }
+ private:
+ static void foreach_place_details_cb(maps_error_e error, int request_id,
+ maps_place_h place, void *user_data);
+ friend class command_get_place_details;
+ };
+
+/*----------------------------------------------------------------------------*/
/*typedef int (*maps_plugin_search_route_f)(
* maps_service_h maps, maps_item_hashtable_h preference,
* maps_coordinates_h origin, maps_coordinates_h destination,
case MAPS_SERVICE_SEARCH_ROUTE_WAYPOINTS:
case MAPS_SERVICE_CANCEL_REQUEST:
case MAPS_SERVICE_MULTI_REVERSE_GEOCODE:
+ case MAPS_SERVICE_SEARCH_PLACE_LIST:
*supported = true;
return MAPS_ERROR_NONE;
default: