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 QUERYLISTENER_H
19 #define QUERYLISTENER_H
22 #include "common/HereMaps_global.h"
24 #ifndef TIZEN_MIGRATION
25 #include <FBaseRtEvent.h>
26 #include <FBaseRtIEventListener.h>
27 #include <FBaseRtIEventArg.h>
30 HERE_MAPS_BEGIN_NAMESPACE
35 typedef std::tr1::shared_ptr<BaseReply> BaseReplyPtr;
37 * This class encapsulates an object that is notified when a response to a query
38 * has become available.
40 * Derived classes must implement the virtual methods of this class.
42 class EXPORT_API QueryListener
43 #ifndef TIZEN_MIGRATION
44 : public Tizen::Base::Runtime::Event
45 , public Tizen::Base::Runtime::IEventListener
50 * This is the default constructor for the class.
55 * This is a virtual destructor for the class.
57 virtual ~QueryListener();
60 * This method triggers a call to the listener's method
61 * <code>OnReplySuccess()</code>.
63 * @param pReply A pointer to the query reply.
65 void NotifyForSuccess(BaseReplyPtr pReply);
68 * This method triggers a call to the listener's method
69 * <code>OnReplyFailure()</code>.
71 * @param pReply A pointer to the query reply.
73 void NotifyForFailure(BaseReplyPtr pReply);
76 * This method is a callback invoked when a query is successful. The
77 * implementation of this method handles the reply to a successful query.
79 * @param rReply A Reference to the query reply object.
82 virtual void OnReplySuccess(BaseReply& rReply) = 0;
85 * This method is a callback invoked when a query fails. The
86 * implementation of this method handles the reply.
88 * @param rReply A Constant reference to the reply. Only the error and user
91 #ifdef TIZEN_MIGRATION
92 virtual void OnFailure(const BaseReply& rReply) = 0;
94 virtual void OnFailure(const BaseReply& rReply);
98 HERE_MAPS_NO_COPY_NO_ASSIGN(QueryListener);
100 #ifndef TIZEN_MIGRATION
101 void FireImpl(Tizen::Base::Runtime::IEventListener& rListener, const Tizen::Base::Runtime::IEventArg& rArgs);
105 HERE_MAPS_END_NAMESPACE