Folders.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:30k
源码类别:

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       Folders.h
  3.  
  4.      Contains:   Folder Manager Interfaces.
  5.  
  6.      Version:    Technology: Mac OS 8
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1995-2001 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:      For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __FOLDERS__
  18. #define __FOLDERS__
  19. #ifndef __MACTYPES__
  20. #include "MacTypes.h"
  21. #endif
  22. #ifndef __MIXEDMODE__
  23. #include "MixedMode.h"
  24. #endif
  25. #ifndef __FILES__
  26. #include "Files.h"
  27. #endif
  28. #if PRAGMA_ONCE
  29. #pragma once
  30. #endif
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34. #if PRAGMA_IMPORT
  35. #pragma import on
  36. #endif
  37. #if PRAGMA_STRUCT_ALIGN
  38.     #pragma options align=mac68k
  39. #elif PRAGMA_STRUCT_PACKPUSH
  40.     #pragma pack(push, 2)
  41. #elif PRAGMA_STRUCT_PACK
  42.     #pragma pack(2)
  43. #endif
  44. enum {
  45.     kOnSystemDisk               = -32768L,                      /* previously was 0x8000 but that is an unsigned value whereas vRefNum is signed*/
  46.     kOnAppropriateDisk          = -32767                        /* Generally, the same as kOnSystemDisk, but it's clearer that this isn't always the 'boot' disk.*/
  47. };
  48. enum {
  49.     kCreateFolder               = true,
  50.     kDontCreateFolder           = false
  51. };
  52. enum {
  53.     kSystemFolderType           = FOUR_CHAR_CODE('macs'),       /* the system folder */
  54.     kDesktopFolderType          = FOUR_CHAR_CODE('desk'),       /* the desktop folder; objects in this folder show on the desk top. */
  55.     kSystemDesktopFolderType    = FOUR_CHAR_CODE('sdsk'),       /* the desktop folder at the root of the hard drive, never the redirected user desktop folder */
  56.     kTrashFolderType            = FOUR_CHAR_CODE('trsh'),       /* the trash folder; objects in this folder show up in the trash */
  57.     kSystemTrashFolderType      = FOUR_CHAR_CODE('strs'),       /* the trash folder at the root of the drive, never the redirected user trash folder */
  58.     kWhereToEmptyTrashFolderType = FOUR_CHAR_CODE('empt'),      /* the "empty trash" folder; Finder starts empty from here down */
  59.     kPrintMonitorDocsFolderType = FOUR_CHAR_CODE('prnt'),       /* Print Monitor documents */
  60.     kStartupFolderType          = FOUR_CHAR_CODE('strt'),       /* Finder objects (applications, documents, DAs, aliases, to...) to open at startup go here */
  61.     kShutdownFolderType         = FOUR_CHAR_CODE('shdf'),       /* Finder objects (applications, documents, DAs, aliases, to...) to open at shutdown go here */
  62.     kAppleMenuFolderType        = FOUR_CHAR_CODE('amnu'),       /* Finder objects to put into the Apple menu go here */
  63.     kControlPanelFolderType     = FOUR_CHAR_CODE('ctrl'),       /* Control Panels go here (may contain INITs) */
  64.     kSystemControlPanelFolderType = FOUR_CHAR_CODE('sctl'),     /* System control panels folder - never the redirected one, always "Control Panels" inside the System Folder */
  65.     kExtensionFolderType        = FOUR_CHAR_CODE('extn'),       /* System extensions go here */
  66.     kFontsFolderType            = FOUR_CHAR_CODE('font'),       /* Fonts go here */
  67.     kPreferencesFolderType      = FOUR_CHAR_CODE('pref'),       /* preferences for applications go here */
  68.     kSystemPreferencesFolderType = FOUR_CHAR_CODE('sprf'),      /* System-type Preferences go here - this is always the system's preferences folder, never a logged in user's */
  69.     kTemporaryFolderType        = FOUR_CHAR_CODE('temp')        /* temporary files go here (deleted periodically, but don't rely on it.) */
  70. };
  71. EXTERN_API( OSErr )
  72. FindFolder                      (short                  vRefNum,
  73.                                  OSType                 folderType,
  74.                                  Boolean                createFolder,
  75.                                  short *                foundVRefNum,
  76.                                  long *                 foundDirID)                         TWOWORDINLINE(0x7000, 0xA823);
  77. EXTERN_API( OSErr )
  78. FindFolderExtended              (short                  vol,
  79.                                  OSType                 foldType,
  80.                                  Boolean                createFolder,
  81.                                  UInt32                 flags,
  82.                                  void *                 data,
  83.                                  short *                vRefNum,
  84.                                  long *                 dirID)                              THREEWORDINLINE(0x303C, 0x0B2C, 0xA823);
  85. EXTERN_API( OSErr )
  86. ReleaseFolder                   (short                  vRefNum,
  87.                                  OSType                 folderType)                         TWOWORDINLINE(0x700B, 0xA823);
  88. #if !TARGET_OS_MAC
  89. /* Since non-mac targets don't know about VRef's or DirID's, the Ex version returns
  90.    the found folder path.
  91.  */
  92. #if CALL_NOT_IN_CARBON
  93. EXTERN_API_C( OSErr )
  94. FindFolderEx                    (short                  vRefNum,
  95.                                  OSType                 folderType,
  96.                                  Boolean                createFolder,
  97.                                  short *                foundVRefNum,
  98.                                  long *                 foundDirID,
  99.                                  char *                 foundFolder);
  100. #endif  /* CALL_NOT_IN_CARBON */
  101. #endif  /* !TARGET_OS_MAC */
  102. /******************************************/
  103. /* Extensible Folder Manager declarations */
  104. /******************************************/
  105. /****************************/
  106. /* Folder Manager constants */
  107. /****************************/
  108. enum {
  109.     kExtensionDisabledFolderType = FOUR_CHAR_CODE('extD'),
  110.     kControlPanelDisabledFolderType = FOUR_CHAR_CODE('ctrD'),
  111.     kSystemExtensionDisabledFolderType = FOUR_CHAR_CODE('macD'),
  112.     kStartupItemsDisabledFolderType = FOUR_CHAR_CODE('strD'),
  113.     kShutdownItemsDisabledFolderType = FOUR_CHAR_CODE('shdD'),
  114.     kApplicationsFolderType     = FOUR_CHAR_CODE('apps'),
  115.     kDocumentsFolderType        = FOUR_CHAR_CODE('docs')
  116. };
  117. enum {
  118.                                                                 /* new constants */
  119.     kVolumeRootFolderType       = FOUR_CHAR_CODE('root'),       /* root folder of a volume */
  120.     kChewableItemsFolderType    = FOUR_CHAR_CODE('flnt'),       /* items deleted at boot */
  121.     kApplicationSupportFolderType = FOUR_CHAR_CODE('asup'),     /* third-party items and folders */
  122.     kTextEncodingsFolderType    = FOUR_CHAR_CODE('膖ex'),       /* encoding tables */
  123.     kStationeryFolderType       = FOUR_CHAR_CODE('odst'),       /* stationery */
  124.     kOpenDocFolderType          = FOUR_CHAR_CODE('odod'),       /* OpenDoc root */
  125.     kOpenDocShellPlugInsFolderType = FOUR_CHAR_CODE('odsp'),    /* OpenDoc Shell Plug-Ins in OpenDoc folder */
  126.     kEditorsFolderType          = FOUR_CHAR_CODE('oded'),       /* OpenDoc editors in MacOS Folder */
  127.     kOpenDocEditorsFolderType   = FOUR_CHAR_CODE('膐df'),       /* OpenDoc subfolder of Editors folder */
  128.     kOpenDocLibrariesFolderType = FOUR_CHAR_CODE('odlb'),       /* OpenDoc libraries folder */
  129.     kGenEditorsFolderType       = FOUR_CHAR_CODE('膃di'),       /* CKH general editors folder at root level of Sys folder */
  130.     kHelpFolderType             = FOUR_CHAR_CODE('膆lp'),       /* CKH help folder currently at root of system folder */
  131.     kInternetPlugInFolderType   = FOUR_CHAR_CODE('膎et'),       /* CKH internet plug ins for browsers and stuff */
  132.     kModemScriptsFolderType     = FOUR_CHAR_CODE('膍od'),       /* CKH modem scripts, get 'em OUT of the Extensions folder */
  133.     kPrinterDescriptionFolderType = FOUR_CHAR_CODE('ppdf'),     /* CKH new folder at root of System folder for printer descs. */
  134.     kPrinterDriverFolderType    = FOUR_CHAR_CODE('膒rd'),       /* CKH new folder at root of System folder for printer drivers */
  135.     kScriptingAdditionsFolderType = FOUR_CHAR_CODE('膕cr'),     /* CKH at root of system folder */
  136.     kSharedLibrariesFolderType  = FOUR_CHAR_CODE('膌ib'),       /* CKH for general shared libs. */
  137.     kVoicesFolderType           = FOUR_CHAR_CODE('fvoc'),       /* CKH macintalk can live here */
  138.     kControlStripModulesFolderType = FOUR_CHAR_CODE('sdev'),    /* CKH for control strip modules */
  139.     kAssistantsFolderType       = FOUR_CHAR_CODE('ast