#ifndef __DragSend__H
#define __DragSend__H

#include <stdbool.h>
#include "WimpLib:DragDrop.h"
#include "WimpLib:XFer.h"

#ifdef __cplusplus
extern "C" {
#endif

/* ---------------------------- DragDrop_Send ----------------------------------
 * Description: Allows the user to export application data on return on the
 *              DragDrop protocol.
 *
 * Parameters:  DragDrop_Info   Info returned by the DragDrop protocol
 *              char* filename  suggested file name
 *              int estsize     estimated size of the file
 *              FNSendProc      caller-supplied function for providing
 *                              application data chunks during the
 *                              data transfer
 *              FNRemoveProc    caller-supplied function to delete source
 *                              data when transfer is completed
 *                              or 0 if source data must remain intact
 *              FNOnSafeProc    caller-supplied function for updating
 *                              application data modif status and
 *                              filename if it was a safe transfer to a file
 *                              or 0 (i.e. when saving a selection)
 *              FNPrintProc     caller-supplied function for printing
 *                              application data, if "icon" is
 *                              dragged onto printer application
 *                              ! not supported yet !
 *              FNOnErrorProc   caller-supplied function for reporting
 *                              errors occurring during the transfer
 *              void* handle    handle to be passed to handler functions.
 *
 * Returns:     true if transfer was completed successfully.
 *
 * Other Info:  You should typically call this function on exit from
 *              DragDrop_DragFile and it will call XFer_Send with the appropriate
 *              parameters. See XFerSend for more details.
 *
 */

bool DragDrop_Send(   const DragDrop_Info* pInfo
		, const char* filename
		, int estsize
		, XFer_SendProc FNSend
		, XFer_RemoveProc FNRemove
		, XFer_OnSafeProc FNOnSafe
		, XFer_PrintProc FNPrint
		, XFer_OnErrorProc FNOnError
		, bool asfileonly
		, void* handle);

/* ---------------------------- DragDrop_Transfer ----------------------------------
 * Description: Allows the user to internally transfer data on return on the
 *              DragDrop protocol.
 *
 * Parameters:  DragDrop_Info   Info returned by the DragDrop protocol
 *              void* data      handle of the data to be passed to handler functions.
 *
 * Returns:     true if transfer was completed successfully.
 *
 * Other Info:  You should typically call this function on exit from
 *              DragDrop_DragFile when pInfo->FTransfer is not NULL.
 *
 */

bool DragDrop_Transfer(const DragDrop_Info* pInfo
		, XFer_RemoveProc FNRemove
		, void* data
		, void* handle);

#ifdef __cplusplus
}
#endif

#endif
