summaryrefslogtreecommitdiff
path: root/plugins/CloudFile/src/cloud_service.h
diff options
context:
space:
mode:
authoraunsane <aunsane@gmail.com>2017-04-16 01:32:19 +0300
committeraunsane <aunsane@gmail.com>2017-04-16 01:32:58 +0300
commit0b9fa1d90f8d0aff7118837ceb1211b578a5a9c8 (patch)
tree3b8be7b839a98a3a52a38d713c2d708ada015510 /plugins/CloudFile/src/cloud_service.h
parent008fb731e3e3b587f596afba1cfe7446de7f0cac (diff)
CloudFile: initial commit
- Dropbox (worked) - Yandex.Disk (worked) - GDrive (not worked)
Diffstat (limited to 'plugins/CloudFile/src/cloud_service.h')
-rw-r--r--plugins/CloudFile/src/cloud_service.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/plugins/CloudFile/src/cloud_service.h b/plugins/CloudFile/src/cloud_service.h
new file mode 100644
index 0000000000..8d52e4cea0
--- /dev/null
+++ b/plugins/CloudFile/src/cloud_service.h
@@ -0,0 +1,41 @@
+#ifndef _CLOUD_SERVICE_H_
+#define _CLOUD_SERVICE_H_
+
+class CCloudService
+{
+protected:
+ HNETLIBUSER hConnection;
+
+ // utils
+ char* PreparePath(const char *oldPath, char *newPath);
+ char* PreparePath(const wchar_t *oldPath, char *newPath);
+
+ virtual char* HttpStatusToError(int status = 0);
+ virtual void HandleHttpError(NETLIBHTTPREQUEST *response);
+ virtual void HandleJsonError(JSONNode &node) = 0;
+
+ JSONNode GetJsonResponse(NETLIBHTTPREQUEST *response);
+
+public:
+ std::map<MCONTACT, HWND> InterceptedContacts;
+
+ CCloudService(HNETLIBUSER hConnection);
+
+ virtual const char* GetModule() const = 0;
+ virtual const wchar_t* GetText() const = 0;
+ virtual HANDLE GetIcon() const = 0;
+
+ virtual bool IsLoggedIn() = 0;
+ virtual void Login() = 0;
+ virtual void Logout() = 0;
+
+ virtual UINT Upload(FileTransferParam *ftp) = 0;
+
+ void SendToContact(MCONTACT hContact, const wchar_t *data);
+ void PasteToInputArea(MCONTACT hContact, const wchar_t *data);
+ void PasteToClipboard(const wchar_t *data);
+
+ void Report(MCONTACT hContact, const wchar_t *data);
+};
+
+#endif //_CLOUD_SERVICE_H_ \ No newline at end of file