summaryrefslogtreecommitdiff
path: root/plugins/DropBox/src/dropBox_proto.h
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2014-02-18 18:25:28 +0000
committerAlexander Lantsev <aunsane@gmail.com>2014-02-18 18:25:28 +0000
commita154027918d0a5f2f270615e606d463e35a80d1e (patch)
tree54f7bbe311633b63c42e99568fa7f9a28936d478 /plugins/DropBox/src/dropBox_proto.h
parentcdbdcef6d92500b3b156ea6e304440e82621aa00 (diff)
added file transfer visualisation
added message with file download link cleaned project and code git-svn-id: http://svn.miranda-ng.org/main/trunk@8164 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/DropBox/src/dropBox_proto.h')
-rw-r--r--plugins/DropBox/src/dropBox_proto.h42
1 files changed, 36 insertions, 6 deletions
diff --git a/plugins/DropBox/src/dropBox_proto.h b/plugins/DropBox/src/dropBox_proto.h
index 2127755059..b79f405fdc 100644
--- a/plugins/DropBox/src/dropBox_proto.h
+++ b/plugins/DropBox/src/dropBox_proto.h
@@ -5,18 +5,49 @@
#include "http_request.h"
#define DROPBOX_API_VER "1"
-
+#define DROPBOX_API_ROOT "sandbox"
#define DROPBOX_API_URL "https://api.dropbox.com/" DROPBOX_API_VER
#define DROPBOX_APICONTENT_URL "https://api-content.dropbox.com/" DROPBOX_API_VER
#define DROPBOX_API_KEY "fa8du7gkf2q8xzg"
-#include "..\..\DropBoxApi\sekret_key.h"
+#include "..\..\DropBox\secret_key.h"
-#define DROPBOX_FILE_CHUNK_SIZE 100 * 1024 //100 KB
-//4 * 1024 * 1024 // 4 MB
+#define DROPBOX_FILE_CHUNK_SIZE 1024 * 1024 //1 MB
extern ULONG g_fileId;
+struct FileTransferParam
+{
+ HANDLE hProcess;
+ PROTOFILETRANSFERSTATUS pfts;
+
+ FileTransferParam()
+ {
+ pfts.cbSize = sizeof(this->pfts);
+ pfts.flags = PFTS_UTF;
+ pfts.currentFileNumber = 0;
+ pfts.currentFileProgress = 0;
+ pfts.currentFileSize = 0;
+ pfts.currentFileTime = 0;
+ pfts.totalBytes = 0;
+ pfts.totalFiles = 0;
+ pfts.totalProgress = 0;
+ pfts.tszWorkingDir = NULL;
+ pfts.wszCurrentFile = NULL;
+ }
+
+ ~FileTransferParam()
+ {
+ for (int i = 0; pfts.pszFiles[pfts.totalFiles]; i++)
+ {
+ delete pfts.pszFiles[i];
+ }
+ delete pfts.pszFiles;
+ }
+};
+
+bool HasAccessToken();
+
void SetContactStatus(MCONTACT hContact, int newStatus);
bool DropBoxLogIn();
@@ -26,14 +57,13 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam);
INT_PTR DropBoxGetCaps(WPARAM wParam, LPARAM lParam);
INT_PTR DropBoxSendMessage(WPARAM wParam, LPARAM lParam);
-INT_PTR DropBoxReceiveMessage(WPARAM wParam, LPARAM lParam);
HttpRequest *DropBoxCreateFileChunkedRequest(const char *data, int length);
bool DropBoxSendFileChunkedStart(const char *data, int length, char *uploadId, int &offset);
bool DropBoxSendFileChunkedNext(const char *data, int length, const char *uploadId, int &offset);
bool DropBoxSendFileChunkedEnd(const char *fileName, const char *uploadId, MCONTACT hContact);
-void DropBoxAsyncFileSend(void *args);
+void DropBoxAsyncFileSend(void *arg);
INT_PTR DropBoxSendFile(WPARAM wParam, LPARAM lParam);