home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / d / desklib / !DeskLib / h_doc / Export < prev    next >
Encoding:
Text File  |  1996-12-04  |  1.5 KB  |  51 lines

  1. #ifndef __Desk_Export_h
  2. #define __Desk_Export_h
  3.  
  4. #ifndef __Desk_wimp_h
  5.     #include "Desk.Wimp.h"
  6. #endif
  7.  
  8. typedef int (*Desk_export_filesaver)( const char *filename, void *reference);
  9. /* 
  10. This type of function should save data to file given by 'filename',
  11. using info in 'reference'. It should return 0 if it was successful.
  12. 'ref' is the (void *) originally passed to
  13.  */
  14.  
  15. typedef int (*Desk_export_ramsaver)( Desk_message_block* ramfetch, int progress, void* reference);
  16. /*
  17. This type of function should Wimp_TransferBlock data. Note that you can
  18. do this using multiple Wimp_TransferBlock's if this is more convenient.
  19. Should return the total number of bytes transfered into 'destbuffer' -
  20. if less than buffersize, then transfer has finished. If <0, error has
  21. occurred. 'reference' is the (void *) originally passed to
  22. Desk_Export_ExportData.
  23.  */
  24.  
  25.  
  26. typedef enum    {
  27.     Desk_export_result_OK    = 0,
  28.     Desk_export_result_RECEIVERFAILED,
  29.     Desk_export_result_FILESAVERFAILED,
  30.     Desk_export_result_RAMSAVERFAILED
  31.     }
  32.     Desk_export_result;
  33.  
  34.  
  35. typedef void (*Desk_export_resulthandler)( Desk_export_result result, void *reference);
  36.  
  37.  
  38. void    Desk_Export_ExportData(
  39.             Desk_event_pollblock*        event,        /* NULL or Desk_message_DATAREQUEST if relevent...        */
  40.             Desk_mouse_block*        mouse,        /* NULL if not saving from a drag. Note event_USERDRAG doesn't return mouse info */
  41.             const char*            leafname,
  42.             Desk_export_filesaver        filesaver,
  43.             Desk_export_ramsaver        ramsaver,
  44.             Desk_export_resulthandler    resulthandler,
  45.             size_t                estimatedsize,
  46.             int                filetype,
  47.             void*                reference
  48.             );
  49.  
  50. #endif
  51.