134db797b48730081301a303857d7a185c985c90
[platform/core/location/maps-plugin-here.git] / inc / engine / finder / PlaceDetailsQuery.h
1 /*
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
10  *
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.
16  */
17
18 #ifndef PLACE_DETAILS_QUERY_H
19 #define PLACE_DETAILS_QUERY_H
20
21 #include "common/HereMaps_global.h"
22 #include "common/BaseQuery.h"
23
24 HERE_MAPS_BEGIN_NAMESPACE
25
26 class PlaceDetailsReply;
27 class FinderQueryListener;
28 class FinderError;
29
30 /**
31  * This class encapsulates a request for detailed information about a specific
32  * place. 
33  * 
34  * \ingroup finder
35  */ 
36 class EXPORT_API PlaceDetailsQuery : public BaseQuery
37 {
38 public:
39
40     /**
41      * This method is the default constructor.
42      */
43     PlaceDetailsQuery();
44
45     /**
46      * This method is a copy constructor.
47      * 
48      * @param rRhs An object whose contents are to be copied to the instance
49      *        being created.
50      */
51     PlaceDetailsQuery(const PlaceDetailsQuery& rRhs);
52
53     /**
54      * This method is the destructor.
55      */
56     ~PlaceDetailsQuery();
57
58     /**
59      * This is the assignment operator.
60      * 
61      * @param rRhs An object whose contents are to be copied to the given
62      *        instance.
63      * 
64      * @return A reference to the given instance of the class after its contents
65      *       have been updated.
66      */
67     PlaceDetailsQuery& operator=(const PlaceDetailsQuery& rRhs);
68
69     /** 
70      * This method sets the place id.
71      * 
72      * @param rPlaceId A constant reference to a string containing the unique
73      *       identifier of the place whose details are to be obtained.
74      */
75     void SetPlaceId(const String& rPlaceId);
76
77     /** 
78      * This method retrieves the place id.
79      * 
80      * @return A string containing the unique identifier of the place whose
81      *       details are to be obtained.
82      */
83     String GetPlaceId() const;
84
85     /**
86      * This method retrieves a BCP 47 code representing the search language.
87      *
88      * @return A string containing a BCP 47 identifier of the language.
89      */
90     String GetLanguage() const;
91
92     /**
93      * This method sets the langauge, using a BCP 47 identifier.
94      *
95      * @param sSearch A constant reference to a string containing a BCP 47
96      *        identifier of the language.
97      */
98     void SetLanguage(const String& sLang);
99
100     /**
101      * This method attempts to establish a connection with the server and then,
102      * if the connection has been established, builds and submits a query.
103      * 
104      * @param rListener A reference to an object that is to be notified when the
105      *        reply to the query has arrived from the server.
106      * 
107      * @param pUserData A pointer to user data to be passed back within the
108      *        corresponding reply object.
109      *
110      * @return Identifier of issued request.
111      */
112     RestItemHandle::RequestId Execute(FinderQueryListener& rListener, Tizen::Maps::HereObject* pUserData = NULL, const char* pUrl="") const;
113
114     /**
115      * This method retrieves error information associated with the query parameters
116      *
117      * @return A constant pointer to an object containing the error details.
118      */
119     const FinderError* GetError() const;
120
121     /**
122      * This static method returns the base URI to be used for all subsequent
123      * place detail queries.
124      *
125      * @return A string containing the base URI.
126      */
127     static String GetBaseUri();
128
129     /**
130      * This static method returns the base URI to be used for all subsequent
131      * place detail queries.
132      *
133      * @param sUri A constant reference to a string containing the base URI.
134      */
135     static void SetBaseUri(const String& sUri);
136
137 private:
138     /**
139      * This method creates the URI for the request.
140      *
141      * @return URI request string.
142      */
143     String CreateUri() const;
144
145 private:
146     class PlaceDetailsQueryImpl;
147     PlaceDetailsQueryImpl* m_pImpl;
148
149     static String s_sBaseUri;
150
151 };
152
153 HERE_MAPS_END_NAMESPACE
154
155 #endif // PLACE_DETAILS_QUERY_H