summaryrefslogtreecommitdiff
path: root/plugins/CloudFile/src/cloud_service.h
diff options
context:
space:
mode:
authoraunsane <aunsane@gmail.com>2017-05-07 02:25:29 +0300
committeraunsane <aunsane@gmail.com>2017-05-07 02:25:29 +0300
commitff6a107e5f566da2644fbfe36455467beafaeb1e (patch)
tree3d5b96794ee835c8686a74da6c418c440c91c403 /plugins/CloudFile/src/cloud_service.h
parent453b3de91c372ee7b2661771aead6675e12fe98f (diff)
CloudFile:
- reworked options to dupport default service - added options to select conflict behavior - multiple fix and refactoring - version bump
Diffstat (limited to 'plugins/CloudFile/src/cloud_service.h')
-rw-r--r--plugins/CloudFile/src/cloud_service.h37
1 files changed, 31 insertions, 6 deletions
diff --git a/plugins/CloudFile/src/cloud_service.h b/plugins/CloudFile/src/cloud_service.h
index ed35961cd6..edc4cdd90d 100644
--- a/plugins/CloudFile/src/cloud_service.h
+++ b/plugins/CloudFile/src/cloud_service.h
@@ -1,6 +1,13 @@
#ifndef _CLOUD_SERVICE_H_
#define _CLOUD_SERVICE_H_
+enum OnConflict
+{
+ NONE,
+ RENAME,
+ REPLACE,
+};
+
class CCloudService
{
protected:
@@ -12,6 +19,7 @@ protected:
char* PreparePath(const wchar_t *oldPath, char *newPath);
virtual char* HttpStatusToError(int status = 0);
+ virtual void HttpResponseToError(NETLIBHTTPREQUEST *response);
virtual void HandleHttpError(NETLIBHTTPREQUEST *response);
virtual void HandleJsonError(JSONNode &node) = 0;
@@ -23,8 +31,8 @@ public:
CCloudService(HNETLIBUSER hConnection);
virtual const char* GetModule() const = 0;
- virtual const wchar_t* GetText() const = 0;
- virtual int GetIconId() const = 0;
+ virtual const wchar_t* GetText() const;
+ virtual int GetIconId() const;
virtual bool IsLoggedIn() = 0;
virtual void Login() = 0;
@@ -34,11 +42,28 @@ public:
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);
};
+class CCloudServiceSearch : public CCloudService
+{
+private:
+ const char *m_search;
+
+protected:
+ void HandleJsonError(JSONNode&) { }
+
+public:
+ CCloudServiceSearch(const char *search)
+ : CCloudService(NULL), m_search(search) { }
+
+ const char* GetModule() const { return m_search; }
+
+ bool IsLoggedIn() { return false; }
+ void Login() { }
+ void Logout() { }
+
+ UINT Upload(FileTransferParam*) { return 0; }
+};
+
#endif //_CLOUD_SERVICE_H_ \ No newline at end of file