/* SaveBox.h */

#include "DeskLib:Wimp.h"
  

/* The SaveBox system requires the following:
  
  1. EventMsg_Initialise() must be called.
  
  2. There must exist a template called SaveBox (As included in the
!DLibEx.Templates file).

  3. You must link with the AttachMenu module.
  
To use it, call SaveBox_PopUp in response to a message_MENUWARNING
(it can be called from a menu handler). The file type must correspond
to the icon you have used in the save box template. i.e. if the icon
is file_fff, pass 0xfff.
  
*/




/* Function to save your data */

/* safe==TRUE if you can unset 'modified' flag */
/* return TRUE if save was successful */

typedef BOOL (*save_handler)(char *name,BOOL safe,void *ref);
                                      



/* Save box control block. Internal use only */

typedef struct {
  save_handler funct;
  void *ref;            
  int ftype;
} savebox_control;



/* Initialise the SaveBox system */

void SaveBox_Initialise(void);  




/* Open a save as: dialog box. Supply default name, file type, save
   handler and referance to pass to the save handler */

void SaveBox_PopUp(char *name,int ftype,save_handler f,void *ref);

                     


/* Internal use ONLY */

BOOL SaveBox_Mouse(event_pollblock *,void *);
BOOL SaveBox_DragDone(event_pollblock *,void *);
BOOL SaveBox_SaveAck(event_pollblock *,void *);
BOOL SaveBox_LoadAck(event_pollblock *,void *);
BOOL SaveBox_KeyPress(event_pollblock *,void *);
BOOL SaveBox_QuickSave(savebox_control *);


