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 GEOCODERQUERYBASE_H
19 #define GEOCODERQUERYBASE_H
21 #include "common/HereMaps_global.h"
23 #include "common/BaseQuery.h"
25 HERE_MAPS_BEGIN_NAMESPACE
27 class ApplicationContext;
30 * This is the base class for implementations of geocoding query classes.
32 * The virtual method require implementation in derived classes.
36 class EXPORT_API GeoCoderQueryBase : public BaseQuery
40 * This enumeration defines identifiers for response attribute switches that
41 * indicate which attributes are to be included in query responses from the
44 enum ResponseAttribute
46 RA_PerformedSearch, ///< Indicates that completed searches are to be included in the response.
47 RA_Label, ///< Indicates that labels are to be included in the response.
48 RA_DidYouMeanSuggestion, ///< Indicates that did-you-mean suggestions are to be included in the response.
49 RA_MatchQuality, ///< Indicates that match quality is to be included in the response.
50 RA_MatchType, ///< Indicates that match type specifiers are to be included in the response.
51 RA_MatchCode, ///< Indicates that match codes are to be included in the response.
52 RA_ParsedRequest, ///< Indicates that parsed requests are to be included in the response.
53 RA_All, ///< Indicates that all attributes are to be included in the response.
54 RA_None ///< Indicates that no attributes are to be included in the response.
58 * This method is the destructor.
65 * This method sets the properties defining a circular area within which a
66 * search is to be conducted. The area is defined in terms of its center and
69 * @param rCoord A constant reference to an object containing the latitude
70 * and longitude of the center of the proximity area (search center).
72 * @param rRadius A value specifying the radius of the search area in meters.
74 virtual void SetProximity(const GeoCoordinates& rCoord, float fRadius = 0) = 0;
77 * This method detects whether coordinates/proximity (the center of search area
80 * @return <code>true</code> if the proximity was set,
81 * otherwise <code>false</code>
83 virtual bool HasProximity() const = 0;
86 * This method adds a language code provided by the caller to the list of
87 * preferred languages.
89 * @param sPreferredLang A constant reference to a string containing a BCP
90 * 47 language code (see also http://tools.ietf.org/html/rfc5646).
91 * identifying the preferred language.
93 void AppendPreferredLanguage(const String& sPreferredLang);
96 * This method retrieves a value indicating the number of preferred
97 * languages that have been set.
99 * @return A value indicating how many preferred languages have been set.
101 size_t GetNumPreferredLanguages() const;
104 * This method retrieves the preferred language identifier at the index
105 * specified by the caller. The identifier is a BCP 47 language code (see
106 * also http://tools.ietf.org/html/rfc5646).
108 * @param idx A value representing an index into the array of preferred
109 * languages from which to retrieve the language identifier.
111 * @return A constant pointer to a string containing the language identifier
112 * or <code>NULL</code> if the supplied index is not valid.
114 const String* GetPreferredLanguage(size_t idx) const;
117 * This method sets a value indicating the maximum number of query results
120 * @param uMaxResults A value indicating the maximum number of query results
123 void SetMaxResults(size_t uMaxResults);
126 * This method sets a value indicating which page is to be returned in a
127 * paging scenario. Note that the value has no effect unless a value
128 * indicating the maximum number of results to retrieve has been specified
129 * (see SetMaxResults).
131 * @param uPage An unsigned integer indicating the page number.
133 void SetPageInformation(size_t uPage);
136 * This method allows the caller to set a value that determines the
137 * functionality and data delivered by the underlying version of the RESTful
140 * @param iValue An integer value that determines the functionality of (and
141 * data delivered by) the underlying RESTful service:
143 * <li>0 - indicates the default behavior of the underlying RESTful
146 * <li>1 - indicates the default behavior of the underlying service and:
147 * <ul><li>reverse geocoding responses include area names if addresses
148 * cannot be determined</li>
149 * <li>addresses/locations can be matched at
150 * intersection level</li>
154 * <ul><li>reverse geocoding responses include the area
155 * display position (center)</li>
156 * <li>map version can be requested (and
157 * included in responses)</li>
162 void SetGenParameter(int iValue);
166 * This method adds a response attribute specified by the caller.
168 * @param aAttr A value identifying the response attribute to add.
170 void AddResponseAttribute(ResponseAttribute aAttr);
173 * This method removes the response attribute specified by the caller.
175 * @param aAttr A value identifying the response attribute to remove.
177 void RemoveResponseAttribute(ResponseAttribute aAttr);
180 * This method adds a key-value pair representing an additional parameter
183 * @param sKey A constant reference to a string containing the name/key of
184 * the additional parameter.
186 * @param sValue A constant reference to a string containing the value of the
187 * additional parameter.
189 void AddAdditionalParameter(const String& sKey, const String& sValue);
192 * This method returns the base URI to be used for all subsequent
195 * @return A string containing the base URI.
197 virtual String GetBaseUri() const = 0;
200 * This method returns the base URI to be used for all subsequent
203 * @param sUri A constant reference to a string containing the base URI.
205 virtual void SetBaseUri(const String& sUri) = 0;
210 * This method is the default constructor.
215 * This method obtains the base URL for the service named by the caller.
217 * @param sService A constant reference to a string that identifies the
218 * service whose base URL is to be obtained.
220 * @param sDst A reference to an object which is to receive the result.
222 * @return <code>true</code> if the base URL has been created successfully,
223 * otherwise <code>false</code>
225 bool CreateBaseUrl(const String& sService, String& sDst) const;
229 HERE_MAPS_NO_COPY_NO_ASSIGN(GeoCoderQueryBase);
231 class GeoCoderQueryBaseImpl;
232 GeoCoderQueryBaseImpl* m_pImpl;
235 HERE_MAPS_END_NAMESPACE