// FVSDK_TransferStatus.h : header file FTP Voyager Software Development Kit transfer status information
//
// 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 29, 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_TransferStatus_HEADER
#define _FVSDK_TransferStatus_HEADER
#include "FVSDK_ErrorCodes.h"
#include "FVSDK_FileInfo.h"
/////////////////////////////////////////////////////////////////////////////
// pack to one byte boundaries
#pragma pack(push)
#pragma pack(1)
/////////////////////////////////////////////////////////////////////////////
// version numbers
const UINT FVSDK_TRANSFER_STATUS_VERSION_1 = 1;
// the current file info structure version
#define FVSDK_TRANSFER_STATUS_CURRENT_VERSION FVSDK_TRANSFER_STATUS_VERSION_1
/*** pfnNotifyTransferStatus(nStatus) Constants ***/
const UINT FVSDK_TRANSFER_NEW = 0; // a new file transfer has started
const UINT FVSDK_TRANSFER_END = 1; // a file transfer is complete
const UINT FVSDK_TRANSFER_SET_FILE_COUNT = 2; // establishes the number of files to be transferred in a multiple file transfer
const UINT FVSDK_TRANSFER_SET_FILE = 3; // the file has changed in a multiple file transfer
const UINT FVSDK_TRANSFER_SET_SIZE = 4; // the file size has changed for a multiple file transfer
const UINT FVSDK_TRANSFER_SET_POS = 5; // the file position has changed for a multiple file transfer
const UINT FVSDK_TRANSFER_INCREMENT_BYTE_OS = 6; // the byte offset for a transfer has changed, usually indicating a resume operation
const UINT FVSDK_TRANSFER_SET_BYTE_OS = 7; // the byte offset for a transfer has been reset, usually indicating a resume operation
/*** END pfnNotifyTransferStatus(nStatus) ***/
/*** FVSDK_TransferMessage(dwMessage) Constants ***/
const DWORD FVSDK_TRANSFER_STATUS_CANCEL = 1; // cancel the transfer all together
const DWORD FVSDK_TRANSFER_STATUS_SKIP_FILE = 2; // skip the current file (multiple file transfers only)
const DWORD FVSDK_TRANSFER_STATUS_STOP_AFTER_DONE = 3; // stop after the current file completes (multiple file transfers only)
/*** END FVSDK_TransferMessage(dwMessage) ***/
// maximum path size plus some for room
#define FVSDK_MAX_PATH (MAX_PATH * 2)
/////////////////////////////////////////////////////////////////////////////
// FVSDK_TransferStatus structure
/*** FVSDK_TransferStatus Structure Description ***
The FVSDK_TransferStatus structure is passed to your application by the pfnNotifyTransferStatus
callback function pointer in the FVSDK_Session structure. This structure identifies a unique
transfer operation by the dwHandle variable. The nSize variable refers to the number of bytes
allocated to the structure. This value is set by the FTP Voyager SDK.
The nVersion variable will always be FVSDK_TRANSFER_STATUS_CURRENT_VERSION.
*** End Description ***/
/*** BEGIN FVSDK_TransferStatus ***/
typedef struct FVSDK_TransferStatusStruct
{
// administrative variables
UINT nSize; // size, in bytes, of this structure (set by the FVSDK)
UINT nVersion; // version number of this structure; use the largest version number defined in FVSDK_TransferStatus.h. Should always be FVSDK_TRANSFER_STATUS_CURRENT_VERSION
DWORD dwHandle; // unique identifier
// information about the transfer session
BOOL bDownload; // TRUE when files are being downloaded, FALSE when being uploaded
BOOL bMove; // TRUE when files are being moved either up or down
BOOL bMultiple; // TRUE when more than one file is being transferred
// information about the current file(s)
char pszFilePath[FVSDK_MAX_PATH]; // the file path
FVSDK_FILE_SIZE fsFileSize; // the file size, in bytes
FVSDK_FILE_SIZE fsPos; // the position in the file
// information about the multiple file transfer
FVSDK_FILE_SIZE fsOverallSize; // the total number of bytes to be transferred (all files)
FVSDK_FILE_SIZE fsOverallPos; // the current position within the total overall size (all files)
// multiple files
long nFileNum; // the file number being transferred
long nTotalFiles; // the total number of files to be transferred
// transfer rate
double dBytesPerSecond; // the total number of bytes per second being transferred
// estimated transfer completion
DWORD dwRemainingHours; // the estimated number of hours to completion
DWORD dwRemainingMinutes; // the estimated number of minutes to completion
DWORD dwRemainingSeconds; // the estimated number of seconds to completion
} FVSDK_TransferStatus;
/*** END FVSDK_TransferStatus ***/
// restore structure packing
#pragma pack(pop)
/////////////////////////////////////////////////////////////////////////////
#endif