summaryrefslogtreecommitdiff
path: root/plugins/ExternalAPI/m_dropbox.h
blob: 3d2eacae5e486bb9b8ef0cb0062c4a1c8346cbe7 (plain)
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
#ifndef M_DROPBOX_H_
#define M_DROPBOX_H_

struct DropboxUploadInfo
{
	const TCHAR *localPath; // local path
	const TCHAR *serverFolder; // server folder in witch file will be placed (can be NULL)
};

// upload file on Dropbox
// wParam = (WPARAM)(char**) '\r\n' separated download links (can be NULL, otherwise should be manually free)
// lParam = (LPARAM)(const DropboxUploadInfo*)
// returns status of transfer.
// 0 on success otherwise fail
#define MS_DROPBOX_UPLOAD "Dropbox/Upload"

// upload file on Dropbox
// wParam = 0
// lParam = (LPARAM)(const DropboxUploadInfo*)
// returns file htansfer handle or NULL on failure
// returns immediately, without waiting for the send
// note, that you can track progress by using ME_PROTO_ACK
#define MS_DROPBOX_UPLOADASYNC "Dropbox/UploadAsync"

// if you want to get download links after upload
// use ME_DROPBOX_UPLOADED hook. you'll get:
struct DropboxUploadResult
{
	HANDLE hProcess;	// hProcess
	int status;			// status of transfer. 0 on success otherwise fail
	const char* data;	// '\r\n' separated download links
};

// notifies a caller that upload has been finished
// wParam = 0
// lParam = (LPARAM)(DropboxUploadResult*)
#define ME_DROPBOX_UPLOADED "Dropbox/Uploaded"

#endif //M_DROPBOX_H_