home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / Includes_and_Autodocs_3.5 / include / gadgets / getfile.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-10-19  |  5.4 KB  |  146 lines

  1. #ifndef GADGETS_GETFILE_H
  2. #define GADGETS_GETFILE_H
  3. /*
  4. **    $VER: getfile.h 44.1 (19.10.1999)
  5. **    Includes Release 44.1
  6. **
  7. **  Definitions for the getfile.gadget BOOPSI class
  8. **
  9. **    (C) Copyright 1987-1999 Amiga, Inc.
  10. **        All Rights Reserved
  11. */
  12.  
  13. /*****************************************************************************/
  14.  
  15. #ifndef REACTION_REACTION_H
  16. #include <reaction/reaction.h>
  17. #endif
  18.  
  19. #ifndef INTUITION_GADGETCLASS_H
  20. #include <intuition/gadgetclass.h>
  21. #endif
  22.  
  23. /*****************************************************************************/
  24.  
  25. /* Attributes defined by the getfile.gadget class
  26.  */
  27. #define GETFILE_Dummy            (REACTION_Dummy + 0x60000)
  28.  
  29. #define GETFILE_TitleText        (GETFILE_Dummy+1)
  30.     /* (STRPTR) Requester title text (default: None) (OM_NEW, OM_SET) */
  31.  
  32. #define GETFILE_LeftEdge        (GETFILE_Dummy+2)
  33. #define GETFILE_TopEdge            (GETFILE_Dummy+3)
  34.     /* (WORD) Requester coordinates  (default leftedge: 30, topedge: 20) (OM_NEW, OM_SET, OM_GET) */
  35.  
  36. #define GETFILE_Width            (GETFILE_Dummy+4)
  37. #define GETFILE_Height            (GETFILE_Dummy+5)
  38.     /* (WORD) Requester dimensions (default height: 200, width: 300) (OM_NEW, OM_SET, OM_GET) */
  39.  
  40. #define GETFILE_File            (GETFILE_Dummy+6)
  41.     /* (STRPTR) Contents of File gadget (default: None) (OM_NEW, OM_SET, OM_GET, OM_NOTIFY) */
  42.  
  43. #define GETFILE_Drawer            (GETFILE_Dummy+7)
  44.     /* (STRPTR) Contents of Drawer gadget (default: None) (OM_NEW, OM_SET, OM_GET, OM_NOTIFY) */
  45.  
  46. #define GETFILE_FullFile        (GETFILE_Dummy+8)
  47.     /* (STRPTR) Complete file name. Replaces GETFILE_Drawer and GETFILE_File (default: None)
  48.             (OM_NEW, OM_SET, OM_GET, OM_NOTIFY)
  49.     */
  50.  
  51. #define GETFILE_FullFileExpand    (GETFILE_Dummy+9)
  52.     /* (BOOL) GETFILE_FullFile will give complete file name(s) expanded with NameFromLock() to
  53.             remove relative paths. (default: TRUE) (OM_NEW, OM_SET)
  54.     */
  55.  
  56. #define GETFILE_Pattern            (GETFILE_Dummy+10)
  57.     /* (STRPTR) Contents of Pattern gadget (default: "#?") (OM_NEW, OM_SET, OM_GET) */
  58.  
  59. #define GETFILE_DoSaveMode        (GETFILE_Dummy+11)
  60.     /* (BOOL) Being used for saving? (default: FALSE) (OM_NEW, OM_SET) */
  61.  
  62. #define GETFILE_DoMultiSelect    (GETFILE_Dummy+12)
  63.     /* (BOOL) Do multi-select? (default: FALSE) (OM_NEW, OM_SET) */
  64.  
  65. #define GETFILE_DoPatterns        (GETFILE_Dummy+13)
  66.     /* (BOOL) Display a Pattern gadget? (default: FALSE) (OM_NEW, OM_SET) */
  67.  
  68. #define GETFILE_DrawersOnly        (GETFILE_Dummy+14)
  69.     /* (BOOL) Don't display files? (default: FALSE) (OM_NEW, OM_SET) */
  70.  
  71. #define GETFILE_FilterFunc        (GETFILE_Dummy+15)
  72.     /* (struct Hook *) Function to filter files (default: None) (OM_NEW, OM_SET)  */
  73.  
  74. #define GETFILE_RejectIcons        (GETFILE_Dummy+16)
  75.     /* (BOOL) Display .info files? (default: FALSE) (OM_NEW, OM_SET)  */
  76.  
  77. #define GETFILE_RejectPattern    (GETFILE_Dummy+17)
  78.     /* (UBYTE *) Don't display files matching pattern (default: None) (OM_NEW, OM_SET) */
  79.  
  80. #define GETFILE_AcceptPattern    (GETFILE_Dummy+18)
  81.     /* (UBYTE *) Accept only files matching pattern (default: None) (OM_NEW, OM_SET) */
  82.  
  83. #define GETFILE_FilterDrawers    (GETFILE_Dummy+19)
  84.     /* (BOOL) Also filter drawers with pattern (default: FALSE) (OM_NEW, OM_SET) */
  85.  
  86. #define GETFILE_Filelist        (GETFILE_Dummy+20)
  87.     /* (struct List *) If the GETFILE_DoMultiSelect tags was used, you can get a pointer
  88.             to the list of selected files/drawers using this tag. The ln_Name part of
  89.             each node will contain the filename/drawername for each selected file with
  90.             a fully qualified path, even if you didn't use the GETFILE_FullFileExpand.
  91.             In single-selected mode, the list will contain the single selected file for
  92.             notification purposes. Don't forget to free the list using the GFILE_FREELIST
  93.             method! (OM_GET, OM_NOTIFY) */
  94.  
  95. #define GETFILE_LBNodeStructs    (GETFILE_Dummy+21)
  96.     /* (BOOL) GETFILE_Filelist will give a list with ListBrowserNodes instead of normal
  97.             struct Node node structures (default: FALSE) (OM_NEW) */
  98.  
  99. #define GETFILE_ReadOnly        (GETFILE_Dummy+22)
  100.     /* (BOOL) If TRUE, a read-only recessed button gadget is used to present the
  101.             file/drawer information. If FALSE, an editable string gadget is used.
  102.             (default: TRUE) (OM_NEW) */
  103.  
  104. #define GETFILE_FilePartOnly    (GETFILE_Dummy+23)
  105.     /* (BOOL) display file part only - valid ONLY in readonly mode!
  106.      */
  107.  
  108. /*****************************************************************************/
  109.  
  110. /*
  111.  * getfile.gadget methods
  112.  */
  113. #define GFILE_REQUEST    (0x620001L)
  114. #define GFILE_FREELIST    (0x620002L)
  115.  
  116. /* The GFILE_REQUEST method should be called whenever you want to open
  117.  * a file/dir requester.
  118.  */
  119.  
  120. struct gfileRequest
  121. {
  122.     ULONG MethodID;                    /* GFILE_REQUEST */
  123.     struct Window *gfile_Window;    /* The window that will be locked when the requester is active. MUST be provided! */
  124. };
  125.  
  126. /* The GFILE_FREELIST method SHOULD be called when you are done doing a multiselect
  127.  * a file/dir select using the tag GETFILE_DoMultiSelect and have processed the result.
  128.  * This method will free the list of struct Node structures.  If you do not free this
  129.  * list using this method, the list will not be freed until you dispose the class.
  130.  */
  131.  
  132. struct gfileFreelist
  133. {
  134.     ULONG MethodID;                    /* GFILE_FREELIST */
  135.     struct List *gfile_Filelist;    /* The list of struct Node obtained using the GETFILE_Filelist tag in OM_GET.
  136.                                         Can be NULL, in which case this method will do nothing. */
  137. };
  138.  
  139. /* macros for calling the methods easily */
  140.  
  141. #define gfRequestFile(obj, win)        DoMethod(obj, GFILE_REQUEST, win)
  142. #define gfRequestDir(obj, win)        DoMethod(obj, GFILE_REQUEST, win)
  143. #define gfFreeFilelist(obj, list)    DoMethod(obj, GFILE_FREELIST, list)
  144.  
  145. #endif /* GADGETS_GETFILE_H */
  146.