From: jomui Date: Mon, 18 Jul 2016 07:31:12 +0000 (+0900) Subject: [ACR-703] Add maps feature (source files and plugin header files) X-Git-Tag: submit/tizen/20160805.024428~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F61%2F80461%2F7;p=platform%2Fcore%2Fapi%2Fmaps-service.git [ACR-703] Add maps feature (source files and plugin header files) Signed-off-by: jomui Change-Id: I0e74430aaa64bf59bf2826c9c24a89f4a88d143e --- diff --git a/CMakeLists.txt b/CMakeLists.txt index e4d0323..ca9eef6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,21 +33,14 @@ SET(dependents capi-media-image-util ) -IF(${TIZEN_VER} LESS 240) +IF(${TIZEN_VER} LESS 0x030000) SET(dependents ${dependents} - # Privilege check - capi-appfw-app-manager - pkgmgr-info - capi-security-privilege-manager + # Privilege check for Tizen 2.x + privacy-manager-client + libsmack ) -ELSEIF(${TIZEN_VER} LESS 300) - SET(dependents - ${dependents} - # Privilege check - security-privilege-checker - ) -ENDIF(${TIZEN_VER} LESS 240) +ENDIF(${TIZEN_VER} LESS 0x030000) SET(pc_dependents "capi-base-common evas") @@ -72,10 +65,10 @@ IF("${PROFILE}" STREQUAL "wearable") ADD_DEFINITIONS("-DTIZEN_WEARABLE") ENDIF("${PROFILE}" STREQUAL "wearable") -ADD_DEFINITIONS("-DTIZEN_VER=${TIZEN_VER}") ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") ADD_DEFINITIONS("-DEXPORT_API=__attribute__((visibility(\"default\")))") #ADD_DEFINITIONS("-DTIZEN_DEBUG") +ADD_DEFINITIONS("-DTIZEN_VER=${TIZEN_VER}") SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined -Wl,--as-needed") diff --git a/doc/maps_plugin_doc.h b/doc/maps_plugin_doc.h index 21a7e25..244014c 100644 --- a/doc/maps_plugin_doc.h +++ b/doc/maps_plugin_doc.h @@ -31,5 +31,9 @@ * * The Maps Plugin provides maps service providers with interfaces to realize * Maps Service APIs. + * + * @section CAPI_MAPS_SERVICE_MODULE_FEATURE Related Feature + * This API is related with the following feature:\n + * - http://tizen.org/feature/maps\n */ #endif /*__MAPS_PLUGIN_DOC_H__ */ diff --git a/include/maps_error.h b/include/maps_error.h index f4d692c..0fd0f86 100644 --- a/include/maps_error.h +++ b/include/maps_error.h @@ -35,6 +35,10 @@ extern "C" { #endif +#ifndef TIZEN_ERROR_MAPS_SERVICE +#define TIZEN_ERROR_MAPS_SERVICE -0x02C20000 +#endif + /** * @brief Enumerations of error codes for Maps Service and Plug-ins * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 2.3.2 @endif diff --git a/include/maps_extra_types.h b/include/maps_extra_types.h index 81b345e..f166d28 100644 --- a/include/maps_extra_types.h +++ b/include/maps_extra_types.h @@ -78,6 +78,7 @@ typedef void *maps_item_list_h; * @retval #MAPS_ERROR_NONE Successful * @retval #MAPS_ERROR_OUT_OF_MEMORY Out of memory * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported * * @see maps_item_list_destroy() * @see maps_item_list_clone() @@ -94,6 +95,7 @@ int maps_item_list_create(maps_item_list_h *list); * @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_SUPPORTED Not supported * * @pre @a list is created using maps_item_list_create(). * @@ -139,6 +141,7 @@ typedef int (*maps_item_list_clone_cb) (void *origin, void **cloned); * @retval #MAPS_ERROR_NONE Successful * @retval #MAPS_ERROR_OUT_OF_MEMORY Out of memory * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported * * @pre @a origin is created using maps_item_list_create(). * @post #maps_item_list_clone_cb is used to clone each item of the list. @@ -163,6 +166,7 @@ int maps_item_list_clone(const maps_item_list_h origin, * @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_SUPPORTED Not supported * * @pre @a list is created using maps_item_list_create(). * @@ -213,6 +217,7 @@ typedef bool(*maps_item_list_foreach_cb) (int index, int total, void *data, * @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 * * @pre @a list is created using maps_item_list_create(). * @post This function invokes maps_item_list_foreach_cb() to deliver list @@ -262,6 +267,7 @@ typedef int (*maps_item_list_free_cb) (void *data); * @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_SUPPORTED Not supported * * @pre @a list is created using maps_item_list_create(). * @post #maps_item_list_free_cb is used to destroy the item of the list. @@ -288,6 +294,7 @@ int maps_item_list_remove(maps_item_list_h list, * @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_SUPPORTED Not supported * * @pre @a list is created using maps_item_list_create(). * @post #maps_item_list_free_cb is used to destroy each item of the list. @@ -329,6 +336,7 @@ typedef bool(*maps_item_list_foreach_noclone_cb) (int index, void *data, void *u * @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 * * @pre @a list is created using maps_item_list_create(). * @post This function invokes maps_item_list_foreach_noclone_cb() to deliver list items. @@ -394,6 +402,7 @@ typedef void *maps_string_hashtable_h; * @retval #MAPS_ERROR_NONE Successful * @retval #MAPS_ERROR_OUT_OF_MEMORY Out of memory * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported * * @see maps_string_hashtable_clone() * @see maps_string_hashtable_destroy() @@ -412,6 +421,7 @@ int maps_string_hashtable_create(maps_string_hashtable_h *table); * @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_SUPPORTED Not supported * * @pre @a table is created using maps_string_hashtable_create(). * @@ -435,6 +445,7 @@ int maps_string_hashtable_destroy(maps_string_hashtable_h table); * @retval #MAPS_ERROR_NONE Successful * @retval #MAPS_ERROR_OUT_OF_MEMORY Out of memory * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported * * @pre @a table is created using maps_string_hashtable_create(). * @@ -456,6 +467,7 @@ int maps_string_hashtable_clone(const maps_string_hashtable_h origin, * @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_SUPPORTED Not supported * * @pre @a table is created using maps_string_hashtable_create(). * @@ -479,6 +491,7 @@ int maps_string_hashtable_set(maps_string_hashtable_h table, const char *key, * @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_SUPPORTED Not supported * * @pre @a table is created using maps_string_hashtable_create(). * @@ -500,6 +513,7 @@ int maps_string_hashtable_get(maps_string_hashtable_h table, const char *key, * @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_SUPPORTED Not supported * * @pre @a table is created using maps_string_hashtable_create(). * @@ -551,6 +565,7 @@ typedef bool(*maps_string_hashtable_foreach_cb) (int index, int total, * @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 * * @pre @a table is created using maps_string_hashtable_create(). * @post This function invokes maps_string_hashtable_foreach_cb() to deliver @@ -577,6 +592,7 @@ int maps_string_hashtable_foreach(maps_string_hashtable_h table, * @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_SUPPORTED Not supported * * @pre @a table is created using maps_string_hashtable_create(). * @@ -637,6 +653,7 @@ typedef void *maps_int_hashtable_h; * @retval #MAPS_ERROR_NONE Successful * @retval #MAPS_ERROR_OUT_OF_MEMORY Out of memory * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported * * @see maps_int_hashtable_clone() * @see maps_int_hashtable_destroy() @@ -655,6 +672,7 @@ int maps_int_hashtable_create(maps_int_hashtable_h *table); * @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_SUPPORTED Not supported * * @pre @a table is created using maps_int_hashtable_create(). * @@ -678,6 +696,7 @@ int maps_int_hashtable_destroy(maps_int_hashtable_h table); * @retval #MAPS_ERROR_NONE Successful * @retval #MAPS_ERROR_OUT_OF_MEMORY Out of memory * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported * * @pre @a table is created using maps_int_hashtable_create(). * @@ -699,6 +718,7 @@ int maps_int_hashtable_clone(const maps_int_hashtable_h origin, * @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_SUPPORTED Not supported * * @pre @a table is created using maps_int_hashtable_create(). * @@ -722,6 +742,7 @@ int maps_int_hashtable_set(maps_int_hashtable_h table, const int key, * @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_SUPPORTED Not supported * * @pre @a table is created using maps_int_hashtable_create(). * @@ -743,6 +764,7 @@ int maps_int_hashtable_get(maps_int_hashtable_h table, const int key, * @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_SUPPORTED Not supported * * @pre @a table is created using maps_int_hashtable_create(). * @@ -793,6 +815,7 @@ typedef bool(*maps_int_hashtable_foreach_cb) (int index, int total, * @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 * * @pre @a table is created using maps_int_hashtable_create(). * @post This function invokes maps_int_hashtable_foreach_cb() to deliver @@ -819,6 +842,7 @@ int maps_int_hashtable_foreach(maps_int_hashtable_h table, * @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_SUPPORTED Not supported * * @pre @a table is created using maps_int_hashtable_create(). * @@ -883,6 +907,7 @@ typedef void *maps_item_hashtable_h; * @retval #MAPS_ERROR_NONE Successful * @retval #MAPS_ERROR_OUT_OF_MEMORY Out of memory * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported * * @see maps_item_hashtable_clone() * @see maps_item_hashtable_destroy() @@ -902,6 +927,7 @@ int maps_item_hashtable_create(maps_item_hashtable_h *table); * @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_SUPPORTED Not supported * * @pre @a table is created using maps_item_hashtable_create(). * @@ -925,6 +951,7 @@ int maps_item_hashtable_destroy(maps_item_hashtable_h table); * @retval #MAPS_ERROR_NONE Successful * @retval #MAPS_ERROR_OUT_OF_MEMORY Out of memory * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported * * @pre @a table is created using maps_item_hashtable_create(). * @@ -1001,6 +1028,7 @@ typedef int (*maps_item_hashtable_free_cb) (void *data); * @retval #MAPS_ERROR_NONE Successful * @retval #MAPS_ERROR_OUT_OF_MEMORY Out of memory * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported * * @pre maps_item_hashtable_clone() will invoke this callback. * @@ -1027,6 +1055,7 @@ int maps_item_hashtable_clone_string(void *origin, void **cloned); * @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_SUPPORTED Not supported * * @pre maps_item_hashtable_destroy(), maps_item_hashtable_remove() or * maps_item_hashtable_set() will invoke this callback. @@ -1055,6 +1084,7 @@ int maps_item_hashtable_free_string(void *data); * @retval #MAPS_ERROR_NONE Successful * @retval #MAPS_ERROR_OUT_OF_MEMORY Out of memory * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported * * @pre maps_item_hashtable_clone() will invoke this callback. * @@ -1080,6 +1110,7 @@ int maps_item_hashtable_clone_int(void *origin, void **cloned); * @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_SUPPORTED Not supported * * @pre maps_item_hashtable_destroy(), maps_item_hashtable_remove() or * maps_item_hashtable_set() will invoke this callback. @@ -1108,6 +1139,7 @@ int maps_item_hashtable_free_int(void *data); * @retval #MAPS_ERROR_NONE Successful * @retval #MAPS_ERROR_OUT_OF_MEMORY Out of memory * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported * * @pre maps_item_hashtable_clone() will invoke this callback. * @@ -1135,6 +1167,7 @@ int maps_item_hashtable_clone_float(void *origin, void **cloned); * @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_SUPPORTED Not supported * * @pre maps_item_hashtable_destroy(), maps_item_hashtable_remove() or * maps_item_hashtable_set() will invoke this callback. @@ -1164,6 +1197,7 @@ int maps_item_hashtable_free_float(void *data); * @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_SUPPORTED Not supported * * @pre @a table is created using maps_item_hashtable_create(). * @@ -1194,6 +1228,7 @@ int maps_item_hashtable_set_string(maps_item_hashtable_h table, * @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_SUPPORTED Not supported * * @pre @a table is created using maps_item_hashtable_create(). * @@ -1224,6 +1259,7 @@ int maps_item_hashtable_set_int(maps_item_hashtable_h table, const char *key, * @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_SUPPORTED Not supported * * @pre @a table is created using maps_item_hashtable_create(). * @@ -1273,6 +1309,7 @@ int maps_item_hashtable_set_float(maps_item_hashtable_h table, * @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_SUPPORTED Not supported * * @pre @a table is created using maps_item_hashtable_create(). * @@ -1308,6 +1345,7 @@ int maps_item_hashtable_set(maps_item_hashtable_h table, const char *key, * @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_SUPPORTED Not supported * * @pre @a table is created using maps_item_hashtable_create(). * @@ -1334,6 +1372,7 @@ int maps_item_hashtable_get_string(maps_item_hashtable_h table, * @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_SUPPORTED Not supported * * @pre @a table is created using maps_item_hashtable_create(). * @@ -1360,6 +1399,7 @@ int maps_item_hashtable_get_int(maps_item_hashtable_h table, const char *key, * @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_SUPPORTED Not supported * * @pre @a table is created using maps_item_hashtable_create(). * @@ -1386,6 +1426,7 @@ int maps_item_hashtable_get_float(maps_item_hashtable_h table, * @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_SUPPORTED Not supported * * @pre @a table is created using maps_item_hashtable_create(). * @@ -1407,6 +1448,7 @@ int maps_item_hashtable_get(maps_item_hashtable_h table, const char *key, * @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_SUPPORTED Not supported * * @pre @a table is created using maps_item_hashtable_create(). * @@ -1457,6 +1499,7 @@ typedef bool(*maps_item_hashtable_foreach_cb) (int index, int total, * @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 * * @pre @a table is created using maps_item_hashtable_create(). * @post This function invokes maps_item_hashtable_foreach_cb() to deliver @@ -1482,6 +1525,7 @@ int maps_item_hashtable_foreach(maps_item_hashtable_h table, * @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_SUPPORTED Not supported * * @pre @a table is created using maps_item_hashtable_create(). * diff --git a/include/maps_place_attribute_plugin.h b/include/maps_place_attribute_plugin.h index 8958682..a45a4a8 100644 --- a/include/maps_place_attribute_plugin.h +++ b/include/maps_place_attribute_plugin.h @@ -51,6 +51,7 @@ extern "C" { * @retval #MAPS_ERROR_NONE Successful * @retval #MAPS_ERROR_OUT_OF_MEMORY Out of memory * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported * * @see maps_place_attribute_destroy() * @see maps_place_attribute_clone() @@ -67,6 +68,7 @@ int maps_place_attribute_create(maps_place_attribute_h *attribute); * @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_SUPPORTED Not supported * * @pre @a attribute is created using maps_place_attribute_create(). * @@ -86,6 +88,7 @@ int maps_place_attribute_set_id(maps_place_attribute_h attribute, * @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_SUPPORTED Not supported * * @pre @a attribute is created using maps_place_attribute_create(). * @@ -105,6 +108,7 @@ int maps_place_attribute_set_label(maps_place_attribute_h attribute, * @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_SUPPORTED Not supported * * @pre @a attribute is created using maps_place_attribute_create(). * diff --git a/include/maps_place_contact_plugin.h b/include/maps_place_contact_plugin.h index 0d17aa1..c335cac 100644 --- a/include/maps_place_contact_plugin.h +++ b/include/maps_place_contact_plugin.h @@ -51,6 +51,7 @@ extern "C" { * @retval #MAPS_ERROR_NONE Successful * @retval #MAPS_ERROR_OUT_OF_MEMORY Out of memory * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported * * @see place_contact_destroy() * @see maps_place_contact_clone() @@ -67,6 +68,7 @@ int maps_place_contact_create(maps_place_contact_h *contact); * @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_SUPPORTED Not supported * * @pre @a contact is created using maps_place_contact_create(). * @@ -86,6 +88,7 @@ int maps_place_contact_set_label(maps_place_contact_h contact, * @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_SUPPORTED Not supported * * @pre @a contact is created using maps_place_contact_create(). * @@ -105,6 +108,7 @@ int maps_place_contact_set_type(maps_place_contact_h contact, * @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_SUPPORTED Not supported * * @pre @a contact is created using maps_place_contact_create(). * diff --git a/include/maps_place_editorial_plugin.h b/include/maps_place_editorial_plugin.h index 2104506..1ead082 100644 --- a/include/maps_place_editorial_plugin.h +++ b/include/maps_place_editorial_plugin.h @@ -50,6 +50,7 @@ extern "C" { * @retval #MAPS_ERROR_NONE Successful * @retval #MAPS_ERROR_OUT_OF_MEMORY Out of memory * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported * * @see maps_place_editorial_destroy() * @see maps_place_editorial_clone() @@ -66,6 +67,7 @@ int maps_place_editorial_create(maps_place_editorial_h *editorial); * @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_SUPPORTED Not supported * * @pre @a editorial is created using maps_place_editorial_create(). * @@ -85,6 +87,7 @@ int maps_place_editorial_set_description(maps_place_editorial_h editorial, * @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_SUPPORTED Not supported * * @pre @a editorial is created using maps_place_editorial_create(). * @@ -104,6 +107,7 @@ int maps_place_editorial_set_language(maps_place_editorial_h editorial, * @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_SUPPORTED Not supported * * @pre @a editorial is created using maps_place_editorial_create(). * diff --git a/include/maps_place_image_plugin.h b/include/maps_place_image_plugin.h index 89c582b..c263a2a 100644 --- a/include/maps_place_image_plugin.h +++ b/include/maps_place_image_plugin.h @@ -50,6 +50,7 @@ extern "C" { * @retval #MAPS_ERROR_NONE Successful * @retval #MAPS_ERROR_OUT_OF_MEMORY Out of memory * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported * * @see maps_place_image_destroy() * @see maps_place_image_clone() @@ -66,6 +67,7 @@ int maps_place_image_create(maps_place_image_h *image); * @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_SUPPORTED Not supported * * @pre @a image is created using maps_place_image_create(). * @@ -84,6 +86,7 @@ int maps_place_image_set_id(maps_place_image_h image, const char *id); * @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_SUPPORTED Not supported * * @pre @a image is created using maps_place_image_create(). * @@ -102,6 +105,7 @@ int maps_place_image_set_url(maps_place_image_h image, const char *url); * @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_SUPPORTED Not supported * * @pre @a image is created using maps_place_image_create(). * @@ -120,6 +124,7 @@ int maps_place_image_set_width(maps_place_image_h image, const int width); * @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_SUPPORTED Not supported * * @pre @a image is created using maps_place_image_create(). * @@ -138,6 +143,7 @@ int maps_place_image_set_height(maps_place_image_h image, const int height); * @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_SUPPORTED Not supported * * @pre @a image is created using maps_place_image_create(). * @@ -158,6 +164,7 @@ int maps_place_image_set_user_link(maps_place_image_h image, * @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_SUPPORTED Not supported * * @pre @a image is created using maps_place_image_create(). * diff --git a/include/maps_place_link_object_plugin.h b/include/maps_place_link_object_plugin.h index 5c3f045..b504ba1 100644 --- a/include/maps_place_link_object_plugin.h +++ b/include/maps_place_link_object_plugin.h @@ -50,6 +50,7 @@ extern "C" { * @retval #MAPS_ERROR_NONE Successful * @retval #MAPS_ERROR_OUT_OF_MEMORY Out of memory * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported * * @see maps_place_link_object_destroy() * @see maps_place_link_object_clone() @@ -66,6 +67,7 @@ int maps_place_link_object_create(maps_place_link_object_h *link); * @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_SUPPORTED Not supported * * @pre @a link is created using maps_place_link_object_create(). * @@ -85,6 +87,7 @@ int maps_place_link_object_set_id(maps_place_link_object_h link, * @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_SUPPORTED Not supported * * @pre @a link is created using maps_place_link_object_create(). * @@ -104,6 +107,7 @@ int maps_place_link_object_set_string(maps_place_link_object_h link, * @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_SUPPORTED Not supported * * @pre @a link is created using maps_place_link_object_create(). * @@ -123,6 +127,7 @@ int maps_place_link_object_set_type(maps_place_link_object_h link, * @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_SUPPORTED Not supported * * @pre @a link is created using maps_place_link_object_create(). * diff --git a/include/maps_place_media_plugin.h b/include/maps_place_media_plugin.h index 2ece4ae..131eec2 100644 --- a/include/maps_place_media_plugin.h +++ b/include/maps_place_media_plugin.h @@ -50,6 +50,7 @@ extern "C" { * @retval #MAPS_ERROR_NONE Successful * @retval #MAPS_ERROR_OUT_OF_MEMORY Out of memory * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported * * @see maps_place_media_destroy() * @see maps_place_media_clone() @@ -66,6 +67,7 @@ int maps_place_media_create(maps_place_media_h *media); * @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_SUPPORTED Not supported * * @pre @a media is created using maps_place_media_create(). * @@ -85,6 +87,7 @@ int maps_place_media_set_attribution(maps_place_media_h media, * @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_SUPPORTED Not supported * * @pre @a media is created using maps_place_media_create(). * @@ -104,6 +107,7 @@ int maps_place_media_set_supplier(maps_place_media_h media, * @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_SUPPORTED Not supported * * @pre @a media is created using maps_place_media_create(). * diff --git a/include/maps_place_plugin.h b/include/maps_place_plugin.h index 869fa45..fc17462 100644 --- a/include/maps_place_plugin.h +++ b/include/maps_place_plugin.h @@ -56,6 +56,7 @@ extern "C" { * @retval #MAPS_ERROR_NONE Successful * @retval #MAPS_ERROR_OUT_OF_MEMORY Out of memory * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported * * @see maps_place_destroy() * @see maps_place_clone() @@ -72,6 +73,7 @@ int maps_place_create(maps_place_h *place); * @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_SUPPORTED Not supported * * @pre @a place is created using maps_place_create(). * @@ -90,6 +92,7 @@ int maps_place_set_id(maps_place_h place, const char *id); * @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_SUPPORTED Not supported * * @pre @a place is created using maps_place_create(). * @@ -108,6 +111,7 @@ int maps_place_set_name(maps_place_h place, const char *name); * @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_SUPPORTED Not supported * * @pre @a place is created using maps_place_create(). * @@ -128,6 +132,7 @@ int maps_place_set_location(maps_place_h place, * @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_SUPPORTED Not supported * * @pre @a place is created using maps_place_create(). * @@ -146,6 +151,7 @@ int maps_place_set_distance(maps_place_h place, const int distance); * @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_SUPPORTED Not supported * * @pre @a place is created using maps_place_create(). * @@ -164,6 +170,7 @@ int maps_place_set_address(maps_place_h place, const maps_address_h address); * @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_SUPPORTED Not supported * * @pre @a place is created using maps_place_create(). * @@ -183,6 +190,7 @@ int maps_place_set_categories(maps_place_h place, * @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_SUPPORTED Not supported * * @pre @a place is created using maps_place_create(). * @@ -201,6 +209,7 @@ int maps_place_set_uri(maps_place_h place, const char *uri); * @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_SUPPORTED Not supported * * @pre @a place is created using maps_place_create(). * @@ -220,6 +229,7 @@ int maps_place_set_attributes(maps_place_h place, * @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_SUPPORTED Not supported * * @pre @a place is created using maps_place_create(). * @@ -239,6 +249,7 @@ int maps_place_set_contacts(maps_place_h place, * @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_SUPPORTED Not supported * * @pre @a place is created using maps_place_create(). * @@ -258,6 +269,7 @@ int maps_place_set_editorials(maps_place_h place, * @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_SUPPORTED Not supported * * @pre @a place is created using maps_place_create(). * @@ -276,6 +288,7 @@ int maps_place_set_images(maps_place_h place, const maps_item_list_h images); * @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_SUPPORTED Not supported * * @pre @a place is created using maps_place_create(). * @@ -295,6 +308,7 @@ int maps_place_set_reviews(maps_place_h place, * @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_SUPPORTED Not supported * * @pre @a place is created using maps_place_create(). * @@ -314,6 +328,7 @@ int maps_place_set_properties(maps_place_h place, * @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_SUPPORTED Not supported * * @pre @a place is created using maps_place_create(). * @@ -333,6 +348,7 @@ int maps_place_set_rating(maps_place_h place, * @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_SUPPORTED Not supported * * @pre @a place is created using maps_place_create(). * @@ -352,6 +368,7 @@ int maps_place_set_supplier_link(maps_place_h place, * @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_SUPPORTED Not supported * * @pre @a place is created using maps_place_create(). * @@ -370,6 +387,7 @@ int maps_place_set_related_link(maps_place_h place, * @retval #MAPS_ERROR_NONE Successful * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter * @retval #MAPS_ERROR_OUT_OF_MEMORY Out of memory + * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported * * @see maps_place_list_destroy() */ diff --git a/include/maps_place_rating_plugin.h b/include/maps_place_rating_plugin.h index bda2948..c4cdf9f 100644 --- a/include/maps_place_rating_plugin.h +++ b/include/maps_place_rating_plugin.h @@ -50,6 +50,7 @@ extern "C" { * @retval #MAPS_ERROR_NONE Successful * @retval #MAPS_ERROR_OUT_OF_MEMORY Out of memory * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported * * @see maps_place_rating_destroy() * @see maps_place_rating_clone() @@ -66,6 +67,7 @@ int maps_place_rating_create(maps_place_rating_h *rating); * @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_SUPPORTED Not supported * * @pre @a rating is created using maps_place_rating_create(). * @@ -84,6 +86,7 @@ int maps_place_rating_set_count(maps_place_rating_h rating, const int count); * @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_SUPPORTED Not supported * * @pre @a rating is created using maps_place_rating_create(). * diff --git a/include/maps_place_review_plugin.h b/include/maps_place_review_plugin.h index 102b34a..79be72e 100644 --- a/include/maps_place_review_plugin.h +++ b/include/maps_place_review_plugin.h @@ -53,6 +53,7 @@ extern "C" { * @retval #MAPS_ERROR_NONE Successful * @retval #MAPS_ERROR_OUT_OF_MEMORY Out of memory * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported * * @see maps_place_review_destroy() * @see maps_place_review_clone() @@ -69,6 +70,7 @@ int maps_place_review_create(maps_place_review_h *review); * @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_SUPPORTED Not supported * * @pre @a review is created using maps_place_review_create(). * @@ -87,6 +89,7 @@ int maps_place_review_set_date(maps_place_review_h review, const char *date); * @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_SUPPORTED Not supported * * @pre @a review is created using maps_place_review_create(). * @@ -106,6 +109,7 @@ int maps_place_review_set_title(maps_place_review_h review, * @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_SUPPORTED Not supported * * @pre @a review is created using maps_place_review_create(). * @@ -125,6 +129,7 @@ int maps_place_review_set_rating(maps_place_review_h review, * @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_SUPPORTED Not supported * * @pre @a review is created using maps_place_review_create(). * @@ -144,6 +149,7 @@ int maps_place_review_set_description(maps_place_review_h review, * @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_SUPPORTED Not supported * * @pre @a review is created using maps_place_review_create(). * @@ -163,6 +169,7 @@ int maps_place_review_set_language(maps_place_review_h review, * @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_SUPPORTED Not supported * * @pre @a review is created using maps_place_review_create(). * @@ -183,6 +190,7 @@ int maps_place_review_set_media(maps_place_review_h review, * @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_SUPPORTED Not supported * * @pre @a review is created using maps_place_review_create(). * diff --git a/include/maps_place_url_plugin.h b/include/maps_place_url_plugin.h index d1b0b81..6b43868 100644 --- a/include/maps_place_url_plugin.h +++ b/include/maps_place_url_plugin.h @@ -50,6 +50,7 @@ extern "C" { * @retval #MAPS_ERROR_NONE Successful * @retval #MAPS_ERROR_OUT_OF_MEMORY Out of memory * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported * * @see maps_place_url_destroy() * @see maps_place_url_clone() @@ -66,6 +67,7 @@ int maps_place_url_create(maps_place_url_h *url); * @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_SUPPORTED Not supported * * @pre @a url is created using maps_place_url_create(). * @@ -84,6 +86,7 @@ int maps_place_url_set_path(maps_place_url_h url, const char *path); * @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_SUPPORTED Not supported * * @pre @a url is created using maps_place_url_create(). * diff --git a/include/maps_plugin.h b/include/maps_plugin.h index 05be1f7..9fcc6f9 100644 --- a/include/maps_plugin.h +++ b/include/maps_plugin.h @@ -66,6 +66,7 @@ typedef void *maps_plugin_h; * @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_NOT_SUPPORTED Not supported * * @see maps_plugin_shutdown() */ @@ -81,6 +82,7 @@ int maps_plugin_init(maps_plugin_h *plugin); * @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_SUPPORTED Not supported * * @see maps_plugin_init() */ @@ -97,6 +99,7 @@ int maps_plugin_shutdown(maps_plugin_h plugin); * @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_NOT_SUPPORTED Not supported * * @see maps_plugin_init() */ @@ -824,6 +827,7 @@ typedef void(*maps_plugin_map_view_ready_cb) (maps_view_h view); * @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_SUPPORTED Not supported * * @see #maps_view_h * @see maps_plugin_destroy_map_view() @@ -839,6 +843,7 @@ int maps_plugin_create_map_view(maps_view_h view, maps_plugin_map_view_ready_cb * @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_SUPPORTED Not supported * * @see #maps_view_h * @see maps_plugin_create_map_view() @@ -858,6 +863,7 @@ int maps_plugin_destroy_map_view(maps_view_h view); * @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_SUPPORTED Not supported * * @post It invokes maps_plugin_render_map_cb() to notify that the rendering is * finished @@ -882,6 +888,7 @@ int maps_plugin_render_map(maps_view_h view, const maps_coordinates_h coordinate * @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_SUPPORTED Not supported * * @post It invokes maps_plugin_render_map_cb() to notify that the rendering is * finished @@ -905,6 +912,7 @@ int maps_plugin_move_center(maps_view_h view, int delta_x, int delta_y); * @retval #MAPS_ERROR_NONE Successful * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter * @retval #MAPS_ERROR_PERMISSION_DENIED Permission Denied + * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported * * @see maps_plugin_get_scalebar() */ @@ -920,6 +928,7 @@ int maps_plugin_set_scalebar(maps_view_h view, bool enable); * @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_SUPPORTED Not supported * * @see maps_plugin_set_scalebar() */ @@ -939,6 +948,7 @@ int maps_plugin_get_scalebar(maps_view_h view, bool *enabled); * @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_SUPPORTED Not supported * * @see maps_plugin_create() */ @@ -958,6 +968,7 @@ int maps_plugin_on_object(maps_view_h view, const maps_view_object_h object, * @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_SUPPORTED Not supported * * @see maps_plugin_create() * @see maps_plugin_geography_to_screen() @@ -979,6 +990,7 @@ int maps_plugin_screen_to_geography(maps_view_h view, int x, int y, * @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_SUPPORTED Not supported * * @see maps_plugin_create() * @see maps_plugin_screen_to_geography() @@ -997,6 +1009,7 @@ int maps_plugin_geography_to_screen(maps_view_h view, const maps_coordinates_h c * @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_SUPPORTED Not supported */ int maps_plugin_get_min_zoom_level(maps_view_h view, int *min_zoom_level); @@ -1010,6 +1023,7 @@ int maps_plugin_get_min_zoom_level(maps_view_h view, int *min_zoom_level); * @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_SUPPORTED Not supported */ int maps_plugin_get_max_zoom_level(maps_view_h view, int *max_zoom_level); @@ -1025,6 +1039,7 @@ int maps_plugin_get_max_zoom_level(maps_view_h view, int *max_zoom_level); * @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_SUPPORTED Not supported * * @see maps_plugin_get_min_zoom_level() * @see maps_plugin_get_max_zoom_level @@ -1044,6 +1059,7 @@ int maps_plugin_get_center(maps_view_h view, maps_coordinates_h *coordinates); * @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_SUPPORTED Not supported */ int maps_plugin_capture_snapshot(maps_view_h view, void **data, int *width, int *height, maps_view_colorspace_type_e *cs); diff --git a/include/maps_plugin_info.h b/include/maps_plugin_info.h index 5894dc2..b4ad70b 100644 --- a/include/maps_plugin_info.h +++ b/include/maps_plugin_info.h @@ -63,6 +63,7 @@ typedef void *maps_plugin_info_h; * @retval #MAPS_ERROR_NONE Successful * @retval #MAPS_ERROR_OUT_OF_MEMORY Out of memory * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported * * @see maps_plugin_info_destroy() * @see maps_plugin_info_clone() @@ -79,6 +80,7 @@ int maps_plugin_info_create(maps_plugin_info_h *info); * @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_SUPPORTED Not supported * * @pre @a info is created using maps_plugin_info_create(). * @@ -100,6 +102,7 @@ int maps_plugin_info_destroy(maps_plugin_info_h info); * @retval #MAPS_ERROR_NONE Successful * @retval #MAPS_ERROR_OUT_OF_MEMORY Out of memory * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported * * @pre @a info is created using maps_plugin_info_create(). * @@ -122,6 +125,7 @@ int maps_plugin_info_clone(const maps_plugin_info_h origin, * @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_SUPPORTED Not supported * * @pre @a info is created using maps_plugin_info_create(). * @@ -140,6 +144,7 @@ int maps_plugin_info_get_provider_name(const maps_plugin_info_h info, * @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_SUPPORTED Not supported * * @pre @a info is created using maps_plugin_info_create(). * diff --git a/include/maps_route_maneuver_plugin.h b/include/maps_route_maneuver_plugin.h index 2d36d5d..35c4609 100644 --- a/include/maps_route_maneuver_plugin.h +++ b/include/maps_route_maneuver_plugin.h @@ -49,6 +49,7 @@ extern "C" { * @retval #MAPS_ERROR_NONE Successful * @retval #MAPS_ERROR_OUT_OF_MEMORY Out of memory * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported * * @see maps_route_maneuver_destroy() * @see maps_route_maneuver_clone() @@ -65,6 +66,7 @@ int maps_route_maneuver_create(maps_route_maneuver_h *maneuver); * @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_SUPPORTED Not supported * * @pre @a maneuver is created using maps_route_maneuver_create(). * @@ -86,6 +88,7 @@ int maps_route_maneuver_set_direction_id(maps_route_maneuver_h maneuver, * @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_SUPPORTED Not supported * * @pre @a maneuver is created using maps_route_maneuver_create(). * @@ -106,6 +109,7 @@ int maps_route_maneuver_set_turn_type(maps_route_maneuver_h maneuver, * @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_SUPPORTED Not supported * * @pre @a maneuver is created using maps_route_maneuver_create(). * @@ -125,6 +129,7 @@ int maps_route_maneuver_set_road_name(maps_route_maneuver_h maneuver, * @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_SUPPORTED Not supported * * @pre @a maneuver is created using maps_route_maneuver_create(). * @@ -145,6 +150,7 @@ int maps_route_maneuver_set_instruction_text(maps_route_maneuver_h maneuver, * @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_SUPPORTED Not supported * * @pre @a maneuver is created using maps_route_maneuver_create(). * @@ -164,6 +170,7 @@ int maps_route_maneuver_set_locale(maps_route_maneuver_h maneuver, * @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_SUPPORTED Not supported * * @pre @a maneuver is created using maps_route_maneuver_create(). * @@ -183,6 +190,7 @@ int maps_route_maneuver_set_position(maps_route_maneuver_h maneuver, * @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_SUPPORTED Not supported * * @pre @a maneuver is created using maps_route_maneuver_create(). * @@ -205,6 +213,7 @@ int maps_route_maneuver_set_time_to_next_instruction(maps_route_maneuver_h * @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_SUPPORTED Not supported * * @pre @a maneuver is created using maps_route_maneuver_create(). * diff --git a/include/maps_route_plugin.h b/include/maps_route_plugin.h index 81b7e3a..6cd08b6 100644 --- a/include/maps_route_plugin.h +++ b/include/maps_route_plugin.h @@ -57,6 +57,7 @@ extern "C" { * @retval #MAPS_ERROR_NONE Successful * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter * @retval #MAPS_ERROR_OUT_OF_MEMORY Out of memory + * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported * * @see maps_route_destroy() * @see maps_route_clone() @@ -73,6 +74,7 @@ int maps_route_create(maps_route_h *route); * @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_SUPPORTED Not supported * * @pre @a route is created using maps_route_create(). * @@ -91,6 +93,7 @@ int maps_route_set_route_id(maps_route_h route, const char *id); * @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_SUPPORTED Not supported * * @pre @a route is created using maps_route_create(). * @@ -111,6 +114,7 @@ int maps_route_set_origin(maps_route_h route, * @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_SUPPORTED Not supported * * @pre @a route is created using maps_route_create(). * @@ -131,6 +135,7 @@ int maps_route_set_destination(maps_route_h route, * @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_SUPPORTED Not supported * * @pre @a route is created using maps_route_create(). * @@ -150,6 +155,7 @@ int maps_route_set_bounding_box(maps_route_h route, * @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_SUPPORTED Not supported * * @pre @a route is created using maps_route_create(). * @@ -169,6 +175,7 @@ int maps_route_set_total_distance(maps_route_h route, * @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_SUPPORTED Not supported * * @pre @a route is created using maps_route_create(). * @@ -188,6 +195,7 @@ int maps_route_set_total_duration(maps_route_h route, * @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_SUPPORTED Not supported * * @pre @a route is created using maps_route_create(). * @@ -209,6 +217,7 @@ int maps_route_set_transport_mode(maps_route_h route, * @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_SUPPORTED Not supported * * @pre @a route is created using maps_route_create(). * @@ -229,6 +238,7 @@ int maps_route_set_distance_unit(maps_route_maneuver_h maneuver, * @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_SUPPORTED Not supported * * @pre @a route is created using maps_route_create(). * @@ -247,6 +257,7 @@ int maps_route_set_path(maps_route_h route, const maps_item_list_h path); * @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_SUPPORTED Not supported * * @pre @a route is created using maps_route_create(). * @@ -267,7 +278,7 @@ int maps_route_set_segments(maps_route_h route, * @return 0 on success, otherwise a negative error value * @retval #MAPS_ERROR_NONE Successful * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter - * @see maps_route_set_total_distance() + * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported * * @pre @a route is created using maps_route_create(). * diff --git a/include/maps_route_segment_plugin.h b/include/maps_route_segment_plugin.h index 1c0b432..5f3f739 100644 --- a/include/maps_route_segment_plugin.h +++ b/include/maps_route_segment_plugin.h @@ -49,6 +49,7 @@ extern "C" { * @retval #MAPS_ERROR_NONE Successful * @retval #MAPS_ERROR_OUT_OF_MEMORY Out of memory * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported * * @see maps_route_segment_destroy() * @see maps_route_segment_clone() @@ -65,6 +66,7 @@ int maps_route_segment_create(maps_route_segment_h *segment); * @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_SUPPORTED Not supported * * @pre @a segment is created using maps_route_segment_create(). * @@ -84,6 +86,7 @@ int maps_route_segment_set_origin(maps_route_segment_h segment, * @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_SUPPORTED Not supported * * @pre @a segment is created using maps_route_segment_create(). * @@ -103,6 +106,7 @@ int maps_route_segment_set_destination(maps_route_segment_h segment, * @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_SUPPORTED Not supported * * @pre @a segment is created using maps_route_segment_create(). * @@ -122,6 +126,7 @@ int maps_route_segment_set_bounding_box(maps_route_segment_h segment, * @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_SUPPORTED Not supported * * @pre @a segment is created using maps_route_segment_create(). * @@ -141,6 +146,7 @@ int maps_route_segment_set_distance(maps_route_segment_h segment, * @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_SUPPORTED Not supported * * @pre @a segment is created using maps_route_segment_create(). * @@ -160,6 +166,7 @@ int maps_route_segment_set_duration(maps_route_segment_h segment, * @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_SUPPORTED Not supported * * @pre @a segment is created using maps_route_segment_create(). * @@ -179,6 +186,7 @@ int maps_route_segment_set_path(maps_route_segment_h segment, * @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_SUPPORTED Not supported * * @pre @a segment is created using maps_route_segment_create(). * diff --git a/include/maps_view_plugin.h b/include/maps_view_plugin.h index 73e8580..98df31e 100644 --- a/include/maps_view_plugin.h +++ b/include/maps_view_plugin.h @@ -58,6 +58,7 @@ typedef enum _maps_view_colorspace_type_e * @retval #MAPS_ERROR_NONE Successful * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter * @retval #MAPS_ERROR_PERMISSION_DENIED Permission Denied + * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported * * @pre @a view is created using maps_view_create(). * @post This function invokes maps_view_on_event_cb() with the event type @@ -89,6 +90,7 @@ int maps_view_set_zoom_factor(maps_view_h view, double zoom_factor); * @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_SUPPORTED Not supported * * @pre @a view is created using maps_view_create(). * @@ -107,6 +109,7 @@ int maps_view_get_zoom_factor(const maps_view_h view, double *zoom_factor); * @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_SUPPORTED Not supported * * @pre @a hView is created using maps_view_create(). * @@ -123,6 +126,7 @@ int maps_view_get_maps_plugin_view_handle(maps_view_h hView, void **maps_plugin_ * @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_SUPPORTED Not supported * * @pre @a hView is created using maps_view_create(). * diff --git a/packaging/capi-maps-service.spec b/packaging/capi-maps-service.spec index 90ce76e..bcd5757 100644 --- a/packaging/capi-maps-service.spec +++ b/packaging/capi-maps-service.spec @@ -15,13 +15,9 @@ BuildRequires: pkgconfig(capi-base-common) BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(capi-system-info) -# Privilege check for Tizen 2.3.2 -#BuildRequires: pkgconfig(capi-appfw-app-manager) -#BuildRequires: pkgconfig(pkgmgr-info) -#BuildRequires: pkgconfig(capi-security-privilege-manager) - -# Privilege check for Tizen 2.4 -#BuildRequires: pkgconfig(security-privilege-checker) +# Privilege check for Tizen 2.x +#BuildRequires: pkgconfig(privacy-manager-client) +#BuildRequires: pkgconfig(libsmack) # Mapping API dependencies BuildRequires: pkgconfig(eina) @@ -54,7 +50,7 @@ export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE" MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DMAJORVER=${MAJORVER} -DFULLVER=%{version} \ - -DLIBDIR=%{_libdir} -DPROFILE=%{?profile} -DTIZEN_VER=300 + -DLIBDIR=%{_libdir} -DPROFILE=%{?profile} -DTIZEN_VER=0x030000 make %{?jobs:-j%jobs} %install diff --git a/src/api/maps_address.cpp b/src/api/maps_address.cpp old mode 100755 new mode 100644 index ead367d..8b39ef0 --- a/src/api/maps_address.cpp +++ b/src/api/maps_address.cpp @@ -19,6 +19,7 @@ #include "maps_plugin_types.h" #include "maps_address.h" #include "maps_util.h" +#include "maps_condition.h" /* * This represents address information such as building number, @@ -55,6 +56,8 @@ const gsize _MAPS_ADDRESS_COUNTY_MAX_LENGTH = 128; EXPORT_API int maps_address_create(maps_address_h *address) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!address) return MAPS_ERROR_INVALID_PARAMETER; @@ -70,6 +73,8 @@ EXPORT_API int maps_address_create(maps_address_h *address) EXPORT_API int maps_address_destroy(maps_address_h address) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!address) return MAPS_ERROR_INVALID_PARAMETER; @@ -105,6 +110,8 @@ EXPORT_API int maps_address_destroy(maps_address_h address) EXPORT_API int maps_address_clone(const maps_address_h origin, maps_address_h *cloned) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!cloned || !origin) return MAPS_ERROR_INVALID_PARAMETER; @@ -192,6 +199,8 @@ EXPORT_API int maps_address_clone(const maps_address_h origin, EXPORT_API int maps_address_get_building_number(const maps_address_h address, char **building_number) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!address || !building_number) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_address_s *) address)->building_number, @@ -201,6 +210,8 @@ EXPORT_API int maps_address_get_building_number(const maps_address_h address, EXPORT_API int maps_address_get_street(const maps_address_h address, char **street) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!address || !street) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_address_s *) address)->street, @@ -210,6 +221,8 @@ EXPORT_API int maps_address_get_street(const maps_address_h address, EXPORT_API int maps_address_get_district(const maps_address_h address, char **district) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!address || !district) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_address_s *) address)->district, @@ -218,6 +231,8 @@ EXPORT_API int maps_address_get_district(const maps_address_h address, EXPORT_API int maps_address_get_city(const maps_address_h address, char **city) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!address || !city) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_address_s *) address)->city, @@ -227,6 +242,8 @@ EXPORT_API int maps_address_get_city(const maps_address_h address, char **city) EXPORT_API int maps_address_get_state(const maps_address_h address, char **state) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!address || !state) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_address_s *) address)->state, @@ -236,6 +253,8 @@ EXPORT_API int maps_address_get_state(const maps_address_h address, EXPORT_API int maps_address_get_country(const maps_address_h address, char **country) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!address || !country) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_address_s *) address)->country, @@ -245,6 +264,8 @@ EXPORT_API int maps_address_get_country(const maps_address_h address, EXPORT_API int maps_address_get_country_code(const maps_address_h address, char **country_code) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!address || !country_code) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_address_s *) address)->country_code, @@ -254,6 +275,8 @@ EXPORT_API int maps_address_get_country_code(const maps_address_h address, EXPORT_API int maps_address_get_county(const maps_address_h address, char **county) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!address || !county) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_address_s *) address)->county, @@ -263,6 +286,8 @@ EXPORT_API int maps_address_get_county(const maps_address_h address, EXPORT_API int maps_address_get_postal_code(const maps_address_h address, char **postal_code) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!address || !postal_code) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_address_s *) address)->postal_code, @@ -272,6 +297,8 @@ EXPORT_API int maps_address_get_postal_code(const maps_address_h address, EXPORT_API int maps_address_get_freetext(const maps_address_h address, char **freetext) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!address || !freetext) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_address_s *) address)->freetext, @@ -283,6 +310,8 @@ EXPORT_API int maps_address_get_freetext(const maps_address_h address, EXPORT_API int maps_address_set_building_number(maps_address_h address, const char *building_number) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!address || !building_number) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(building_number, @@ -293,6 +322,8 @@ EXPORT_API int maps_address_set_building_number(maps_address_h address, EXPORT_API int maps_address_set_street(maps_address_h address, const char *street) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!address || !street) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(street, _MAPS_ADDRESS_STREET_MAX_LENGTH, @@ -302,6 +333,8 @@ EXPORT_API int maps_address_set_street(maps_address_h address, EXPORT_API int maps_address_set_district(maps_address_h address, const char *district) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!address || !district) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(district, _MAPS_ADDRESS_DISTRICT_MAX_LENGTH, @@ -310,6 +343,8 @@ EXPORT_API int maps_address_set_district(maps_address_h address, EXPORT_API int maps_address_set_city(maps_address_h address, const char *city) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!address || !city) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(city, _MAPS_ADDRESS_CITY_MAX_LENGTH, @@ -318,6 +353,8 @@ EXPORT_API int maps_address_set_city(maps_address_h address, const char *city) EXPORT_API int maps_address_set_state(maps_address_h address, const char *state) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!address || !state) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(state, _MAPS_ADDRESS_STATE_MAX_LENGTH, @@ -327,6 +364,8 @@ EXPORT_API int maps_address_set_state(maps_address_h address, const char *state) EXPORT_API int maps_address_set_country(maps_address_h address, const char *country) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!address || !country) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(country, _MAPS_ADDRESS_COUNTRY_MAX_LENGTH, @@ -336,6 +375,8 @@ EXPORT_API int maps_address_set_country(maps_address_h address, EXPORT_API int maps_address_set_country_code(maps_address_h address, const char *country_code) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!address || !country_code) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(country_code, @@ -346,6 +387,8 @@ EXPORT_API int maps_address_set_country_code(maps_address_h address, EXPORT_API int maps_address_set_county(maps_address_h address, const char *county) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!address || !county) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(county, _MAPS_ADDRESS_COUNTY_MAX_LENGTH, @@ -355,6 +398,8 @@ EXPORT_API int maps_address_set_county(maps_address_h address, EXPORT_API int maps_address_set_postal_code(maps_address_h address, const char *postal_code) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!address || !postal_code) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(postal_code, @@ -365,6 +410,8 @@ EXPORT_API int maps_address_set_postal_code(maps_address_h address, EXPORT_API int maps_address_set_freetext(maps_address_h address, const char *freetext) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!address || !freetext) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(freetext, _MAPS_ADDRESS_FREE_TEXT_MAX_LENGTH, @@ -377,6 +424,8 @@ EXPORT_API int maps_address_set_freetext(maps_address_h address, EXPORT_API int maps_address_list_create(maps_address_list_h *address_list) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!address_list) return MAPS_ERROR_INVALID_PARAMETER; @@ -390,6 +439,8 @@ EXPORT_API int maps_address_list_create(maps_address_list_h *address_list) EXPORT_API int maps_address_list_append(maps_address_list_h address_list, maps_address_h address) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!address_list || !address) return MAPS_ERROR_INVALID_PARAMETER; @@ -402,6 +453,8 @@ EXPORT_API int maps_address_list_append(maps_address_list_h address_list, maps_a EXPORT_API int maps_address_list_remove(maps_address_list_h address_list, maps_address_h address) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!address_list || !address) return MAPS_ERROR_INVALID_PARAMETER; @@ -414,6 +467,8 @@ EXPORT_API int maps_address_list_remove(maps_address_list_h address_list, maps_a EXPORT_API int maps_address_list_get_length(maps_address_list_h address_list, int *length) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!address_list || !length) return MAPS_ERROR_INVALID_PARAMETER; @@ -424,6 +479,8 @@ EXPORT_API int maps_address_list_get_length(maps_address_list_h address_list, in EXPORT_API int maps_address_list_foreach(maps_address_list_h address_list, maps_address_cb callback, void *user_data) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!address_list || !callback) return MAPS_ERROR_INVALID_PARAMETER; @@ -453,6 +510,8 @@ EXPORT_API int maps_address_list_foreach(maps_address_list_h address_list, maps_ EXPORT_API int maps_address_list_destroy(maps_address_list_h address_list) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!address_list) return MAPS_ERROR_INVALID_PARAMETER; @@ -467,61 +526,46 @@ EXPORT_API int maps_address_list_destroy(maps_address_list_h address_list) bool maps_address_is_valid(const maps_address_h address) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!address) return false; - bool ret = true; + bool ret = false; maps_address_s *a = (maps_address_s *) address; do { - if (a->building_number && strlen(a->building_number) > _MAPS_ADDRESS_BUILDING_NUMBER_MAX_LENGTH) { - ret = false; + if (a->building_number && strlen(a->building_number) > _MAPS_ADDRESS_BUILDING_NUMBER_MAX_LENGTH) break; - } - if (a->street && strlen(a->street) > _MAPS_ADDRESS_STREET_MAX_LENGTH) { - ret = false; + + if (a->street && strlen(a->street) > _MAPS_ADDRESS_STREET_MAX_LENGTH) break; - } - if (a->district && strlen(a->district) > _MAPS_ADDRESS_DISTRICT_MAX_LENGTH) { - ret = false; + if (a->district && strlen(a->district) > _MAPS_ADDRESS_DISTRICT_MAX_LENGTH) break; - } - if (a->city && strlen(a->city) > _MAPS_ADDRESS_CITY_MAX_LENGTH) { - ret = false; + if (a->city && strlen(a->city) > _MAPS_ADDRESS_CITY_MAX_LENGTH) break; - } - if (a->state && strlen(a->state) > _MAPS_ADDRESS_STATE_MAX_LENGTH) { - ret = false; + if (a->state && strlen(a->state) > _MAPS_ADDRESS_STATE_MAX_LENGTH) break; - } - if (a->country_code && strlen(a->country_code) > _MAPS_ADDRESS_COUNTRY_CODE_MAX_LENGTH) { - ret = false; + if (a->country_code && strlen(a->country_code) > _MAPS_ADDRESS_COUNTRY_CODE_MAX_LENGTH) break; - } - if (a->postal_code && strlen(a->postal_code) > _MAPS_ADDRESS_POSTAL_CODE_MAX_LENGTH) { - ret = false; + if (a->postal_code && strlen(a->postal_code) > _MAPS_ADDRESS_POSTAL_CODE_MAX_LENGTH) break; - } - if (a->freetext && strlen(a->freetext) > _MAPS_ADDRESS_FREE_TEXT_MAX_LENGTH) { - ret = false; + if (a->freetext && strlen(a->freetext) > _MAPS_ADDRESS_FREE_TEXT_MAX_LENGTH) break; - } - if (a->country && strlen(a->country) > _MAPS_ADDRESS_COUNTRY_MAX_LENGTH) { - ret = false; + if (a->country && strlen(a->country) > _MAPS_ADDRESS_COUNTRY_MAX_LENGTH) break; - } - if (a->county && strlen(a->county) > _MAPS_ADDRESS_COUNTY_MAX_LENGTH) { - ret = false; + if (a->county && strlen(a->county) > _MAPS_ADDRESS_COUNTY_MAX_LENGTH) break; - } + + ret = true; } while (false); return ret; -} \ No newline at end of file +} diff --git a/src/api/maps_area.cpp b/src/api/maps_area.cpp index 1a0ca45..382691a 100644 --- a/src/api/maps_area.cpp +++ b/src/api/maps_area.cpp @@ -18,6 +18,7 @@ #include "maps_error.h" #include "maps_area.h" #include "maps_util.h" +#include "maps_condition.h" extern bool maps_coordinates_is_valid(const maps_coordinates_h coordinates); @@ -25,6 +26,9 @@ EXPORT_API int maps_area_create_rectangle(const maps_coordinates_h top_left, const maps_coordinates_h bottom_right, maps_area_h *area) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; + if (!top_left || !bottom_right || !area) return MAPS_ERROR_INVALID_PARAMETER; @@ -52,6 +56,9 @@ EXPORT_API int maps_area_create_rectangle(const maps_coordinates_h top_left, EXPORT_API int maps_area_create_circle(const maps_coordinates_h center, const double radius, maps_area_h *area) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; + if (!center || !area || radius <= 0) return MAPS_ERROR_INVALID_PARAMETER; @@ -75,17 +82,20 @@ EXPORT_API int maps_area_create_circle(const maps_coordinates_h center, EXPORT_API int maps_area_destroy(maps_area_h area) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!area) return MAPS_ERROR_INVALID_PARAMETER; maps_area_s *handle = (maps_area_s *) area; - g_free(handle); return MAPS_ERROR_NONE; } EXPORT_API int maps_area_clone(const maps_area_h origin, maps_area_h *cloned) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!cloned || !origin) return MAPS_ERROR_INVALID_PARAMETER; @@ -120,6 +130,8 @@ EXPORT_API int maps_area_clone(const maps_area_h origin, maps_area_h *cloned) bool maps_area_is_valid(const maps_area_h area) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!area) return false; bool ret = true; diff --git a/src/api/maps_condition.cpp b/src/api/maps_condition.cpp index 9005054..6a71b6d 100644 --- a/src/api/maps_condition.cpp +++ b/src/api/maps_condition.cpp @@ -16,96 +16,95 @@ #include #include -#if TIZEN_VER < 240 -#include -#include -#include /* privilege */ -#elif TIZEN_VER < 300 -#include /* privilege */ -#endif #include /* system_info_get_platform_bool */ #include /* log */ #include +#if (TIZEN_VER < VERSION(3, 0, 0)) +#include +#include - -#define MAPSERVICE_PRIVILEGE "http://tizen.org/privilege/mapservice" - +#define MAPSERVICE_PRIVILEGE "privilege::tizen::mapservice" +#define MAPSERVICE_PERMISSION "rw" +#endif +#define MAPS_FEATURE "http://tizen.org/feature/maps" #define INTERNET_FEATURE "http://tizen.org/feature/network.internet" -#if TIZEN_VER < 240 -static char* __maps_condition_get_package_id(char **package_id) +#if (TIZEN_VER < VERSION(3, 0, 0)) +static int __maps_condition_check_privilege(const char *privilege_name, const char *permission) { - int ret = 0; - pid_t pid = 0; - char *app_id = NULL; - char *pkg_id = NULL; - pkgmgrinfo_appinfo_h pkgmgrinfo_appinfo; - - do { - pid = getpid(); - ret = app_manager_get_app_id(pid, &app_id); - if (ret) { - MAPS_LOGE("Fail to get app_id. Err[%d]", ret); - break; - } - - ret = pkgmgrinfo_appinfo_get_appinfo(app_id, &pkgmgrinfo_appinfo); - if (ret) { - MAPS_LOGE("Fail to get appinfo for [%s]. Err[%d]", app_id, ret); - break; - } - - ret = pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo, &pkg_id); - if (ret) { - MAPS_LOGE("Fail to get package_id for [%s]. Err[%d]", app_id, ret); - break; - } + if (!privilege_name || !permission) + return MAPS_ERROR_INVALID_PARAMETER; - *package_id = g_strdup(pkg_id); - } while (0); + int ret; + char *label = NULL; - g_free(app_id); - pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo); - - return *package_id; + if (smack_new_label_from_self(&label) == -1) { + MAPS_LOGE("smack_new_label_from_self error"); + return MAPS_ERROR_INVALID_OPERATION; + } + ret = smack_have_access(label, privilege_name, permission); + if (ret == 1) { + ret = MAPS_ERROR_NONE; + } else if (ret == 0) { + ret = MAPS_ERROR_PERMISSION_DENIED; + } else { + ret = MAPS_ERROR_INVALID_OPERATION; + } + g_free(label); + return ret; } #endif bool maps_condition_check_privilege(void) { - bool is_permitted = true; -#if TIZEN_VER < 240 - /* to check for Tizen 2.x privilege */ - char *package_id = NULL; - if (!__maps_condition_get_package_id(&package_id)) - return is_permitted; + static bool is_permitted = true; + static bool is_read = false; - int ret = privilege_checker_check_package_privilege(package_id, MAPSERVICE_PRIVILEGE); - is_permitted = (ret == PRIV_CHECKER_ERR_NONE); - g_free(package_id); -#elif TIZEN_VER < 300 - int ret = privilege_checker_check_privilege(MAPSERVICE_PRIVILEGE); - is_permitted = (ret == PRIVILEGE_CHECKER_ERR_NONE); + if (!is_read) { +#if (TIZEN_VER < VERSION(3, 0, 0)) + int ret = __maps_condition_check_privilege(MAPSERVICE_PRIVILEGE, MAPSERVICE_PERMISSION); + is_permitted = (ret == MAPS_ERROR_NONE); #else - /* to check for Tizen 3.x privilege */ - extern const char *MAPS_PLUGINS_PATH_PREFIX; - is_permitted = (access(MAPS_PLUGINS_PATH_PREFIX, F_OK) != 0) || /* not exist */ - (access(MAPS_PLUGINS_PATH_PREFIX, R_OK) == 0); /* readable */ + /* to check for Tizen 3.x privilege */ + extern const char *MAPS_PLUGINS_PATH_PREFIX; + is_permitted = (access(MAPS_PLUGINS_PATH_PREFIX, F_OK) != 0) || /* not exist */ + (access(MAPS_PLUGINS_PATH_PREFIX, R_OK) == 0); /* readable */ #endif - MAPS_LOGD("mapservice privilege is%sconsented", (is_permitted ? " " : " not ")); + is_read = true; + MAPS_LOGD("mapservice privilege is%sconsented", (is_permitted ? " " : " not ")); + } return is_permitted; } -bool maps_condition_check_feature(void) +bool maps_condition_check_maps_feature(void) { - bool is_supported = true; + static bool is_supported = true; + static bool is_read = false; + + if (!is_read) { + int ret = system_info_get_platform_bool(MAPS_FEATURE, &is_supported); + if (ret == SYSTEM_INFO_ERROR_NONE) { + MAPS_LOGD("maps feature is%ssupported", (is_supported ? " " : " not ")); + is_read = true; + } + } + return is_supported; +} + +bool maps_condition_check_internet_feature(void) +{ + static bool is_supported = true; #ifdef TIZEN_WEARABLE - int ret = system_info_get_platform_bool(INTERNET_FEATURE, &is_supported); - if (ret == SYSTEM_INFO_ERROR_NONE) - MAPS_LOGD("internet feature is%ssupported", (is_supported ? " " : " not ")); - else - MAPS_LOGD("system info error (%d)", ret); + static bool is_read = false; + + if (!is_read) { + int ret = system_info_get_platform_bool(INTERNET_FEATURE, &is_supported); + if (ret == SYSTEM_INFO_ERROR_NONE) { + MAPS_LOGD("internet feature is%ssupported", (is_supported ? " " : " not ")); + is_read = true; + } + } #endif return is_supported; } diff --git a/src/api/maps_condition.h b/src/api/maps_condition.h index 9ccbf6b..9450c26 100644 --- a/src/api/maps_condition.h +++ b/src/api/maps_condition.h @@ -21,10 +21,16 @@ */ bool maps_condition_check_privilege(void); +/** + * @brief Gets if maps feature is supported + * @remarks If target is not a wearable gear, it returns true always. + */ +bool maps_condition_check_maps_feature(void); + /** * @brief Gets if network.internet feature is supported * @remarks If target is not a wearable gear, it returns true always. */ -bool maps_condition_check_feature(void); +bool maps_condition_check_internet_feature(void); #endif /* __MAPS_SERVICE_CHECK_H__ */ diff --git a/src/api/maps_coordinates.cpp b/src/api/maps_coordinates.cpp index 8aa25e4..34be975 100644 --- a/src/api/maps_coordinates.cpp +++ b/src/api/maps_coordinates.cpp @@ -19,11 +19,14 @@ #include "maps_plugin_types.h" #include "maps_coordinates.h" #include "maps_util.h" +#include "maps_condition.h" EXPORT_API int maps_coordinates_create(const double latitude, const double longitude, maps_coordinates_h *coords) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!coords) return MAPS_ERROR_INVALID_PARAMETER; @@ -48,6 +51,8 @@ EXPORT_API int maps_coordinates_create(const double latitude, EXPORT_API int maps_coordinates_destroy(maps_coordinates_h coords) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!coords) return MAPS_ERROR_INVALID_PARAMETER; @@ -61,6 +66,8 @@ EXPORT_API int maps_coordinates_destroy(maps_coordinates_h coords) EXPORT_API int maps_coordinates_clone(const maps_coordinates_h origin, maps_coordinates_h *cloned) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!cloned || !origin) return MAPS_ERROR_INVALID_PARAMETER; int error = MAPS_ERROR_NONE; @@ -81,6 +88,8 @@ EXPORT_API int maps_coordinates_clone(const maps_coordinates_h origin, EXPORT_API int maps_coordinates_get_latitude(const maps_coordinates_h coords, double *latitude) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!coords || !latitude) return MAPS_ERROR_INVALID_PARAMETER; *latitude = ((maps_coordinates_s *) coords)->latitude; @@ -90,6 +99,8 @@ EXPORT_API int maps_coordinates_get_latitude(const maps_coordinates_h coords, EXPORT_API int maps_coordinates_get_longitude(const maps_coordinates_h coords, double *longitude) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!coords || !longitude) return MAPS_ERROR_INVALID_PARAMETER; *longitude = ((maps_coordinates_s *) coords)->longitude; @@ -100,6 +111,8 @@ EXPORT_API int maps_coordinates_get_latitude_longitude(const maps_coordinates_h double *latitude, double *longitude) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!coords || !latitude || !longitude) return MAPS_ERROR_INVALID_PARAMETER; *latitude = ((maps_coordinates_s *) coords)->latitude; @@ -112,6 +125,8 @@ EXPORT_API int maps_coordinates_get_latitude_longitude(const maps_coordinates_h EXPORT_API int maps_coordinates_set_latitude(maps_coordinates_h coords, const double latitude) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!coords) return MAPS_ERROR_INVALID_PARAMETER; MAPS_CHECK_CONDITION(latitude >= -90 @@ -124,6 +139,8 @@ EXPORT_API int maps_coordinates_set_latitude(maps_coordinates_h coords, EXPORT_API int maps_coordinates_set_longitude(maps_coordinates_h coords, const double longitude) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!coords) return MAPS_ERROR_INVALID_PARAMETER; MAPS_CHECK_CONDITION(longitude >= -180 @@ -137,6 +154,8 @@ EXPORT_API int maps_coordinates_set_latitude_longitude(maps_coordinates_h coords const double latitude, const double longitude) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!coords) return MAPS_ERROR_INVALID_PARAMETER; MAPS_CHECK_CONDITION(latitude >= -90 @@ -156,6 +175,8 @@ EXPORT_API int maps_coordinates_set_latitude_longitude(maps_coordinates_h coords EXPORT_API int maps_coordinates_list_create(maps_coordinates_list_h *coordinates_list) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!coordinates_list) return MAPS_ERROR_INVALID_PARAMETER; @@ -181,6 +202,8 @@ static void _free_coordinates(gpointer data) EXPORT_API int maps_coordinates_list_destroy(maps_coordinates_list_h coordinates_list) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!coordinates_list) return MAPS_ERROR_INVALID_PARAMETER; @@ -194,6 +217,8 @@ EXPORT_API int maps_coordinates_list_destroy(maps_coordinates_list_h coordinates EXPORT_API int maps_coordinates_list_append(maps_coordinates_list_h coordinates_list, maps_coordinates_h coordinates) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!coordinates_list || !coordinates) return MAPS_ERROR_INVALID_PARAMETER; @@ -207,6 +232,8 @@ EXPORT_API int maps_coordinates_list_append(maps_coordinates_list_h coordinates_ EXPORT_API int maps_coordinates_list_remove(maps_coordinates_list_h coordinates_list, maps_coordinates_h coordinates) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!coordinates_list || !coordinates) return MAPS_ERROR_INVALID_PARAMETER; @@ -220,6 +247,8 @@ EXPORT_API int maps_coordinates_list_remove(maps_coordinates_list_h coordinates_ EXPORT_API int maps_coordinates_list_get_length(maps_coordinates_list_h coordinates_list, int *length) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!coordinates_list || !length) return MAPS_ERROR_INVALID_PARAMETER; @@ -230,6 +259,8 @@ EXPORT_API int maps_coordinates_list_get_length(maps_coordinates_list_h coordina EXPORT_API int maps_coordinates_list_foreach(maps_coordinates_list_h coordinates_list, maps_coordinates_cb callback, void *user_data) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!coordinates_list || !callback) return MAPS_ERROR_INVALID_PARAMETER; diff --git a/src/api/maps_extra_types.cpp b/src/api/maps_extra_types.cpp index 4bfddd5..d0eb1bf 100644 --- a/src/api/maps_extra_types.cpp +++ b/src/api/maps_extra_types.cpp @@ -18,6 +18,7 @@ #include "maps_error.h" #include "maps_extra_types.h" #include "maps_util.h" +#include "maps_condition.h" typedef struct _maps_item_list_s { @@ -26,6 +27,8 @@ typedef struct _maps_item_list_s EXPORT_API int maps_item_list_create(maps_item_list_h *list) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!list) return MAPS_ERROR_INVALID_PARAMETER; maps_item_list_s *l = g_slice_new0(maps_item_list_s); @@ -43,6 +46,8 @@ EXPORT_API int maps_item_list_create(maps_item_list_h *list) EXPORT_API int maps_item_list_destroy(maps_item_list_h list) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!list) return MAPS_ERROR_INVALID_PARAMETER; maps_item_list_s *l = (maps_item_list_s *) list; @@ -55,6 +60,8 @@ EXPORT_API int maps_item_list_destroy(maps_item_list_h list) EXPORT_API int maps_item_list_append(maps_item_list_h list, const void *data, maps_item_list_clone_cb clone_func) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!list || !data) return MAPS_ERROR_INVALID_PARAMETER; void *p = NULL; @@ -75,10 +82,11 @@ EXPORT_API int maps_item_list_foreach(maps_item_list_h list, maps_item_list_foreach_cb callback, void *user_data) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!list || !callback) return MAPS_ERROR_INVALID_PARAMETER; maps_item_list_s *l = (maps_item_list_s *) list; - if (!l->l) return MAPS_ERROR_NOT_FOUND; @@ -106,9 +114,10 @@ EXPORT_API int maps_item_list_remove(maps_item_list_h list, void *item, maps_item_list_free_cb free_func) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!list) return MAPS_ERROR_INVALID_PARAMETER; - maps_item_list_s *l = (maps_item_list_s *) list; if (l->l) { l->l = g_list_remove(l->l, item); @@ -120,6 +129,8 @@ EXPORT_API int maps_item_list_remove(maps_item_list_h list, EXPORT_API int maps_item_list_foreach_noclone(maps_item_list_h list, maps_item_list_foreach_noclone_cb callback, void *user_data) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!list || !callback) return MAPS_ERROR_INVALID_PARAMETER; maps_item_list_s *l = (maps_item_list_s *) list; @@ -141,8 +152,11 @@ EXPORT_API int maps_item_list_foreach_noclone(maps_item_list_h list, maps_item_l EXPORT_API int maps_item_list_remove_all(maps_item_list_h list, maps_item_list_free_cb free_func) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!list) return MAPS_ERROR_INVALID_PARAMETER; + maps_item_list_s *l = (maps_item_list_s *) list; if (l->l) { GList *head = g_list_first(l->l); @@ -162,6 +176,8 @@ EXPORT_API int maps_item_list_clone(const maps_item_list_h origin, maps_item_list_clone_cb clone_func, maps_item_list_h *cloned) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!cloned || !origin || !clone_func) return MAPS_ERROR_INVALID_PARAMETER; @@ -207,10 +223,12 @@ typedef struct _maps_string_hashtable_s EXPORT_API int maps_string_hashtable_create(maps_string_hashtable_h *table) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!table) return MAPS_ERROR_INVALID_PARAMETER; - maps_string_hashtable_s *t = g_slice_new0(maps_string_hashtable_s); + maps_string_hashtable_s *t = g_slice_new0(maps_string_hashtable_s); if (!t) { MAPS_LOGE("OUT_OF_MEMORY(0x%08x)", MAPS_ERROR_OUT_OF_MEMORY); return MAPS_ERROR_OUT_OF_MEMORY; @@ -223,6 +241,8 @@ EXPORT_API int maps_string_hashtable_create(maps_string_hashtable_h *table) EXPORT_API int maps_string_hashtable_destroy(maps_string_hashtable_h table) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!table) return MAPS_ERROR_INVALID_PARAMETER; maps_string_hashtable_s *t = (maps_string_hashtable_s *) table; @@ -235,6 +255,8 @@ EXPORT_API int maps_string_hashtable_destroy(maps_string_hashtable_h table) EXPORT_API int maps_string_hashtable_set(maps_string_hashtable_h table, const char *key, const char *value) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!table || !key || !value) return MAPS_ERROR_INVALID_PARAMETER; maps_string_hashtable_s *t = (maps_string_hashtable_s *) table; @@ -247,6 +269,8 @@ EXPORT_API int maps_string_hashtable_set(maps_string_hashtable_h table, EXPORT_API int maps_string_hashtable_get(maps_string_hashtable_h table, const char *key, char **value) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!table || !key || !value) return MAPS_ERROR_INVALID_PARAMETER; maps_string_hashtable_s *t = (maps_string_hashtable_s *) table; @@ -261,6 +285,8 @@ EXPORT_API int maps_string_hashtable_get(maps_string_hashtable_h table, EXPORT_API int maps_string_hashtable_remove(maps_string_hashtable_h table, const char *key) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!table || !key) return MAPS_ERROR_INVALID_PARAMETER; maps_string_hashtable_s *t = (maps_string_hashtable_s *) table; @@ -274,6 +300,8 @@ EXPORT_API int maps_string_hashtable_foreach(maps_string_hashtable_h table, callback, void *user_data) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!table || !callback) return MAPS_ERROR_INVALID_PARAMETER; maps_string_hashtable_s *t = (maps_string_hashtable_s *) table; @@ -306,6 +334,8 @@ EXPORT_API int maps_string_hashtable_foreach(maps_string_hashtable_h table, EXPORT_API int maps_string_hashtable_clone(const maps_string_hashtable_h origin, maps_string_hashtable_h *cloned) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!cloned || !origin) return MAPS_ERROR_INVALID_PARAMETER; @@ -343,6 +373,8 @@ EXPORT_API int maps_string_hashtable_clone(const maps_string_hashtable_h origin, EXPORT_API int maps_string_hashtable_contains(maps_string_hashtable_h table, const char * key, bool * contains) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!table || !key || !contains) return MAPS_ERROR_INVALID_PARAMETER; maps_string_hashtable_s *t = (maps_string_hashtable_s *) table; @@ -359,6 +391,8 @@ typedef struct _maps_int_hashtable_s EXPORT_API int maps_int_hashtable_create(maps_int_hashtable_h *table) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!table) return MAPS_ERROR_INVALID_PARAMETER; maps_int_hashtable_s *t = g_slice_new0(maps_int_hashtable_s); @@ -375,6 +409,8 @@ EXPORT_API int maps_int_hashtable_create(maps_int_hashtable_h *table) EXPORT_API int maps_int_hashtable_destroy(maps_int_hashtable_h table) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!table) return MAPS_ERROR_INVALID_PARAMETER; maps_int_hashtable_s *t = (maps_int_hashtable_s *) table; @@ -387,6 +423,8 @@ EXPORT_API int maps_int_hashtable_destroy(maps_int_hashtable_h table) EXPORT_API int maps_int_hashtable_set(maps_int_hashtable_h table, const int key, const int value) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!table) return MAPS_ERROR_INVALID_PARAMETER; maps_int_hashtable_s *t = (maps_int_hashtable_s *) table; @@ -405,6 +443,8 @@ EXPORT_API int maps_int_hashtable_set(maps_int_hashtable_h table, EXPORT_API int maps_int_hashtable_get(maps_int_hashtable_h table, const int key, int *value) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!table || !value) return MAPS_ERROR_INVALID_PARAMETER; maps_int_hashtable_s *t = (maps_int_hashtable_s *) table; @@ -420,6 +460,8 @@ EXPORT_API int maps_int_hashtable_get(maps_int_hashtable_h table, EXPORT_API int maps_int_hashtable_remove(maps_int_hashtable_h table, const int key) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!table) return MAPS_ERROR_INVALID_PARAMETER; maps_int_hashtable_s *t = (maps_int_hashtable_s *) table; @@ -432,6 +474,8 @@ EXPORT_API int maps_int_hashtable_foreach(maps_int_hashtable_h table, maps_int_hashtable_foreach_cb callback, void *user_data) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!table || !callback) return MAPS_ERROR_INVALID_PARAMETER; maps_int_hashtable_s *t = (maps_int_hashtable_s *) table; @@ -459,6 +503,8 @@ EXPORT_API int maps_int_hashtable_foreach(maps_int_hashtable_h table, EXPORT_API int maps_int_hashtable_clone(const maps_int_hashtable_h origin, maps_int_hashtable_h *cloned) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!cloned || !origin) return MAPS_ERROR_INVALID_PARAMETER; @@ -500,6 +546,8 @@ EXPORT_API int maps_int_hashtable_clone(const maps_int_hashtable_h origin, EXPORT_API int maps_int_hashtable_contains(maps_int_hashtable_h table, const int key, bool *contains) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!table || !contains) return MAPS_ERROR_INVALID_PARAMETER; maps_int_hashtable_s *t = (maps_int_hashtable_s *) table; @@ -546,6 +594,8 @@ typedef struct _maps_item_hashtable_s EXPORT_API int maps_item_hashtable_create(maps_item_hashtable_h *table) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!table) return MAPS_ERROR_INVALID_PARAMETER; maps_item_hashtable_s *t = g_slice_new0(maps_item_hashtable_s); @@ -563,6 +613,8 @@ EXPORT_API int maps_item_hashtable_create(maps_item_hashtable_h *table) EXPORT_API int maps_item_hashtable_destroy(maps_item_hashtable_h table) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!table) return MAPS_ERROR_INVALID_PARAMETER; maps_item_hashtable_s *t = (maps_item_hashtable_s *) table; @@ -574,6 +626,8 @@ EXPORT_API int maps_item_hashtable_destroy(maps_item_hashtable_h table) EXPORT_API int maps_item_hashtable_clone_string(void *origin, void **cloned) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!origin || !cloned) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string((char *) origin, strlen((char *) origin), @@ -582,12 +636,16 @@ EXPORT_API int maps_item_hashtable_clone_string(void *origin, void **cloned) EXPORT_API int maps_item_hashtable_free_string(void *data) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; g_free(data); return MAPS_ERROR_NONE; } EXPORT_API int maps_item_hashtable_clone_int(void *origin, void **cloned) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!origin || !cloned) return MAPS_ERROR_INVALID_PARAMETER; int *n_cloned = g_new0(int, 1); @@ -605,12 +663,16 @@ EXPORT_API int maps_item_hashtable_clone_int(void *origin, void **cloned) EXPORT_API int maps_item_hashtable_free_int(void *data) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; g_free(data); return MAPS_ERROR_NONE; } EXPORT_API int maps_item_hashtable_clone_float(void *origin, void **cloned) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!origin || !cloned) return MAPS_ERROR_INVALID_PARAMETER; double *n_cloned = g_new0(double, 1); @@ -628,6 +690,8 @@ EXPORT_API int maps_item_hashtable_clone_float(void *origin, void **cloned) EXPORT_API int maps_item_hashtable_free_float(void *data) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; g_free(data); return MAPS_ERROR_NONE; } @@ -636,6 +700,8 @@ EXPORT_API int maps_item_hashtable_set_string(maps_item_hashtable_h table, const char *key, const char *value) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; return maps_item_hashtable_set(table, key, value, maps_item_hashtable_clone_string, maps_item_hashtable_free_string); @@ -644,6 +710,8 @@ EXPORT_API int maps_item_hashtable_set_string(maps_item_hashtable_h table, EXPORT_API int maps_item_hashtable_set_int(maps_item_hashtable_h table, const char *key, const int value) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; return maps_item_hashtable_set(table, key, &value, maps_item_hashtable_clone_int, maps_item_hashtable_free_int); } @@ -652,6 +720,8 @@ EXPORT_API int maps_item_hashtable_set_float(maps_item_hashtable_h table, const char *key, const double value) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; return maps_item_hashtable_set(table, key, &value, maps_item_hashtable_clone_float, maps_item_hashtable_free_float); @@ -662,6 +732,8 @@ EXPORT_API int maps_item_hashtable_set(maps_item_hashtable_h table, maps_item_hashtable_clone_cb clone_func, maps_item_hashtable_free_cb free_func) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!table || !key || !value || !clone_func || !free_func) return MAPS_ERROR_INVALID_PARAMETER; maps_item_hashtable_s *t = (maps_item_hashtable_s *) table; @@ -688,12 +760,16 @@ EXPORT_API int maps_item_hashtable_set(maps_item_hashtable_h table, EXPORT_API int maps_item_hashtable_get_string(maps_item_hashtable_h table, const char *key, char **value) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; return maps_item_hashtable_get(table, key, (void **) value); } EXPORT_API int maps_item_hashtable_get_int(maps_item_hashtable_h table, const char *key, int *value) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!table || !key || !value) return MAPS_ERROR_INVALID_PARAMETER; int *data = NULL; @@ -708,6 +784,8 @@ EXPORT_API int maps_item_hashtable_get_int(maps_item_hashtable_h table, EXPORT_API int maps_item_hashtable_get_float(maps_item_hashtable_h table, const char *key, double *value) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!table || !key || !value) return MAPS_ERROR_INVALID_PARAMETER; double *data = NULL; @@ -722,6 +800,8 @@ EXPORT_API int maps_item_hashtable_get_float(maps_item_hashtable_h table, EXPORT_API int maps_item_hashtable_get(maps_item_hashtable_h table, const char *key, void **value) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!table || !key || !value) return MAPS_ERROR_INVALID_PARAMETER; maps_item_hashtable_s *t = (maps_item_hashtable_s *) table; @@ -737,6 +817,8 @@ EXPORT_API int maps_item_hashtable_get(maps_item_hashtable_h table, EXPORT_API int maps_item_hashtable_remove(maps_item_hashtable_h table, const char *key) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!table || !key) return MAPS_ERROR_INVALID_PARAMETER; maps_item_hashtable_s *t = (maps_item_hashtable_s *) table; @@ -750,10 +832,11 @@ EXPORT_API int maps_item_hashtable_foreach(maps_item_hashtable_h table, callback, void *user_data) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!table || !callback) return MAPS_ERROR_INVALID_PARAMETER; maps_item_hashtable_s *t = (maps_item_hashtable_s *) table; - if (!t->t) return MAPS_ERROR_NOT_FOUND; @@ -787,6 +870,8 @@ EXPORT_API int maps_item_hashtable_foreach(maps_item_hashtable_h table, EXPORT_API int maps_item_hashtable_clone(const maps_item_hashtable_h origin, maps_item_hashtable_h* cloned) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!cloned || !origin) return MAPS_ERROR_INVALID_PARAMETER; @@ -825,6 +910,8 @@ EXPORT_API int maps_item_hashtable_clone(const maps_item_hashtable_h origin, EXPORT_API int maps_item_hashtable_contains(maps_item_hashtable_h table, const char *key, bool *contains) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!table || !key || !contains) return MAPS_ERROR_INVALID_PARAMETER; maps_item_hashtable_s *t = (maps_item_hashtable_s *) table; diff --git a/src/api/maps_place.cpp b/src/api/maps_place.cpp index c57803a..4f945a6 100644 --- a/src/api/maps_place.cpp +++ b/src/api/maps_place.cpp @@ -13,13 +13,14 @@ * limitations under the License. */ +#include #include "maps_error.h" #include "maps_place_plugin.h" #include "maps_extra_types.h" #include "maps_util.h" #include "maps_address.h" #include "maps_place_private.h" -#include +#include "maps_condition.h" static bool __is_supported(const maps_place_h place, maps_service_data_e data) { @@ -95,6 +96,8 @@ const gsize _MAPS_PLACE_URI_MAX_LENGTH = 256; EXPORT_API int maps_place_create(maps_place_h *place) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place) return MAPS_ERROR_INVALID_PARAMETER; *place = (maps_place_h) g_slice_new0(maps_place_s); @@ -109,6 +112,8 @@ EXPORT_API int maps_place_create(maps_place_h *place) EXPORT_API int maps_place_destroy(maps_place_h place) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place) return MAPS_ERROR_INVALID_PARAMETER; @@ -183,6 +188,8 @@ EXPORT_API int maps_place_destroy(maps_place_h place) EXPORT_API int maps_place_clone(const maps_place_h origin, maps_place_h *cloned) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!cloned || !origin) return MAPS_ERROR_INVALID_PARAMETER; @@ -306,6 +313,8 @@ EXPORT_API int maps_place_clone(const maps_place_h origin, EXPORT_API int maps_place_get_id(const maps_place_h place, char **id) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !id) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_place_s *) place)->id, @@ -314,6 +323,8 @@ EXPORT_API int maps_place_get_id(const maps_place_h place, char **id) EXPORT_API int maps_place_get_name(const maps_place_h place, char **name) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !name) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_place_s *) place)->name, @@ -322,6 +333,8 @@ EXPORT_API int maps_place_get_name(const maps_place_h place, char **name) EXPORT_API int maps_place_get_uri(const maps_place_h place, char **uri) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !uri) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_place_s *) place)->uri, @@ -331,6 +344,8 @@ EXPORT_API int maps_place_get_uri(const maps_place_h place, char **uri) EXPORT_API int maps_place_get_location(const maps_place_h place, maps_coordinates_h *location) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !location) return MAPS_ERROR_INVALID_PARAMETER; return maps_coordinates_clone(((maps_place_s *) place)->location, @@ -339,6 +354,8 @@ EXPORT_API int maps_place_get_location(const maps_place_h place, EXPORT_API int maps_place_get_distance(const maps_place_h place, int *distance) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !distance) return MAPS_ERROR_INVALID_PARAMETER; *distance = ((maps_place_s *) place)->distance; @@ -348,36 +365,24 @@ EXPORT_API int maps_place_get_distance(const maps_place_h place, int *distance) EXPORT_API int maps_place_get_address(const maps_place_h place, maps_address_h *address) { - /* Check if the handle of the Place is valid */ - if (!place) + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; + if (!place || !address) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if this API feature available */ if (!__is_supported(place, MAPS_PLACE_ADDRESS)) return MAPS_ERROR_NOT_SUPPORTED; - - /* Check if parameters are valid */ - if (!address) - return MAPS_ERROR_INVALID_PARAMETER; - return maps_address_clone(((maps_place_s *) place)->address, address); } EXPORT_API int maps_place_get_rating(const maps_place_h place, maps_place_rating_h *rating) { - /* Check if the handle of the Place is valid */ - if (!place) + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; + if (!place || !rating) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if this API feature available */ if (!__is_supported(place, MAPS_PLACE_RATING)) return MAPS_ERROR_NOT_SUPPORTED; - - /* Check if parameters are valid */ - if (!rating) - return MAPS_ERROR_INVALID_PARAMETER; - return maps_place_rating_clone(((maps_place_s *) place)->rating, rating); } @@ -386,6 +391,8 @@ EXPORT_API int maps_place_foreach_property(const maps_place_h place, maps_place_properties_cb callback, void *user_data) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !callback) return MAPS_ERROR_INVALID_PARAMETER; return maps_item_hashtable_foreach(((maps_place_s *) place)->properties, @@ -396,18 +403,12 @@ EXPORT_API int maps_place_foreach_category(const maps_place_h place, maps_place_categories_cb callback, void *user_data) { - /* Check if the handle of the Place is valid */ - if (!place) + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; + if (!place || !callback) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if this API feature available */ if (!__is_supported(place, MAPS_PLACE_CATEGORIES)) return MAPS_ERROR_NOT_SUPPORTED; - - /* Check if parameters are valid */ - if (!callback) - return MAPS_ERROR_INVALID_PARAMETER; - return maps_item_list_foreach(((maps_place_s *) place)->categories, maps_place_category_clone, callback, user_data); } @@ -416,18 +417,12 @@ EXPORT_API int maps_place_foreach_attribute(const maps_place_h place, maps_place_attributes_cb callback, void * user_data) { - /* Check if the handle of the Place is valid */ - if (!place) + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; + if (!place || !callback) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if this API feature available */ if (!__is_supported(place, MAPS_PLACE_ATTRIBUTES)) return MAPS_ERROR_NOT_SUPPORTED; - - /* Check if parameters are valid */ - if (!callback) - return MAPS_ERROR_INVALID_PARAMETER; - return maps_item_list_foreach(((maps_place_s *) place)->attribute, maps_place_attribute_clone, callback, user_data); } @@ -436,18 +431,12 @@ EXPORT_API int maps_place_foreach_contact(const maps_place_h place, maps_place_contacts_cb callback, void *user_data) { - /* Check if the handle of the Place is valid */ - if (!place) + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; + if (!place || !callback) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if this API feature available */ if (!__is_supported(place, MAPS_PLACE_CONTACTS)) return MAPS_ERROR_NOT_SUPPORTED; - - /* Check if parameters are valid */ - if (!callback) - return MAPS_ERROR_INVALID_PARAMETER; - return maps_item_list_foreach(((maps_place_s *) place)->contacts, maps_place_contact_clone, callback, user_data); } @@ -456,18 +445,12 @@ EXPORT_API int maps_place_foreach_editorial(const maps_place_h place, maps_place_editorials_cb callback, void *user_data) { - /* Check if the handle of the Place is valid */ - if (!place) + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; + if (!place || !callback) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if this API feature available */ if (!__is_supported(place, MAPS_PLACE_EDITORIALS)) return MAPS_ERROR_NOT_SUPPORTED; - - /* Check if parameters are valid */ - if (!callback) - return MAPS_ERROR_INVALID_PARAMETER; - return maps_item_list_foreach(((maps_place_s *) place)->editorials, maps_place_editorial_clone, callback, user_data); } @@ -476,18 +459,12 @@ EXPORT_API int maps_place_foreach_image(const maps_place_h place, maps_place_images_cb callback, void *user_data) { - /* Check if the handle of the Place is valid */ - if (!place) + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; + if (!place || !callback) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if this API feature available */ if (!__is_supported(place, MAPS_PLACE_IMAGE)) return MAPS_ERROR_NOT_SUPPORTED; - - /* Check if parameters are valid */ - if (!callback) - return MAPS_ERROR_INVALID_PARAMETER; - return maps_item_list_foreach(((maps_place_s *) place)->images, maps_place_image_clone, callback, user_data); } @@ -496,18 +473,12 @@ EXPORT_API int maps_place_foreach_review(const maps_place_h place, maps_place_reviews_cb callback, void *user_data) { - /* Check if the handle of the Place is valid */ - if (!place) + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; + if (!place || !callback) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if this API feature available */ if (!__is_supported(place, MAPS_PLACE_REVIEWS)) return MAPS_ERROR_NOT_SUPPORTED; - - /* Check if parameters are valid */ - if (!callback) - return MAPS_ERROR_INVALID_PARAMETER; - return maps_item_list_foreach(((maps_place_s *) place)->reviews, maps_place_review_clone, callback, user_data); } @@ -515,18 +486,12 @@ EXPORT_API int maps_place_foreach_review(const maps_place_h place, EXPORT_API int maps_place_get_supplier_link(const maps_place_image_h place, maps_place_link_object_h *supplier) { - /* Check if the handle of the Place is valid */ - if (!place) + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; + if (!place || !supplier) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if this API feature available */ if (!__is_supported(place, MAPS_PLACE_SUPPLIER)) return MAPS_ERROR_NOT_SUPPORTED; - - /* Check if parameters are valid */ - if (!supplier) - return MAPS_ERROR_INVALID_PARAMETER; - return maps_place_link_object_clone(((maps_place_s *) place)->supplier, supplier); } @@ -534,18 +499,12 @@ EXPORT_API int maps_place_get_supplier_link(const maps_place_image_h place, EXPORT_API int maps_place_get_related_link(const maps_place_image_h place, maps_place_link_object_h *related) { - /* Check if the handle of the Place is valid */ - if (!place) + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; + if (!place || !related) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if this API feature available */ if (!__is_supported(place, MAPS_PLACE_RELATED)) return MAPS_ERROR_NOT_SUPPORTED; - - /* Check if parameters are valid */ - if (!related) - return MAPS_ERROR_INVALID_PARAMETER; - return maps_place_link_object_clone(((maps_place_s *) place)->related, related); } @@ -553,6 +512,8 @@ EXPORT_API int maps_place_get_related_link(const maps_place_image_h place, int _maps_place_is_data_supported(const maps_place_h place, maps_service_data_e data, bool *supported) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !supported) return MAPS_ERROR_INVALID_PARAMETER; @@ -572,6 +533,8 @@ int _maps_place_is_data_supported(const maps_place_h place, EXPORT_API int maps_place_set_id(maps_place_h place, const char *id) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !id) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(id, _MAPS_PLACE_ID_MAX_LENGTH, @@ -580,6 +543,8 @@ EXPORT_API int maps_place_set_id(maps_place_h place, const char *id) EXPORT_API int maps_place_set_name(maps_place_h place, const char *name) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !name) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(name, _MAPS_PLACE_NAME_MAX_LENGTH, @@ -588,6 +553,8 @@ EXPORT_API int maps_place_set_name(maps_place_h place, const char *name) EXPORT_API int maps_place_set_uri(maps_place_h place, const char *uri) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !uri) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(uri, _MAPS_PLACE_URI_MAX_LENGTH, @@ -596,6 +563,8 @@ EXPORT_API int maps_place_set_uri(maps_place_h place, const char *uri) EXPORT_API int maps_place_set_location(maps_place_h place, const maps_coordinates_h location) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !location) return MAPS_ERROR_INVALID_PARAMETER; maps_place_s *p = (maps_place_s *) place; @@ -606,7 +575,9 @@ EXPORT_API int maps_place_set_location(maps_place_h place, const maps_coordinate EXPORT_API int maps_place_set_distance(maps_place_h place, const int distance) { - if (!place) + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; + if (!place || distance < 0) return MAPS_ERROR_INVALID_PARAMETER; maps_place_s *p = (maps_place_s *) place; p->distance = distance; @@ -615,6 +586,8 @@ EXPORT_API int maps_place_set_distance(maps_place_h place, const int distance) EXPORT_API int maps_place_set_address(maps_place_h place, const maps_address_h address) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !address) return MAPS_ERROR_INVALID_PARAMETER; maps_place_s *p = (maps_place_s *) place; @@ -625,6 +598,8 @@ EXPORT_API int maps_place_set_address(maps_place_h place, const maps_address_h a EXPORT_API int maps_place_set_categories(maps_place_h place, const maps_item_list_h categories) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !categories) return MAPS_ERROR_INVALID_PARAMETER; maps_place_s *p = (maps_place_s *) place; @@ -637,6 +612,8 @@ EXPORT_API int maps_place_set_categories(maps_place_h place, const maps_item_lis EXPORT_API int maps_place_set_attributes(maps_place_h place, const maps_item_list_h attributes) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !attributes) return MAPS_ERROR_INVALID_PARAMETER; maps_place_s *p = (maps_place_s *) place; @@ -649,6 +626,8 @@ EXPORT_API int maps_place_set_attributes(maps_place_h place, const maps_item_lis EXPORT_API int maps_place_set_contacts(maps_place_h place, const maps_item_list_h contacts) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !contacts) return MAPS_ERROR_INVALID_PARAMETER; maps_place_s *p = (maps_place_s *) place; @@ -661,6 +640,8 @@ EXPORT_API int maps_place_set_contacts(maps_place_h place, const maps_item_list_ EXPORT_API int maps_place_set_editorials(maps_place_h place, const maps_item_list_h editorials) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !editorials) return MAPS_ERROR_INVALID_PARAMETER; maps_place_s *p = (maps_place_s *) place; @@ -673,6 +654,8 @@ EXPORT_API int maps_place_set_editorials(maps_place_h place, const maps_item_lis EXPORT_API int maps_place_set_images(maps_place_h place, const maps_item_list_h images) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !images) return MAPS_ERROR_INVALID_PARAMETER; maps_place_s *p = (maps_place_s *) place; @@ -685,6 +668,8 @@ EXPORT_API int maps_place_set_images(maps_place_h place, const maps_item_list_h EXPORT_API int maps_place_set_reviews(maps_place_h place, const maps_item_list_h reviews) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !reviews) return MAPS_ERROR_INVALID_PARAMETER; maps_place_s *p = (maps_place_s *) place; @@ -698,6 +683,8 @@ EXPORT_API int maps_place_set_reviews(maps_place_h place, const maps_item_list_h EXPORT_API int maps_place_set_properties(maps_place_h place, const maps_item_hashtable_h properties) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !properties) return MAPS_ERROR_INVALID_PARAMETER; maps_place_s *p = (maps_place_s *) place; @@ -708,6 +695,8 @@ EXPORT_API int maps_place_set_properties(maps_place_h place, EXPORT_API int maps_place_set_rating(maps_place_h place, const maps_place_rating_h rating) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !rating) return MAPS_ERROR_INVALID_PARAMETER; maps_place_s *p = (maps_place_s *) place; @@ -719,6 +708,8 @@ EXPORT_API int maps_place_set_rating(maps_place_h place, const maps_place_rating EXPORT_API int maps_place_set_supplier_link(maps_place_h place, const maps_place_link_object_h supplier) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !supplier) return MAPS_ERROR_INVALID_PARAMETER; maps_place_s *p = (maps_place_s *) place; @@ -730,6 +721,8 @@ EXPORT_API int maps_place_set_supplier_link(maps_place_h place, EXPORT_API int maps_place_set_related_link(maps_place_h place, const maps_place_link_object_h related) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !related) return MAPS_ERROR_INVALID_PARAMETER; maps_place_s *p = (maps_place_s *) place; @@ -741,6 +734,8 @@ EXPORT_API int maps_place_set_related_link(maps_place_h place, int _maps_place_set_supported_data(maps_place_h place, const maps_int_hashtable_h supported_data) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !supported_data) return MAPS_ERROR_INVALID_PARAMETER; maps_place_s *p = (maps_place_s *) place; @@ -752,30 +747,31 @@ int _maps_place_set_supported_data(maps_place_h place, EXPORT_API int maps_place_list_foreach(const maps_place_list_h place_list, maps_place_cb callback, void *user_data) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place_list || !callback) return MAPS_ERROR_INVALID_PARAMETER; - return maps_item_list_foreach_noclone((maps_item_list_h) place_list, callback, user_data); } EXPORT_API int maps_place_list_create(maps_place_list_h *place_list) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place_list) return MAPS_ERROR_INVALID_PARAMETER; - return maps_item_list_create(place_list); } EXPORT_API int maps_place_list_destroy(maps_place_list_h place_list) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place_list) return MAPS_ERROR_INVALID_PARAMETER; - int error = MAPS_ERROR_NONE; - - error = maps_item_list_remove_all(place_list, maps_place_destroy); + int error = maps_item_list_remove_all(place_list, maps_place_destroy); if (error != MAPS_ERROR_NONE) return error; - return maps_item_list_destroy(place_list); -} \ No newline at end of file +} diff --git a/src/api/maps_place_attribute.cpp b/src/api/maps_place_attribute.cpp index bbf8c77..9cf8db8 100644 --- a/src/api/maps_place_attribute.cpp +++ b/src/api/maps_place_attribute.cpp @@ -13,10 +13,11 @@ * limitations under the License. */ +#include #include "maps_error.h" #include "maps_place_attribute_plugin.h" -#include #include "maps_util.h" +#include "maps_condition.h" typedef struct _maps_place_attribute_s { @@ -33,6 +34,8 @@ const gsize _MAPS_PLACE_ATTRIBUTE_TEXT_MAX_LENGTH = 512; EXPORT_API int maps_place_attribute_create(maps_place_attribute_h *place) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place) return MAPS_ERROR_INVALID_PARAMETER; *place = (maps_place_attribute_h) g_slice_new0(maps_place_attribute_s); @@ -47,6 +50,8 @@ EXPORT_API int maps_place_attribute_create(maps_place_attribute_h *place) EXPORT_API int maps_place_attribute_destroy(maps_place_attribute_h place) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place) return MAPS_ERROR_INVALID_PARAMETER; @@ -66,6 +71,8 @@ EXPORT_API int maps_place_attribute_destroy(maps_place_attribute_h place) EXPORT_API int maps_place_attribute_clone(const maps_place_attribute_h origin, maps_place_attribute_h *cloned) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!cloned || !origin) return MAPS_ERROR_INVALID_PARAMETER; @@ -108,6 +115,8 @@ EXPORT_API int maps_place_attribute_clone(const maps_place_attribute_h origin, EXPORT_API int maps_place_attribute_get_id(const maps_place_attribute_h place, char **id) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !id) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_place_attribute_s *) place)->id, @@ -116,6 +125,8 @@ EXPORT_API int maps_place_attribute_get_id(const maps_place_attribute_h place, c EXPORT_API int maps_place_attribute_get_text(const maps_place_attribute_h place, char **text) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !text) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_place_attribute_s *) place)->text, @@ -124,6 +135,8 @@ EXPORT_API int maps_place_attribute_get_text(const maps_place_attribute_h place, EXPORT_API int maps_place_attribute_get_label(const maps_place_attribute_h place, char **label) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !label) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_place_attribute_s *) place)->label, @@ -134,6 +147,8 @@ EXPORT_API int maps_place_attribute_get_label(const maps_place_attribute_h place EXPORT_API int maps_place_attribute_set_id(maps_place_attribute_h place, const char * id) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !id) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(id, _MAPS_PLACE_ATTRIBUTE_ID_MAX_LENGTH, @@ -142,6 +157,8 @@ EXPORT_API int maps_place_attribute_set_id(maps_place_attribute_h place, const c EXPORT_API int maps_place_attribute_set_label(maps_place_attribute_h place, const char *label) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !label) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(label, _MAPS_PLACE_ATTRIBUTE_LABEL_MAX_LENGTH, @@ -150,8 +167,10 @@ EXPORT_API int maps_place_attribute_set_label(maps_place_attribute_h place, cons EXPORT_API int maps_place_attribute_set_text(maps_place_attribute_h place, const char *text) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !text) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(text, _MAPS_PLACE_ATTRIBUTE_TEXT_MAX_LENGTH, &((maps_place_attribute_s *) place)->text); -} \ No newline at end of file +} diff --git a/src/api/maps_place_category.cpp b/src/api/maps_place_category.cpp index 1a2c5b3..eec9e77 100644 --- a/src/api/maps_place_category.cpp +++ b/src/api/maps_place_category.cpp @@ -13,11 +13,12 @@ * limitations under the License. */ +#include #include "maps_error.h" #include "maps_extra_types.h" -#include #include "maps_util.h" #include "maps_place_category.h" +#include "maps_condition.h" typedef struct _maps_place_category_s { @@ -34,6 +35,8 @@ const gsize _MAPS_PLACE_CATEGORY_URL_MAX_LENGTH = 128; EXPORT_API int maps_place_category_create(maps_place_category_h *place) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place) return MAPS_ERROR_INVALID_PARAMETER; *place = g_slice_new0(maps_place_category_s); @@ -48,6 +51,8 @@ EXPORT_API int maps_place_category_create(maps_place_category_h *place) EXPORT_API int maps_place_category_destroy(maps_place_category_h place) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place) return MAPS_ERROR_INVALID_PARAMETER; int error = MAPS_ERROR_NONE; @@ -68,6 +73,8 @@ EXPORT_API int maps_place_category_destroy(maps_place_category_h place) EXPORT_API int maps_place_category_clone(const maps_place_category_h origin, maps_place_category_h *cloned) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!cloned || !origin) return MAPS_ERROR_INVALID_PARAMETER; @@ -110,6 +117,8 @@ EXPORT_API int maps_place_category_clone(const maps_place_category_h origin, EXPORT_API int maps_place_category_get_name(const maps_place_category_h place, char **name) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !name) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_place_category_s *) place)->name, @@ -118,6 +127,8 @@ EXPORT_API int maps_place_category_get_name(const maps_place_category_h place, c EXPORT_API int maps_place_category_get_id(const maps_place_category_h place, char **id) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !id) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_place_category_s *) place)->id, @@ -126,6 +137,8 @@ EXPORT_API int maps_place_category_get_id(const maps_place_category_h place, cha EXPORT_API int maps_place_category_get_url(const maps_place_category_h place, char **url) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !url) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_place_category_s *) place)->url, @@ -136,6 +149,8 @@ EXPORT_API int maps_place_category_get_url(const maps_place_category_h place, ch EXPORT_API int maps_place_category_set_id(maps_place_category_h place, const char *id) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !id) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(id, _MAPS_PLACE_CATEGORY_ID_MAX_LENGTH, @@ -144,6 +159,8 @@ EXPORT_API int maps_place_category_set_id(maps_place_category_h place, const cha EXPORT_API int maps_place_category_set_name(maps_place_category_h place, const char *name) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !name) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(name, _MAPS_PLACE_CATEGORY_NAME_MAX_LENGTH, @@ -152,8 +169,10 @@ EXPORT_API int maps_place_category_set_name(maps_place_category_h place, const c EXPORT_API int maps_place_category_set_url(maps_place_category_h place, const char *url) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !url) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(url, _MAPS_PLACE_CATEGORY_URL_MAX_LENGTH, &((maps_place_category_s *) place)->url); -} \ No newline at end of file +} diff --git a/src/api/maps_place_contact.cpp b/src/api/maps_place_contact.cpp index aafab76..e9d55af 100644 --- a/src/api/maps_place_contact.cpp +++ b/src/api/maps_place_contact.cpp @@ -13,10 +13,11 @@ * limitations under the License. */ +#include #include "maps_error.h" #include "maps_place_contact_plugin.h" -#include #include "maps_util.h" +#include "maps_condition.h" typedef struct _maps_place_contact_s { @@ -33,10 +34,12 @@ const gsize _MAPS_PLACE_CONTACT_VALUE_MAX_LENGTH = 512; EXPORT_API int maps_place_contact_create(maps_place_contact_h *place) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place) return MAPS_ERROR_INVALID_PARAMETER; - *place = (maps_place_contact_h) g_slice_new0(maps_place_contact_s); + *place = (maps_place_contact_h) g_slice_new0(maps_place_contact_s); if (*place == NULL) { MAPS_LOGE("OUT_OF_MEMORY(0x%08x)", MAPS_ERROR_OUT_OF_MEMORY); return MAPS_ERROR_OUT_OF_MEMORY; @@ -47,6 +50,8 @@ EXPORT_API int maps_place_contact_create(maps_place_contact_h *place) EXPORT_API int maps_place_contact_destroy(maps_place_contact_h place) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place) return MAPS_ERROR_INVALID_PARAMETER; @@ -66,6 +71,8 @@ EXPORT_API int maps_place_contact_destroy(maps_place_contact_h place) EXPORT_API int maps_place_contact_clone(const maps_place_contact_h origin, maps_place_contact_h *cloned) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!cloned || !origin) return MAPS_ERROR_INVALID_PARAMETER; @@ -107,6 +114,8 @@ EXPORT_API int maps_place_contact_clone(const maps_place_contact_h origin, EXPORT_API int maps_place_contact_get_label(const maps_place_contact_h place, char **label) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !label) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_place_contact_s *) place)->label, @@ -115,6 +124,8 @@ EXPORT_API int maps_place_contact_get_label(const maps_place_contact_h place, ch EXPORT_API int maps_place_contact_get_type(const maps_place_contact_h place, char **type) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !type) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_place_contact_s *) place)->type, @@ -123,6 +134,8 @@ EXPORT_API int maps_place_contact_get_type(const maps_place_contact_h place, cha EXPORT_API int maps_place_contact_get_value(const maps_place_contact_h place, char **value) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !value) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_place_contact_s *) place)->value, @@ -133,6 +146,8 @@ EXPORT_API int maps_place_contact_get_value(const maps_place_contact_h place, ch EXPORT_API int maps_place_contact_set_label(maps_place_contact_h place, const char *label) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !label) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(label, _MAPS_PLACE_CONTACT_LABEL_MAX_LENGTH, @@ -141,6 +156,8 @@ EXPORT_API int maps_place_contact_set_label(maps_place_contact_h place, const ch EXPORT_API int maps_place_contact_set_type(maps_place_contact_h place, const char *type) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !type) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(type, _MAPS_PLACE_CONTACT_TYPE_MAX_LENGTH, @@ -149,8 +166,10 @@ EXPORT_API int maps_place_contact_set_type(maps_place_contact_h place, const cha EXPORT_API int maps_place_contact_set_value(maps_place_contact_h place, const char *value) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !value) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(value, _MAPS_PLACE_CONTACT_VALUE_MAX_LENGTH, &((maps_place_contact_s *) place)->value); -} \ No newline at end of file +} diff --git a/src/api/maps_place_editorial.cpp b/src/api/maps_place_editorial.cpp index 3dc74bb..d7777e9 100644 --- a/src/api/maps_place_editorial.cpp +++ b/src/api/maps_place_editorial.cpp @@ -13,11 +13,12 @@ * limitations under the License. */ +#include #include "maps_error.h" #include "maps_place_editorial_plugin.h" #include "maps_place_media_plugin.h" -#include #include "maps_util.h" +#include "maps_condition.h" typedef struct _maps_place_editorial_s { @@ -33,10 +34,12 @@ const gsize _MAPS_PLACE_EDITORIAL_LANGUAGE_MAX_LENGTH = 32; EXPORT_API int maps_place_editorial_create(maps_place_editorial_h *place) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place) return MAPS_ERROR_INVALID_PARAMETER; - *place = (maps_place_editorial_h) g_slice_new0(maps_place_editorial_s); + *place = (maps_place_editorial_h) g_slice_new0(maps_place_editorial_s); if (*place == NULL) { MAPS_LOGE("OUT_OF_MEMORY(0x%08x)", MAPS_ERROR_OUT_OF_MEMORY); return MAPS_ERROR_OUT_OF_MEMORY; @@ -47,6 +50,8 @@ EXPORT_API int maps_place_editorial_create(maps_place_editorial_h *place) EXPORT_API int maps_place_editorial_destroy(maps_place_editorial_h place) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place) return MAPS_ERROR_INVALID_PARAMETER; @@ -67,6 +72,8 @@ EXPORT_API int maps_place_editorial_destroy(maps_place_editorial_h place) EXPORT_API int maps_place_editorial_clone(const maps_place_editorial_h origin, maps_place_editorial_h *cloned) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!cloned || !origin) return MAPS_ERROR_INVALID_PARAMETER; @@ -111,6 +118,8 @@ EXPORT_API int maps_place_editorial_clone(const maps_place_editorial_h origin, EXPORT_API int maps_place_editorial_get_description(const maps_place_editorial_h place, char **description) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !description) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_place_editorial_s *) place)->description, @@ -120,6 +129,8 @@ EXPORT_API int maps_place_editorial_get_description(const maps_place_editorial_h EXPORT_API int maps_place_editorial_get_language(const maps_place_editorial_h place, char **language) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !language) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_place_editorial_s *) place)->language, @@ -129,6 +140,8 @@ EXPORT_API int maps_place_editorial_get_language(const maps_place_editorial_h pl EXPORT_API int maps_place_editorial_get_media(const maps_place_editorial_h place, maps_place_media_h *media) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !media) return MAPS_ERROR_INVALID_PARAMETER; return maps_place_media_clone(((maps_place_editorial_s *) place)->media, media); @@ -139,30 +152,34 @@ EXPORT_API int maps_place_editorial_get_media(const maps_place_editorial_h place EXPORT_API int maps_place_editorial_set_description(maps_place_editorial_h place, const char *description) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !description) return MAPS_ERROR_INVALID_PARAMETER; - return maps_set_string(description, - _MAPS_PLACE_EDITORIAL_DESCRIPTION_MAX_LENGTH, + return maps_set_string(description, _MAPS_PLACE_EDITORIAL_DESCRIPTION_MAX_LENGTH, &((maps_place_editorial_s *) place)->description); } EXPORT_API int maps_place_editorial_set_language(maps_place_editorial_h place, const char *language) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !language) return MAPS_ERROR_INVALID_PARAMETER; - return maps_set_string(language, - _MAPS_PLACE_EDITORIAL_LANGUAGE_MAX_LENGTH, + return maps_set_string(language, _MAPS_PLACE_EDITORIAL_LANGUAGE_MAX_LENGTH, &((maps_place_editorial_s *) place)->language); } EXPORT_API int maps_place_editorial_set_media(maps_place_editorial_h place, const maps_place_media_h media) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !media) return MAPS_ERROR_INVALID_PARAMETER; maps_place_editorial_s *e = (maps_place_editorial_s *) place; if (e->media) maps_place_media_destroy(e->media); return maps_place_media_clone(media, &e->media); -} \ No newline at end of file +} diff --git a/src/api/maps_place_filter.cpp b/src/api/maps_place_filter.cpp index c94e26c..6437088 100644 --- a/src/api/maps_place_filter.cpp +++ b/src/api/maps_place_filter.cpp @@ -14,11 +14,12 @@ * limitations under the License. */ +#include #include "maps_error.h" #include "maps_place_filter.h" #include "maps_extra_types.h" -#include #include "maps_util.h" +#include "maps_condition.h" typedef struct _maps_place_filter_s { @@ -29,10 +30,12 @@ typedef struct _maps_place_filter_s EXPORT_API int maps_place_filter_create(maps_place_filter_h *filter) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!filter) return MAPS_ERROR_INVALID_PARAMETER; - *filter = (maps_place_filter_h) g_slice_new0(maps_place_filter_s); + *filter = (maps_place_filter_h) g_slice_new0(maps_place_filter_s); if (*filter == NULL) { MAPS_LOGE("OUT_OF_MEMORY(0x%08x)", MAPS_ERROR_OUT_OF_MEMORY); return MAPS_ERROR_OUT_OF_MEMORY; @@ -46,6 +49,8 @@ EXPORT_API int maps_place_filter_create(maps_place_filter_h *filter) EXPORT_API int maps_place_filter_destroy(maps_place_filter_h filter) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!filter) return MAPS_ERROR_INVALID_PARAMETER; @@ -61,6 +66,8 @@ EXPORT_API int maps_place_filter_destroy(maps_place_filter_h filter) EXPORT_API int maps_place_filter_clone(const maps_place_filter_h origin, maps_place_filter_h *cloned) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!cloned || !origin) return MAPS_ERROR_INVALID_PARAMETER; @@ -96,6 +103,8 @@ EXPORT_API int maps_place_filter_clone(const maps_place_filter_h origin, EXPORT_API int maps_place_filter_get(const maps_place_filter_h filter, const char *key, char **value) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!filter) return MAPS_ERROR_INVALID_PARAMETER; return maps_item_hashtable_get_string(((maps_place_filter_s *) filter)-> @@ -106,6 +115,8 @@ EXPORT_API int maps_place_filter_foreach_property(const maps_place_filter_h filt maps_place_filter_properties_cb callback, void *user_data) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!filter || !callback) return MAPS_ERROR_INVALID_PARAMETER; return maps_item_hashtable_foreach(((maps_place_filter_s *) filter)-> @@ -115,6 +126,8 @@ EXPORT_API int maps_place_filter_foreach_property(const maps_place_filter_h filt EXPORT_API int maps_place_filter_get_keyword(const maps_place_filter_h filter, char **keyword) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!filter || !keyword) return MAPS_ERROR_INVALID_PARAMETER; return maps_item_hashtable_get_string(((maps_place_filter_s *) filter)-> @@ -124,6 +137,8 @@ EXPORT_API int maps_place_filter_get_keyword(const maps_place_filter_h filter, EXPORT_API int maps_place_filter_get_place_name(const maps_place_filter_h filter, char **place_name) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!filter || !place_name) return MAPS_ERROR_INVALID_PARAMETER; return maps_item_hashtable_get_string(((maps_place_filter_s *) filter)-> @@ -133,6 +148,8 @@ EXPORT_API int maps_place_filter_get_place_name(const maps_place_filter_h filter EXPORT_API int maps_place_filter_get_category(const maps_place_filter_h filter, maps_place_category_h *category) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!filter || !category) return MAPS_ERROR_INVALID_PARAMETER; return maps_item_hashtable_get(((maps_place_filter_s *) filter)->table, @@ -142,6 +159,8 @@ EXPORT_API int maps_place_filter_get_category(const maps_place_filter_h filter, EXPORT_API int maps_place_filter_get_place_address(const maps_place_filter_h filter, char **place_address) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!filter || !place_address) return MAPS_ERROR_INVALID_PARAMETER; return maps_item_hashtable_get_string(((maps_place_filter_s *) filter)-> @@ -153,6 +172,8 @@ EXPORT_API int maps_place_filter_get_place_address(const maps_place_filter_h fil EXPORT_API int maps_place_filter_set(maps_place_filter_h filter, const char *key, const char *value) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!filter) return MAPS_ERROR_INVALID_PARAMETER; return maps_item_hashtable_set_string(((maps_place_filter_s *) filter)-> @@ -162,6 +183,8 @@ EXPORT_API int maps_place_filter_set(maps_place_filter_h filter, EXPORT_API int maps_place_filter_set_keyword(maps_place_filter_h filter, const char *keyword) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!filter || !keyword) return MAPS_ERROR_INVALID_PARAMETER; return maps_item_hashtable_set_string(((maps_place_filter_s *) filter)-> @@ -171,6 +194,8 @@ EXPORT_API int maps_place_filter_set_keyword(maps_place_filter_h filter, EXPORT_API int maps_place_filter_set_place_name(maps_place_filter_h filter, const char *place_name) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!filter || !place_name) return MAPS_ERROR_INVALID_PARAMETER; return maps_item_hashtable_set_string(((maps_place_filter_s *) filter)-> @@ -180,6 +205,8 @@ EXPORT_API int maps_place_filter_set_place_name(maps_place_filter_h filter, EXPORT_API int maps_place_filter_set_category(maps_place_filter_h filter, const maps_place_category_h category) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!filter || !category) return MAPS_ERROR_INVALID_PARAMETER; return maps_item_hashtable_set(((maps_place_filter_s *) filter)->table, @@ -190,8 +217,10 @@ EXPORT_API int maps_place_filter_set_category(maps_place_filter_h filter, EXPORT_API int maps_place_filter_set_place_address(maps_place_filter_h filter, const char *place_address) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; 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); -} \ No newline at end of file +} diff --git a/src/api/maps_place_image.cpp b/src/api/maps_place_image.cpp index eb57bc8..af04b18 100644 --- a/src/api/maps_place_image.cpp +++ b/src/api/maps_place_image.cpp @@ -13,13 +13,13 @@ * limitations under the License. */ +#include #include "maps_error.h" #include "maps_place_image_plugin.h" -#include #include "maps_place_media_plugin.h" #include "maps_place_link_object_plugin.h" -#include #include "maps_util.h" +#include "maps_condition.h" typedef struct _maps_place_image_s { @@ -38,6 +38,8 @@ const gsize _MAPS_PLACE_IMAGE_URL_MAX_LENGTH = 128; EXPORT_API int maps_place_image_create(maps_place_image_h *place) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place) return MAPS_ERROR_INVALID_PARAMETER; *place = (maps_place_image_h) g_slice_new0(maps_place_image_s); @@ -52,6 +54,8 @@ EXPORT_API int maps_place_image_create(maps_place_image_h *place) EXPORT_API int maps_place_image_destroy(maps_place_image_h place) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place) return MAPS_ERROR_INVALID_PARAMETER; @@ -74,6 +78,8 @@ EXPORT_API int maps_place_image_destroy(maps_place_image_h place) EXPORT_API int maps_place_image_clone(const maps_place_image_h origin, maps_place_image_h *cloned) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!cloned || !origin) return MAPS_ERROR_INVALID_PARAMETER; @@ -112,8 +118,7 @@ EXPORT_API int maps_place_image_clone(const maps_place_image_h origin, } if (i->user) { - error = maps_place_image_set_user_link(*cloned, - i->user); + error = maps_place_image_set_user_link(*cloned, i->user); if (error != MAPS_ERROR_NONE) break; } @@ -130,6 +135,8 @@ EXPORT_API int maps_place_image_clone(const maps_place_image_h origin, EXPORT_API int maps_place_image_get_url(const maps_place_image_h place, char **url) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !url) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_place_image_s *) place)->url, @@ -138,6 +145,8 @@ EXPORT_API int maps_place_image_get_url(const maps_place_image_h place, char **u EXPORT_API int maps_place_image_get_id(const maps_place_image_h place, char **id) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !id) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_place_image_s *) place)->id, @@ -146,6 +155,8 @@ EXPORT_API int maps_place_image_get_id(const maps_place_image_h place, char **id EXPORT_API int maps_place_image_get_width(const maps_place_image_h place, int *width) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !width) return MAPS_ERROR_INVALID_PARAMETER; *width = ((maps_place_image_s *) place)->width; @@ -154,6 +165,8 @@ EXPORT_API int maps_place_image_get_width(const maps_place_image_h place, int *w EXPORT_API int maps_place_image_get_height(const maps_place_image_h place, int *height) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !height) return MAPS_ERROR_INVALID_PARAMETER; *height = ((maps_place_image_s *) place)->height; @@ -163,6 +176,8 @@ EXPORT_API int maps_place_image_get_height(const maps_place_image_h place, int * EXPORT_API int maps_place_image_get_user_link(const maps_place_image_h place, maps_place_link_object_h *user) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !user) return MAPS_ERROR_INVALID_PARAMETER; return maps_place_link_object_clone(((maps_place_image_s *) place)->user, user); @@ -171,6 +186,8 @@ EXPORT_API int maps_place_image_get_user_link(const maps_place_image_h place, EXPORT_API int maps_place_image_get_media(const maps_place_image_h place, maps_place_media_h *media) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !media) return MAPS_ERROR_INVALID_PARAMETER; return maps_place_media_clone(((maps_place_image_s *) place)->media, media); @@ -180,6 +197,8 @@ EXPORT_API int maps_place_image_get_media(const maps_place_image_h place, EXPORT_API int maps_place_image_set_id(maps_place_image_h place, const char *id) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !id) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(id, _MAPS_PLACE_IMAGE_ID_MAX_LENGTH, @@ -189,6 +208,8 @@ EXPORT_API int maps_place_image_set_id(maps_place_image_h place, const char *id) EXPORT_API int maps_place_image_set_url(maps_place_image_h place, const char *url) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !url) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(url, _MAPS_PLACE_IMAGE_URL_MAX_LENGTH, @@ -198,6 +219,8 @@ EXPORT_API int maps_place_image_set_url(maps_place_image_h place, EXPORT_API int maps_place_image_set_width(maps_place_image_h place, const int width) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || width < 0) return MAPS_ERROR_INVALID_PARAMETER; ((maps_place_image_s *) place)->width = width; @@ -207,6 +230,8 @@ EXPORT_API int maps_place_image_set_width(maps_place_image_h place, EXPORT_API int maps_place_image_set_height(maps_place_image_h place, const int height) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || height < 0) return MAPS_ERROR_INVALID_PARAMETER; ((maps_place_image_s *) place)->height = height; @@ -217,6 +242,8 @@ EXPORT_API int maps_place_image_set_user_link(maps_place_image_h place, const maps_place_link_object_h user) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !user) return MAPS_ERROR_INVALID_PARAMETER; maps_place_image_s *i = (maps_place_image_s *) place; @@ -228,10 +255,12 @@ EXPORT_API int maps_place_image_set_user_link(maps_place_image_h place, EXPORT_API int maps_place_image_set_media(maps_place_image_h place, const maps_place_media_h media) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !media) return MAPS_ERROR_INVALID_PARAMETER; maps_place_image_s *i = (maps_place_image_s *) place; if (i->media) maps_place_media_destroy(i->media); return maps_place_media_clone(media, &i->media); -} \ No newline at end of file +} diff --git a/src/api/maps_place_link_object.cpp b/src/api/maps_place_link_object.cpp index 2314512..6035863 100644 --- a/src/api/maps_place_link_object.cpp +++ b/src/api/maps_place_link_object.cpp @@ -13,10 +13,11 @@ * limitations under the License. */ +#include #include "maps_error.h" #include "maps_place_link_object_plugin.h" -#include #include "maps_util.h" +#include "maps_condition.h" typedef struct _maps_place_link_object_s { @@ -35,6 +36,8 @@ const gsize _MAPS_PLACE_LINK_OBJECT_STRING_MAX_LENGTH = 256; EXPORT_API int maps_place_link_object_create(maps_place_link_object_h *place) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place) return MAPS_ERROR_INVALID_PARAMETER; *place = (maps_place_link_object_h) @@ -50,6 +53,8 @@ EXPORT_API int maps_place_link_object_create(maps_place_link_object_h *place) EXPORT_API int maps_place_link_object_destroy(maps_place_link_object_h place) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place) return MAPS_ERROR_INVALID_PARAMETER; @@ -68,10 +73,11 @@ EXPORT_API int maps_place_link_object_destroy(maps_place_link_object_h place) return MAPS_ERROR_NONE; } -EXPORT_API int maps_place_link_object_clone(const maps_place_link_object_h - origin, maps_place_link_object_h * - cloned) +EXPORT_API int maps_place_link_object_clone(const maps_place_link_object_h origin, + maps_place_link_object_h *cloned) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!cloned || !origin) return MAPS_ERROR_INVALID_PARAMETER; @@ -91,22 +97,19 @@ EXPORT_API int maps_place_link_object_clone(const maps_place_link_object_h } if (lo->name) { - error = maps_place_link_object_set_name(*cloned, - lo->name); + error = maps_place_link_object_set_name(*cloned, lo->name); if (error != MAPS_ERROR_NONE) break; } if (lo->type) { - error = maps_place_link_object_set_type(*cloned, - lo->type); + error = maps_place_link_object_set_type(*cloned, lo->type); if (error != MAPS_ERROR_NONE) break; } if (lo->string) { - error = maps_place_link_object_set_string(*cloned, - lo->string); + error = maps_place_link_object_set_string(*cloned, lo->string); if (error != MAPS_ERROR_NONE) break; } @@ -124,6 +127,8 @@ EXPORT_API int maps_place_link_object_clone(const maps_place_link_object_h EXPORT_API int maps_place_link_object_get_string(const maps_place_link_object_h place, char **string) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !string) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_place_link_object_s *) place)->string, @@ -133,6 +138,8 @@ EXPORT_API int maps_place_link_object_get_string(const maps_place_link_object_h EXPORT_API int maps_place_link_object_get_type(const maps_place_link_object_h place, char **type) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !type) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_place_link_object_s *) place)->type, @@ -142,6 +149,8 @@ EXPORT_API int maps_place_link_object_get_type(const maps_place_link_object_h pl EXPORT_API int maps_place_link_object_get_id(const maps_place_link_object_h place, char **id) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !id) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_place_link_object_s *) place)->id, @@ -151,6 +160,8 @@ EXPORT_API int maps_place_link_object_get_id(const maps_place_link_object_h plac EXPORT_API int maps_place_link_object_get_name(const maps_place_link_object_h place, char **name) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !name) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_place_link_object_s *) place)->name, @@ -162,6 +173,8 @@ EXPORT_API int maps_place_link_object_get_name(const maps_place_link_object_h pl EXPORT_API int maps_place_link_object_set_id(maps_place_link_object_h place, const char *id) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !id) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(id, _MAPS_PLACE_LINK_OBJECT_ID_MAX_LENGTH, @@ -171,6 +184,8 @@ EXPORT_API int maps_place_link_object_set_id(maps_place_link_object_h place, EXPORT_API int maps_place_link_object_set_string(maps_place_link_object_h place, const char *string) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !string) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(string, @@ -181,6 +196,8 @@ EXPORT_API int maps_place_link_object_set_string(maps_place_link_object_h place, EXPORT_API int maps_place_link_object_set_type(maps_place_link_object_h place, const char *type) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !type) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(type, _MAPS_PLACE_LINK_OBJECT_TYPE_MAX_LENGTH, @@ -190,6 +207,8 @@ EXPORT_API int maps_place_link_object_set_type(maps_place_link_object_h place, EXPORT_API int maps_place_link_object_set_name(maps_place_link_object_h place, const char *name) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !name) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(name, _MAPS_PLACE_LINK_OBJECT_NAME_MAX_LENGTH, diff --git a/src/api/maps_place_media.cpp b/src/api/maps_place_media.cpp index b6d0cb6..61b3de2 100644 --- a/src/api/maps_place_media.cpp +++ b/src/api/maps_place_media.cpp @@ -13,11 +13,12 @@ * limitations under the License. */ +#include #include "maps_error.h" #include "maps_place_media_plugin.h" #include "maps_place_link_object_plugin.h" -#include #include "maps_util.h" +#include "maps_condition.h" typedef struct _maps_place_media_s { @@ -32,6 +33,8 @@ const gsize _MAPS_PLACE_MEDIA_ATTRIBUTION_MAX_LENGTH = 64; EXPORT_API int maps_place_media_create(maps_place_media_h *place) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place) return MAPS_ERROR_INVALID_PARAMETER; *place = (maps_place_media_h) g_slice_new0(maps_place_media_s); @@ -46,6 +49,8 @@ EXPORT_API int maps_place_media_create(maps_place_media_h *place) EXPORT_API int maps_place_media_destroy(maps_place_media_h place) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place) return MAPS_ERROR_INVALID_PARAMETER; @@ -65,6 +70,8 @@ EXPORT_API int maps_place_media_destroy(maps_place_media_h place) EXPORT_API int maps_place_media_clone(const maps_place_media_h origin, maps_place_media_h *cloned) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!cloned || !origin) return MAPS_ERROR_INVALID_PARAMETER; @@ -107,6 +114,8 @@ EXPORT_API int maps_place_media_clone(const maps_place_media_h origin, EXPORT_API int maps_place_media_get_attribution(const maps_place_media_h place, char **attribution) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !attribution) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_place_media_s *) place)->attribution, @@ -116,6 +125,8 @@ EXPORT_API int maps_place_media_get_attribution(const maps_place_media_h place, EXPORT_API int maps_place_media_get_supplier(const maps_place_media_h place, maps_place_link_object_h *supplier) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !supplier) return MAPS_ERROR_INVALID_PARAMETER; return maps_place_link_object_clone(((maps_place_media_s *) place)->supplier, supplier); @@ -124,6 +135,8 @@ EXPORT_API int maps_place_media_get_supplier(const maps_place_media_h place, EXPORT_API int maps_place_media_get_via(const maps_place_media_h place, maps_place_link_object_h * via) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !via) return MAPS_ERROR_INVALID_PARAMETER; return maps_place_link_object_clone(((maps_place_media_s *) place)->via, via); @@ -134,6 +147,8 @@ EXPORT_API int maps_place_media_get_via(const maps_place_media_h place, EXPORT_API int maps_place_media_set_attribution(maps_place_media_h place, const char *attribution) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !attribution) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(attribution, @@ -144,6 +159,8 @@ EXPORT_API int maps_place_media_set_attribution(maps_place_media_h place, EXPORT_API int maps_place_media_set_supplier(maps_place_media_h place, const maps_place_link_object_h supplier) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !supplier) return MAPS_ERROR_INVALID_PARAMETER; maps_place_media_s *m = (maps_place_media_s *) place; @@ -155,10 +172,12 @@ EXPORT_API int maps_place_media_set_supplier(maps_place_media_h place, EXPORT_API int maps_place_media_set_via(maps_place_media_h place, const maps_place_link_object_h via) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !via) return MAPS_ERROR_INVALID_PARAMETER; maps_place_media_s *m = (maps_place_media_s *) place; if (m->via) maps_place_link_object_destroy(m->via); return maps_place_link_object_clone(via, &m->via); -} \ No newline at end of file +} diff --git a/src/api/maps_place_rating.cpp b/src/api/maps_place_rating.cpp index 1deb89c..301b1fa 100644 --- a/src/api/maps_place_rating.cpp +++ b/src/api/maps_place_rating.cpp @@ -13,10 +13,11 @@ * limitations under the License. */ +#include #include "maps_error.h" #include "maps_place_rating_plugin.h" -#include #include "maps_util.h" +#include "maps_condition.h" typedef struct _maps_place_rating_s { @@ -28,6 +29,8 @@ typedef struct _maps_place_rating_s EXPORT_API int maps_place_rating_create(maps_place_rating_h *place) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place) return MAPS_ERROR_INVALID_PARAMETER; *place = (maps_place_rating_h) g_slice_new0(maps_place_rating_s); @@ -42,6 +45,8 @@ EXPORT_API int maps_place_rating_create(maps_place_rating_h *place) EXPORT_API int maps_place_rating_destroy(maps_place_rating_h place) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place) return MAPS_ERROR_INVALID_PARAMETER; g_slice_free(maps_place_rating_s, place); @@ -51,6 +56,8 @@ EXPORT_API int maps_place_rating_destroy(maps_place_rating_h place) EXPORT_API int maps_place_rating_clone(const maps_place_rating_h origin, maps_place_rating_h *cloned) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!cloned || !origin) return MAPS_ERROR_INVALID_PARAMETER; @@ -83,6 +90,8 @@ EXPORT_API int maps_place_rating_clone(const maps_place_rating_h origin, EXPORT_API int maps_place_rating_get_count(const maps_place_rating_h place, int *count) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !count) return MAPS_ERROR_INVALID_PARAMETER; *count = ((maps_place_rating_s *) place)->count; @@ -92,6 +101,8 @@ EXPORT_API int maps_place_rating_get_count(const maps_place_rating_h place, EXPORT_API int maps_place_rating_get_average(const maps_place_rating_h place, double *average) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !average) return MAPS_ERROR_INVALID_PARAMETER; *average = ((maps_place_rating_s *) place)->average; @@ -103,6 +114,8 @@ EXPORT_API int maps_place_rating_get_average(const maps_place_rating_h place, EXPORT_API int maps_place_rating_set_count(maps_place_rating_h place, const int count) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || (count < 0)) return MAPS_ERROR_INVALID_PARAMETER; ((maps_place_rating_s *) place)->count = count; @@ -112,8 +125,10 @@ EXPORT_API int maps_place_rating_set_count(maps_place_rating_h place, EXPORT_API int maps_place_rating_set_average(maps_place_rating_h place, const double average) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || (average < 0)) return MAPS_ERROR_INVALID_PARAMETER; ((maps_place_rating_s *) place)->average = average; return MAPS_ERROR_NONE; -} \ No newline at end of file +} diff --git a/src/api/maps_place_review.cpp b/src/api/maps_place_review.cpp index 208be21..7a6042f 100644 --- a/src/api/maps_place_review.cpp +++ b/src/api/maps_place_review.cpp @@ -13,12 +13,13 @@ * limitations under the License. */ +#include #include "maps_error.h" #include "maps_place_review_plugin.h" #include "maps_place_media_plugin.h" #include "maps_place_link_object_plugin.h" -#include #include "maps_util.h" +#include "maps_condition.h" typedef struct _maps_place_review_s { @@ -40,6 +41,8 @@ const gsize _MAPS_PLACE_REVIEW_LANGUAGE_MAX_LENGTH = 32; EXPORT_API int maps_place_review_create(maps_place_review_h *place) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place) return MAPS_ERROR_INVALID_PARAMETER; *place = (maps_place_review_h) g_slice_new0(maps_place_review_s); @@ -54,6 +57,8 @@ EXPORT_API int maps_place_review_create(maps_place_review_h *place) EXPORT_API int maps_place_review_destroy(maps_place_review_h place) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place) return MAPS_ERROR_INVALID_PARAMETER; @@ -80,6 +85,8 @@ EXPORT_API int maps_place_review_destroy(maps_place_review_h place) EXPORT_API int maps_place_review_clone(const maps_place_review_h origin, maps_place_review_h *cloned) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!cloned || !origin) return MAPS_ERROR_INVALID_PARAMETER; @@ -106,14 +113,12 @@ EXPORT_API int maps_place_review_clone(const maps_place_review_h origin, ((maps_place_review_s *) (*cloned))->rating = r->rating; if (r->description) { - error = maps_place_review_set_description(*cloned, - r->description); + error = maps_place_review_set_description(*cloned, r->description); if (error != MAPS_ERROR_NONE) break; } if (r->language) { - error = maps_place_review_set_language(*cloned, - r->language); + error = maps_place_review_set_language(*cloned, r->language); if (error != MAPS_ERROR_NONE) break; } @@ -123,8 +128,7 @@ EXPORT_API int maps_place_review_clone(const maps_place_review_h origin, break; } if (r->user) { - error = maps_place_review_set_user_link(*cloned, - r->user); + error = maps_place_review_set_user_link(*cloned, r->user); if (error != MAPS_ERROR_NONE) break; } @@ -142,6 +146,8 @@ EXPORT_API int maps_place_review_clone(const maps_place_review_h origin, EXPORT_API int maps_place_review_get_date(const maps_place_review_h place, char **date) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !date) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_place_review_s *) place)->date, @@ -151,6 +157,8 @@ EXPORT_API int maps_place_review_get_date(const maps_place_review_h place, EXPORT_API int maps_place_review_get_title(const maps_place_review_h place, char **title) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !title) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_place_review_s *) place)->title, @@ -160,6 +168,8 @@ EXPORT_API int maps_place_review_get_title(const maps_place_review_h place, EXPORT_API int maps_place_review_get_rating(const maps_place_review_h place, double *rating) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !rating) return MAPS_ERROR_INVALID_PARAMETER; *rating = ((maps_place_review_s *) place)->rating; @@ -169,6 +179,8 @@ EXPORT_API int maps_place_review_get_rating(const maps_place_review_h place, EXPORT_API int maps_place_review_get_description(const maps_place_review_h place, char **description) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !description) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_place_review_s *) place)->description, @@ -178,6 +190,8 @@ EXPORT_API int maps_place_review_get_description(const maps_place_review_h place EXPORT_API int maps_place_review_get_language(const maps_place_review_h place, char ** language) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !language) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_place_review_s *) place)->language, @@ -187,6 +201,8 @@ EXPORT_API int maps_place_review_get_language(const maps_place_review_h place, EXPORT_API int maps_place_review_get_media(const maps_place_review_h place, maps_place_media_h *media) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !media) return MAPS_ERROR_INVALID_PARAMETER; return maps_place_media_clone(((maps_place_review_s *) place)->media, @@ -196,6 +212,8 @@ EXPORT_API int maps_place_review_get_media(const maps_place_review_h place, EXPORT_API int maps_place_review_get_user_link(const maps_place_review_h place, maps_place_link_object_h *user) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !user) return MAPS_ERROR_INVALID_PARAMETER; return maps_place_link_object_clone(((maps_place_review_s *) place)->user, user); @@ -206,6 +224,8 @@ EXPORT_API int maps_place_review_get_user_link(const maps_place_review_h place, EXPORT_API int maps_place_review_set_date(maps_place_review_h place, const char *date) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !date) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(date, _MAPS_PLACE_REVIEW_DATE_MAX_LENGTH, @@ -215,6 +235,8 @@ EXPORT_API int maps_place_review_set_date(maps_place_review_h place, EXPORT_API int maps_place_review_set_title(maps_place_review_h place, const char *title) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !title) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(title, _MAPS_PLACE_REVIEW_TITLE_MAX_LENGTH, @@ -224,6 +246,8 @@ EXPORT_API int maps_place_review_set_title(maps_place_review_h place, EXPORT_API int maps_place_review_set_rating(maps_place_review_h place, const double rating) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place) return MAPS_ERROR_INVALID_PARAMETER; ((maps_place_review_s *) place)->rating = rating; @@ -233,6 +257,8 @@ EXPORT_API int maps_place_review_set_rating(maps_place_review_h place, EXPORT_API int maps_place_review_set_description(maps_place_review_h place, const char *description) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !description) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(description, @@ -243,6 +269,8 @@ EXPORT_API int maps_place_review_set_description(maps_place_review_h place, EXPORT_API int maps_place_review_set_language(maps_place_review_h place, const char *language) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !language) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(language, _MAPS_PLACE_REVIEW_LANGUAGE_MAX_LENGTH, @@ -252,6 +280,8 @@ EXPORT_API int maps_place_review_set_language(maps_place_review_h place, EXPORT_API int maps_place_review_set_media(maps_place_review_h place, const maps_place_media_h media) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !media) return MAPS_ERROR_INVALID_PARAMETER; maps_place_review_s *r = (maps_place_review_s *) place; @@ -263,10 +293,12 @@ EXPORT_API int maps_place_review_set_media(maps_place_review_h place, EXPORT_API int maps_place_review_set_user_link(maps_place_review_h place, const maps_place_link_object_h user) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !user) return MAPS_ERROR_INVALID_PARAMETER; maps_place_review_s *r = (maps_place_review_s *) place; if (r->user) maps_place_link_object_destroy(r->user); return maps_place_link_object_clone(user, &r->user); -} \ No newline at end of file +} diff --git a/src/api/maps_place_url.cpp b/src/api/maps_place_url.cpp index a54f00b..c96ca52 100644 --- a/src/api/maps_place_url.cpp +++ b/src/api/maps_place_url.cpp @@ -13,10 +13,11 @@ * limitations under the License. */ +#include #include "maps_error.h" #include "maps_place_url_plugin.h" -#include #include "maps_util.h" +#include "maps_condition.h" typedef struct _maps_place_url_s { @@ -31,10 +32,12 @@ const gsize _MAPS_PLACE_URL_DESC_MAX_LENGTH = 512; EXPORT_API int maps_place_url_create(maps_place_url_h *place) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place) return MAPS_ERROR_INVALID_PARAMETER; - *place = (maps_place_url_h) g_slice_new0(maps_place_url_s); + *place = (maps_place_url_h) g_slice_new0(maps_place_url_s); if (*place == NULL) { MAPS_LOGE("OUT_OF_MEMORY(0x%08x)", MAPS_ERROR_OUT_OF_MEMORY); return MAPS_ERROR_OUT_OF_MEMORY; @@ -45,6 +48,8 @@ EXPORT_API int maps_place_url_create(maps_place_url_h *place) EXPORT_API int maps_place_url_destroy(maps_place_url_h place) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place) return MAPS_ERROR_INVALID_PARAMETER; @@ -62,6 +67,8 @@ EXPORT_API int maps_place_url_destroy(maps_place_url_h place) EXPORT_API int maps_place_url_clone(const maps_place_url_h origin, maps_place_url_h *cloned) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!cloned || !origin) return MAPS_ERROR_INVALID_PARAMETER; @@ -98,6 +105,8 @@ EXPORT_API int maps_place_url_clone(const maps_place_url_h origin, EXPORT_API int maps_place_url_get_path(const maps_place_url_h place, char **path) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !path) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_place_url_s *) place)->path, @@ -106,6 +115,8 @@ EXPORT_API int maps_place_url_get_path(const maps_place_url_h place, char **path EXPORT_API int maps_place_url_get_description(const maps_place_url_h place, char **desc) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !desc) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_place_url_s *) place)->desc, @@ -116,6 +127,8 @@ EXPORT_API int maps_place_url_get_description(const maps_place_url_h place, char EXPORT_API int maps_place_url_set_path(maps_place_url_h place, const char *path) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !path) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(path, _MAPS_PLACE_URL_PATH_MAX_LENGTH, @@ -125,8 +138,10 @@ EXPORT_API int maps_place_url_set_path(maps_place_url_h place, const char *path) EXPORT_API int maps_place_url_set_description(maps_place_url_h place, const char *desc) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!place || !desc) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(desc, _MAPS_PLACE_URL_DESC_MAX_LENGTH, &((maps_place_url_s *) place)->desc); -} \ No newline at end of file +} diff --git a/src/api/maps_plugin_info.cpp b/src/api/maps_plugin_info.cpp index 69d7bea..f713c0d 100644 --- a/src/api/maps_plugin_info.cpp +++ b/src/api/maps_plugin_info.cpp @@ -13,10 +13,11 @@ * limitations under the License. */ +#include #include "maps_error.h" #include "maps_plugin_info.h" -#include #include "maps_util.h" +#include "maps_condition.h" typedef struct _maps_plugin_info_s { @@ -29,6 +30,8 @@ const gsize _MAPS_PLUGIN_INFO_NAME_MAX_LENGTH = 64; EXPORT_API int maps_plugin_info_create(maps_plugin_info_h *info) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!info) return MAPS_ERROR_INVALID_PARAMETER; *info = g_slice_new0(maps_plugin_info_s); @@ -43,6 +46,8 @@ EXPORT_API int maps_plugin_info_create(maps_plugin_info_h *info) EXPORT_API int maps_plugin_info_destroy(maps_plugin_info_h info) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!info) return MAPS_ERROR_INVALID_PARAMETER; int error = MAPS_ERROR_NONE; @@ -59,6 +64,8 @@ EXPORT_API int maps_plugin_info_destroy(maps_plugin_info_h info) EXPORT_API int maps_plugin_info_clone(const maps_plugin_info_h origin, maps_plugin_info_h *cloned) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!cloned || !origin) return MAPS_ERROR_INVALID_PARAMETER; @@ -90,6 +97,8 @@ EXPORT_API int maps_plugin_info_clone(const maps_plugin_info_h origin, EXPORT_API int maps_plugin_info_get_provider_name(const maps_plugin_info_h info, char **provider_name) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!info || !provider_name) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_plugin_info_s *) info)->provider_name, @@ -101,6 +110,8 @@ EXPORT_API int maps_plugin_info_get_provider_name(const maps_plugin_info_h info, EXPORT_API int maps_plugin_info_set_provider_name(maps_plugin_info_h info, const char *provider_name) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!info || !provider_name) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(provider_name, _MAPS_PLUGIN_INFO_NAME_MAX_LENGTH, diff --git a/src/api/maps_preference.cpp b/src/api/maps_preference.cpp index 674c473..6c953d9 100644 --- a/src/api/maps_preference.cpp +++ b/src/api/maps_preference.cpp @@ -14,11 +14,12 @@ * limitations under the License. */ +#include #include "maps_error.h" #include "maps_extra_types.h" #include "maps_util.h" #include "maps_preference.h" -#include +#include "maps_condition.h" const int _DEFAULT_ALTERNATIVES_SIZE = 2; @@ -90,6 +91,8 @@ static bool __maps_preference_properties_helper_cb(int index, int total, EXPORT_API int maps_preference_create(maps_preference_h *preference) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!preference) return MAPS_ERROR_INVALID_PARAMETER; @@ -98,19 +101,23 @@ EXPORT_API int maps_preference_create(maps_preference_h *preference) return error; do { - error = maps_item_hashtable_set_int(*preference, "MAPS_PREFERENCE_DISTANCE_UNIT", MAPS_DISTANCE_UNIT_M); + error = maps_item_hashtable_set_int(*preference, + "MAPS_PREFERENCE_DISTANCE_UNIT", MAPS_DISTANCE_UNIT_M); if (error != MAPS_ERROR_NONE) break; - error = maps_item_hashtable_set_string(*preference, "MAPS_PREFERENCE_LANGUAGE", "en-US"); + error = maps_item_hashtable_set_string(*preference, + "MAPS_PREFERENCE_LANGUAGE", "en-US"); if (error != MAPS_ERROR_NONE) break; - error = maps_item_hashtable_set_int(*preference, "MAPS_PREFERENCE_MAX_RESULTS", 25); + error = maps_item_hashtable_set_int(*preference, + "MAPS_PREFERENCE_MAX_RESULTS", 25); if (error != MAPS_ERROR_NONE) break; - error = maps_item_hashtable_set_int(*preference, "MAPS_PREFERENCE_ROUTE_ALTERNATIVES", 0); + error = maps_item_hashtable_set_int(*preference, + "MAPS_PREFERENCE_ROUTE_ALTERNATIVES", 0); if (error != MAPS_ERROR_NONE) break; @@ -123,6 +130,8 @@ EXPORT_API int maps_preference_create(maps_preference_h *preference) EXPORT_API int maps_preference_destroy(maps_preference_h preference) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!preference) return MAPS_ERROR_INVALID_PARAMETER; return maps_item_hashtable_destroy(preference); @@ -131,6 +140,8 @@ EXPORT_API int maps_preference_destroy(maps_preference_h preference) EXPORT_API int maps_preference_clone(const maps_preference_h origin, maps_preference_h *cloned) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!cloned || !origin) return MAPS_ERROR_INVALID_PARAMETER; return maps_item_hashtable_clone(origin, cloned); @@ -141,6 +152,8 @@ EXPORT_API int maps_preference_clone(const maps_preference_h origin, EXPORT_API int maps_preference_get_distance_unit(const maps_preference_h preference, maps_distance_unit_e *unit) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!preference || !unit) return MAPS_ERROR_INVALID_PARAMETER; return maps_item_hashtable_get_int(preference, @@ -150,6 +163,8 @@ EXPORT_API int maps_preference_get_distance_unit(const maps_preference_h prefere EXPORT_API int maps_preference_get_language(const maps_preference_h preference, char **language) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!preference || !language) return MAPS_ERROR_INVALID_PARAMETER; return maps_item_hashtable_get_string(preference, @@ -159,6 +174,8 @@ EXPORT_API int maps_preference_get_language(const maps_preference_h preference, EXPORT_API int maps_preference_get_max_results(const maps_preference_h preference, int *max_results) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!preference || !max_results) return MAPS_ERROR_INVALID_PARAMETER; return maps_item_hashtable_get_int(preference, @@ -168,6 +185,8 @@ EXPORT_API int maps_preference_get_max_results(const maps_preference_h preferenc EXPORT_API int maps_preference_get_country_code(const maps_preference_h preference, char **country_code) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!preference || !country_code) return MAPS_ERROR_INVALID_PARAMETER; return maps_item_hashtable_get_string(preference, @@ -177,6 +196,8 @@ EXPORT_API int maps_preference_get_country_code(const maps_preference_h preferen EXPORT_API int maps_preference_get_route_optimization(const maps_preference_h preference, maps_route_optimization_e *optimization) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!preference || !optimization) return MAPS_ERROR_INVALID_PARAMETER; return maps_item_hashtable_get_int(preference, @@ -186,6 +207,8 @@ EXPORT_API int maps_preference_get_route_optimization(const maps_preference_h pr EXPORT_API int maps_preference_get_route_transport_mode(const maps_preference_h preference, maps_route_transport_mode_e *transport_mode) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!preference || !transport_mode) return MAPS_ERROR_INVALID_PARAMETER; return maps_item_hashtable_get_int(preference, @@ -195,6 +218,8 @@ EXPORT_API int maps_preference_get_route_transport_mode(const maps_preference_h EXPORT_API int maps_preference_get_route_feature_weight(const maps_preference_h preference, maps_route_feature_weight_e *feature_weight) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!preference || !feature_weight) return MAPS_ERROR_INVALID_PARAMETER; return maps_item_hashtable_get_int(preference, @@ -204,6 +229,8 @@ EXPORT_API int maps_preference_get_route_feature_weight(const maps_preference_h EXPORT_API int maps_preference_get_route_feature(const maps_preference_h preference, maps_route_feature_e * feature) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!preference || !feature) return MAPS_ERROR_INVALID_PARAMETER; return maps_item_hashtable_get_int(preference, @@ -213,6 +240,8 @@ EXPORT_API int maps_preference_get_route_feature(const maps_preference_h prefere EXPORT_API int maps_preference_get_route_alternatives_enabled( const maps_preference_h preference, bool *enable) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!preference) return MAPS_ERROR_INVALID_PARAMETER; @@ -222,13 +251,14 @@ EXPORT_API int maps_preference_get_route_alternatives_enabled( return error; *enable = (alternatives == _DEFAULT_ALTERNATIVES_SIZE) ? true :false; - return MAPS_ERROR_NONE; } EXPORT_API int maps_preference_get(const maps_preference_h preference, const char *key, char **value) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!preference || !key || !value) return MAPS_ERROR_INVALID_PARAMETER; return maps_item_hashtable_get_string(preference, key, value); @@ -238,6 +268,8 @@ EXPORT_API int maps_preference_get(const maps_preference_h preference, EXPORT_API int maps_preference_foreach_property(const maps_preference_h preference, maps_preference_properties_cb callback, void *user_data) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!preference || !callback) return MAPS_ERROR_INVALID_PARAMETER; callback_data cd = { callback, user_data }; @@ -250,6 +282,8 @@ EXPORT_API int maps_preference_foreach_property(const maps_preference_h preferen EXPORT_API int maps_preference_set_distance_unit(maps_preference_h preference, const maps_distance_unit_e unit) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!preference) return MAPS_ERROR_INVALID_PARAMETER; if ((unit < MAPS_DISTANCE_UNIT_M) || (unit > MAPS_DISTANCE_UNIT_YD)) @@ -261,6 +295,8 @@ EXPORT_API int maps_preference_set_distance_unit(maps_preference_h preference, EXPORT_API int maps_preference_set_language(maps_preference_h preference, const char *language) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!preference || !language) return MAPS_ERROR_INVALID_PARAMETER; return maps_item_hashtable_set_string(preference, @@ -270,6 +306,8 @@ EXPORT_API int maps_preference_set_language(maps_preference_h preference, EXPORT_API int maps_preference_set_max_results(maps_preference_h preference, const int max_results) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!preference || max_results <= 0) return MAPS_ERROR_INVALID_PARAMETER; return maps_item_hashtable_set_int(preference, @@ -279,6 +317,8 @@ EXPORT_API int maps_preference_set_max_results(maps_preference_h preference, EXPORT_API int maps_preference_set_country_code(maps_preference_h preference, const char *country_code) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!preference || !country_code) return MAPS_ERROR_INVALID_PARAMETER; return maps_item_hashtable_set_string(preference, @@ -288,6 +328,8 @@ EXPORT_API int maps_preference_set_country_code(maps_preference_h preference, EXPORT_API int maps_preference_set_route_optimization(maps_preference_h preference, const maps_route_optimization_e optimization) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!preference) return MAPS_ERROR_INVALID_PARAMETER; if ((optimization < MAPS_ROUTE_TYPE_FASTEST) @@ -300,6 +342,8 @@ EXPORT_API int maps_preference_set_route_optimization(maps_preference_h preferen EXPORT_API int maps_preference_set_route_transport_mode(maps_preference_h preference, const maps_route_transport_mode_e transport_mode) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!preference) return MAPS_ERROR_INVALID_PARAMETER; if ((transport_mode < MAPS_ROUTE_TRANSPORT_MODE_CAR) @@ -312,6 +356,8 @@ EXPORT_API int maps_preference_set_route_transport_mode(maps_preference_h prefer EXPORT_API int maps_preference_set_route_feature_weight(maps_preference_h preference, const maps_route_feature_weight_e feature_weight) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!preference) return MAPS_ERROR_INVALID_PARAMETER; if ((feature_weight < MAPS_ROUTE_FEATURE_WEIGHT_NORMAL) @@ -324,6 +370,8 @@ EXPORT_API int maps_preference_set_route_feature_weight(maps_preference_h prefer EXPORT_API int maps_preference_set_route_feature(maps_preference_h preference, const maps_route_feature_e feature) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!preference) return MAPS_ERROR_INVALID_PARAMETER; if ((feature < MAPS_ROUTE_FEATURE_NO) @@ -336,6 +384,8 @@ EXPORT_API int maps_preference_set_route_feature(maps_preference_h preference, EXPORT_API int maps_preference_set_route_alternatives_enabled(maps_preference_h preference, bool enable) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!preference) return MAPS_ERROR_INVALID_PARAMETER; @@ -349,59 +399,9 @@ EXPORT_API int maps_preference_set_route_alternatives_enabled(maps_preference_h EXPORT_API int maps_preference_set_property(maps_preference_h preference, const char *key, const char *value) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!preference || !key || !value) return MAPS_ERROR_INVALID_PARAMETER; return maps_item_hashtable_set_string(preference, key, value); } - -/*----------------------------------------------------------------------------*/ - -#if 0 -EXPORT_API int maps_preference_append_route_feature(maps_preference_h - preference, maps_item_list_h feature_list, - maps_route_feature_weight_e feature) -{ - if (!preference || max_result_count <= 0) - return MAPS_ERROR_INVALID_PARAMETER; - - maps_item_list_s* list = (maps_item_list_s*) feature_list; - - if (!feature) { - maps_item_list_create(list); - } - - maps_item_list_append(list, feature); - maps_item_hashtable_s* p = (maps_item_hashtable_s*) preference; - - int ret; - ret = maps_item_hashtable_set(p, "MAPS_PREFERENCE_ROUTE_FEATURE", list); - - feature = list; - - return ret; -} - -EXPORT_API int maps_preference_remove_route_feature(maps_preference_h - preference, maps_item_list_h feature_list, - maps_route_feature_weight_e feature) -{ - if (!preference || !feature_list) - return MAPS_ERROR_INVALID_PARAMETER; - - maps_item_list_s* list = (maps_item_list_s*) feature_list; - - if (!feature) { - maps_item_list_create(list); - } - - maps_item_list_remove(list, feature); - maps_item_hashtable_s* p = (maps_item_hashtable_s*) preference; - - int ret; - ret = maps_item_hashtable_set(p, "MAPS_PREFERENCE_ROUTE_FEATURE", list); - - feature = list; - - return ret; -} -#endif diff --git a/src/api/maps_route.cpp b/src/api/maps_route.cpp index 7dd9fa4..7a9fc70 100644 --- a/src/api/maps_route.cpp +++ b/src/api/maps_route.cpp @@ -22,6 +22,7 @@ #include "maps_route_segment_plugin.h" #include "maps_route_private.h" #include "maps_route_segment_private.h" +#include "maps_condition.h" static bool __is_supported(const maps_route_h route, maps_service_data_e data) { @@ -70,6 +71,8 @@ const gsize _MAPS_ROUTE_ID_MAX_LENGTH = 32; EXPORT_API int maps_route_create(maps_route_h *route) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!route) return MAPS_ERROR_INVALID_PARAMETER; *route = (maps_route_h) g_slice_new0(maps_route_s); @@ -84,6 +87,8 @@ EXPORT_API int maps_route_create(maps_route_h *route) EXPORT_API int maps_route_destroy(maps_route_h route) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!route) return MAPS_ERROR_INVALID_PARAMETER; @@ -119,8 +124,10 @@ EXPORT_API int maps_route_destroy(maps_route_h route) } EXPORT_API int maps_route_clone(const maps_route_h origin, - maps_route_h *cloned) + maps_route_h *cloned) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!cloned || !origin) return MAPS_ERROR_INVALID_PARAMETER; @@ -209,6 +216,8 @@ EXPORT_API int maps_route_clone(const maps_route_h origin, EXPORT_API int maps_route_get_route_id(const maps_route_h route, char **route_id) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!route || !route_id) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_route_s *) route)->route_id, @@ -218,6 +227,8 @@ EXPORT_API int maps_route_get_route_id(const maps_route_h route, EXPORT_API int maps_route_get_origin(const maps_route_h route, maps_coordinates_h *origin) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!route || !origin) return MAPS_ERROR_INVALID_PARAMETER; maps_coordinates_clone(((maps_route_s *) route)->origin, origin); @@ -227,6 +238,8 @@ EXPORT_API int maps_route_get_origin(const maps_route_h route, EXPORT_API int maps_route_get_destination(const maps_route_h route, maps_coordinates_h *destination) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!route || !destination) return MAPS_ERROR_INVALID_PARAMETER; return maps_coordinates_clone(((maps_route_s *) route)->destination, @@ -236,6 +249,8 @@ EXPORT_API int maps_route_get_destination(const maps_route_h route, EXPORT_API int maps_route_get_bounding_box(const maps_route_h route, maps_area_h *bounding_box) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!route || !bounding_box) return MAPS_ERROR_INVALID_PARAMETER; return maps_area_clone(((maps_route_s *) route)->bounding_box, @@ -245,6 +260,8 @@ EXPORT_API int maps_route_get_bounding_box(const maps_route_h route, EXPORT_API int maps_route_get_transport_mode(const maps_route_h route, maps_route_transport_mode_e *transport_mode) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!route || !transport_mode) return MAPS_ERROR_INVALID_PARAMETER; *transport_mode = ((maps_route_s *) route)->transport_mode; @@ -254,6 +271,8 @@ EXPORT_API int maps_route_get_transport_mode(const maps_route_h route, EXPORT_API int maps_route_get_total_distance(const maps_route_h route, double *total_distance) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!route || !total_distance) return MAPS_ERROR_INVALID_PARAMETER; *total_distance = ((maps_route_s *) route)->total_distance; @@ -263,6 +282,8 @@ EXPORT_API int maps_route_get_total_distance(const maps_route_h route, EXPORT_API int maps_route_get_total_duration(const maps_route_h route, long *total_duration) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!route || !total_duration) return MAPS_ERROR_INVALID_PARAMETER; *total_duration = ((maps_route_s *) route)->total_duration; @@ -273,15 +294,12 @@ EXPORT_API int maps_route_foreach_path(const maps_route_h route, maps_route_path_cb callback, void *user_data) { - /* Check if the handle of the Route is valid */ + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!route) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if this API feature available */ if (!__is_supported(route, MAPS_ROUTE_PATH)) return MAPS_ERROR_NOT_SUPPORTED; - - /* Check if parameters are valid */ if (!callback) return MAPS_ERROR_INVALID_PARAMETER; @@ -293,16 +311,13 @@ EXPORT_API int maps_route_foreach_segment(const maps_route_h route, maps_route_segment_cb callback, void *user_data) { - /* Check if the handle of the Route is valid */ + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!route) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if this API feature available */ if (!__is_supported(route, MAPS_ROUTE_SEGMENTS_PATH) && !__is_supported(route, MAPS_ROUTE_SEGMENTS_MANEUVERS)) return MAPS_ERROR_NOT_SUPPORTED; - - /* Check if parameters are valid */ if (!callback) return MAPS_ERROR_INVALID_PARAMETER; @@ -314,6 +329,8 @@ EXPORT_API int maps_route_foreach_property(const maps_route_h route, maps_route_properties_cb callback, void *user_data) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!route || !callback) return MAPS_ERROR_INVALID_PARAMETER; return maps_item_hashtable_foreach(((maps_route_s *) route)->properties, @@ -323,6 +340,8 @@ EXPORT_API int maps_route_foreach_property(const maps_route_h route, EXPORT_API int maps_route_get_distance_unit(const maps_route_h route, maps_distance_unit_e *distance_unit) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!route || !distance_unit) return MAPS_ERROR_INVALID_PARAMETER; *distance_unit = ((maps_route_s *) route)->distance_unit; @@ -332,6 +351,8 @@ EXPORT_API int maps_route_get_distance_unit(const maps_route_h route, int _maps_route_is_data_supported(const maps_route_h route, maps_service_data_e data, bool *supported) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!route || !supported) return MAPS_ERROR_INVALID_PARAMETER; @@ -353,6 +374,8 @@ int _maps_route_is_data_supported(const maps_route_h route, EXPORT_API int maps_route_set_route_id(const maps_route_h route, const char *route_id) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!route || !route_id) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(route_id, _MAPS_ROUTE_ID_MAX_LENGTH, @@ -362,6 +385,8 @@ EXPORT_API int maps_route_set_route_id(const maps_route_h route, EXPORT_API int maps_route_set_origin(maps_route_h route, const maps_coordinates_h origin) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!route || !origin) return MAPS_ERROR_INVALID_PARAMETER; maps_route_s *p = (maps_route_s *) route; @@ -373,6 +398,8 @@ EXPORT_API int maps_route_set_origin(maps_route_h route, EXPORT_API int maps_route_set_destination(maps_route_h route, const maps_coordinates_h destination) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!route || !destination) return MAPS_ERROR_INVALID_PARAMETER; maps_route_s *p = (maps_route_s *) route; @@ -384,6 +411,8 @@ EXPORT_API int maps_route_set_destination(maps_route_h route, EXPORT_API int maps_route_set_bounding_box(maps_route_h route, const maps_area_h bounding_box) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!route || !bounding_box) return MAPS_ERROR_INVALID_PARAMETER; maps_route_s *p = (maps_route_s *) route; @@ -395,6 +424,8 @@ EXPORT_API int maps_route_set_bounding_box(maps_route_h route, EXPORT_API int maps_route_set_total_distance(maps_route_h route, const double total_distance) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!route || total_distance < 0) return MAPS_ERROR_INVALID_PARAMETER; ((maps_route_s *) route)->total_distance = total_distance; @@ -404,6 +435,8 @@ EXPORT_API int maps_route_set_total_distance(maps_route_h route, EXPORT_API int maps_route_set_total_duration(maps_route_h route, const long total_duration) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!route || total_duration < 0) return MAPS_ERROR_INVALID_PARAMETER; ((maps_route_s *) route)->total_duration = total_duration; @@ -413,6 +446,8 @@ EXPORT_API int maps_route_set_total_duration(maps_route_h route, EXPORT_API int maps_route_set_transport_mode(maps_route_h route, const maps_route_transport_mode_e transport_mode) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!route) return MAPS_ERROR_INVALID_PARAMETER; if ((transport_mode < MAPS_ROUTE_TRANSPORT_MODE_CAR) || @@ -425,6 +460,8 @@ EXPORT_API int maps_route_set_transport_mode(maps_route_h route, EXPORT_API int maps_route_set_path(maps_route_h route, const maps_item_list_h path) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!route || !path) return MAPS_ERROR_INVALID_PARAMETER; maps_route_s *p = (maps_route_s *) route; @@ -439,6 +476,8 @@ EXPORT_API int maps_route_set_path(maps_route_h route, EXPORT_API int maps_route_set_segments(maps_route_h route, const maps_item_list_h segments) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!route || !segments) return MAPS_ERROR_INVALID_PARAMETER; maps_route_s *p = (maps_route_s *) route; @@ -454,6 +493,8 @@ EXPORT_API int maps_route_set_segments(maps_route_h route, EXPORT_API int maps_route_set_properties(maps_route_h route, const maps_item_hashtable_h properties) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!route || !properties) return MAPS_ERROR_INVALID_PARAMETER; maps_route_s *p = (maps_route_s *) route; @@ -465,6 +506,8 @@ EXPORT_API int maps_route_set_properties(maps_route_h route, EXPORT_API int maps_route_set_distance_unit(maps_route_h route, const maps_distance_unit_e distance_unit) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!route) return MAPS_ERROR_INVALID_PARAMETER; if ((distance_unit < MAPS_DISTANCE_UNIT_M) || @@ -491,4 +534,4 @@ int _maps_route_set_supported_data(maps_route_h route, error = maps_item_list_foreach(p->segments, NULL, __maps_route_set_supported_data_foreach_cb, supported_data); return error; -} \ No newline at end of file +} diff --git a/src/api/maps_route_maneuver.cpp b/src/api/maps_route_maneuver.cpp index cde6cec..f8b19b9 100644 --- a/src/api/maps_route_maneuver.cpp +++ b/src/api/maps_route_maneuver.cpp @@ -19,6 +19,7 @@ #include "maps_route_maneuver_plugin.h" #include "maps_extra_types.h" #include "maps_util.h" +#include "maps_condition.h" typedef struct _maps_route_maneuver_s { @@ -40,6 +41,8 @@ const gsize _MAPS_ROUTE_MANEUVER_LOCALE_MAX_LENGTH = 32; EXPORT_API int maps_route_maneuver_create(maps_route_maneuver_h *maneuver) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!maneuver) return MAPS_ERROR_INVALID_PARAMETER; *maneuver = (maps_route_maneuver_h) g_slice_new0(maps_route_maneuver_s); @@ -54,6 +57,8 @@ EXPORT_API int maps_route_maneuver_create(maps_route_maneuver_h *maneuver) EXPORT_API int maps_route_maneuver_destroy(maps_route_maneuver_h maneuver) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!maneuver) return MAPS_ERROR_INVALID_PARAMETER; @@ -75,6 +80,8 @@ EXPORT_API int maps_route_maneuver_destroy(maps_route_maneuver_h maneuver) EXPORT_API int maps_route_maneuver_clone(const maps_route_maneuver_h origin, maps_route_maneuver_h *cloned) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!cloned || !origin) return MAPS_ERROR_INVALID_PARAMETER; @@ -141,6 +148,8 @@ EXPORT_API int maps_route_maneuver_clone(const maps_route_maneuver_h origin, EXPORT_API int maps_route_maneuver_get_direction_id(const maps_route_maneuver_h maneuver, maps_route_direction_e *direction_id) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!maneuver || !direction_id) return MAPS_ERROR_INVALID_PARAMETER; *direction_id = ((maps_route_maneuver_s *) maneuver)->direction_id; @@ -150,6 +159,8 @@ EXPORT_API int maps_route_maneuver_get_direction_id(const maps_route_maneuver_h EXPORT_API int maps_route_maneuver_get_turn_type(const maps_route_maneuver_h maneuver, maps_route_turn_type_e *turn_type) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!maneuver || !turn_type) return MAPS_ERROR_INVALID_PARAMETER; *turn_type = ((maps_route_maneuver_s *) maneuver)->turn_type; @@ -159,6 +170,8 @@ EXPORT_API int maps_route_maneuver_get_turn_type(const maps_route_maneuver_h man EXPORT_API int maps_route_maneuver_get_position(const maps_route_maneuver_h maneuver, maps_coordinates_h *position) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!maneuver || !position) return MAPS_ERROR_INVALID_PARAMETER; return maps_coordinates_clone(((maps_route_maneuver_s *) maneuver)-> @@ -168,6 +181,8 @@ EXPORT_API int maps_route_maneuver_get_position(const maps_route_maneuver_h mane EXPORT_API int maps_route_maneuver_get_road_name(const maps_route_maneuver_h maneuver, char ** road_name) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!maneuver || !road_name) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_route_maneuver_s *) maneuver)->road_name, @@ -177,17 +192,19 @@ EXPORT_API int maps_route_maneuver_get_road_name(const maps_route_maneuver_h man EXPORT_API int maps_route_maneuver_get_instruction_text(const maps_route_maneuver_h maneuver, char ** instruction_text) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!maneuver || !instruction_text) return MAPS_ERROR_INVALID_PARAMETER; - return maps_get_string(((maps_route_maneuver_s *) maneuver)-> - instruction_text, - _MAPS_ROUTE_MANEUVER_INSTRUCTION_TEXT_MAX_LENGTH, - instruction_text); + return maps_get_string(((maps_route_maneuver_s *) maneuver)->instruction_text, + _MAPS_ROUTE_MANEUVER_INSTRUCTION_TEXT_MAX_LENGTH, instruction_text); } EXPORT_API int maps_route_maneuver_get_locale(const maps_route_maneuver_h maneuver, char **locale) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!maneuver || !locale) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_route_maneuver_s *) maneuver)->locale, @@ -198,6 +215,8 @@ EXPORT_API int maps_route_maneuver_get_time_to_next_instruction(const maps_route_maneuver_h maneuver, int *time_to_next_instruction) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!maneuver || !time_to_next_instruction) return MAPS_ERROR_INVALID_PARAMETER; *time_to_next_instruction = @@ -209,11 +228,12 @@ EXPORT_API int maps_route_maneuver_get_distance_to_next_instruction(const maps_route_maneuver_h maneuver, double *distance_to_next_instruction) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!maneuver || !distance_to_next_instruction) return MAPS_ERROR_INVALID_PARAMETER; *distance_to_next_instruction = - ((maps_route_maneuver_s *) maneuver)-> - distance_to_next_instruction; + ((maps_route_maneuver_s *) maneuver)->distance_to_next_instruction; return MAPS_ERROR_NONE; } @@ -222,6 +242,8 @@ EXPORT_API int maps_route_maneuver_get_distance_to_next_instruction(const EXPORT_API int maps_route_maneuver_set_direction_id(maps_route_maneuver_h maneuver, const maps_route_direction_e direction_id) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!maneuver) return MAPS_ERROR_INVALID_PARAMETER; if ((direction_id < MAPS_ROUTE_DIRECTION_NONE) @@ -234,6 +256,8 @@ EXPORT_API int maps_route_maneuver_set_direction_id(maps_route_maneuver_h maneuv EXPORT_API int maps_route_maneuver_set_turn_type(maps_route_maneuver_h maneuver, const maps_route_turn_type_e turn_type) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!maneuver) return MAPS_ERROR_INVALID_PARAMETER; if ((turn_type < MAPS_ROUTE_TURN_TYPE_NONE) @@ -246,6 +270,8 @@ EXPORT_API int maps_route_maneuver_set_turn_type(maps_route_maneuver_h maneuver, EXPORT_API int maps_route_maneuver_set_position(maps_route_maneuver_h maneuver, const maps_coordinates_h position) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!maneuver || !position) return MAPS_ERROR_INVALID_PARAMETER; maps_route_maneuver_s *p = (maps_route_maneuver_s *) maneuver; @@ -257,6 +283,8 @@ EXPORT_API int maps_route_maneuver_set_position(maps_route_maneuver_h maneuver, EXPORT_API int maps_route_maneuver_set_road_name(maps_route_maneuver_h maneuver, const char *road_name) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!maneuver || !road_name) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(road_name, @@ -267,6 +295,8 @@ EXPORT_API int maps_route_maneuver_set_road_name(maps_route_maneuver_h maneuver, EXPORT_API int maps_route_maneuver_set_instruction_text(maps_route_maneuver_h maneuver, const char * instruction_text) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!maneuver || !instruction_text) return MAPS_ERROR_INVALID_PARAMETER; return maps_set_string(instruction_text, @@ -277,6 +307,8 @@ EXPORT_API int maps_route_maneuver_set_instruction_text(maps_route_maneuver_h ma EXPORT_API int maps_route_maneuver_set_locale(maps_route_maneuver_h maneuver, const char *locale) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!maneuver || !locale) return MAPS_ERROR_INVALID_PARAMETER; maps_route_maneuver_s *p = (maps_route_maneuver_s *) maneuver; @@ -287,6 +319,8 @@ EXPORT_API int maps_route_maneuver_set_time_to_next_instruction( maps_route_maneuver_h maneuver, const int time_to_next_instruction) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!maneuver || time_to_next_instruction < 0) return MAPS_ERROR_INVALID_PARAMETER; ((maps_route_maneuver_s *) maneuver)->time_to_next_instruction = @@ -298,6 +332,8 @@ EXPORT_API int maps_route_maneuver_set_distance_to_next_instruction( maps_route_maneuver_h maneuver, const double distance_to_next_instruction) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!maneuver || distance_to_next_instruction < 0) return MAPS_ERROR_INVALID_PARAMETER; ((maps_route_maneuver_s *) maneuver)->distance_to_next_instruction = diff --git a/src/api/maps_route_segment.cpp b/src/api/maps_route_segment.cpp index 184a723..ceaa889 100644 --- a/src/api/maps_route_segment.cpp +++ b/src/api/maps_route_segment.cpp @@ -21,6 +21,7 @@ #include "maps_extra_types.h" #include "maps_util.h" #include "maps_route_segment_private.h" +#include "maps_condition.h" static bool __is_supported(const maps_route_segment_h route_segment, maps_service_data_e data) @@ -51,6 +52,8 @@ typedef struct _maps_route_segment_s EXPORT_API int maps_route_segment_create(maps_route_segment_h *segment) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!segment) return MAPS_ERROR_INVALID_PARAMETER; *segment = (maps_route_segment_h) g_slice_new0(maps_route_segment_s); @@ -65,6 +68,8 @@ EXPORT_API int maps_route_segment_create(maps_route_segment_h *segment) EXPORT_API int maps_route_segment_destroy(maps_route_segment_h segment) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!segment) return MAPS_ERROR_INVALID_PARAMETER; @@ -81,8 +86,7 @@ EXPORT_API int maps_route_segment_destroy(maps_route_segment_h segment) maps_item_list_destroy(p->path); } if (p->maneuvers) { - maps_item_list_remove_all(p->maneuvers, - maps_route_maneuver_destroy); + maps_item_list_remove_all(p->maneuvers, maps_route_maneuver_destroy); maps_item_list_destroy(p->maneuvers); } @@ -96,6 +100,8 @@ EXPORT_API int maps_route_segment_destroy(maps_route_segment_h segment) EXPORT_API int maps_route_segment_clone(const maps_route_segment_h segment, maps_route_segment_h *cloned) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!cloned || !segment) return MAPS_ERROR_INVALID_PARAMETER; @@ -164,6 +170,8 @@ EXPORT_API int maps_route_segment_clone(const maps_route_segment_h segment, EXPORT_API int maps_route_segment_get_origin(const maps_route_segment_h segment, maps_coordinates_h *origin) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!segment || !origin) return MAPS_ERROR_INVALID_PARAMETER; return maps_coordinates_clone(((maps_route_segment_s *) segment)-> @@ -173,6 +181,8 @@ EXPORT_API int maps_route_segment_get_origin(const maps_route_segment_h segment, EXPORT_API int maps_route_segment_get_destination(const maps_route_segment_h segment, maps_coordinates_h *destination) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!segment || !destination) return MAPS_ERROR_INVALID_PARAMETER; return maps_coordinates_clone(((maps_route_segment_s *) segment)-> @@ -182,6 +192,8 @@ EXPORT_API int maps_route_segment_get_destination(const maps_route_segment_h seg EXPORT_API int maps_route_segment_get_bounding_box(const maps_route_segment_h segment, maps_area_h *bounding_box) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!segment || !bounding_box) return MAPS_ERROR_INVALID_PARAMETER; return maps_area_clone(((maps_route_segment_s *) segment)->bounding_box, @@ -191,6 +203,8 @@ EXPORT_API int maps_route_segment_get_bounding_box(const maps_route_segment_h se EXPORT_API int maps_route_segment_get_distance(const maps_route_segment_h segment, double *distance) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!segment || !distance) return MAPS_ERROR_INVALID_PARAMETER; *distance = ((maps_route_segment_s *) segment)->distance; @@ -200,6 +214,8 @@ EXPORT_API int maps_route_segment_get_distance(const maps_route_segment_h segmen EXPORT_API int maps_route_segment_get_duration(const maps_route_segment_h segment, long *duration) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!segment || !duration) return MAPS_ERROR_INVALID_PARAMETER; *duration = ((maps_route_segment_s *) segment)->duration; @@ -210,15 +226,12 @@ EXPORT_API int maps_route_segment_foreach_path(const maps_route_segment_h segmen maps_route_segment_path_cb callback, void *user_data) { - /* Check if the handle of the Segment is valid */ + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!segment) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if this API feature available */ if (!__is_supported(segment, MAPS_ROUTE_SEGMENTS_PATH)) return MAPS_ERROR_NOT_SUPPORTED; - - /* Check if parameters are valid */ if (!callback) return MAPS_ERROR_INVALID_PARAMETER; @@ -230,15 +243,12 @@ EXPORT_API int maps_route_segment_foreach_maneuver(const maps_route_segment_h se maps_route_segment_maneuver_cb callback, void *user_data) { - /* Check if the handle of the Segment is valid */ + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!segment) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if this API feature available */ if (!__is_supported(segment, MAPS_ROUTE_SEGMENTS_MANEUVERS)) return MAPS_ERROR_NOT_SUPPORTED; - - /* Check if parameters are valid */ if (!callback) return MAPS_ERROR_INVALID_PARAMETER; @@ -270,6 +280,8 @@ int _maps_route_segment_is_data_supported(const maps_route_segment_h segment, EXPORT_API int maps_route_segment_set_origin(maps_route_segment_h segment, const maps_coordinates_h origin) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!segment || !origin) return MAPS_ERROR_INVALID_PARAMETER; maps_route_segment_s *p = (maps_route_segment_s *) segment; @@ -281,6 +293,8 @@ EXPORT_API int maps_route_segment_set_origin(maps_route_segment_h segment, EXPORT_API int maps_route_segment_set_destination(maps_route_segment_h segment, const maps_coordinates_h destination) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!segment || !destination) return MAPS_ERROR_INVALID_PARAMETER; maps_route_segment_s *p = (maps_route_segment_s *) segment; @@ -292,6 +306,8 @@ EXPORT_API int maps_route_segment_set_destination(maps_route_segment_h segment, EXPORT_API int maps_route_segment_set_bounding_box(maps_route_segment_h segment, const maps_area_h bounding_box) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!segment || !bounding_box) return MAPS_ERROR_INVALID_PARAMETER; maps_route_segment_s *p = (maps_route_segment_s *) segment; @@ -303,6 +319,8 @@ EXPORT_API int maps_route_segment_set_bounding_box(maps_route_segment_h segment, EXPORT_API int maps_route_segment_set_distance(maps_route_segment_h segment, const double distance) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!segment || distance < 0) return MAPS_ERROR_INVALID_PARAMETER; ((maps_route_segment_s *) segment)->distance = distance; @@ -312,6 +330,8 @@ EXPORT_API int maps_route_segment_set_distance(maps_route_segment_h segment, EXPORT_API int maps_route_segment_set_duration(maps_route_segment_h segment, const long duration) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!segment || duration < 0) return MAPS_ERROR_INVALID_PARAMETER; ((maps_route_segment_s *) segment)->duration = duration; @@ -321,6 +341,8 @@ EXPORT_API int maps_route_segment_set_duration(maps_route_segment_h segment, EXPORT_API int maps_route_segment_set_path(maps_route_segment_h segment, const maps_item_list_h path) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!segment || !path) return MAPS_ERROR_INVALID_PARAMETER; maps_route_segment_s *s = (maps_route_segment_s *) segment; @@ -335,6 +357,8 @@ EXPORT_API int maps_route_segment_set_path(maps_route_segment_h segment, EXPORT_API int maps_route_segment_set_maneuvers(maps_route_segment_h segment, const maps_item_list_h maneuvers) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!segment || !maneuvers) return MAPS_ERROR_INVALID_PARAMETER; maps_route_segment_s *s = (maps_route_segment_s *) segment; @@ -351,10 +375,12 @@ EXPORT_API int maps_route_segment_set_maneuvers(maps_route_segment_h segment, int _maps_route_segment_set_supported_data(maps_route_segment_h segment, const maps_int_hashtable_h supported_data) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!segment || !supported_data) return MAPS_ERROR_INVALID_PARAMETER; maps_route_segment_s *p = (maps_route_segment_s *) segment; if (p->supported_data) maps_int_hashtable_destroy(p->supported_data); return maps_int_hashtable_clone(supported_data, &p->supported_data); -} \ No newline at end of file +} diff --git a/src/api/maps_service.cpp b/src/api/maps_service.cpp index 6d8207b..5a4efab 100644 --- a/src/api/maps_service.cpp +++ b/src/api/maps_service.cpp @@ -64,6 +64,8 @@ static bool __maps_provider_supported(maps_service_h maps, maps_service_e servic EXPORT_API int maps_service_foreach_provider(maps_service_provider_info_cb callback, void *user_data) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!callback) return MAPS_ERROR_INVALID_PARAMETER; @@ -86,11 +88,10 @@ EXPORT_API int maps_service_foreach_provider(maps_service_provider_info_cb callb EXPORT_API int maps_service_create(const char *maps_provider, maps_service_h *maps) { - /* Check if parameters are valid */ + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!maps || !maps_provider) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if privileges enough */ if (!maps_condition_check_privilege()) { MAPS_LOGD("ERROR: privilege is not included"); return MAPS_ERROR_PERMISSION_DENIED; @@ -148,11 +149,10 @@ EXPORT_API int maps_service_create(const char *maps_provider, maps_service_h *ma EXPORT_API int maps_service_destroy(maps_service_h maps) { - /* Check if parameters are valid */ + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!maps) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if privileges enough */ if (!maps_condition_check_privilege()) return MAPS_ERROR_PERMISSION_DENIED; @@ -169,8 +169,11 @@ EXPORT_API int maps_service_destroy(maps_service_h maps) EXPORT_API int maps_service_set_provider_key(maps_service_h maps, const char *provider_key) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!maps || !provider_key) return MAPS_ERROR_INVALID_PARAMETER; + const plugin::plugin_s *p = __extract_plugin(maps); if (!p) return MAPS_ERROR_INVALID_PARAMETER; @@ -180,8 +183,11 @@ EXPORT_API int maps_service_set_provider_key(maps_service_h maps, EXPORT_API int maps_service_get_provider_key(const maps_service_h maps, char **provider_key) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!maps || !provider_key) return MAPS_ERROR_INVALID_PARAMETER; + const plugin::plugin_s *p = __extract_plugin(maps); if (!p) return MAPS_ERROR_INVALID_PARAMETER; @@ -191,8 +197,11 @@ EXPORT_API int maps_service_get_provider_key(const maps_service_h maps, EXPORT_API int maps_service_set_preference(maps_service_h maps, maps_string_hashtable_h preference) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!maps || !preference) return MAPS_ERROR_INVALID_PARAMETER; + const plugin::plugin_s *p = __extract_plugin(maps); if (!p) return MAPS_ERROR_INVALID_PARAMETER; @@ -202,8 +211,11 @@ EXPORT_API int maps_service_set_preference(maps_service_h maps, EXPORT_API int maps_service_get_preference(maps_service_h maps, maps_string_hashtable_h *preference) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!maps || !preference) return MAPS_ERROR_INVALID_PARAMETER; + const plugin::plugin_s *p = __extract_plugin(maps); if (!p) return MAPS_ERROR_INVALID_PARAMETER; @@ -214,11 +226,14 @@ EXPORT_API int maps_service_provider_is_service_supported(const maps_service_h m maps_service_e service, bool *supported) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!maps || !supported) return MAPS_ERROR_INVALID_PARAMETER; if ((service < MAPS_SERVICE_GEOCODE) || (service > MAPS_SERVICE_SEARCH_PLACE_LIST)) return MAPS_ERROR_INVALID_PARAMETER; + const plugin::plugin_s *p = __extract_plugin(maps); if (!p) return MAPS_ERROR_NOT_SUPPORTED; @@ -229,6 +244,8 @@ EXPORT_API int maps_service_provider_is_data_supported(const maps_service_h maps maps_service_data_e data, bool *supported) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!maps || !supported) return MAPS_ERROR_INVALID_PARAMETER; if ((data < MAPS_PLACE_ADDRESS) @@ -253,7 +270,7 @@ EXPORT_API int maps_service_geocode(const maps_service_h maps, int *request_id) { /* Check if internet feature is supported */ - if (!maps_condition_check_feature()) + if (!maps_condition_check_maps_feature() || !maps_condition_check_internet_feature()) return MAPS_ERROR_NOT_SUPPORTED; /* Check if the handle of the Maps Service is valid */ @@ -288,7 +305,7 @@ EXPORT_API int maps_service_geocode_inside_area(const maps_service_h maps, void *user_data, int *request_id) { /* Check if internet feature is supported */ - if (!maps_condition_check_feature()) + if (!maps_condition_check_maps_feature() || !maps_condition_check_internet_feature()) return MAPS_ERROR_NOT_SUPPORTED; /* Check if the handle of the Maps Service is valid */ @@ -323,7 +340,7 @@ EXPORT_API int maps_service_geocode_by_structured_address(const maps_service_h m void *user_data, int *request_id) { /* Check if internet feature is supported */ - if (!maps_condition_check_feature()) + if (!maps_condition_check_maps_feature() || !maps_condition_check_internet_feature()) return MAPS_ERROR_NOT_SUPPORTED; /* Check if the handle of the Maps Service is valid */ @@ -359,7 +376,7 @@ EXPORT_API int maps_service_reverse_geocode(const maps_service_h maps, int *request_id) { /* Check if internet feature is supported */ - if (!maps_condition_check_feature()) + if (!maps_condition_check_maps_feature() || !maps_condition_check_internet_feature()) return MAPS_ERROR_NOT_SUPPORTED; /* Check if the handle of the Maps Service is valid */ @@ -403,7 +420,7 @@ EXPORT_API int maps_service_search_place(const maps_service_h maps, void *user_data, int *request_id) { /* Check if internet feature is supported */ - if (!maps_condition_check_feature()) + if (!maps_condition_check_maps_feature() || !maps_condition_check_internet_feature()) return MAPS_ERROR_NOT_SUPPORTED; /* Check if the handle of the Maps Service is valid */ @@ -439,7 +456,7 @@ EXPORT_API int maps_service_search_place_by_area(const maps_service_h maps, int *request_id) { /* Check if internet feature is supported */ - if (!maps_condition_check_feature()) + if (!maps_condition_check_maps_feature() || !maps_condition_check_internet_feature()) return MAPS_ERROR_NOT_SUPPORTED; /* Check if the handle of the Maps Service is valid */ @@ -477,7 +494,7 @@ EXPORT_API int maps_service_search_place_by_address(const maps_service_h maps, int *request_id) { /* Check if internet feature is supported */ - if (!maps_condition_check_feature()) + if (!maps_condition_check_maps_feature() || !maps_condition_check_internet_feature()) return MAPS_ERROR_NOT_SUPPORTED; /* Check if the handle of the Maps Service is valid */ @@ -513,7 +530,7 @@ EXPORT_API int maps_service_search_place_list(const maps_service_h maps, void *user_data, int *request_id) { /* Check if internet feature is supported */ - if (!maps_condition_check_feature()) + if (!maps_condition_check_maps_feature() || !maps_condition_check_internet_feature()) return MAPS_ERROR_NOT_SUPPORTED; if (!maps) @@ -541,7 +558,7 @@ EXPORT_API int maps_service_get_place_details(const maps_service_h maps, void *user_data, int *request_id) { /* Check if internet feature is supported */ - if (!maps_condition_check_feature()) + if (!maps_condition_check_maps_feature() || !maps_condition_check_internet_feature()) return MAPS_ERROR_NOT_SUPPORTED; if (!maps) @@ -576,7 +593,7 @@ EXPORT_API int maps_service_search_route(const maps_service_h maps, void *user_data, int *request_id) { /* Check if internet feature is supported */ - if (!maps_condition_check_feature()) + if (!maps_condition_check_maps_feature() || !maps_condition_check_internet_feature()) return MAPS_ERROR_NOT_SUPPORTED; /* Check if the handle of the Maps Service is valid */ @@ -612,7 +629,7 @@ EXPORT_API int maps_service_search_route_waypoints(const maps_service_h maps, int *request_id) { /* Check if internet feature is supported */ - if (!maps_condition_check_feature()) + if (!maps_condition_check_maps_feature() || !maps_condition_check_internet_feature()) return MAPS_ERROR_NOT_SUPPORTED; /* Check if the handle of the Maps Service is valid */ @@ -646,6 +663,9 @@ EXPORT_API int maps_service_search_route_waypoints(const maps_service_h maps, EXPORT_API int maps_service_cancel_request(const maps_service_h maps, int request_id) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; + /* Check if the handle of the Maps Service is valid */ if (!maps) return MAPS_ERROR_INVALID_PARAMETER; @@ -677,8 +697,7 @@ EXPORT_API int maps_service_multi_reverse_geocode(const maps_service_h maps, const maps_coordinates_list_h coordinates_list, const maps_preference_h preference, maps_service_multi_reverse_geocode_cb callback, void *user_data, int *request_id) { - /* Check if internet feature is supported */ - if (!maps_condition_check_feature()) + if (!maps_condition_check_maps_feature() || !maps_condition_check_internet_feature()) return MAPS_ERROR_NOT_SUPPORTED; if (!maps) diff --git a/src/api/maps_view.cpp b/src/api/maps_view.cpp index 6a8eeb3..c32286b 100644 --- a/src/api/maps_view.cpp +++ b/src/api/maps_view.cpp @@ -506,6 +506,8 @@ static void __maps_view_create_panel(maps_view_h view, Evas_Object *obj) /* Create the panel and link it to the instance of Maps Service */ EXPORT_API int maps_view_create(maps_service_h maps, Evas_Object *obj, maps_view_h *view) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!maps || !obj || !view) return MAPS_ERROR_INVALID_PARAMETER; if (!maps_condition_check_privilege()) @@ -624,11 +626,10 @@ EXPORT_API int maps_view_create(maps_service_h maps, Evas_Object *obj, maps_view /* Destroy the panel and unlink it from the instance of Maps Service */ EXPORT_API int maps_view_destroy(maps_view_h view) { - /* Check if parameters are valid */ + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!view) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if privileges enough */ if (!maps_condition_check_privilege()) return MAPS_ERROR_PERMISSION_DENIED; @@ -773,15 +774,10 @@ static int __maps_view_set_center(maps_view_h view, maps_coordinates_h coordinat EXPORT_API int maps_view_set_center(maps_view_h view, maps_coordinates_h coordinates) { - /* Check if internet feature is supported */ - if (!maps_condition_check_feature()) + if (!maps_condition_check_maps_feature() || !maps_condition_check_internet_feature()) return MAPS_ERROR_NOT_SUPPORTED; - - /* Check if parameters are valid */ if (!view || !coordinates) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if privileges enough */ if (!maps_condition_check_privilege()) return MAPS_ERROR_PERMISSION_DENIED; @@ -813,15 +809,10 @@ int _maps_view_move_center(maps_view_h view, const int delta_x, const int delta_ EXPORT_API int maps_view_set_scalebar_enabled(const maps_view_h view, bool enable) { - /* Check if internet feature is supported */ - if (!maps_condition_check_feature()) + if (!maps_condition_check_maps_feature() || !maps_condition_check_internet_feature()) return MAPS_ERROR_NOT_SUPPORTED; - - /* Check if parameters are valid */ if (!view) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if privileges enough */ if (!maps_condition_check_privilege()) return MAPS_ERROR_PERMISSION_DENIED; @@ -830,6 +821,8 @@ EXPORT_API int maps_view_set_scalebar_enabled(const maps_view_h view, bool enabl EXPORT_API int maps_view_get_scalebar_enabled(const maps_view_h view, bool *enabled) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!view || !enabled) return MAPS_ERROR_INVALID_PARAMETER; @@ -838,6 +831,8 @@ EXPORT_API int maps_view_get_scalebar_enabled(const maps_view_h view, bool *enab EXPORT_API int maps_view_get_center(const maps_view_h view, maps_coordinates_h *coordinates) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!view || !coordinates) return MAPS_ERROR_INVALID_PARAMETER; maps_view_s *v = (maps_view_s *) view; @@ -846,15 +841,10 @@ EXPORT_API int maps_view_get_center(const maps_view_h view, maps_coordinates_h * EXPORT_API int maps_view_set_zoom_level(maps_view_h view, int level) { - /* Check if internet feature is supported */ - if (!maps_condition_check_feature()) + if (!maps_condition_check_maps_feature() || !maps_condition_check_internet_feature()) return MAPS_ERROR_NOT_SUPPORTED; - - /* Check if parameters are valid */ if (!view) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if privileges enough */ if (!maps_condition_check_privilege()) return MAPS_ERROR_PERMISSION_DENIED; @@ -887,6 +877,8 @@ EXPORT_API int maps_view_set_zoom_level(maps_view_h view, int level) EXPORT_API int maps_view_get_zoom_level(const maps_view_h view, int *level) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!view || !level) return MAPS_ERROR_INVALID_PARAMETER; maps_view_s *v = (maps_view_s *) view; @@ -896,11 +888,10 @@ EXPORT_API int maps_view_get_zoom_level(const maps_view_h view, int *level) EXPORT_API int maps_view_set_min_zoom_level(maps_view_h view, int level) { - /* Check if parameters are valid */ + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!view) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if privileges enough */ if (!maps_condition_check_privilege()) return MAPS_ERROR_PERMISSION_DENIED; @@ -919,6 +910,8 @@ EXPORT_API int maps_view_set_min_zoom_level(maps_view_h view, int level) EXPORT_API int maps_view_get_min_zoom_level(const maps_view_h view, int *min_zoom_level) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!view || !min_zoom_level) return MAPS_ERROR_INVALID_PARAMETER; maps_view_s *v = (maps_view_s *) view; @@ -928,11 +921,10 @@ EXPORT_API int maps_view_get_min_zoom_level(const maps_view_h view, int *min_zoo EXPORT_API int maps_view_set_max_zoom_level(maps_view_h view, int level) { - /* Check if parameters are valid */ + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!view) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if privileges enough */ if (!maps_condition_check_privilege()) return MAPS_ERROR_PERMISSION_DENIED; @@ -951,6 +943,8 @@ EXPORT_API int maps_view_set_max_zoom_level(maps_view_h view, int level) EXPORT_API int maps_view_get_max_zoom_level(const maps_view_h view, int *max_zoom_level) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!view || !max_zoom_level) return MAPS_ERROR_INVALID_PARAMETER; maps_view_s *v = (maps_view_s *) view; @@ -1029,6 +1023,8 @@ int _maps_view_set_zoom_rotate(maps_view_h view, EXPORT_API int maps_view_set_zoom_factor(const maps_view_h view, const double factor) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!view) return MAPS_ERROR_INVALID_PARAMETER; @@ -1042,6 +1038,8 @@ EXPORT_API int maps_view_set_zoom_factor(const maps_view_h view, EXPORT_API int maps_view_get_zoom_factor(const maps_view_h view, double *factor) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!view || !factor) return MAPS_ERROR_INVALID_PARAMETER; maps_view_s *v = (maps_view_s *) view; @@ -1051,15 +1049,10 @@ EXPORT_API int maps_view_get_zoom_factor(const maps_view_h view, double *factor) EXPORT_API int maps_view_set_orientation(maps_view_h view, double angle) { - /* Check if internet feature is supported */ - if (!maps_condition_check_feature()) + if (!maps_condition_check_maps_feature() || !maps_condition_check_internet_feature()) return MAPS_ERROR_NOT_SUPPORTED; - - /* Check if parameters are valid */ if (!view) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if privileges enough */ if (!maps_condition_check_privilege()) return MAPS_ERROR_PERMISSION_DENIED; @@ -1073,6 +1066,8 @@ EXPORT_API int maps_view_set_orientation(maps_view_h view, double angle) EXPORT_API int maps_view_get_orientation(const maps_view_h view, double *angle) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!view || !angle) return MAPS_ERROR_INVALID_PARAMETER; maps_view_s *v = (maps_view_s *) view; @@ -1088,11 +1083,10 @@ EXPORT_API int maps_view_get_orientation(const maps_view_h view, double *angle) EXPORT_API int maps_view_screen_to_geolocation(maps_view_h view, int x, int y, maps_coordinates_h *coordinates) { - /* Check if parameters are valid */ + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!view || !coordinates) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if privileges enough */ if (!maps_condition_check_privilege()) return MAPS_ERROR_PERMISSION_DENIED; @@ -1106,11 +1100,10 @@ EXPORT_API int maps_view_screen_to_geolocation(maps_view_h view, EXPORT_API int maps_view_geolocation_to_screen(const maps_view_h view, const maps_coordinates_h coordinates, int *x, int *y) { - /* Check if parameters are valid */ + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!view || !coordinates || !x || !y) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if privileges enough */ if (!maps_condition_check_privilege()) return MAPS_ERROR_PERMISSION_DENIED; @@ -1130,18 +1123,12 @@ EXPORT_API int maps_view_geolocation_to_screen(const maps_view_h view, EXPORT_API int maps_view_set_type(maps_view_h view, maps_view_type_e type) { - /* Check if internet feature is supported */ - if (!maps_condition_check_feature()) + if (!maps_condition_check_maps_feature() || !maps_condition_check_internet_feature()) return MAPS_ERROR_NOT_SUPPORTED; - - /* Check if parameters are valid */ if (!view) return MAPS_ERROR_INVALID_PARAMETER; - if ((type < MAPS_VIEW_TYPE_NORMAL) || (type > MAPS_VIEW_TYPE_HYBRID)) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if privileges enough */ if (!maps_condition_check_privilege()) return MAPS_ERROR_PERMISSION_DENIED; @@ -1152,6 +1139,8 @@ EXPORT_API int maps_view_set_type(maps_view_h view, maps_view_type_e type) EXPORT_API int maps_view_get_type(const maps_view_h view, maps_view_type_e *type) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!view || !type) return MAPS_ERROR_INVALID_PARAMETER; maps_view_s *v = (maps_view_s *) view; @@ -1161,15 +1150,10 @@ EXPORT_API int maps_view_get_type(const maps_view_h view, maps_view_type_e *type EXPORT_API int maps_view_set_buildings_enabled(maps_view_h view, bool enabled) { - /* Check if internet feature is supported */ - if (!maps_condition_check_feature()) + if (!maps_condition_check_maps_feature() || !maps_condition_check_internet_feature()) return MAPS_ERROR_NOT_SUPPORTED; - - /* Check if parameters are valid */ if (!view) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if privileges enough */ if (!maps_condition_check_privilege()) return MAPS_ERROR_PERMISSION_DENIED; @@ -1180,6 +1164,8 @@ EXPORT_API int maps_view_set_buildings_enabled(maps_view_h view, bool enabled) EXPORT_API int maps_view_get_buildings_enabled(const maps_view_h view, bool *enabled) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!view || !enabled) return MAPS_ERROR_INVALID_PARAMETER; maps_view_s *v = (maps_view_s *) view; @@ -1189,15 +1175,10 @@ EXPORT_API int maps_view_get_buildings_enabled(const maps_view_h view, bool *ena EXPORT_API int maps_view_set_traffic_enabled(maps_view_h view, bool enabled) { - /* Check if internet feature is supported */ - if (!maps_condition_check_feature()) + if (!maps_condition_check_maps_feature() || !maps_condition_check_internet_feature()) return MAPS_ERROR_NOT_SUPPORTED; - - /* Check if parameters are valid */ if (!view) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if privileges enough */ if (!maps_condition_check_privilege()) return MAPS_ERROR_PERMISSION_DENIED; @@ -1208,6 +1189,8 @@ EXPORT_API int maps_view_set_traffic_enabled(maps_view_h view, bool enabled) EXPORT_API int maps_view_get_traffic_enabled(const maps_view_h view, bool *enabled) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!view || !enabled) return MAPS_ERROR_INVALID_PARAMETER; maps_view_s *v = (maps_view_s *) view; @@ -1217,15 +1200,10 @@ EXPORT_API int maps_view_get_traffic_enabled(const maps_view_h view, bool *enabl EXPORT_API int maps_view_set_public_transit_enabled(maps_view_h view, bool enabled) { - /* Check if internet feature is supported */ - if (!maps_condition_check_feature()) + if (!maps_condition_check_maps_feature() || !maps_condition_check_internet_feature()) return MAPS_ERROR_NOT_SUPPORTED; - - /* Check if parameters are valid */ if (!view) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if privileges enough */ if (!maps_condition_check_privilege()) return MAPS_ERROR_PERMISSION_DENIED; @@ -1236,6 +1214,8 @@ EXPORT_API int maps_view_set_public_transit_enabled(maps_view_h view, bool enabl EXPORT_API int maps_view_get_public_transit_enabled(const maps_view_h view, bool *enabled) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!view || !enabled) return MAPS_ERROR_INVALID_PARAMETER; maps_view_s *v = (maps_view_s *) view; @@ -1297,6 +1277,8 @@ int _maps_view_set_inertia_enabled(maps_view_h view, bool enabled) EXPORT_API int maps_view_get_inertia_enabled(maps_view_h view, bool *enabled) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!view || !enabled) return MAPS_ERROR_INVALID_PARAMETER; @@ -1307,15 +1289,10 @@ EXPORT_API int maps_view_get_inertia_enabled(maps_view_h view, bool *enabled) EXPORT_API int maps_view_set_language(maps_view_h view, const char *language) { - /* Check if internet feature is supported */ - if (!maps_condition_check_feature()) + if (!maps_condition_check_maps_feature() || !maps_condition_check_internet_feature()) return MAPS_ERROR_NOT_SUPPORTED; - - /* Check if parameters are valid */ if (!view || !language) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if privileges enough */ if (!maps_condition_check_privilege()) return MAPS_ERROR_PERMISSION_DENIED; @@ -1328,6 +1305,8 @@ EXPORT_API int maps_view_set_language(maps_view_h view, const char *language) EXPORT_API int maps_view_get_language(const maps_view_h view, char **language) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!view || !language) return MAPS_ERROR_INVALID_PARAMETER; return maps_get_string(((maps_view_s *) view)->language, @@ -1339,6 +1318,8 @@ EXPORT_API int maps_view_get_language(const maps_view_h view, char **language) EXPORT_API int maps_view_get_viewport(const maps_view_h view, Evas_Object **viewport) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!view || !viewport) return MAPS_ERROR_INVALID_PARAMETER; maps_view_s *v = (maps_view_s *) view; @@ -1366,15 +1347,10 @@ int _maps_view_get_clipper(const maps_view_h view, Evas_Object **clipper) EXPORT_API int maps_view_set_screen_location(maps_view_h view, int x, int y, int width, int height) { - /* Check if internet feature is supported */ - if (!maps_condition_check_feature()) + if (!maps_condition_check_maps_feature() || !maps_condition_check_internet_feature()) return MAPS_ERROR_NOT_SUPPORTED; - - /* Check if parameters are valid */ if (!view) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if privileges enough */ if (!maps_condition_check_privilege()) return MAPS_ERROR_PERMISSION_DENIED; @@ -1386,6 +1362,8 @@ EXPORT_API int maps_view_set_screen_location(maps_view_h view, int x, int y, int EXPORT_API int maps_view_get_screen_location(const maps_view_h view, int *x, int *y, int *width, int *height) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!view || (!x && !y && !width && !height)) return MAPS_ERROR_INVALID_PARAMETER; maps_view_s *v = (maps_view_s *) view; @@ -1395,7 +1373,7 @@ EXPORT_API int maps_view_get_screen_location(const maps_view_h view, int *x, int EXPORT_API int maps_view_move(maps_view_h view, int x, int y) { - if (!maps_condition_check_feature()) + if (!maps_condition_check_maps_feature() || !maps_condition_check_internet_feature()) return MAPS_ERROR_NOT_SUPPORTED; if (!view) return MAPS_ERROR_INVALID_PARAMETER; @@ -1408,15 +1386,10 @@ EXPORT_API int maps_view_move(maps_view_h view, int x, int y) EXPORT_API int maps_view_resize(maps_view_h view, int width, int height) { - /* Check if internet feature is supported */ - if (!maps_condition_check_feature()) + if (!maps_condition_check_maps_feature() || !maps_condition_check_internet_feature()) return MAPS_ERROR_NOT_SUPPORTED; - - /* Check if parameters are valid */ if (!view || (width <= 0) || (height <= 0)) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if privileges enough */ if (!maps_condition_check_privilege()) return MAPS_ERROR_PERMISSION_DENIED; @@ -1429,6 +1402,8 @@ EXPORT_API int maps_view_resize(maps_view_h view, int width, int height) EXPORT_API int maps_view_set_visibility(maps_view_h view, bool visible) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!view) return MAPS_ERROR_INVALID_PARAMETER; @@ -1442,6 +1417,8 @@ EXPORT_API int maps_view_set_visibility(maps_view_h view, bool visible) EXPORT_API int maps_view_get_visibility(const maps_view_h view, bool *visible) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!view || !visible) return MAPS_ERROR_INVALID_PARAMETER; @@ -1469,6 +1446,8 @@ int _maps_view_redraw(const maps_view_h view) EXPORT_API int maps_view_set_event_cb(maps_view_h view, maps_view_event_type_e type, maps_view_on_event_cb callback, void *user_data) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!view || !callback) return MAPS_ERROR_INVALID_PARAMETER; if ((type < MAPS_VIEW_EVENT_GESTURE) || (type > MAPS_VIEW_EVENT_READY)) @@ -1483,6 +1462,8 @@ EXPORT_API int maps_view_set_event_cb(maps_view_h view, maps_view_event_type_e t EXPORT_API int maps_view_unset_event_cb(maps_view_h view, maps_view_event_type_e type) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!view) return MAPS_ERROR_INVALID_PARAMETER; if ((type < MAPS_VIEW_EVENT_GESTURE) || (type > MAPS_VIEW_EVENT_READY)) @@ -1497,6 +1478,8 @@ EXPORT_API int maps_view_unset_event_cb(maps_view_h view, maps_view_event_type_e EXPORT_API int maps_view_set_gesture_enabled(maps_view_h view, maps_view_gesture_e gesture, bool enabled) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!view) return MAPS_ERROR_INVALID_PARAMETER; if ((gesture < MAPS_VIEW_GESTURE_NONE) || (gesture > MAPS_VIEW_GESTURE_LONG_PRESS)) @@ -1508,6 +1491,8 @@ EXPORT_API int maps_view_set_gesture_enabled(maps_view_h view, maps_view_gesture EXPORT_API int maps_view_get_gesture_enabled(const maps_view_h view, maps_view_gesture_e gesture, bool *enabled) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!view || !enabled) return MAPS_ERROR_INVALID_PARAMETER; if ((gesture < MAPS_VIEW_GESTURE_NONE) || (gesture > MAPS_VIEW_GESTURE_LONG_PRESS)) @@ -1522,11 +1507,10 @@ EXPORT_API int maps_view_get_gesture_enabled(const maps_view_h view, maps_view_g EXPORT_API int maps_view_add_object(maps_view_h view, maps_view_object_h object) { - /* Check if parameters are valid */ + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!view || !object) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if privileges enough */ if (!maps_condition_check_privilege()) return MAPS_ERROR_PERMISSION_DENIED; @@ -1561,11 +1545,10 @@ EXPORT_API int maps_view_add_object(maps_view_h view, maps_view_object_h object) EXPORT_API int maps_view_remove_object(maps_view_h view, maps_view_object_h object) { - /* Check if parameters are valid */ + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!view || !object) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if privileges enough */ if (!maps_condition_check_privilege()) return MAPS_ERROR_PERMISSION_DENIED; @@ -1590,11 +1573,10 @@ EXPORT_API int maps_view_remove_object(maps_view_h view, maps_view_object_h obje EXPORT_API int maps_view_remove_all_objects(maps_view_h view) { - /* Check if parameters are valid */ + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!view) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if privileges enough */ if (!maps_condition_check_privilege()) return MAPS_ERROR_PERMISSION_DENIED; @@ -1618,6 +1600,8 @@ EXPORT_API int maps_view_remove_all_objects(maps_view_h view) EXPORT_API int maps_view_foreach_object(maps_view_h view, maps_view_object_cb callback, void *user_data) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!view || !callback) return MAPS_ERROR_INVALID_PARAMETER; maps_view_s *v = (maps_view_s *)view; @@ -1835,25 +1819,24 @@ maps_view_object_h _maps_view_object_hit_test(maps_view_h view, int x, int y, ma EXPORT_API int maps_view_get_maps_plugin_view_handle(maps_view_h hView, void **maps_plugin_view_handle) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!hView || !maps_plugin_view_handle) return MAPS_ERROR_INVALID_PARAMETER; maps_view_s *v = (maps_view_s *)hView; - *maps_plugin_view_handle = v->maps_plugin_view_handle; - return MAPS_ERROR_NONE; } EXPORT_API int maps_view_set_maps_plugin_view_handle(maps_view_h hView, void *maps_plugin_view_handle) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!hView) return MAPS_ERROR_INVALID_PARAMETER; maps_view_s *v = (maps_view_s *)hView; - v->maps_plugin_view_handle = maps_plugin_view_handle; - return MAPS_ERROR_NONE; } - diff --git a/src/api/maps_view_event_data.cpp b/src/api/maps_view_event_data.cpp index 10ed3d0..5c1fda0 100644 --- a/src/api/maps_view_event_data.cpp +++ b/src/api/maps_view_event_data.cpp @@ -18,6 +18,7 @@ #include "maps_error.h" #include "maps_view_event_data.h" #include "maps_util.h" +#include "maps_condition.h" /* * This represents visual event object information @@ -102,21 +103,22 @@ int _maps_view_event_data_create(maps_view_event_data_h *event) EXPORT_API int maps_view_event_data_destroy(maps_view_event_data_h event) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!event) return MAPS_ERROR_INVALID_PARAMETER; maps_view_event_data_s *e = (maps_view_event_data_s *) event; - if (e->center) maps_coordinates_destroy(e->center); - g_slice_free(maps_view_event_data_s, e); - return MAPS_ERROR_NONE; } EXPORT_API int maps_view_event_data_clone(const maps_view_event_data_h origin, maps_view_event_data_h *cloned) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!origin || !cloned) return MAPS_ERROR_INVALID_PARAMETER; @@ -264,6 +266,8 @@ int _maps_view_event_data_set_object(maps_view_event_data_h event, maps_view_obj EXPORT_API int maps_view_event_data_get_type(const maps_view_event_data_h event, maps_view_event_type_e *event_type) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!event || !event_type) return MAPS_ERROR_INVALID_PARAMETER; maps_view_event_data_s *e = (maps_view_event_data_s *) event; @@ -273,6 +277,8 @@ EXPORT_API int maps_view_event_data_get_type(const maps_view_event_data_h event, EXPORT_API int maps_view_event_data_get_gesture_type(const maps_view_event_data_h event, maps_view_gesture_e *gesture_type) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!event || !gesture_type) return MAPS_ERROR_INVALID_PARAMETER; maps_view_event_data_s *e = (maps_view_event_data_s *) event; @@ -284,6 +290,8 @@ EXPORT_API int maps_view_event_data_get_gesture_type(const maps_view_event_data_ EXPORT_API int maps_view_event_data_get_action_type(const maps_view_event_data_h event, maps_view_action_e *action_type) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!event || !action_type) return MAPS_ERROR_INVALID_PARAMETER; maps_view_event_data_s *e = (maps_view_event_data_s *) event; @@ -295,6 +303,8 @@ EXPORT_API int maps_view_event_data_get_action_type(const maps_view_event_data_h EXPORT_API int maps_view_event_data_get_center(const maps_view_event_data_h event, maps_coordinates_h *center) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!event || !center) return MAPS_ERROR_INVALID_PARAMETER; maps_view_event_data_s *e = (maps_view_event_data_s *) event; @@ -307,6 +317,8 @@ EXPORT_API int maps_view_event_data_get_center(const maps_view_event_data_h even EXPORT_API int maps_view_event_data_get_delta(const maps_view_event_data_h event, int *delta_x, int *delta_y) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!event || !delta_x || !delta_y) return MAPS_ERROR_INVALID_PARAMETER; maps_view_event_data_s *e = (maps_view_event_data_s *) event; @@ -319,6 +331,8 @@ EXPORT_API int maps_view_event_data_get_delta(const maps_view_event_data_h event EXPORT_API int maps_view_event_data_get_position(const maps_view_event_data_h event, int *x, int* y) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!event || !x || !y) return MAPS_ERROR_INVALID_PARAMETER; maps_view_event_data_s *e = (maps_view_event_data_s *) event; @@ -331,6 +345,8 @@ EXPORT_API int maps_view_event_data_get_position(const maps_view_event_data_h ev EXPORT_API int maps_view_event_data_get_coordinates(const maps_view_event_data_h event, maps_coordinates_h *coordinates) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!event || !coordinates) return MAPS_ERROR_INVALID_PARAMETER; maps_view_event_data_s *e = (maps_view_event_data_s *) event; @@ -343,6 +359,8 @@ EXPORT_API int maps_view_event_data_get_coordinates(const maps_view_event_data_h EXPORT_API int maps_view_event_data_get_fingers(const maps_view_event_data_h event, int *fingers) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!event || !fingers) return MAPS_ERROR_INVALID_PARAMETER; maps_view_event_data_s *e = (maps_view_event_data_s *) event; @@ -354,6 +372,8 @@ EXPORT_API int maps_view_event_data_get_fingers(const maps_view_event_data_h eve EXPORT_API int maps_view_event_data_get_zoom_factor(const maps_view_event_data_h event, double *zoom_factor) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!event || !zoom_factor) return MAPS_ERROR_INVALID_PARAMETER; maps_view_event_data_s *e = (maps_view_event_data_s *) event; @@ -365,6 +385,8 @@ EXPORT_API int maps_view_event_data_get_zoom_factor(const maps_view_event_data_h EXPORT_API int maps_view_event_data_get_rotation_angle(const maps_view_event_data_h event, double *rotation_angle) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!event || !rotation_angle) return MAPS_ERROR_INVALID_PARAMETER; maps_view_event_data_s *e = (maps_view_event_data_s *) event; @@ -376,6 +398,8 @@ EXPORT_API int maps_view_event_data_get_rotation_angle(const maps_view_event_dat EXPORT_API int maps_view_event_data_get_object(const maps_view_event_data_h event, maps_view_object_h *object) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!event || !object) return MAPS_ERROR_INVALID_PARAMETER; maps_view_event_data_s *e = (maps_view_event_data_s *) event; diff --git a/src/api/maps_view_object.cpp b/src/api/maps_view_object.cpp index 6aafe45..b85eeb5 100644 --- a/src/api/maps_view_object.cpp +++ b/src/api/maps_view_object.cpp @@ -15,17 +15,18 @@ */ #include +#include #include "maps_view_object.h" #include "maps_view_object_plugin.h" #include "maps_error.h" #include "maps_util.h" #include "maps_view.h" #include "maps_extra_types.h" +#include "maps_condition.h" #include "marker_constructor.h" #include "polyline_constructor.h" #include "polygon_constructor.h" #include "overlay_constructor.h" -#include #ifndef M_PI #define M_PI 3.14159265358979323846 @@ -438,6 +439,8 @@ int _maps_view_object_set_view(maps_view_object_h object, maps_view_h view) EXPORT_API int maps_view_object_create_marker(maps_coordinates_h coordinates, const char *image_file_path, maps_view_marker_type_e type, maps_view_object_h *marker) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!coordinates || !marker) return MAPS_ERROR_INVALID_PARAMETER; if (type < MAPS_VIEW_MARKER_PIN || type > MAPS_VIEW_MARKER_STICKER) @@ -459,6 +462,8 @@ EXPORT_API int maps_view_object_create_polyline(maps_coordinates_list_h coordina unsigned char r, unsigned char g, unsigned char b, unsigned char a, int width, maps_view_object_h *polyline) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!coordinates || !polyline || width < 1 || width > 100) return MAPS_ERROR_INVALID_PARAMETER; @@ -477,6 +482,8 @@ EXPORT_API int maps_view_object_create_polyline(maps_coordinates_list_h coordina EXPORT_API int maps_view_object_create_polygon(maps_coordinates_list_h coordinates, unsigned char r, unsigned char g, unsigned char b, unsigned char a, maps_view_object_h *polygon) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!coordinates || !polygon) return MAPS_ERROR_INVALID_PARAMETER; @@ -495,6 +502,8 @@ EXPORT_API int maps_view_object_create_polygon(maps_coordinates_list_h coordinat EXPORT_API int maps_view_object_create_overlay(maps_coordinates_h coordinates, Evas_Object *object, maps_view_overlay_type_e type, maps_view_object_h *overlay) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!overlay || !coordinates) return MAPS_ERROR_INVALID_PARAMETER; if (type < MAPS_VIEW_OVERLAY_NORMAL || type > MAPS_VIEW_OVERLAY_BOX) @@ -517,6 +526,8 @@ EXPORT_API int maps_view_object_create_overlay(maps_coordinates_h coordinates, EXPORT_API int maps_view_object_destroy(maps_view_object_h object) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!object) return MAPS_ERROR_INVALID_PARAMETER; @@ -548,6 +559,8 @@ EXPORT_API int maps_view_object_destroy(maps_view_object_h object) EXPORT_API int maps_view_object_get_type(maps_view_object_h object, maps_view_object_type_e *type) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!object || !type) return MAPS_ERROR_INVALID_PARAMETER; *type = ((maps_view_object_s *)object)->type; @@ -561,6 +574,8 @@ EXPORT_API int maps_view_object_get_type(maps_view_object_h object, maps_view_ob EXPORT_API int maps_view_object_set_visible(maps_view_object_h object, bool visible) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!object) return MAPS_ERROR_INVALID_PARAMETER; maps_view_object_s *o = (maps_view_object_s *)object; @@ -574,6 +589,8 @@ EXPORT_API int maps_view_object_set_visible(maps_view_object_h object, bool visi EXPORT_API int maps_view_object_get_visible(const maps_view_object_h object, bool *visible) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!object || !visible) return MAPS_ERROR_INVALID_PARAMETER; maps_view_object_s *o = (maps_view_object_s *)object; @@ -590,6 +607,8 @@ EXPORT_API int maps_view_object_get_visible(const maps_view_object_h object, boo EXPORT_API int maps_view_object_polyline_set_polyline(maps_view_object_h polyline, maps_coordinates_list_h points) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!polyline || !points) return MAPS_ERROR_INVALID_PARAMETER; @@ -611,6 +630,8 @@ EXPORT_API int maps_view_object_polyline_set_polyline(maps_view_object_h polylin EXPORT_API int maps_view_object_polyline_foreach_point(maps_view_object_h polyline, maps_coordinates_cb callback, void *user_data) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!polyline || !callback) return MAPS_ERROR_INVALID_PARAMETER; @@ -626,6 +647,8 @@ EXPORT_API int maps_view_object_polyline_foreach_point(maps_view_object_h polyli EXPORT_API int maps_view_object_polyline_set_color(maps_view_object_h polyline, unsigned char r, unsigned char g, unsigned char b, unsigned char a) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!polyline) return MAPS_ERROR_INVALID_PARAMETER; @@ -649,6 +672,8 @@ EXPORT_API int maps_view_object_polyline_set_color(maps_view_object_h polyline, EXPORT_API int maps_view_object_polyline_get_color(const maps_view_object_h polyline, unsigned char *r, unsigned char *g, unsigned char *b, unsigned char *a) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!polyline || (!r && !g && !b && !a)) return MAPS_ERROR_INVALID_PARAMETER; @@ -672,6 +697,8 @@ EXPORT_API int maps_view_object_polyline_get_color(const maps_view_object_h poly EXPORT_API int maps_view_object_polyline_set_width(maps_view_object_h polyline, int width) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!polyline) return MAPS_ERROR_INVALID_PARAMETER; if (width < 0 || width > 100) @@ -693,6 +720,8 @@ EXPORT_API int maps_view_object_polyline_set_width(maps_view_object_h polyline, EXPORT_API int maps_view_object_polyline_get_width(const maps_view_object_h polyline, int *width) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!polyline || !width) return MAPS_ERROR_INVALID_PARAMETER; @@ -713,6 +742,8 @@ EXPORT_API int maps_view_object_polyline_get_width(const maps_view_object_h poly EXPORT_API int maps_view_object_polygon_set_polygon(maps_view_object_h polygon, maps_coordinates_list_h points) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!polygon || !points) return MAPS_ERROR_INVALID_PARAMETER; @@ -734,6 +765,8 @@ EXPORT_API int maps_view_object_polygon_set_polygon(maps_view_object_h polygon, EXPORT_API int maps_view_object_polygon_foreach_point(maps_view_object_h polygon, maps_coordinates_cb callback, void *user_data) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!polygon || !callback) return MAPS_ERROR_INVALID_PARAMETER; @@ -750,6 +783,8 @@ EXPORT_API int maps_view_object_polygon_foreach_point(maps_view_object_h polygon EXPORT_API int maps_view_object_polygon_set_fill_color(maps_view_object_h polygon, unsigned char r, unsigned char g, unsigned char b, unsigned char a) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!polygon) return MAPS_ERROR_INVALID_PARAMETER; @@ -773,6 +808,8 @@ EXPORT_API int maps_view_object_polygon_set_fill_color(maps_view_object_h polygo EXPORT_API int maps_view_object_polygon_get_fill_color(const maps_view_object_h polygon, unsigned char *r, unsigned char *g, unsigned char *b, unsigned char *a) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!polygon || (!r && !g && !b && !a)) return MAPS_ERROR_INVALID_PARAMETER; @@ -802,6 +839,8 @@ EXPORT_API int maps_view_object_polygon_get_fill_color(const maps_view_object_h EXPORT_API int maps_view_object_marker_set_coordinates(maps_view_object_h marker, maps_coordinates_h coordinates) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!marker || !coordinates) return MAPS_ERROR_INVALID_PARAMETER; maps_view_marker_data_s *m = __get_marker_data(marker); @@ -819,9 +858,9 @@ EXPORT_API int maps_view_object_marker_set_coordinates(maps_view_object_h marker EXPORT_API int maps_view_object_marker_resize(maps_view_object_h marker, int width, int height) { - if (!marker) - return MAPS_ERROR_INVALID_PARAMETER; - if (width < 0 || height < 0) + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; + if (!marker || width < 0 || height < 0) return MAPS_ERROR_INVALID_PARAMETER; maps_view_marker_data_s *m = __get_marker_data(marker); if (!m) @@ -837,6 +876,8 @@ EXPORT_API int maps_view_object_marker_resize(maps_view_object_h marker, int wid EXPORT_API int maps_view_object_marker_set_image_file(maps_view_object_h marker, const char *file_path) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!marker || !file_path) return MAPS_ERROR_INVALID_PARAMETER; maps_view_marker_data_s *m = __get_marker_data(marker); @@ -853,6 +894,8 @@ EXPORT_API int maps_view_object_marker_set_image_file(maps_view_object_h marker, EXPORT_API int maps_view_object_marker_get_image_file(const maps_view_object_h marker, char **file_path) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!marker || !file_path) return MAPS_ERROR_INVALID_PARAMETER; maps_view_marker_data_s *m = __get_marker_data(marker); @@ -863,6 +906,8 @@ EXPORT_API int maps_view_object_marker_get_image_file(const maps_view_object_h m EXPORT_API int maps_view_object_marker_get_coordinates(const maps_view_object_h marker, maps_coordinates_h *coordinates) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!marker || !coordinates) return MAPS_ERROR_INVALID_PARAMETER; maps_view_marker_data_s *m = __get_marker_data(marker); @@ -873,6 +918,8 @@ EXPORT_API int maps_view_object_marker_get_coordinates(const maps_view_object_h EXPORT_API int maps_view_object_marker_set_size(maps_view_object_h marker, int width, int height) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!marker) return MAPS_ERROR_INVALID_PARAMETER; maps_view_marker_data_s *m = __get_marker_data(marker); @@ -885,6 +932,8 @@ EXPORT_API int maps_view_object_marker_set_size(maps_view_object_h marker, int w EXPORT_API int maps_view_object_marker_get_size(const maps_view_object_h marker, int *width, int *height) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!marker || (!width && !height)) return MAPS_ERROR_INVALID_PARAMETER; maps_view_marker_data_s *m = __get_marker_data(marker); @@ -912,6 +961,8 @@ int _maps_view_object_marker_set_type(maps_view_object_h marker, maps_view_marke EXPORT_API int maps_view_object_marker_get_type(const maps_view_object_h marker, maps_view_marker_type_e *type) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!marker || !type) return MAPS_ERROR_INVALID_PARAMETER; maps_view_marker_data_s *m = __get_marker_data(marker); @@ -923,6 +974,8 @@ EXPORT_API int maps_view_object_marker_get_type(const maps_view_object_h marker, EXPORT_API int maps_view_object_marker_set_z_order(maps_view_object_h marker, int z_order) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!marker || (z_order > 100 || z_order < -100)) return MAPS_ERROR_INVALID_PARAMETER; maps_view_marker_data_s *m = __get_marker_data(marker); @@ -940,6 +993,8 @@ EXPORT_API int maps_view_object_marker_set_z_order(maps_view_object_h marker, in EXPORT_API int maps_view_object_marker_get_z_order(const maps_view_object_h marker, int *z_order) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!marker || !z_order) return MAPS_ERROR_INVALID_PARAMETER; maps_view_marker_data_s *m = __get_marker_data(marker); @@ -1062,6 +1117,8 @@ int _maps_view_object_overlay_set_bubble(maps_view_object_h overlay) EXPORT_API int maps_view_object_overlay_get_object(maps_view_object_h overlay, Evas_Object **object) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!overlay || !object) return MAPS_ERROR_INVALID_PARAMETER; maps_view_overlay_data_s *m = __get_overlay_data(overlay); @@ -1087,6 +1144,8 @@ int _maps_view_object_overlay_set_object(maps_view_object_h overlay, Evas_Object EXPORT_API int maps_view_object_overlay_set_coordinates(maps_view_object_h overlay, maps_coordinates_h coordinates) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!overlay || !coordinates) return MAPS_ERROR_INVALID_PARAMETER; maps_view_overlay_data_s *m = __get_overlay_data(overlay); @@ -1100,6 +1159,8 @@ EXPORT_API int maps_view_object_overlay_set_coordinates(maps_view_object_h overl EXPORT_API int maps_view_object_overlay_get_coordinates(const maps_view_object_h overlay, maps_coordinates_h *coordinates) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!overlay || !coordinates) return MAPS_ERROR_INVALID_PARAMETER; maps_view_overlay_data_s *m = __get_overlay_data(overlay); @@ -1110,6 +1171,8 @@ EXPORT_API int maps_view_object_overlay_get_coordinates(const maps_view_object_h EXPORT_API int maps_view_object_overlay_set_min_zoom_level(maps_view_object_h overlay, int zoom) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!overlay || zoom < 0) return MAPS_ERROR_INVALID_PARAMETER; maps_view_overlay_data_s *m = __get_overlay_data(overlay); @@ -1126,6 +1189,8 @@ EXPORT_API int maps_view_object_overlay_set_min_zoom_level(maps_view_object_h ov EXPORT_API int maps_view_object_overlay_get_max_zoom_level(const maps_view_object_h overlay, int *zoom) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!overlay || !zoom) return MAPS_ERROR_INVALID_PARAMETER; maps_view_overlay_data_s *m = __get_overlay_data(overlay); @@ -1137,6 +1202,8 @@ EXPORT_API int maps_view_object_overlay_get_max_zoom_level(const maps_view_objec EXPORT_API int maps_view_object_overlay_set_max_zoom_level(maps_view_object_h overlay, int zoom) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!overlay || zoom < 0) return MAPS_ERROR_INVALID_PARAMETER; maps_view_overlay_data_s *m = __get_overlay_data(overlay); @@ -1153,6 +1220,8 @@ EXPORT_API int maps_view_object_overlay_set_max_zoom_level(maps_view_object_h ov EXPORT_API int maps_view_object_overlay_get_min_zoom_level(const maps_view_object_h overlay, int *zoom) { + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!overlay || !zoom) return MAPS_ERROR_INVALID_PARAMETER; maps_view_overlay_data_s *m = __get_overlay_data(overlay); diff --git a/src/api/maps_view_snapshot.cpp b/src/api/maps_view_snapshot.cpp old mode 100755 new mode 100644 index 09cf269..1c8c3f3 --- a/src/api/maps_view_snapshot.cpp +++ b/src/api/maps_view_snapshot.cpp @@ -21,6 +21,7 @@ #include #include #include +#include "maps_condition.h" const plugin::interface_s *__get_plugin_interface(maps_view_h view); @@ -103,16 +104,15 @@ static image_util_colorspace_e __convert_colorspace(maps_view_colorspace_type_e } EXPORT_API int maps_view_capture_snapshot(maps_view_h view, - maps_view_snapshot_format_type_e type, - int quality, - const char *path) + maps_view_snapshot_format_type_e type, + int quality, + const char *path) { - /* Check if parameters are valid */ + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; if (!view || type < MAPS_VIEW_SNAPSHOT_BMP || type > MAPS_VIEW_SNAPSHOT_JPEG || quality < 0 || quality > 100 || !path || (path && *path == '\0')) return MAPS_ERROR_INVALID_PARAMETER; - - /* Check if privileges enough */ if (!maps_condition_check_privilege()) return MAPS_ERROR_PERMISSION_DENIED; diff --git a/src/maps_util.h b/src/maps_util.h old mode 100644 new mode 100755 index cade33a..81d951c --- a/src/maps_util.h +++ b/src/maps_util.h @@ -65,6 +65,9 @@ return code; \ } while (0) +#undef VERSION +#define VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c)) + /*----------------------------------------------------------------------------*/ #define _S(s) #s