<< Back
// FVSDK_Funcs.h : header file FTP Voyager Software Development Kit exported function declarations
//
// Copyright © 1997-2008 - Rhino Software, Inc.
// FTP Voyager® is a registered trademark of Rhino Software, Inc.
// http://www.RhinoSoft.com/
//
// Author:  Mark P. Peterson
// Date:    August 19, 2005
//
// You are free to use/modify this code but leave this header intact.
// FTP Voyager, the FTP Voyager Software Development Kit, and FtpTree ActiveX
// Control are not public domain.  Any registration IDs or non-public domain
// software from Rhino Software, Inc. remains copyrighted.  For more information
// refer to the license agreement distributed with the FTP Voyager SDK.
//
// If you decide to use the FTP Voyager Software Development Kit, or FtpTree
// ActiveX control, you must first purchase a license.  For more information
// visit http://www.RhinoSoft.com/
//------------------------------------------------------------------------------

// prevent multiple inclusions of this file
#ifndef _FVSDK_Funcs_HEADER
#define _FVSDK_Funcs_HEADER

/////////////////////////////////////////////////////////////////////////////
// other FTP Voyager SDK header files
#include "FVSDK_ErrorCodes.h"
#include "FVSDK_Session.h"
#include "FVSDK_FileInfo.h"
#include "FVSDK_TransferStatus.h"

/////////////////////////////////////////////////////////////////////////////
// macros
/*** FVSDK_SyncFolders(dwSyncOptions) Constants ***/
#define FVSDK_SYNCOPT_SYNCREMOTE                    0x0000      // applicable only when FVSDK_SYNCOPT_USEDIALOG is not set
#define FVSDK_SYNCOPT_SYNCLOCAL                     0x0001      // applicable only when FVSDK_SYNCOPT_USEDIALOG is not set
#define FVSDK_SYNCOPT_IGNORECASE                    0x0002      // ignore file and directory letter case when comparing the local and remote files and directories
#define FVSDK_SYNCOPT_COMPARESIZE                   0x0004      // compare file size when determining the required synchronize folders action
#define FVSDK_SYNCOPT_COMPARETIME                   0x0008      // compare the file time when determining the required synchronize folders action
#define FVSDK_SYNCOPT_INCLUDEDIRS                   0x0010      // search subdirectories in addition to the specified directories
#define FVSDK_SYNCOPT_DONTDELETE                    0x0020      // don't delete any files when synchronizing (i.e., when the file doesn't also exist in the other directory)
#define FVSDK_SYNCOPT_OVERWRITECONFIRMATIONS        0x0040      // prompt the user prior to overwriting files, asking the user's permission
#define FVSDK_SYNCOPT_DELETECONFIRMATIONS           0x0080      // prompt the user prior to deleting files, (FVSDK_SYNCOPT_DONTDELETE must not be set)
#define FVSDK_SYNCOPT_REMOTEIGNORENEWER             0x0100      // do not perform the date / time comparison on files that are newer on the server (important for systems where the file date and time cannot be maintained after uploads)
#define FVSDK_SYNCOPT_REMOTEIGNOREOLDER             0x0200      // do not perform the date / time comparison on files that are older on the server
#define FVSDK_SYNCOPT_LOCALIGNORENEWER              0x0400      // do not perform the date / time comparison on files that are newer on the local machine
#define FVSDK_SYNCOPT_LOCALIGNOREOLDER              0x0800      // do not perform the date / time comparison on files that are older on the local machine (important for systems where the file date and time cannot be maintained after uploads)
#define FVSDK_SYNCOPT_MINIMIZESTATUSDIALOGS         0x1000      // pop-up transfer dialogs may be used, but minimize them
#define FVSDK_SYNCOPT_QUEUEERRORMESSAGES            0x2000      // put all errors into a queue for display when complete
#define FVSDK_SYNCOPT_IGNORESYMBOLICLINKS           0x4000      // when UNIX symbolic links are encountered, do not attempt to synchronize these files or directories
#define FVSDK_SYNCOPT_USEDIALOG                     0x8000      // present the FTP Voyager Synchronize Folders dialog to the user; when not set, the synchronize folders operations are carried out with no user intervention
/*** END FVSDK_SyncFolders(dwSyncOptions) ***/

/////////////////////////////////////////////////////////////////////////////
// exported functions

// DLL management
STDAPI_(FVSDK_ERROR_CODE) FVSDK_BuildDate(FVSDK_TIME* ptmTime);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_Version(char* pszBuffer, int nBufferSize);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_FtpTreeBuildDate(FVSDK_Session* pSession, FVSDK_TIME* ptmTime);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_FtpTreeVersion(FVSDK_Session* pSession, char* pszBuffer, int nBufferSize);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_SetRegistrationID(char* pszRegistrationID);

