summaryrefslogtreecommitdiff
path: root/plugins/ExternalAPI/m_ftpfile.h
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2012-06-29 05:38:03 +0000
committerKirill Volinsky <mataes2007@gmail.com>2012-06-29 05:38:03 +0000
commitaf7e438cfe8ce85e1da234318ed1584e89d952cc (patch)
tree4cdb1379ef8d6c00389aa89cfb27a404ae2aba56 /plugins/ExternalAPI/m_ftpfile.h
parent230623d50baff4e8bf13a8572e0b895bad7b7ed4 (diff)
only add some plugins and protocols, not adapted
See please maybe not all need us git-svn-id: http://svn.miranda-ng.org/main/trunk@678 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/ExternalAPI/m_ftpfile.h')
-rw-r--r--plugins/ExternalAPI/m_ftpfile.h119
1 files changed, 119 insertions, 0 deletions
diff --git a/plugins/ExternalAPI/m_ftpfile.h b/plugins/ExternalAPI/m_ftpfile.h
new file mode 100644
index 0000000000..6575fd9e3b
--- /dev/null
+++ b/plugins/ExternalAPI/m_ftpfile.h
@@ -0,0 +1,119 @@
+/*
+FTP File YM plugin
+Copyright (C) 2007-2010 Jan Holub
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This 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
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+
+#ifndef __M_FTP_FILE_H__
+#define __M_FTP_FILE_H__
+
+#define FNUM_DEFAULT 0 // user's default FTP server
+#define FNUM_FTP1 1 // first FTP server in setting
+#define FNUM_FTP2 2 // second...
+#define FNUM_FTP3 3
+#define FNUM_FTP4 4
+#define FNUM_FTP5 5
+
+#define FMODE_RAWFILE 1 // Object list contains path(s) to file(s) which will be uploaded as they are
+#define FMODE_ZIPFILE 2 // ... path(s) to file(s) which will be zipped and uploaded as one ZIP file
+#define FMODE_ZIPFOLDER 4 // ... path to folder which will be zipped and uploaded as one ZIP file (objectCount == 1)
+
+#define FUPL_UNICODE 1 // Object list contains WCHAR* paths
+
+#if defined _UNICODE || defined UNICODE
+#define FUPL_TCHAR FUPL_UNICODE
+#else
+#define FUPL_TCHAR 0
+#endif
+
+typedef struct
+{
+ int cbSize; // size of the structure
+ HANDLE hContact; // contact handle, can be NULL
+ BYTE ftpNum; // number of the FTP server which will be used for upload, can be one of FNUM_* values
+ BYTE mode; // upload mode, can be one of FMODE_* values
+ DWORD flags; // bitwise OR of the FUPL_* flags above
+
+ union {
+ TCHAR **pstzObjects; // pointer to the array of the object(s) to upload, content is determined by MODE value
+ char **pszObjects;
+ wchar_t **pswzObjects;
+ };
+
+ int objectCount; // number of items in Object list
+} FTPUPLOAD;
+
+//
+// Send file(s) or folder in selected mode to the FTP server
+// wParam = (WPARAM)0; not used
+// lParam = (LPARAM)(FTPUPLOAD*)&ftpu; pointer to FTPUPLOAD
+// returns 0 if upload started with no errors, nonzero otherwise
+//
+#define MS_FTPFILE_UPLOAD "FTPFile/Upload"
+
+__inline static INT_PTR FTPFileUploadA(HANDLE hContact, BYTE ftpNum, BYTE mode, char **pszObjects, int objCount)
+{
+ FTPUPLOAD ftpu = {0};
+ ftpu.cbSize = sizeof(ftpu);
+ ftpu.hContact = hContact;
+ ftpu.ftpNum = ftpNum;
+ ftpu.mode = mode;
+ ftpu.pszObjects = pszObjects;
+ ftpu.objectCount = objCount;
+ return CallService(MS_FTPFILE_UPLOAD, (WPARAM)0, (LPARAM)&ftpu);
+}
+
+__inline static INT_PTR FTPFileUploadW(HANDLE hContact, BYTE ftpNum, BYTE mode, wchar_t **pswzObjects, int objCount)
+{
+ FTPUPLOAD ftpu = {0};
+ ftpu.cbSize = sizeof(ftpu);
+ ftpu.hContact = hContact;
+ ftpu.ftpNum = ftpNum;
+ ftpu.mode = mode;
+ ftpu.flags = FUPL_UNICODE;
+ ftpu.pswzObjects = pswzObjects;
+ ftpu.objectCount = objCount;
+ return CallService(MS_FTPFILE_UPLOAD, (WPARAM)0, (LPARAM)&ftpu);
+}
+
+#if defined _UNICODE || defined UNICODE
+#define FTPFileUpload FTPFileUploadW
+#else
+#define FTPFileUpload FTPFileUploadA
+#endif
+
+//
+// Show a simple file manager
+// wParam = (WPARAM)0; not used
+// lParam = (LPARAM)0; not used
+// returns 0 always
+//
+#define MS_FTPFILE_SHOWMANAGER "FTPFile/ShowManager"
+
+__inline static INT_PTR FTPFileShowManager()
+{
+ return CallService(MS_FTPFILE_SHOWMANAGER, (WPARAM)0, (LPARAM)0);
+}
+
+//
+// OBSOLOTE SERVICE (used by Send Screenshot plugin)
+// Do NOT use it!
+//
+#define MS_FTPFILE_SHAREFILE "FTPFile/ShareFiles"
+
+#endif \ No newline at end of file