home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 594b.lha / Precognition_rel1 / pcg_FileReq.h < prev    next >
C/C++ Source or Header  |  1991-12-12  |  2KB  |  65 lines

  1. #ifndef PCG_FILEREQ_H
  2. #define PCG_FILEREQ_H
  3.  
  4. #include "Precognition.h"
  5. #include <libraries/dos.h>
  6.  
  7.  
  8. typedef BOOL (*frFileFilter)( struct FileInfoBlock *fib );
  9.  
  10.    /*
  11.    ** an 'frFileFilter' is a pointer to a function which accepts a
  12.    ** a 'FileInfoBlock' and returns TRUE iff that file should appear
  13.    ** in the requester.
  14.    **
  15.    ** This allows applications to filter out unwanted files from the
  16.    ** the requester.  e.g. the filter 'frsf_NoIcons' filters out ".info"
  17.    ** files.
  18.    */
  19.  
  20. BOOL frff_NoIcons( struct FileInfoBlock *fib );
  21.    /*
  22.    ** This filters out all files ending in ".info"
  23.    */
  24.  
  25. #define FULLPATHNAME_SIZE 129
  26.  
  27. typedef struct FileReqInfo
  28. {
  29.    Screen        *screen;
  30.    MsgPort       *SharedUserPort;
  31.    char          *title;
  32.    BOOL           MustExist;
  33.    char          *FullPathName; /* This needs to be a BIG (129) string */
  34.    frFileFilter   filter;
  35. } FileReqInfo;
  36.  
  37.    /*
  38.    ** File Requester information.
  39.    **
  40.    **    'screen' is the screen on which to open (NULL for workbench)
  41.    **
  42.    **    'title'  is the title of the file requester window
  43.    **
  44.    **    'MustExist' is a flag which indicates that the selected file
  45.    **                must already exist.
  46.    **
  47.    **    'filter' is a pointer to a function which filters out unwanted
  48.    **                files.  Use NULL to have all files.  Use 'frff_NoIcons'
  49.    **                to filter out ".info" files.  (Or create your own.)
  50.    **
  51.    **    FullPathName, if not null, is the default pathname.  The user
  52.    **                selection is also returned here.
  53.    **
  54.    */
  55.  
  56. BOOL pcg_FileReq( FileReqInfo *frInfo );
  57.  
  58.    /*
  59.    ** Precognition file requester.
  60.    **
  61.    ** Returns FALSE if the user selected "Cancel"
  62.    ** (or some other error occurred.)
  63.    */
  64.  
  65. #endif