2 * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef _LOCATION_HERE_PLACE_H_
18 #define _LOCATION_HERE_PLACE_H_
23 #include "here_manager.h"
26 #include <maps_place_plugin.h>
27 #include <maps_place_rating_plugin.h>
28 #include <maps_place_contact_plugin.h>
29 #include <maps_place_image_plugin.h>
30 #include <maps_place_link_object_plugin.h>
31 #include <maps_place_editorial_plugin.h>
32 #include <maps_place_review_plugin.h>
35 #include <finder/DiscoveryQuery.h>
36 #include <finder/PlaceDetailsQuery.h>
37 #include <finder/FinderQueryListener.h>
38 #include <finder/DiscoveryReply.h>
39 #include <finder/PlaceDetailsReply.h>
40 #include <finder/PlaceDetails.h>
41 #include <finder/CategoryId.h>
42 #include <finder/LinkObject.h>
43 #include <finder/Ratings.h>
44 #include <finder/RelatedItem.h>
45 #include <common/GeoLocation.h>
46 #include <common/Address.h>
49 HERE_PLUGIN_BEGIN_NAMESPACE
51 using namespace HERE_MAPS_NAMESPACE_PREFIX;
55 , public FinderQueryListener
58 typedef std::deque<maps_place_h> PlaceList;
61 *This is the default constructor for Place.
64 HerePlace(void *pCbFunc, void *pUserData, int nReqId);
67 *This is the default destructor for Place.
72 here_error_e PrepareDiscoveryQuery();
73 here_error_e PrepareDiscoveryPreference(maps_preference_h hPref);
74 here_error_e PrepareDiscoveryFilter(maps_place_filter_h hFilter);
76 here_error_e StartDiscoveryPlace(maps_coordinates_h hCoord, int nDistance);
77 here_error_e StartDiscoveryPlaceByArea(maps_area_h hArea);
78 here_error_e StartDiscoveryPlaceByAddress(const char *szAddr, maps_area_h hArea);
80 here_error_e PreparePlaceDetailsQuery();
81 here_error_e PreparePlaceDetailsPreference(maps_preference_h hPref);
83 here_error_e StartPlaceDetails(const char* szPlaceId);
84 here_error_e StartPlaceDetailsInternal(const char* szUrl);
86 virtual void OnDiscoverReply(const DiscoveryReply &Reply);
87 virtual void OnPlaceDetailsReply(const PlaceDetailsReply &Reply);
90 void ProcessPlaceLocation(PlaceDetails herePlace, maps_place_h mapsPlace);
91 void ProcessPlaceContact(PlaceDetails herePlace, maps_place_h mapsPlace);
92 void ProcessPlaceCategory(PlaceDetails herePlace, maps_place_h mapsPlace);
93 void ProcessPlaceImage(PlaceDetails herePlace, maps_place_h mapsPlace);
94 void ProcessPlaceDetails(PlaceDetails herePlace, maps_place_h mapsPlace);
95 void ProcessPlaceReviews(PlaceDetails herePlace, maps_place_h mapsPlace);
96 void ProcessPlaceRatings(PlaceDetails herePlace, maps_place_h mapsPlace);
97 void ProcessPlaceRated(PlaceDetails herePlace, maps_place_h mapsPlace);
99 void __sortList(PlaceList &list);
100 static bool __compareWithTitle(const maps_place_h &item1, const maps_place_h &item2);
101 static bool __compareWithId(const maps_place_h &item1, const maps_place_h &item2);
102 static bool __compareWithType(const maps_place_h &item1, const maps_place_h &item2);
103 static bool __compareWithDistance(const maps_place_h &item1, const maps_place_h &item2);
104 static bool __compareWithRating(const maps_place_h &item1, const maps_place_h &item2);
105 static bool __compareWithCategory(const maps_place_h &item1, const maps_place_h &item2);
106 static bool __compareWithCategoryCb(int index, int total, maps_place_category_h category,
109 DiscoveryQuery* m_pDiscoveryQuery;
110 PlaceDetailsQuery* m_pPlaceDetailsQuery;
115 PlaceList m_PlaceList;;
117 static const bool __sending_place_details_query_automatically = TRUE;
120 HERE_PLUGIN_END_NAMESPACE
122 #endif //_LOCATION_HERE_PLACE_H_