enum ReplyType
{
RT_Discovery = 0, // Indicates a reply to a discovery query.
- RT_PlaceDetails // Indicates a reply to a request for place details.
+ RT_PlaceDetails, // Indicates a reply to a request for place details.
+#ifdef TIZEN_CUSTOMIZATION
+ RT_Categories // Indicates a reply to a request for categories.
+#endif
};
/**
* This method is the constructor.
--- /dev/null
+/*
+ * Copyright (C) 2013 HERE Global B.V. All rights reserved.
+ * This software, including documentation, is protected by copyright controlled by
+ * HERE Global B.V. (“Software”). All rights are reserved. Copying, including reproducing,
+ * storing, adapting or translating, any or all of this material requires the prior
+ * written consent of HERE Global B.V. You may use this
+ * Software in accordance with the terms and conditions defined in the
+ * HERE Location Platform Services Terms and Conditions, available at
+ * http://developer.here.com/terms-conditions-base
+ *
+ * As an additional permission to the above, you may distribute Software,
+ * in object code format as part of an Application, according to, and subject to, terms and
+ * conditions defined in the Tizen Software Development kit (“SDK”) License Agreement.
+ * You may distribute such object code format Application under terms of your choice,
+ * provided that the header and source files of the Software have not been modified.
+ */
+
+#ifndef CATEGORIES_QUERY_H_
+#define CATEGORIES_QUERY_H_
+
+#include "common/HereMaps_global.h"
+#include "common/BaseQuery.h"
+#include "finder/Category.h"
+#include "common/GeoBoundingArea.h"
+
+#ifdef TIZEN_CUSTOMIZATION
+HERE_MAPS_BEGIN_NAMESPACE
+
+class QueryListener;
+class GeoCoordinates;
+class FinderQueryListener;
+class FinderError;
+
+/**
+ * This class encapsulates a places discovery query.
+ *
+ * \ingroup finder
+ */
+class EXPORT_API CategoriesQuery : public BaseQuery
+{
+public:
+ /**
+ * This enumeration defines identifiers for the supported discovery query
+ * types.
+ */
+ enum QueryType
+ {
+ QT_PLACES = 0, ///< Indicates a query that searches for places.
+ QT_CUISINES, ///< Indicates a query that searches for cuisines.
+ };
+
+ /**
+ * This enumeration defines identifiers for the supported discovery query
+ * result types.
+ */
+ /*
+ * The identifiers are not valid for search QueryTypes.
+ */
+ enum ResultTypes
+ {
+ SIT_CATEGORY = 0, ///< Indicates that the result contains only category items
+ };
+
+public:
+
+ /**
+ * This method is the default constructor.
+ */
+ CategoriesQuery();
+
+ /**
+ * This method is a constructor. It constructs a valid <code>CategoriesQuery</code> from
+ * a URL provided by the caller.
+ *
+ * @param sUrl A constant reference to the URL of the location whose details
+ * are to be retrieved from the server
+ */
+ CategoriesQuery(const String& sUrl);
+
+ /**
+ * This method is the (virtual) destructor.
+ */
+ virtual ~CategoriesQuery();
+
+ /**
+ * This method retrieves a value indicating the query type.
+ *
+ * @return A value indicating the query type.
+ */
+ QueryType GetType() const;
+
+ /**
+ * This method sets the query type.
+ *
+ * @param eType A value indicating the query type.
+ */
+ void SetType(QueryType eType);
+
+ /**
+ * This method retrieves the search proximity.
+ *
+ * @return An object containing the geographic coordinates of the location
+ * around which the search is/was to be conducted and within whose
+ * proximity the results must lie.
+ */
+ GeoCoordinates GetProximity() const;
+
+ /**
+ * This method sets search proximity.
+ *
+ * @param rCoord An object containing the geographic coordinates of the
+ * location around which the search is/was to be conducted and within
+ * whose proximity the results must lie.
+ */
+ void SetProximity(const GeoCoordinates& rCoord);
+
+ /**
+ * This method retrieves a BCP 47 identifier of the search language.
+ *
+ * @return A string containing a BCP 47 identifier of the language.
+ */
+ String GetLanguage() const;
+
+ /**
+ * This method sets the langauge, using a BCP 47 langauge code.
+ *
+ * @param sSearch A constant reference to a string containing a BCP 47
+ * identifier of the language.
+ */
+ void SetLanguage(const String& sLang);
+
+
+ /**
+ * This method attempts to establish a connection
+ * with the server and then, if the connection has been established, it
+ * builds and submits a query.
+ *
+ * @param rDst A reference to an object that is to be notified when the
+ * reply to the query has arrived from the server.
+ *
+ * @param pUserData A pointer to user data to be passed back within the
+ * corresponding reply object.
+ *
+ * @return Identifier of issued request.
+ */
+ RestItemHandle::RequestId Execute(FinderQueryListener& rListener, Tizen::Maps::HereObject* pUserData = NULL) const;
+
+ /**
+ * This method retrieves error information associated with the query.
+ *
+ * @return A constant pointer to an object containing the error details.
+ */
+ const FinderError* GetError() const;
+
+ /**
+ * This static method returns the base URI to be used for all subsequent
+ * discovery queries.
+ *
+ * @return A string containing the base URI.
+ */
+ static String GetBaseUri();
+
+ /**
+ * This static method returns the base URI to be used for all subsequent
+ * discovery queries.
+ *
+ * @param sUri A constant reference to a string containing the base URI.
+ */
+ static void SetBaseUri(const String& sUri);
+
+private:
+
+ /**
+ * This method creates the URI for the request.
+ *
+ * @return URI request string.
+ */
+ String CreateUri() const;
+
+ bool AppendService(CategoriesQuery::QueryType eType, String& sDst) const;
+
+private:
+ HERE_MAPS_NO_COPY_NO_ASSIGN(CategoriesQuery);
+
+ class CategoriesQueryImpl;
+ CategoriesQueryImpl* m_pImpl;
+
+ friend class CategoriesReply;
+
+ static String s_sBaseUri;
+
+};
+
+HERE_MAPS_END_NAMESPACE
+#endif
+
+#endif // CATEGORIES_QUERY_H_
--- /dev/null
+/*
+ * Copyright (C) 2013 HERE Global B.V. All rights reserved.
+ * This software, including documentation, is protected by copyright controlled by
+ * HERE Global B.V. (“Software”). All rights are reserved. Copying, including reproducing,
+ * storing, adapting or translating, any or all of this material requires the prior
+ * written consent of HERE Global B.V. You may use this
+ * Software in accordance with the terms and conditions defined in the
+ * HERE Location Platform Services Terms and Conditions, available at
+ * http://developer.here.com/terms-conditions-base
+ *
+ * As an additional permission to the above, you may distribute Software,
+ * in object code format as part of an Application, according to, and subject to, terms and
+ * conditions defined in the Tizen Software Development kit (“SDK”) License Agreement.
+ * You may distribute such object code format Application under terms of your choice,
+ * provided that the header and source files of the Software have not been modified.
+ */
+
+#ifndef CATEGORIES_REPLY_H_
+#define CATEGORIES_REPLY_H_
+
+#include "finder/BaseFinderReply.h"
+#include "finder/CategoriesQuery.h"
+
+HERE_MAPS_BEGIN_NAMESPACE
+
+/**
+ * This class encapsulates a response to a discovery query. The response is a
+ * page of link objects, each containing information about one place. It also
+ * includes a link to the next page of results, if available.
+ *
+ * \ingroup finder
+ */
+class EXPORT_API CategoriesReply : public BaseFinderReply
+{
+public:
+
+ /**
+ * This is the default constructor.
+ */
+ CategoriesReply();
+
+ /**
+ * This is the (virtual) destructor.
+ */
+ virtual ~CategoriesReply();
+
+ /**
+ * This method retrieves a list of search result items that can lead an
+ * application user to detailed information about specific places.
+ *
+ * @return A vector of instances of <code>SearchItem</code> which represent
+ * individual search results.
+ */
+ CategoryList GetCategoryList() const;
+
+private:
+ void SetCategoryList(const CategoryList&);
+
+private:
+ HERE_MAPS_NO_COPY_NO_ASSIGN(CategoriesReply);
+
+ virtual bool OnDataReceived(const unsigned char* pBuffer, size_t uSize);
+
+ class CategoriesReplyImpl;
+ CategoriesReplyImpl* m_pImpl;
+
+ friend class JsonParser;
+};
+
+HERE_MAPS_END_NAMESPACE
+
+#endif // CATEGORIES_REPLY_H_
class DiscoveryReply;
class PlaceDetailsReply;
+#ifdef TIZEN_CUSTOMIZATION
+class CategoriesReply;
+#endif
/**
* This class encapsulates an object that is notified when a response to a query
*/
virtual void OnPlaceDetailsReply(const PlaceDetailsReply& rReply) = 0;
+ #ifdef TIZEN_CUSTOMIZATION
+ /**
+ * This method is a callback invoked when data have arrived in response to a
+ * categories request.
+ *
+ * @param rReply A constant reference to an object containing the response data.
+ */
+ virtual void OnCategoriesReply(const CategoriesReply& rReply) = 0;
+ #endif
+
#ifdef TIZEN_MIGRATION
/**
* This method is a callback invoked when geocoding request is failed.
virtual void OnPlaceDetailsFailure(const PlaceDetailsReply& rReply) = 0;
#endif
+ #ifdef TIZEN_CUSTOMIZATION
+ /**
+ * This method is a callback invoked when categories request is failed.
+ *
+ * @param rReply A Constant reference to an object containing the response data.
+ */
+ virtual void OnCategoriesFailure(const CategoriesReply& rReply) = 0;
+ #endif
+
private:
HERE_MAPS_NO_COPY_NO_ASSIGN(FinderQueryListener);
class GeoBoundingBox;
class SearchContext;
class FinderError;
+#ifdef TIZEN_CUSTOMIZATION
+class CategoriesReply;
+#endif
/**
* Parses Places API Json data.
*/
static bool ParsePlaceResult( ByteBuffer& buf, PlaceDetails& place_data, FinderError*& error);
+#ifdef TIZEN_CUSTOMIZATION
+ /**
+ * Parse categories result.
+ * @param json_stream ByteBuffer.
+ * @param place_data Parsed categories data.
+ * @param error A pointer to an object that is populated
+ * with error information should parsing fail.
+ */
+ static bool ParseCategoriesSearch( ByteBuffer& buf, CategoriesReply& results_page, FinderError*& pError );
+#endif
+
private:
static void ParseGeocodeSearch( ByteBuffer& json_stream,
static void ParseAddress( IJsonValue* json_location, GeoLocation& loc );
static void ParsePlaceResults(JsonArray* pObject, PlaceItemList&, SearchItemList& );
+#ifdef TIZEN_CUSTOMIZATION
+ static void ParseCategoriesSearch( IJsonValue* pJsonValue, CategoriesReply& result );
+#endif
private:
static void GetStringValue(JsonObject* pObject, const String& sKey, String& value );
maps_place_filter_h hFilter, maps_service_search_place_list_cb pCbFunc,
void * pUserData, int *nReqId);
-int HerePluginSearchPlaceDetails(const char* szUrl,
- maps_service_get_place_details_cb pCbFunc,
- void * pUserData, int *nReqId);
+int HerePluginGetPlaceDetails(const char* szUrl,
+ maps_service_get_place_details_cb pCbFunc, void * pUserData, int *nReqId);
+
+int HerePluginGetPlaceCategories(maps_item_hashtable_h hPref,
+ maps_service_get_place_categories_cb pCbFunc, void *pUserData, int *nReqId);
int HerePluginSearchRoute(maps_coordinates_h hOrigin, maps_coordinates_h hDestination,
maps_item_hashtable_h hPref, maps_service_search_route_cb pCbFunc,
#include <finder/Ratings.h>
#include <finder/RelatedItem.h>
#include <finder/ExtendedAttribute.h>
+#include <finder/CategoriesQuery.h>
+#include <finder/CategoriesReply.h>
#include <common/GeoLocation.h>
#include <common/Address.h>
{
public:
typedef std::deque<maps_place_h> PlaceList;
+ typedef std::deque<maps_place_category_h> PlaceCategoryList;
/**
*This is the default constructor for Place.
here_error_e PreparePlaceDetailsQuery();
here_error_e PreparePlaceDetailsPreference(maps_preference_h hPref);
+ here_error_e PreparePlaceDetailsPreference(PlaceDetailsQuery* pPlaceDetailsQuery, maps_preference_h hPref);
here_error_e StartPlaceDetails(const char* szUrl);
here_error_e StartPlaceDetailsInternal(const char* szUrl);
+ here_error_e PrepareCategoriesQuery();
+ here_error_e PrepareCategoriesPreference(maps_preference_h hPref);
+ here_error_e PrepareCategoriesPreference(PlaceDetailsQuery* pPlaceDetailsQuery, maps_preference_h hPref);
+ here_error_e PrepareCategoriesFilter(maps_place_filter_h hFilter);
+
+ here_error_e StartCategories();
+
virtual void OnDiscoverReply(const DiscoveryReply &Reply);
virtual void OnDiscoverFailure(const DiscoveryReply& Reply);
virtual void OnPlaceDetailsReply(const PlaceDetailsReply &Reply);
virtual void OnPlaceDetailsFailure(const PlaceDetailsReply& Reply);
+ virtual void OnCategoriesReply(const CategoriesReply &Reply);
+ virtual void OnCategoriesFailure(const CategoriesReply& Reply);
+
private:
void ProcessPlaceLocation(PlaceDetails herePlace, maps_place_h mapsPlace);
void ProcessPlaceContacts(PlaceDetails herePlace, maps_place_h mapsPlace);
bool ProcessPlaceLinkObject(LinkObject hereLinkObject, maps_place_link_object_h mapsLinkObject);
void __sortList(PlaceList &list);
- void __flushReplies(int error);
+ void __flushPlaceReplies(int error);
+ void __flushCategoriesReplies(int error);
static bool __compareWithTitle(const maps_place_h &item1, const maps_place_h &item2);
static bool __compareWithId(const maps_place_h &item1, const maps_place_h &item2);
static bool __compareWithType(const maps_place_h &item1, const maps_place_h &item2);
DiscoveryQuery* m_pDiscoveryQuery;
PlaceDetailsQuery* m_pPlaceDetailsQuery;
+ CategoriesQuery* m_pCategoriesQuery;
int m_nReplyCnt;
int m_nReplyIdx;
bool m_bReplyFlushed;
maps_distance_unit_e m_eDistanceUnit;
PlaceList m_PlaceList;
+ PlaceCategoryList m_CategoryList;
static const bool __sending_place_details_query_automatically = TRUE;
};
-libheremaps-engine.so.1.0.6_19
\ No newline at end of file
+libheremaps-engine.so.1.0.6_20
\ No newline at end of file
-libheremaps-engine.so.1.0.6_19
\ No newline at end of file
+libheremaps-engine.so.1.0.6_20
\ No newline at end of file
-libheremaps-engine.so.1.0.6_19
\ No newline at end of file
+libheremaps-engine.so.1.0.6_20
\ No newline at end of file
-libheremaps-engine.so.1.0.6_19
\ No newline at end of file
+libheremaps-engine.so.1.0.6_20
\ No newline at end of file
return error;
}
-int HerePluginSearchPlaceDetails(const char* szUrl,
- maps_service_get_place_details_cb pCbFunc,
- void *pUserData, int *nReqId)
+int HerePluginGetPlaceDetails(const char* szUrl,
+ maps_service_get_place_details_cb pCbFunc, void *pUserData, int *nReqId)
{
/* checking parmaters */
if (!szUrl || (szUrl && *szUrl == '\0') || !pCbFunc || !nReqId)
return error;
}
+int HerePluginGetPlaceCategories(maps_item_hashtable_h hPref,
+ maps_service_get_place_categories_cb pCbFunc, void *pUserData, int *nReqId)
+{
+ /* checking parmaters */
+ if (!pCbFunc || !nReqId)
+ return HERE_ERROR_INVALID_PARAMETER;
+
+ if (HereManager::CheckAgreement() != HERE_ERROR_NONE)
+ return HERE_ERROR_PERMISSION_DENIED;
+
+ if (!HereManager::GetHandler())
+ return HERE_ERROR_INVALID_OPERATION;
+
+ /* creating instance */
+ HerePlace *pPlace =
+ (HerePlace*)(HereManager::GetHandler()->CreateInstance(HereManager::HERE_SVC_PLACE,
+ (void*)pCbFunc, pUserData, nReqId));
+
+ if(!pPlace)
+ return HERE_ERROR_SERVICE_NOT_AVAILABLE;
+
+ /* sending request */
+ here_error_e error = HERE_ERROR_NONE;
+
+ do {
+ error = pPlace->PrepareCategoriesQuery();
+ if (error != HERE_ERROR_NONE) break;
+
+ error = pPlace->PrepareCategoriesPreference(hPref);
+ if (error != HERE_ERROR_NONE) break;
+
+ error = pPlace->StartCategories();
+ } while (0);
+
+ /* finishing task */
+ if(error != HERE_ERROR_NONE)
+ pPlace->TerminateService();
+
+ return error;
+}
+
int HerePluginSearchRoute(maps_coordinates_h hOrigin, maps_coordinates_h hDestination,
maps_item_hashtable_h hPref, maps_service_search_route_cb pCbFunc,
void *pUserData, int *nReqId)
{
m_pDiscoveryQuery = NULL;
m_pPlaceDetailsQuery = NULL;
+ m_pCategoriesQuery = NULL;
+
m_pCbFunc = pCbFunc;
m_pUserData = pUserData;
m_pPlaceDetailsQuery = NULL;
}
+ if (m_pCategoriesQuery) {
+ delete m_pCategoriesQuery;
+ m_pCategoriesQuery = NULL;
+ }
+
while (!m_PlaceList.empty()) {
maps_place_destroy(m_PlaceList.front());
m_PlaceList.pop_front();
here_error_e HerePlace::PreparePlaceDetailsPreference(maps_preference_h hPref)
{
- if (!m_pPlaceDetailsQuery)
+ return PreparePlaceDetailsPreference(m_pPlaceDetailsQuery, hPref);
+}
+
+here_error_e HerePlace::PreparePlaceDetailsPreference(PlaceDetailsQuery* pPlaceDetailsQuery, maps_preference_h hPref)
+{
+ if (!pPlaceDetailsQuery)
return HERE_ERROR_OUT_OF_MEMORY;
if (!hPref)
char *szLanguage = NULL;
ret = maps_preference_get_language(hPref, &szLanguage);
if (ret == MAPS_ERROR_NONE && szLanguage && *szLanguage)
- m_pPlaceDetailsQuery->SetLanguage(szLanguage);
+ pPlaceDetailsQuery->SetLanguage(szLanguage);
g_free(szLanguage);
maps_distance_unit_e eUnit;
return (bExcuted ? HERE_ERROR_NONE : HERE_ERROR_INVALID_OPERATION);
}
+here_error_e HerePlace::PrepareCategoriesQuery()
+{
+ if (m_pCategoriesQuery)
+ return HERE_ERROR_PERMISSION_DENIED;
+
+ m_pCategoriesQuery = new (std::nothrow) CategoriesQuery();
+
+ if (!m_pCategoriesQuery)
+ return HERE_ERROR_OUT_OF_MEMORY;
+ else
+ return HERE_ERROR_NONE;
+}
+
+here_error_e HerePlace::PrepareCategoriesPreference(maps_preference_h hPref)
+{
+ if (!m_pCategoriesQuery)
+ return HERE_ERROR_OUT_OF_MEMORY;
+
+ if (!hPref)
+ return HERE_ERROR_NONE;
+
+ int ret;
+ char *szLanguage = NULL;
+ ret = maps_preference_get_language(hPref, &szLanguage);
+ if (ret == MAPS_ERROR_NONE && szLanguage && *szLanguage)
+ m_pCategoriesQuery->SetLanguage(szLanguage);
+ g_free(szLanguage);
+
+ maps_distance_unit_e eUnit;
+ ret = maps_preference_get_distance_unit(hPref, &eUnit);
+ if (ret == MAPS_ERROR_NONE)
+ m_eDistanceUnit = eUnit;
+
+ return HERE_ERROR_NONE;
+}
+
+here_error_e HerePlace::PrepareCategoriesFilter(maps_place_filter_h hFilter)
+{
+ if (!m_pCategoriesQuery)
+ return HERE_ERROR_OUT_OF_MEMORY;
+
+ if (!hFilter)
+ return HERE_ERROR_INVALID_PARAMETER;
+
+ return HERE_ERROR_NONE;
+}
+
+here_error_e HerePlace::StartCategories()
+{
+ GeoCoordinates geoCoord;
+ geoCoord.SetLatitude(0.);
+ geoCoord.SetLongitude(0.);
+ m_pCategoriesQuery->SetProximity(geoCoord);
+
+ /* Execute query */
+ m_nRestReqId = m_pCategoriesQuery->Execute(*this, NULL);
+
+ return (m_nRestReqId > 0 ? HERE_ERROR_NONE : HERE_ERROR_INVALID_OPERATION);
+}
+
void HerePlace::OnDiscoverReply(const DiscoveryReply &Reply)
{
maps_place_h mapsPlace;
if (m_nReplyCnt == 0)
error = MAPS_ERROR_NOT_FOUND;
- __flushReplies(error);
+ __flushPlaceReplies(error);
delete this;
}
}
if (!m_bReplyFlushed) {
m_nReplyIdx = 0;
m_nReplyCnt = 0;
- __flushReplies((maps_error_e)GetErrorCode(Reply));
+ __flushPlaceReplies((maps_error_e)GetErrorCode(Reply));
delete this;
}
}
if (m_nReplyCnt == 0)
error = MAPS_ERROR_NOT_FOUND;
- __flushReplies(error);
+ __flushPlaceReplies(error);
delete this;
}
}
if (!m_bReplyFlushed) {
m_nReplyIdx = 0;
m_nReplyCnt = 0;
- __flushReplies(GetErrorCode(Reply));
+ __flushPlaceReplies(GetErrorCode(Reply));
delete this;
}
} else {
MAPS_LOGD("Internal error during updating detailed information for the place. (%d/%d)", m_nReplyIdx, m_nReplyCnt);
if (!m_bReplyFlushed && (m_nReplyIdx == m_nReplyCnt))
{
- __flushReplies(MAPS_ERROR_NONE);
+ __flushPlaceReplies(MAPS_ERROR_NONE);
delete this;
}
}
}
+void HerePlace::OnCategoriesReply(const CategoriesReply &Reply)
+{
+ CategoryList hereCategoryList = Reply.GetCategoryList();
+ CategoryList::iterator hereCategoryIt;
+
+ int error = MAPS_ERROR_NONE, sub_error;
+ bool is_valid;
+ maps_place_category_h mapsCategory;
+ m_nReplyIdx = 0;
+ m_nReplyCnt = 0;
+
+ for (hereCategoryIt = hereCategoryList.begin();
+ hereCategoryIt != hereCategoryList.end();
+ hereCategoryIt++) {
+ is_valid = false;
+
+ if (maps_place_category_create(&mapsCategory) == MAPS_ERROR_NONE) {
+ if (!hereCategoryIt->GetCategoryId().ToString().empty()) {
+ sub_error = maps_place_category_set_id(mapsCategory, (char*)hereCategoryIt->GetCategoryId().ToString().data());
+ is_valid |= (sub_error == MAPS_ERROR_NONE);
+ }
+
+ if (!hereCategoryIt->GetTitle().empty()) {
+ sub_error = maps_place_category_set_name(mapsCategory, (char*)hereCategoryIt->GetTitle().data());
+ is_valid |= (sub_error == MAPS_ERROR_NONE);
+ }
+
+ if (!hereCategoryIt->GetHref().empty()) {
+ sub_error = maps_place_category_set_url(mapsCategory, (char*)hereCategoryIt->GetHref().data());
+ is_valid |= (sub_error == MAPS_ERROR_NONE);
+ }
+
+ if (is_valid && !m_bCanceled) {
+ m_CategoryList.push_back(mapsCategory);
+ m_nReplyCnt++;
+ }
+ else
+ maps_place_category_destroy(mapsCategory);
+ }
+ }
+
+ __flushCategoriesReplies(error);
+ delete this;
+}
+
+void HerePlace::OnCategoriesFailure(const CategoriesReply& Reply)
+{
+ MAPS_LOGD("Internal error during updating detailed information for the place.");
+ delete this;
+}
+
void HerePlace::ProcessPlaceLocation(PlaceDetails herePlace, maps_place_h mapsPlace)
{
GeoLocation hereLocation = herePlace.GetLocation();
return is_valid;
}
-void HerePlace::__flushReplies(int error)
+void HerePlace::__flushPlaceReplies(int error)
{
maps_place_h mapsPlace;
maps_item_list_h placeList = NULL;
m_bReplyFlushed = true;
}
+void HerePlace::__flushCategoriesReplies(int error)
+{
+ maps_place_category_h category;
+ m_nReplyIdx = 0;
+ m_nReplyCnt = m_CategoryList.size();
+
+ if (error == MAPS_ERROR_NONE && m_nReplyCnt == 0)
+ error = MAPS_ERROR_NOT_FOUND;
+
+ if (error != MAPS_ERROR_NONE) {
+ ((maps_service_get_place_categories_cb)m_pCbFunc)((maps_error_e)error, m_nReqId, 0, 0, NULL, m_pUserData);
+ return;
+ }
+
+ while (m_nReplyIdx < m_nReplyCnt && !m_bCanceled && !m_CategoryList.empty()) {
+ category = m_CategoryList.front();
+ m_CategoryList.pop_front();
+
+ /* callback function */
+ if (((maps_service_get_place_categories_cb)m_pCbFunc)((maps_error_e)error, m_nReqId,
+ m_nReplyIdx++, m_nReplyCnt, category, m_pUserData) == FALSE)
+ break;
+ }
+ m_bReplyFlushed = true;
+}
+
bool HerePlace::__compareWithTitle(const maps_place_h &item1, const maps_place_h &item2)
{
bool result = false;
case MAPS_SERVICE_CANCEL_REQUEST:
case MAPS_SERVICE_MULTI_REVERSE_GEOCODE:
case MAPS_SERVICE_SEARCH_PLACE_LIST:
- case MAPS_SERVICE_SEARCH_GET_PLACE_DETAILS:
+ case MAPS_SERVICE_GET_PLACE_DETAILS:
+ case MAPS_SERVICE_GET_PLACE_CATEGORIES:
case MAPS_SERVICE_VIEW:
case MAPS_SERVICE_VIEW_SNAPSHOT:
*supported = TRUE;
EXPORT_API int maps_plugin_get_place_details(const char* url,
maps_service_get_place_details_cb callback, void* user_data, int* request_id)
{
- int ret = HerePluginSearchPlaceDetails(url, callback, user_data, request_id);
+ int ret = HerePluginGetPlaceDetails(url, callback, user_data, request_id);
+
+ MAPS_LOGD("here_error_e = %d, %s", ret, ConverHereErrorToString(ret));
+
+ return ConvertToMapsError(ret);
+}
+
+EXPORT_API int maps_plugin_get_place_categories(maps_preference_h preference,
+ maps_service_get_place_categories_cb callback, void* user_data, int* request_id)
+{
+ int ret = HerePluginGetPlaceCategories(preference, callback, user_data, request_id);
MAPS_LOGD("here_error_e = %d, %s", ret, ConverHereErrorToString(ret));