1 /**
2  * @file DelegateMEGARequestListener.h
3  * @brief Listener to reveice and send request events to the app
4  *
5  * (c) 2013-2014 by Mega Limited, Auckland, New Zealand
6  *
7  * This file is part of the MEGA SDK - Client Access Engine.
8  *
9  * Applications using the MEGA API must present a valid application key
10  * and comply with the the rules set forth in the Terms of Service.
11  *
12  * The MEGA SDK is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15  *
16  * @copyright Simplified (2-clause) BSD License.
17  *
18  * You should have received a copy of the license along with this
19  * program.
20  */
21 #import "MEGARequestDelegate.h"
22 #import "megaapi.h"
23 #import "MEGASdk.h"
24 
25 class DelegateMEGARequestListener : public mega::MegaRequestListener {
26 
27 public:
28 
29     DelegateMEGARequestListener(MEGASdk *megaSDK, id<MEGARequestDelegate>listener, bool singleListener = true);
30     id<MEGARequestDelegate>getUserListener();
31 
32     void onRequestStart(mega::MegaApi *api, mega::MegaRequest *request);
33     void onRequestFinish(mega::MegaApi *api, mega::MegaRequest *request, mega::MegaError *e);
34     void onRequestUpdate(mega::MegaApi *api, mega::MegaRequest *request);
35     void onRequestTemporaryError(mega::MegaApi *api, mega::MegaRequest *request, mega::MegaError *e);
36 
37 private:
38     MEGASdk *megaSDK;
39     id<MEGARequestDelegate>listener;
40     bool singleListener;
41 };