summaryrefslogtreecommitdiff
path: root/plugins/CloudFile/src/Services/microsoft_service.h
blob: 8c3c30e0353d9b66edc2e8d7c0b75f55ab8a3b51 (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
#ifndef _CLOUDFILE_ONEDRIVE_H_
#define _CLOUDFILE_ONEDRIVE_H_

class COneDriveService : public CCloudService
{
private:
	static unsigned RequestAccessTokenThread(void *owner, void *param);

	void HandleJsonError(JSONNode &node);

	void CreateUploadSession(char *uploadUri, const char *name, const char *parentId = NULL);
	void UploadFileChunk(const char *uploadUri, const char *chunk, size_t chunkSize, uint64_t offset, uint64_t fileSize, char *itemId);
	void CreateFolder(const char *path, char *itemId);
	void CreateSharedLink(const char *itemId, char *url);

public:
	COneDriveService(HNETLIBUSER hConnection);

	const char* GetModule() const;
	const wchar_t* GetText() const;
	int GetIconId() const;

	bool IsLoggedIn();
	void Login();
	void Logout();

	UINT Upload(FileTransferParam *ftp);
};

#endif //_CLOUDFILE_ONEDRIVE_H_