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 REVERSEGEOCODERQUERY_H
19 #define REVERSEGEOCODERQUERY_H
21 #include "common/HereMaps_global.h"
23 #include "geocoder/GeoCoderQueryBase.h"
25 HERE_MAPS_BEGIN_NAMESPACE
29 class GeoCoderQueryListener;
32 * This class represents a reverse geocoding query.
34 * Instances of the class are used to obtain an address (or a set of addresses)
35 * corresponding to a set of geographic coordinates.
39 class EXPORT_API ReverseGeoCoderQuery : public GeoCoderQueryBase
43 * This enumeration defines identifiers for reverse geocoding modes. A mode
44 * indicates whether addresses are to be returned or
45 * administrative area names (such as city, county, state, country).
49 RM_RetrieveAreas, ///< Indicates that administrative area names are to be retrieved.
50 RM_RetrieveAddresses ///< Indicates that addresses are to be retrieved.
54 * This method is the default constructor.
56 ReverseGeoCoderQuery();
59 * This method is a constructor that initializes the query with the location
60 * to reverse-geocode and the mode.
62 * @param rCoordinate A constant reference to an object containing the geographic
63 * coordinates of the location to reverse-geocode.
65 * @param aMode A value indicating the reverse geocoding mode to use.
67 ReverseGeoCoderQuery(const GeoCoordinates& rCoordinate, ReverseMode aMode);
70 * This method is a constructor that initializes the query with the location
71 * to reverse-geocode, the mode and the radius within which to conduct the
74 * @param rCoordinate A constant reference to an object containing the geographic
75 * coordinates of the location to reverse-geocode.
77 * @param aMode A value indicating the reverse geocoding mode to use.
79 * @param fRadius A float value indicating the radius (in meters) within
82 ReverseGeoCoderQuery(const GeoCoordinates& rCoordinate, ReverseMode aMode, float fRadius);
85 * This method is the (virtual) destructor.
87 virtual ~ReverseGeoCoderQuery();
90 * This method sets the properties defining a circular area within which a
91 * search is to be conducted. The area is defined in terms of its center and
94 * @param rCoord A constant reference to an object containing the latitude
95 * and longitude of the center of the proximity area (search center).
97 * @param rRadius A value specifying the radius of the search area in meters.
99 void SetProximity(const GeoCoordinates& rCoord, float fRadius = 0);
102 * This method detects whether coordinates/proximity (the center of search area
105 * @return <code>true</code> if the proximity was set,
106 * otherwise <code>false</code>
108 bool HasProximity() const;
111 * This method sets the reverse geocoding mode to apply to the query.
113 * @param aMode A value indicating the reverse geocoding mode to use.
115 void SetMode(ReverseMode aMode);
118 * This method attempts to establish a connection
119 * with the server and then, if the connection has been established, it
120 * builds and submits a query.
122 * @param rListener A shared pointer to an object that is to be notified when
123 * the reply to the query has arrived from the server.
125 * @param pUserData A pointer to user data to be echoed in the reply object.
127 * @return A value representing the identifier of the issued request.
129 RestItemHandle::RequestId Execute(GeoCoderQueryListener& rListener, Tizen::Maps::HereObject* pUserData = NULL) const;
132 * This method returns the base URI to be used for all subsequent
133 * reverse geocoder queries.
135 * @return A string containing the base URI.
137 String GetBaseUri() const;
140 * This method returns the base URI to be used for all subsequent
141 * reverse geocoder queries.
143 * @param sUri A constant reference to a string containing the base URI.
145 void SetBaseUri(const String& sUri);
149 * This method creates the URI for the request.
151 * @return URI request string.
153 String CreateUri() const;
156 HERE_MAPS_NO_COPY_NO_ASSIGN(ReverseGeoCoderQuery);
158 class ReverseGeoCoderQueryImpl;
159 ReverseGeoCoderQueryImpl* m_pImpl;
162 HERE_MAPS_END_NAMESPACE