(* Title:   saveas.h
 * Purpose: export of data by dragging icon from dialogue box
 *
 *)

#ifndef __saveas_h
#define __saveas_h

#ifndef __xfersend_h
#include "xfersend.h"
#endif


(* ----------------------------- saveas -------------------------------------
 * Description:   Displays a dialogue box, for the user to export application
 *                data.
 *
 * Parameters:    int filetype -- type of file to save to
 *                char *name -- suggested file name
 *                int estsize -- estimated size of the file
 *                xfersend_saveproc -- caller-supplied function for saving
 *                                     application data to a file
 *                xfersend_sendproc -- caller-supplied function for RAM
 *                                     data transfer (if application is able
 *                                     to do this)
 *                xfersend_printproc -- caller-supplied function for printing
 *                                      application data, if "save icon" is
 *                                      dragged onto printer application
 *                void *handle -- handle to be passed to handler functions
 * Returns:       TRUE if data exported successfully.
 * Other Info:    This function displays a dialogue box with the following
 *                fields:
 *                     i) a sprite icon appropriate to the given file type
 *                    ii) the suggested filename
 *                   iii) an OK button
 *                (Note: a template called "xfer_send" must be in the
 *                application's templates file to use this function, set up
 *                as in the !Edit, !Draw and !Paint applications)
 *                Xfersend deals with the complexities of message-passing
 *                protocols to achieve the data transfer. Refer to the
 *                typedefs in xfersend.h for an explanation of what the
 *                three caller-supplied functions should do.
 *                If you pass 0 as the xfersend_sendproc, then no in-core
 *                data transfer will be attempted
 *                If you pass 0 as the xfersend_printproc, then the file
 *                format for printing is assumed to be the same as for saving
 *                The estimated file size is not essential, but may improve
 *                performance.
 *
 *)
procedure saveas(filetype : integer;
                name : string;
                estsize : integer;
                saveproc : xfersend_saveproc;
                sendproc : xfersend_sendproc;
                printproc : xfersend_printproc;
                handle : pointer) : boolean; extern;


(* ----------------------- saveas_read_leafname_during_send -----------------
 * Description:   Gets the "leaf" of the file name in the "filename" field
 *                of the "xfer-send" dialogue box.
 *
 * Parameters:    char *name -- buffer to put file name in
 *                int length -- size in bytes of supplied buffer
 * Returns:       void.
 * Other Info:    none.
 *
 *)
procedure saveas_read_leafname_during_send(name : string;
                                           length : integer); extern;

#endif

(* end saveas.h *)