// session management
STDAPI_(FVSDK_ERROR_CODE) FVSDK_ValidSession(FVSDK_Session* pSession);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_InitSession(FVSDK_Session* pSession, BOOL bDynamic);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_CloseSession(FVSDK_Session* pSession);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_NewSession(FVSDK_Session** ppNewSession);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_FreeSession(FVSDK_Session* pSession);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_ApplySessionChange(FVSDK_Session* pSession);

// connection
STDAPI_(FVSDK_ERROR_CODE) FVSDK_Connect(FVSDK_Session* pSession);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_Disconnect(FVSDK_Session* pSession);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_Connected(FVSDK_Session* pSession);

// general operations
STDAPI_(FVSDK_ERROR_CODE) FVSDK_Working(FVSDK_Session* pSession);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_Stop(FVSDK_Session* pSession);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_LastOperationStopped(FVSDK_Session* pSession);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_GetLastResponse(FVSDK_Session* pSession, UINT nIndex, char* pszBuffer, int nBufferSize);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_GetWelcomeMessage(FVSDK_Session* pSession, UINT nIndex, char* pszBuffer, int nBufferSize);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_SendCommand(FVSDK_Session* pSession, LPCTSTR pszCommand, int* pnResp);

// directory operations
STDAPI_(FVSDK_ERROR_CODE) FVSDK_GetCurrentDirectory(FVSDK_Session* pSession, LPSTR pszBuffer, int nBufferSize);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_SetCurrentDirectory(FVSDK_Session* pSession, LPCTSTR pszPathName);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_UpOneDirectory(FVSDK_Session* pSession);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_CreateDirectory(FVSDK_Session* pSession, LPCTSTR pszPathName);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_RemoveDirectory(FVSDK_Session* pSession, LPCTSTR pszPathName);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_RemoveFile(FVSDK_Session* pSession, LPCTSTR pszPathName);

// file operations
STDAPI_(FVSDK_ERROR_CODE) FVSDK_Rename(FVSDK_Session* pSession, LPCTSTR pszOldPathName, LPCTSTR pszNewPathName);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_Size(FVSDK_Session* pSession, LPCTSTR pszPathName, FVSDK_FILE_SIZE* pFileSize);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_OpenFile(FVSDK_Session* pSession, LPCTSTR pszFileName, BOOL bBinary, FVSDK_FILE_SIZE fsResumeLoc);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_CreateFile(FVSDK_Session* pSession, LPCTSTR pszFileName, BOOL bBinary, FVSDK_FILE_SIZE fsResumeLoc);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_OpenFileRW(FVSDK_Session* pSession, LPCTSTR pszFileName, BOOL bRead, BOOL bBinary, FVSDK_FILE_SIZE fsResumeLoc);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_ReadFile(FVSDK_Session* pSession, PBYTE pBuffer, int* pnBufferSize);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_WriteFile(FVSDK_Session* pSession, PBYTE pBuffer, int* pnBufferSize, BOOL bEnd);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_CloseFile(FVSDK_Session* pSession);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_SetFileDateAndTime(FVSDK_Session* pSession, LPCTSTR pszFileName, FVSDK_TIME* ptmLocalDate);

// directory listing
STDAPI_(FVSDK_ERROR_CODE) FVSDK_ValidFileInfo(FVSDK_FileInfo* pFileInfo);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_FindFile(FVSDK_Session* pSession, LPCTSTR pszFileName);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_FindNextFile(FVSDK_Session* pSession, FVSDK_FileInfo* pFileInfo);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_FindFileClose(FVSDK_Session* pSession);

// file transfer
STDAPI_(FVSDK_ERROR_CODE) FVSDK_Download(FVSDK_Session* pSession, LPCTSTR pszSourcePath, LPCTSTR pszDestPath);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_Upload(FVSDK_Session* pSession, LPCTSTR pszSourcePath, LPCTSTR pszDestPath);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_MoveDown(FVSDK_Session* pSession, LPCTSTR pszSourcePath, LPCTSTR pszDestPath);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_MoveUp(FVSDK_Session* pSession, LPCTSTR pszSourcePath, LPCTSTR pszDestPath);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_RemoteEdit(FVSDK_Session* pSession, LPCTSTR pszFilePath);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_RemoteView(FVSDK_Session* pSession, LPCTSTR pszFilePath);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_TransferMessage(FVSDK_Session* pSession, DWORD dwTransferStatusHandle, DWORD dwMessage, DWORD dwParams);

// high level U/I functions
STDAPI_(FVSDK_ERROR_CODE) FVSDK_FindFilesDialog(FVSDK_Session* pSession, LPCTSTR pszDirectoryPath);
STDAPI_(FVSDK_ERROR_CODE) FVSDK_SyncFolders(FVSDK_Session* pSession, LPCTSTR pszRemotePath, LPCTSTR pszLocalPath, DWORD dwSyncOptions, LPCTSTR pszIgnoreStartingWith, long nMaxThreads);

/////////////////////////////////////////////////////////////////////////////
#endif