diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-10-12 11:29:22 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-10-12 11:29:22 +0000 |
commit | 8473fb7c85680042038cc0ad40d4e22bb6a639e7 (patch) | |
tree | 3c0e0d3ddd863528e60dd98421d2129a22bd8e0d /plugins/FTPFileYM/src/job_generic.h | |
parent | 557f2816f5cd30705dec989c97a8a67c026d36d1 (diff) |
FTPFileYM: folders restructurization
git-svn-id: http://svn.miranda-ng.org/main/trunk@1885 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/FTPFileYM/src/job_generic.h')
-rw-r--r-- | plugins/FTPFileYM/src/job_generic.h | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/plugins/FTPFileYM/src/job_generic.h b/plugins/FTPFileYM/src/job_generic.h new file mode 100644 index 0000000000..618d891a82 --- /dev/null +++ b/plugins/FTPFileYM/src/job_generic.h @@ -0,0 +1,109 @@ +/*
+FTP File YM plugin
+Copyright (C) 2007-2010 Jan Holub
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation version 2
+of the License.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#pragma once
+
+#include "common.h"
+#include "dialog.h"
+#include "serverlist.h"
+
+class Event
+{
+private:
+ HANDLE handle;
+
+public:
+ Event() { handle = CreateEvent (0, FALSE, FALSE, 0); }
+ ~Event() { CloseHandle (handle); }
+
+ operator HANDLE () { return handle; }
+
+ void release() { SetEvent(handle); }
+ void wait() { WaitForSingleObject(handle, INFINITE); }
+};
+
+class GenericJob
+{
+private:
+ int openFileDialog();
+ int openFolderDialog();
+ void getFilesFromOpenDialog();
+ int getFilesFromFolder(TCHAR *stzFolder);
+ void addFile(TCHAR *fileName);
+
+public:
+ enum EMode
+ {
+ FTP_RAWFILE = 8,
+ FTP_ZIPFILE = 16,
+ FTP_ZIPFOLDER = 32
+ };
+
+ enum EStatus
+ {
+ STATUS_CREATED = 0,
+ STATUS_WAITING,
+ STATUS_CONNECTING,
+ STATUS_UPLOADING,
+ STATUS_PACKING,
+ STATUS_PAUSED,
+ STATUS_CANCELED,
+ STATUS_COMPLETED
+ };
+
+ HANDLE hContact;
+ int iFtpNum, fileID;
+ ServerList::FTP *ftp;
+ TCHAR stzFilePath[1024];
+ TCHAR stzFileName[64];
+ char szSafeFileName[64];
+ EMode mode;
+ EStatus status;
+
+ UploadDialog::Tab *tab;
+ vector<TCHAR *> files;
+ TCHAR * operator[] (int i) const { return files[i];}
+
+ GenericJob(HANDLE hContact, int iFtpNum, EMode mode);
+ GenericJob(GenericJob *job);
+ virtual ~GenericJob();
+
+ int getFiles();
+ int getFiles(void **objects, int objCount, DWORD flags);
+ void setStatus(EStatus status);
+
+ bool isCompleted();
+ bool isPaused();
+ bool isWaitting();
+ bool isConnecting();
+ bool isCanceled();
+
+ TCHAR *getStatusString();
+
+ virtual void start() = 0;
+ virtual void pause() = 0;
+ virtual void resume() = 0;
+ virtual void cancel() = 0;
+ virtual void addToUploadDlg() = 0;
+ virtual void pauseHandler() = 0;
+
+ virtual void refreshTab(bool bTabChanged);
+ virtual void closeTab() = 0;
+ virtual void closeAllTabs() = 0;
+ virtual void createToolTip() = 0;
+};
|