home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 October / Chip_2004-10_cd1.bin / tema / where / Setup.exe / {app} / DescAPI / DescAPI.inc < prev    next >
Encoding:
Text File  |  2004-01-14  |  8.8 KB  |  282 lines

  1. const
  2. {$IFDEF DescAPI_10}
  3.   MaxDescLength = 4096;
  4. {$ELSE}
  5.   MaxDescLength = 32768;
  6. {$ENDIF}
  7.   MaxAliasLength = 255;
  8.   MaxDiskNameLength = 255;
  9.  
  10.   DT_Floppy525_360     = 0;
  11.   DT_Floppy525_12      = 1;
  12.   DT_Floppy35_720      = 2;
  13.   DT_Floppy525_8SD     = 3;
  14.   DT_Floppy525_8DD     = 4;
  15.   DT_HardDisk          = 5;
  16.   DT_TapeDrive         = 6;
  17.   DT_Floppy35_144      = 7;
  18.   DT_Optical           = 8;
  19.   DT_Floppy35_288      = 9;
  20.   DT_CDROM             = 10;
  21.   DT_Network           = 11;
  22.   DT_RamDisk           = 12;
  23.   DT_Removable         = 13;
  24.   DT_ZipDrive          = 14;
  25.   DT_JazDrive          = 15;
  26.   DT_ZipDrivePlus      = 16;
  27.   DT_SeagateDirectTape = 17;
  28.   DT_LS120             = 18;
  29.   DT_MOS320            = 19;
  30.   DT_MOS332            = 20;
  31.   DT_M2531A            = 21;
  32.   DT_Jaz2Drive         = 22;
  33.   DT_Zip250            = 23;
  34. {$IFDEF DescAPI_20}
  35.   DT_AudioCD           = 24;
  36.   DT_DVD               = 25;
  37.   DT_CDR               = 26;
  38.   DT_CDRW              = 27;
  39.   DT_DVDR              = 28;
  40.   DT_DVDRAM            = 29;
  41.   DT_DVDRW             = 30;
  42.   DT_DVDPLUSRW         = 31;
  43.   DT_DVDPLUSR          = 32;
  44.   DT_DDCDROM           = 33;
  45.   DT_DDCDR             = 34;
  46.   DT_DDCDRW            = 35;
  47. {$ENDIF}
  48.   DT_DiskGroup         = $FE;
  49.   DT_Unknown           = $FF;
  50.  
  51.   // Plugins can use the following error code with SetLastError() function
  52.   // to abort disk scanning. This code should be used with unrecoverable
  53.   // errors that affect scanning altogether, for example if plugin detects
  54.   // that media is no longer available
  55.   ERR_AbortScan = $FFFA8047;
  56.  
  57. type
  58.   TPluginType =
  59.      (ptReserved, ptSameFile, ptParentItem, ptItemList, ptDiskInfo, ptCDDB,
  60.       ptFormatting, ptThumbnails, ptCustomIcons, ptFileNameFormatting,
  61.       ptFolder, ptRuntime);
  62.  
  63.   TPluginDefaultState =
  64.      (pdsUserDefined_EnabledFirstTime, pdsUserDefined_DisabledFirstTime,
  65.       pdsForceAlwaysEnabled, pdsForceAlwaysDisabled);
  66.  
  67.   TDiskInfoRecord = record
  68.     lpszRootPath: PChar;
  69.     lpszVirtualRoot: PChar;
  70.     lpszVolumeLabel: PChar;
  71.     lpszFSName: PChar;
  72.     iMaxNameLength: Integer;
  73.     dwSerialNumber: DWORD;
  74.     wDiskNum: Word;
  75.     wMediaType: Word;
  76.     iBytesPerSector: Integer;
  77.     iSectorsPerCluster: Integer;
  78.     iTotalClusters: Integer;
  79.     iFreeClusters: Integer;
  80.     iNumberOfFiles: Integer;
  81.     iNumberOfCompressedFiles: Integer;
  82.     wNumberOfDirs: Word;
  83.   end;
  84.  
  85.  
  86.   //********** Common functions to both DescAPI 1.0 and DescAPI 2.0 **********
  87.  
  88.   TConfigPluginProc = procedure(HInstance: THandle; OwnerWnd: THandle;
  89.      PluginID: Word); stdcall;
  90.  
  91.   TRegisterPlugin = function (PluginID: Word; PluginType: TPluginType; PluginName,
  92.      FileMask: PChar; ConfigProc: TConfigPluginProc): Integer; stdcall;
  93.  
  94.   TRegisterDescPlugins = procedure (RegisterPlugin: TRegisterPlugin); stdcall;
  95.  
  96.   TInitDescImport = procedure; stdcall;
  97.  
  98.   TDoneDescImport = procedure; stdcall;
  99.  
  100.   TRequireFileProc = function(FileName: PChar): PChar; stdcall;
  101.  
  102.   TStoreDescProc = function(FileName, Desc: PChar): Boolean; stdcall;
  103.  
  104.  
  105.   //****************** DescAPI 1.0 specific functions ************************
  106.  
  107.   TModuleInfo = procedure(ModuleName, Author, Version: PChar); stdcall;
  108.  
  109.   TImportDesc_SameFile = function(PluginID: Word; FileName,Desc: PChar;
  110.      RequireFile: TRequireFileProc): Boolean; stdcall;
  111.  
  112.   TImportDesc_ParentItem = function(PluginID: Word; ParentName,FoundList,Desc: PChar;
  113.      RequireFile: TRequireFileProc): Boolean; stdcall;
  114.  
  115.   TImportDesc_ItemList = procedure(PluginID: Word; ParentName,FoundList: PChar;
  116.      RequireFile: TRequireFileProc; StoreDescProc: TStoreDescProc); stdcall;
  117.  
  118.   TImportDesc_DiskInfoProc = function(PluginID: Word; DescInfo: TDiskInfoRecord;
  119.      Desc: PChar): Boolean; stdcall;
  120.  
  121.   //****************** DescAPI 2.0 specific functions ************************
  122.  
  123.   TStoreAliasNameProc = function(FileName, AliasName: PChar): Boolean; stdcall;
  124.  
  125.   TModuleInfoRec = record
  126.      lpszModuleName: PChar;
  127.      lpszAuthor: PChar;
  128.      lpszVersion: PChar
  129.   end;
  130.   TModuleInfoPtr = ^TModuleInfoRec;
  131.   TModuleInfoEx = procedure(ModuleInfo: TModuleInfoPtr); stdcall;
  132.  
  133.   TPluginDefaultStateProc = function(PluginID: Word): TPluginDefaultState; stdcall;
  134.  
  135.   TPluginCapabilitiesRec = record
  136.      ImportingDesc: Boolean;
  137.      ImportingAlias: Boolean;
  138.   end;
  139.   TPluginCapabilitiesPtr = ^TPluginCapabilitiesRec;
  140.  
  141.   TPluginCapabilitiesProc = function(PluginID: Word; PluginCapabilities: TPluginCapabilitiesPtr): Integer; stdcall;
  142.  
  143.   TImportSameFileRec = record
  144.      FileName: PChar;
  145.      Desc: PChar;
  146.      AliasName: PChar;
  147.      RequireFileProc: TRequireFileProc;
  148.      MaxDescSize: Word;
  149.      SilentMode: Boolean;
  150.      OwnerWnd: THandle;
  151.   end;
  152.   TImportSameFilePtr = ^TImportSameFileRec;
  153.   TImportDesc_SameFileEx = function(PluginID: Word; ImportSameFile: TImportSameFilePtr): Integer; stdcall;
  154.  
  155.   TImportParentItemRec = record
  156.      ParentName: PChar;
  157.      FoundList: PChar;
  158.      Desc: PChar;
  159.      AliasName: PChar;
  160.      RequireFileProc: TRequireFileProc;
  161.      MaxDescSize: Word;
  162.      SilentMode: Boolean;
  163.      OwnerWnd: THandle;
  164.   end;
  165.   TImportParentItemPtr = ^TImportParentItemRec;
  166.   TImportDesc_ParentItemEx = function(PluginID: Word; ImportParentItem: TImportParentItemPtr): Integer; stdcall;
  167.  
  168.   TImportItemListRec = record
  169.      ParentName: PChar;
  170.      FoundList: PChar;
  171.      RequireFileProc: TRequireFileProc;
  172.      StoreDescProc: TStoreDescProc;
  173.      StoreAliasNameProc: TStoreAliasNameProc;
  174.      MaxDescSize: Word;
  175.      SilentMode: Boolean;
  176.      OwnerWnd: THandle;
  177.   end;
  178.   TImportItemListPtr = ^TImportItemListRec;
  179.   TImportDesc_ItemListEx = function(PluginID: Word; ImportItemList: TImportItemListPtr): Integer; stdcall;
  180.  
  181.   TImportDiskInfoRec = record
  182.      DescInfo: TDiskInfoRecord;
  183.      Desc: PChar;
  184.      DiskName: PChar;
  185.      CDDBQueryID: PChar;
  186.      MaxDescSize: Word;
  187.      SilentMode: Boolean;
  188.      OwnerWnd: THandle;
  189.   end;
  190.   TImportDiskInfoPtr = ^TImportDiskInfoRec;
  191.   TImportDesc_DiskInfoProcEx = function(PluginID: Word; ImportDiskInfo: TImportDiskInfoPtr): Integer; stdcall;
  192.  
  193.   TFormatDescRec = record
  194.      Desc: PChar;
  195.      MaxDescSize: Word;
  196.      SourceModuleFile: PChar;
  197.      SourcePluginID: Word;
  198.      OwnerWnd: THandle;
  199.   end;
  200.   TFormatDescPtr = ^TFormatDescRec;
  201.   TFormatDescriptionProcEx = function(PluginID: Word; FormatDesc: TFormatDescPtr): Integer; stdcall;
  202.  
  203.   TThumbnailRec = record
  204.      FileName: PChar;
  205.      XSize,YSize: Word;
  206.      BitmapHandle: HBitmap;
  207.      RequireFileProc: TRequireFileProc;
  208.      SilentMode: Boolean;
  209.      OwnerWnd: THandle;
  210.   end;
  211.   TThumbnailPtr = ^TThumbnailRec;
  212.   TImportThumbnailProcEx = function(PluginID: Word; ThumbnailPtr: TThumbnailPtr): Integer; stdcall;
  213.  
  214.   //****************** DescAPI 2.10 specific functions ******************
  215.  
  216.   TFormatFileNameRec = record
  217.      FileName: PChar;
  218.      FullPath: PChar;
  219.      IsDirectory: Boolean;
  220.      IsCompressed: Boolean;
  221.      OwnerWnd: THandle;
  222.   end;
  223.   TFormatFileNamePtr = ^TFormatFileNameRec;
  224.   TFormatFileNameProcEx = function(PluginID: Word; FormatFileName: TFormatFileNamePtr): Integer; stdcall;
  225.  
  226.   TCustomIconRec = record
  227.      ItemPath: PChar;
  228.      IconHandle: HIcon;
  229.      SilentMode: Boolean;
  230.      OwnerWnd: THandle;
  231.   end;
  232.   TCustomIconPtr = ^TCustomIconRec;
  233.   TImportCustomIconProcEx = function(PluginID: Word; CustomIconPtr: TCustomIconPtr): Integer; stdcall;
  234.  
  235.   //****************** DescAPI 2.20 specific functions ******************
  236.  
  237.   TInitVCLPlugin = procedure(AppHandle: THandle); stdcall;
  238.  
  239.   TRegisterRuntimePlugin = function (PluginID: Word; PluginType: TPluginType;
  240.      PluginName, FileMask, MenuOption: PChar; RequiresMedia: Boolean;
  241.      ConfigProc: TConfigPluginProc): Integer; stdcall;
  242.  
  243.   TRegisterRuntimePlugins = procedure (RegisterPlugin: TRegisterRuntimePlugin); stdcall;
  244.  
  245.   TDiskInfoPtr = ^TDiskInfoRecord;
  246.  
  247.   TFileInfoRec = record
  248.      FileName: PChar;
  249.      Size: Int64;
  250.      Attribute: Byte;
  251.      DateCreated: Integer;
  252.      DateModified: Integer;
  253.      DateAccessed: Integer;
  254.   end;
  255.   TFileInfoPtr = ^TFileInfoRec;
  256.  
  257.   TFolderInfoRec = record
  258.      FolderPath: PChar;
  259.      Size: Int64;
  260.      Attribute: Byte;
  261.      DateCreated: Integer;
  262.      DateModified: Integer;
  263.      DateAccessed: Integer;
  264.   end;
  265.   TFolderInfoPtr = ^TFolderInfoRec;
  266.  
  267.   TValidateRuntimePlugin = function (PluginID: Word; DiskInfo: TDiskInfoPtr;
  268.      FolderInfo: TFolderInfoPtr; FileInfo: TFileInfoPtr): Boolean; stdcall;
  269.  
  270.   TImportFolderRec = record
  271.      Drive: PChar;
  272.      FolderPath: PChar;
  273.      Desc: PChar;
  274.      AliasName: PChar;
  275.      RequireFileProc: TRequireFileProc;
  276.      MaxDescSize: Word;
  277.      SilentMode: Boolean;
  278.      OwnerWnd: THandle;
  279.   end;
  280.   TImportFolderPtr = ^TImportFolderRec;
  281.   TImportDesc_FolderEx = function(PluginID: Word; ImportFolderPtr: TImportFolderPtr): Integer; stdcall;
  282.