3123bd77803118401beea288d48455e760d36166
[platform/core/location/maps-plugin-here.git] / inc / engine / common / BaseQuery.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 BASEQUERY_H
19 #define BASEQUERY_H
20
21 #include "common/HereMaps_global.h"
22 #include "common/QueryListener.h"
23 #include "common/RestItemHandle.h"
24 #ifdef TIZEN_MIGRATION
25 #include "base/HereObject.h"
26 #else
27 #include <FBase.h>
28 #endif
29
30 HERE_MAPS_BEGIN_NAMESPACE
31
32 class BaseReply;
33 class QueryListener;
34 class GeoCoordinates;
35 class GeoBoundingBox;
36
37 /**
38  * This class is the base class representing any rest based query class
39  * in this library
40  */
41 class BaseQuery
42 {
43 public:
44     typedef int RequestId;
45
46     /**
47      * This is the destructor.
48      */
49     virtual ~BaseQuery();
50
51     /**
52      * This method creates the query URI. It is to be implemented be derived classes.
53      *
54      * @return URI string.
55      */
56     virtual String CreateUri() const = 0;
57
58 protected:
59     /**
60      * This constant represents an illegal URL (an empty string).
61      */
62     static const String ILLEGAL_URL;
63
64     /**
65      * This is the default constructor.
66      */
67     BaseQuery();
68
69     /**
70      * This method appends authentication credentials to the query. The
71      * authentication credentials are <code>app_id</code> and
72      * <code>app_code</code>. The method obtains the credentials set at
73      * initialization and copies them to the destination provided by the caller,
74      * following the standard query-parameter format:
75      * <code>app_id=app_id_value&app_code=app_code_value<code>
76      *
77      * @param sDst A reference to a string to receive the authentication
78      * credentials.
79      *
80      * @return <code>true</code> if the destination string has been set with the
81      *        authentication credentials, <code>false</code> if the the
82      *        <code>ApplicationContext</code> is uninitialized.
83      */
84     bool AppendCredentials(String& sDst) const;
85
86 #ifndef TIZEN_MIGRATION
87     /**
88      * This method retrieves the user data associated with the query.
89      *
90      * @return A pointer to an object containing the user data.
91      */
92     Tizen::Maps::HereObject* GetUserData() const;
93 #endif
94
95 private:
96     HERE_MAPS_NO_COPY_NO_ASSIGN(BaseQuery);
97
98     class BaseQueryImpl;
99     BaseQueryImpl* m_pImpl;
100 };
101
102 HERE_MAPS_END_NAMESPACE
103
104 #endif // BASEQUERY_H