-
Notifications
You must be signed in to change notification settings - Fork 0
/
BundleDownloader.h
65 lines (47 loc) · 1.19 KB
/
BundleDownloader.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
* BundleDownloader.h
*
* Created on: Apr 4, 2012
* Author: iraklis
*/
#ifndef BUNDLEDOWNLOADER_H_
#define BUNDLEDOWNLOADER_H_
#include <MAUtil/Environment.h>
#include <MAUtil/Connection.h>
#include <wchar.h>
#include <MAUtil/Downloader.h>
using namespace MAUtil;
class BundleListener
{
public:
virtual void bundleDownloaded(MAHandle data);
};
class BundleDownloader: public TextBoxListener, ConnectionListener, public DownloadListener
{
public:
BundleDownloader(BundleListener *bl);
void textBoxClosed(int result, int textLength);
void connectFinished(Connection *conn, int result);
void connRecvFinished(Connection *conn, int result);
void downloadBundle();
void downloadCancelled(Downloader* downloader);
void error(Downloader* downloader, int code);
void finishedDownloading(Downloader* downloader, MAHandle data);
private:
BundleListener *mBundleListener;
wchar mWServerAddress[128];
char mServerAddress[128];
Connection mSocket;
bool hasPage;
/**
* Buffer for TCP messages
*/
char mBuffer[1024];
/**
* Buffer for the bundle address
*/
char mBundleAddress[256];
Downloader *mDownloader;
MAHandle mResourceFile;
};
#endif /* BUNDLEDOWNLOADER_H_ */