2 * Copyright (C) 2013 HERE Global B.V. All rights reserved.
3 * This software, including documentation, is protected by copyright controlled by
4 * HERE Global B.V. (“Software”). All rights are reserved. Copying, including reproducing,
5 * storing, adapting or translating, any or all of this material requires the prior
6 * written consent of HERE Global B.V. You may use this
7 * Software in accordance with the terms and conditions defined in the
8 * HERE Location Platform Services Terms and Conditions, available at
9 * http://developer.here.com/terms-conditions-base
11 * As an additional permission to the above, you may distribute Software,
12 * in object code format as part of an Application, according to, and subject to, terms and
13 * conditions defined in the Tizen Software Development kit (“SDK”) License Agreement.
14 * You may distribute such object code format Application under terms of your choice,
15 * provided that the header and source files of the Software have not been modified.
18 #ifndef GEOCODERQUERY_H_
19 #define GEOCODERQUERY_H_
21 #include "common/HereMaps_global.h"
23 #include "geocoder/GeoCoderQueryBase.h"
25 HERE_MAPS_BEGIN_NAMESPACE
30 class ApplicationContext;
31 class GeoCoderQueryListener;
34 * This class represents a geocoding query.
36 * Instances of this class are used to obtain the geographic coordinates of
37 * locations on the basis of an address (complete or partial) and/or a free text
42 class EXPORT_API GeoCoderQuery : public GeoCoderQueryBase
47 * This is the default constructor.
52 * This method is a constructor.
54 * @param rAddress A constant reference to an object providing the details
55 * of an address to use in the query.
57 GeoCoderQuery(const Address& rAddress);
60 * This method is a constructor.
62 * @param rAddress A constant reference to an object that provides the details
63 * of an address to use in the query.
65 * @param sSearch A constant reference to a string containing the search
66 * text to use in the query.
68 GeoCoderQuery(const Address& rAddress, const String& sSearch);
71 * This method is a constructor.
73 * @param sSearch A constant reference to a string containing the search
74 * text to use in the query.
76 GeoCoderQuery(const String& sSearch);
79 * This method is a virtual destructor.
81 virtual ~GeoCoderQuery();
84 * This method sets the properties defining a circular area within which a
85 * search is to be conducted. The area is defined in terms of its center and
88 * @param rCoord A constant reference to an object containing the latitude
89 * and longitude of the center of the proximity area (search center).
91 * @param rRadius A value specifying the radius of the search area in meters.
93 void SetProximity(const GeoCoordinates& rCoord, float fRadius = 0);
96 * This method detects whether coordinates/proximity (the center of search area
99 * @return <code>true</code> if the proximity was set,
100 * otherwise <code>false</code>
102 bool HasProximity() const;
105 * This method sets the address to be used in the query.
107 * @param rAddress A constant reference to an object providing the details
108 * of an address to use in the query.
110 void SetAddress(const Address& rAddress);
113 * This method sets the search text to be used in the query.
115 * @param sSearch A constant reference to a string containing the search
116 * text to use in the query.
118 void SetSearchtext(const String& sSearch);
121 * This method sets the map view using the bounding box object provided by
122 * the caller. The map view is a soft filter, which means that the
123 * response includes relevant results from within the map view, but also
124 * possibly from a wider area, and even relevant global results are
127 * @param rMapView A constant reference to a bounding box object that
128 * defines the map view in terms of the geographic coordinates of
129 * the top-left and bottom-right corners.
131 void SetMapView(const GeoBoundingBox& rMapView);
134 * This method sets the bounding box to be used in the query. The bounding
135 * box is a hard filter in that the response includes relevant results from
136 * within the area it defines.
138 * @param A constant reference to an instance of
139 * <code>GeoBoundingBox</code>, representing a geographic area within
140 * which to perform the search.
142 void SetBoundingBox(const GeoBoundingBox& rBoundingBox);
145 * This method sets the location identifier to be used in the query.
147 * @param sID a constant reference to a string containing the location
151 void SetLocationId(const String& sId);
154 * This method attempts to establish a connection
155 * with the server and then, if the connection has been established, it
156 * builds and submits a query.
158 * @param rListener A reference to an object that is to be notified when
159 * the reply to the query has arrived from the server.
161 * @param pUserData A pointer to user data to be passed back within the
162 * corresponding reply object.
164 * @return Identifier of issued request.
166 RestItemHandle::RequestId Execute(GeoCoderQueryListener& rListener, Tizen::Maps::HereObject* pUserData = NULL) const;
169 * This method returns the base URI to be used for all subsequent
172 * @return A string containing the base URI.
174 String GetBaseUri() const;
177 * This method returns the base URI to be used for all subsequent
180 * @param sUri A constant reference to a string containing the base URI.
182 void SetBaseUri(const String& sUri);
186 * This method creates the URI for the request.
188 * @return URI request string.
190 String CreateUri() const;
193 HERE_MAPS_NO_COPY_NO_ASSIGN(GeoCoderQuery);
195 class GeoCoderQueryImpl;
196 GeoCoderQueryImpl* m_pImpl;
199 HERE_MAPS_END_NAMESPACE
201 #endif /* GEOCODERQUERY_H_ */