Folders.pas 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715
  1. {
  2. File: Folders.p
  3. Contains: Folder Manager Interfaces.
  4. Version: Technology: Mac OS 8
  5. Release: Universal Interfaces 3.4.2
  6. Copyright: © 1995-2002 by Apple Computer, Inc., all rights reserved.
  7. Bugs?: For bug reports, consult the following page on
  8. the World Wide Web:
  9. http://www.freepascal.org/bugs.html
  10. }
  11. {
  12. Modified for use with Free Pascal
  13. Version 200
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$mode macpas}
  17. {$packenum 1}
  18. {$macro on}
  19. {$inline on}
  20. {$CALLING MWPASCAL}
  21. unit Folders;
  22. interface
  23. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  24. {$setc GAP_INTERFACES_VERSION := $0200}
  25. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  26. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  27. {$endc}
  28. {$ifc defined CPUPOWERPC and defined CPUI386}
  29. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  30. {$endc}
  31. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  32. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  33. {$endc}
  34. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  35. {$setc __ppc__ := 1}
  36. {$elsec}
  37. {$setc __ppc__ := 0}
  38. {$endc}
  39. {$ifc not defined __i386__ and defined CPUI386}
  40. {$setc __i386__ := 1}
  41. {$elsec}
  42. {$setc __i386__ := 0}
  43. {$endc}
  44. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  45. {$error Conflicting definitions for __ppc__ and __i386__}
  46. {$endc}
  47. {$ifc defined __ppc__ and __ppc__}
  48. {$setc TARGET_CPU_PPC := TRUE}
  49. {$setc TARGET_CPU_X86 := FALSE}
  50. {$elifc defined __i386__ and __i386__}
  51. {$setc TARGET_CPU_PPC := FALSE}
  52. {$setc TARGET_CPU_X86 := TRUE}
  53. {$elsec}
  54. {$error Neither __ppc__ nor __i386__ is defined.}
  55. {$endc}
  56. {$setc TARGET_CPU_PPC_64 := FALSE}
  57. {$ifc defined FPC_BIG_ENDIAN}
  58. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  59. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  60. {$elifc defined FPC_LITTLE_ENDIAN}
  61. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  62. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  63. {$elsec}
  64. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  65. {$endc}
  66. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  67. {$setc CALL_NOT_IN_CARBON := FALSE}
  68. {$setc OLDROUTINENAMES := FALSE}
  69. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  70. {$setc OPAQUE_UPP_TYPES := TRUE}
  71. {$setc OTCARBONAPPLICATION := TRUE}
  72. {$setc OTKERNEL := FALSE}
  73. {$setc PM_USE_SESSION_APIS := TRUE}
  74. {$setc TARGET_API_MAC_CARBON := TRUE}
  75. {$setc TARGET_API_MAC_OS8 := FALSE}
  76. {$setc TARGET_API_MAC_OSX := TRUE}
  77. {$setc TARGET_CARBON := TRUE}
  78. {$setc TARGET_CPU_68K := FALSE}
  79. {$setc TARGET_CPU_MIPS := FALSE}
  80. {$setc TARGET_CPU_SPARC := FALSE}
  81. {$setc TARGET_OS_MAC := TRUE}
  82. {$setc TARGET_OS_UNIX := FALSE}
  83. {$setc TARGET_OS_WIN32 := FALSE}
  84. {$setc TARGET_RT_MAC_68881 := FALSE}
  85. {$setc TARGET_RT_MAC_CFM := FALSE}
  86. {$setc TARGET_RT_MAC_MACHO := TRUE}
  87. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  88. {$setc TYPE_BOOL := FALSE}
  89. {$setc TYPE_EXTENDED := FALSE}
  90. {$setc TYPE_LONGLONG := TRUE}
  91. uses MacTypes,MixedMode,Files;
  92. {$ALIGN MAC68K}
  93. const
  94. kOnSystemDisk = -32768; { previously was 0x8000 but that is an unsigned value whereas vRefNum is signed }
  95. kOnAppropriateDisk = -32767; { Generally, the same as kOnSystemDisk, but it's clearer that this isn't always the 'boot' disk. }
  96. { Folder Domains - Carbon only. The constants above can continue to be used, but the folder/volume returned will }
  97. { be from one of the domains below. }
  98. kSystemDomain = -32766; { Read-only system hierarchy. }
  99. kLocalDomain = -32765; { All users of a single machine have access to these resources. }
  100. kNetworkDomain = -32764; { All users configured to use a common network server has access to these resources. }
  101. kUserDomain = -32763; { Read/write. Resources that are private to the user. }
  102. kClassicDomain = -32762; { Domain referring to the currently configured Classic System Folder }
  103. kCreateFolder = true;
  104. kDontCreateFolder = false;
  105. kSystemFolderType = $6D616373 (* 'macs' *); { the system folder }
  106. kDesktopFolderType = $6465736B (* 'desk' *); { the desktop folder; objects in this folder show on the desk top. }
  107. kSystemDesktopFolderType = $7364736B (* 'sdsk' *); { the desktop folder at the root of the hard drive, never the redirected user desktop folder }
  108. kTrashFolderType = $74727368 (* 'trsh' *); { the trash folder; objects in this folder show up in the trash }
  109. kSystemTrashFolderType = $73747273 (* 'strs' *); { the trash folder at the root of the drive, never the redirected user trash folder }
  110. kWhereToEmptyTrashFolderType = $656D7074 (* 'empt' *); { the "empty trash" folder; Finder starts empty from here down }
  111. kPrintMonitorDocsFolderType = $70726E74 (* 'prnt' *); { Print Monitor documents }
  112. kStartupFolderType = $73747274 (* 'strt' *); { Finder objects (applications, documents, DAs, aliases, to...) to open at startup go here }
  113. kShutdownFolderType = $73686466 (* 'shdf' *); { Finder objects (applications, documents, DAs, aliases, to...) to open at shutdown go here }
  114. kAppleMenuFolderType = $616D6E75 (* 'amnu' *); { Finder objects to put into the Apple menu go here }
  115. kControlPanelFolderType = $6374726C (* 'ctrl' *); { Control Panels go here (may contain INITs) }
  116. kSystemControlPanelFolderType = $7363746C (* 'sctl' *); { System control panels folder - never the redirected one, always "Control Panels" inside the System Folder }
  117. kExtensionFolderType = $6578746E (* 'extn' *); { System extensions go here }
  118. kFontsFolderType = $666F6E74 (* 'font' *); { Fonts go here }
  119. kPreferencesFolderType = $70726566 (* 'pref' *); { preferences for applications go here }
  120. kSystemPreferencesFolderType = $73707266 (* 'sprf' *); { System-type Preferences go here - this is always the system's preferences folder, never a logged in user's }
  121. kTemporaryFolderType = $74656D70 (* 'temp' *); { temporary files go here (deleted periodically, but don't rely on it.) }
  122. {
  123. * FindFolder()
  124. *
  125. * Availability:
  126. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  127. * CarbonLib: in CarbonLib 1.0 and later
  128. * Mac OS X: in version 10.0 and later
  129. }
  130. function FindFolder(vRefNum: SInt16; folderType: OSType; createFolder: boolean; var foundVRefNum: SInt16; var foundDirID: UInt32): OSErr; external name '_FindFolder';
  131. {
  132. * FindFolderExtended()
  133. *
  134. * Availability:
  135. * Non-Carbon CFM: in InterfaceLib 9.0 and later
  136. * CarbonLib: in CarbonLib 1.0 and later
  137. * Mac OS X: in version 10.0 and later
  138. }
  139. function FindFolderExtended(vol: SInt16; foldType: OSType; createFolder: boolean; flags: UInt32; data: UnivPtr; var vRefNum: SInt16; var dirID: UInt32): OSErr; external name '_FindFolderExtended';
  140. {
  141. * ReleaseFolder()
  142. *
  143. * Availability:
  144. * Non-Carbon CFM: in FoldersLib 1.0 and later
  145. * CarbonLib: in CarbonLib 1.0 and later
  146. * Mac OS X: in version 10.0 and later
  147. }
  148. function ReleaseFolder(vRefNum: SInt16; folderType: OSType): OSErr; external name '_ReleaseFolder';
  149. {$ifc NOT TARGET_OS_MAC}
  150. { Since non-mac targets don't know about VRef's or DirID's, the Ex version returns
  151. the found folder path.
  152. }
  153. {$ifc CALL_NOT_IN_CARBON}
  154. {
  155. * FindFolderEx()
  156. *
  157. * Availability:
  158. * Non-Carbon CFM: not available
  159. * CarbonLib: not available
  160. * Mac OS X: not available
  161. }
  162. function FindFolderEx(vRefNum: SInt16; folderType: OSType; createFolder: boolean; var foundVRefNum: SInt16; var foundDirID: UInt32; foundFolder: CStringPtr): OSErr; external name '_FindFolderEx';
  163. {$endc} {CALL_NOT_IN_CARBON}
  164. {$endc}
  165. {
  166. * FSFindFolder()
  167. *
  168. * Availability:
  169. * Non-Carbon CFM: in InterfaceLib 9.1 and later
  170. * CarbonLib: in CarbonLib 1.1 and later
  171. * Mac OS X: in version 10.0 and later
  172. }
  173. function FSFindFolder(vRefNum: SInt16; folderType: OSType; createFolder: boolean; var foundRef: FSRef): OSErr; external name '_FSFindFolder';
  174. {
  175. * FSFindFolderExtended()
  176. *
  177. * Availability:
  178. * Non-Carbon CFM: in InterfaceLib 9.1 and later
  179. * CarbonLib: in CarbonLib 1.1 and later
  180. * Mac OS X: in version 10.0 and later
  181. }
  182. function FSFindFolderExtended(vol: SInt16; foldType: OSType; createFolder: boolean; flags: UInt32; data: UnivPtr; var foundRef: FSRef): OSErr; external name '_FSFindFolderExtended';
  183. {****************************************}
  184. { Extensible Folder Manager declarations }
  185. {****************************************}
  186. {**************************}
  187. { Folder Manager constants }
  188. {**************************}
  189. const
  190. kExtensionDisabledFolderType = $65787444 (* 'extD' *);
  191. kControlPanelDisabledFolderType = $63747244 (* 'ctrD' *);
  192. kSystemExtensionDisabledFolderType = $6D616344 (* 'macD' *);
  193. kStartupItemsDisabledFolderType = $73747244 (* 'strD' *);
  194. kShutdownItemsDisabledFolderType = $73686444 (* 'shdD' *);
  195. kApplicationsFolderType = $61707073 (* 'apps' *);
  196. kDocumentsFolderType = $646F6373 (* 'docs' *);
  197. { new constants }
  198. kVolumeRootFolderType = $726F6F74 (* 'root' *); { root folder of a volume }
  199. kChewableItemsFolderType = $666C6E74 (* 'flnt' *); { items deleted at boot }
  200. kApplicationSupportFolderType = $61737570 (* 'asup' *); { third-party items and folders }
  201. kTextEncodingsFolderType = $C6927465 (* 'Ätex' *); { encoding tables }
  202. kStationeryFolderType = $6F647374 (* 'odst' *); { stationery }
  203. kOpenDocFolderType = $6F646F64 (* 'odod' *); { OpenDoc root }
  204. kOpenDocShellPlugInsFolderType = $6F647370 (* 'odsp' *); { OpenDoc Shell Plug-Ins in OpenDoc folder }
  205. kEditorsFolderType = $6F646564 (* 'oded' *); { OpenDoc editors in MacOS Folder }
  206. kOpenDocEditorsFolderType = $C6926F64 (* 'Äodf' *); { OpenDoc subfolder of Editors folder }
  207. kOpenDocLibrariesFolderType = $6F646C62 (* 'odlb' *); { OpenDoc libraries folder }
  208. kGenEditorsFolderType = $C6926564 (* 'Äedi' *); { CKH general editors folder at root level of Sys folder }
  209. kHelpFolderType = $C692686C (* 'Ählp' *); { CKH help folder currently at root of system folder }
  210. kInternetPlugInFolderType = $C6926E65 (* 'Änet' *); { CKH internet plug ins for browsers and stuff }
  211. kModemScriptsFolderType = $C6926D6F (* 'Ämod' *); { CKH modem scripts, get 'em OUT of the Extensions folder }
  212. kPrinterDescriptionFolderType = $70706466 (* 'ppdf' *); { CKH new folder at root of System folder for printer descs. }
  213. kPrinterDriverFolderType = $C6927072 (* 'Äprd' *); { CKH new folder at root of System folder for printer drivers }
  214. kScriptingAdditionsFolderType = $C6927363 (* 'Äscr' *); { CKH at root of system folder }
  215. kSharedLibrariesFolderType = $C6926C69 (* 'Älib' *); { CKH for general shared libs. }
  216. kVoicesFolderType = $66766F63 (* 'fvoc' *); { CKH macintalk can live here }
  217. kControlStripModulesFolderType = $73646576 (* 'sdev' *); { CKH for control strip modules }
  218. kAssistantsFolderType = $617374C6 (* 'astÄ' *); { SJF for Assistants (MacOS Setup Assistant, etc) }
  219. kUtilitiesFolderType = $757469C6 (* 'utiÄ' *); { SJF for Utilities folder }
  220. kAppleExtrasFolderType = $616578C6 (* 'aexÄ' *); { SJF for Apple Extras folder }
  221. kContextualMenuItemsFolderType = $636D6E75 (* 'cmnu' *); { SJF for Contextual Menu items }
  222. kMacOSReadMesFolderType = $6D6F72C6 (* 'morÄ' *); { SJF for MacOS ReadMes folder }
  223. kALMModulesFolderType = $77616C6B (* 'walk' *); { EAS for Location Manager Module files except type 'thng' (within kExtensionFolderType) }
  224. kALMPreferencesFolderType = $74726970 (* 'trip' *); { EAS for Location Manager Preferences (within kPreferencesFolderType; contains kALMLocationsFolderType) }
  225. kALMLocationsFolderType = $66616C6C (* 'fall' *); { EAS for Location Manager Locations (within kALMPreferencesFolderType) }
  226. kColorSyncProfilesFolderType = $70726F66 (* 'prof' *); { for ColorSyncª Profiles }
  227. kThemesFolderType = $74686D65 (* 'thme' *); { for Theme data files }
  228. kFavoritesFolderType = $66617673 (* 'favs' *); { Favorties folder for Navigation Services }
  229. kInternetFolderType = $696E74C6 (* 'intÄ' *); { Internet folder (root level of startup volume) }
  230. kAppearanceFolderType = $61707072 (* 'appr' *); { Appearance folder (root of system folder) }
  231. kSoundSetsFolderType = $736E6473 (* 'snds' *); { Sound Sets folder (in Appearance folder) }
  232. kDesktopPicturesFolderType = $647470C6 (* 'dtpÄ' *); { Desktop Pictures folder (in Appearance folder) }
  233. kInternetSearchSitesFolderType = $69737366 (* 'issf' *); { Internet Search Sites folder }
  234. kFindSupportFolderType = $666E6473 (* 'fnds' *); { Find support folder }
  235. kFindByContentFolderType = $66626366 (* 'fbcf' *); { Find by content folder }
  236. kInstallerLogsFolderType = $696C6766 (* 'ilgf' *); { Installer Logs folder }
  237. kScriptsFolderType = $736372C6 (* 'scrÄ' *); { Scripts folder }
  238. kFolderActionsFolderType = $66617366 (* 'fasf' *); { Folder Actions Scripts folder }
  239. kLauncherItemsFolderType = $6C61756E (* 'laun' *); { Launcher Items folder }
  240. kRecentApplicationsFolderType = $72617070 (* 'rapp' *); { Recent Applications folder }
  241. kRecentDocumentsFolderType = $72646F63 (* 'rdoc' *); { Recent Documents folder }
  242. kRecentServersFolderType = $72737672 (* 'rsvr' *); { Recent Servers folder }
  243. kSpeakableItemsFolderType = $73706B69 (* 'spki' *); { Speakable Items folder }
  244. kKeychainFolderType = $6B63686E (* 'kchn' *); { Keychain folder }
  245. kQuickTimeExtensionsFolderType = $71746578 (* 'qtex' *); { QuickTime Extensions Folder (in Extensions folder) }
  246. kDisplayExtensionsFolderType = $6473706C (* 'dspl' *); { Display Extensions Folder (in Extensions folder) }
  247. kMultiprocessingFolderType = $6D707866 (* 'mpxf' *); { Multiprocessing Folder (in Extensions folder) }
  248. kPrintingPlugInsFolderType = $70706C67 (* 'pplg' *); { Printing Plug-Ins Folder (in Extensions folder) }
  249. { New Folder Types to accommodate the Mac OS X Folder Manager }
  250. { These folder types are not applicable on Mac OS 9. }
  251. kDomainTopLevelFolderType = $64746F70 (* 'dtop' *); { The top-level of a Folder domain, e.g. "/System" }
  252. kDomainLibraryFolderType = $646C6962 (* 'dlib' *); { the Library subfolder of a particular domain }
  253. kColorSyncFolderType = $73796E63 (* 'sync' *); { Contains ColorSync-related folders }
  254. kColorSyncCMMFolderType = $63636D6D (* 'ccmm' *); { ColorSync CMMs }
  255. kColorSyncScriptingFolderType = $63736372 (* 'cscr' *); { ColorSync Scripting support }
  256. kPrintersFolderType = $696D7072 (* 'impr' *); { Contains Printing-related folders }
  257. kSpeechFolderType = $73706368 (* 'spch' *); { Contains Speech-related folders }
  258. kCarbonLibraryFolderType = $63617262 (* 'carb' *); { Contains Carbon-specific file }
  259. kDocumentationFolderType = $696E666F (* 'info' *); { Contains Documentation files (not user documents) }
  260. kDeveloperDocsFolderType = $64646F63 (* 'ddoc' *); { Contains Developer Documentation files and folders }
  261. kDeveloperHelpFolderType = $64657668 (* 'devh' *); { Contains Developer Help related files }
  262. kISSDownloadsFolderType = $69737364 (* 'issd' *); { Contains Internet Search Sites downloaded from the Internet }
  263. kUserSpecificTmpFolderType = $75746D70 (* 'utmp' *); { Contains temporary items created on behalf of the current user }
  264. kCachedDataFolderType = $63616368 (* 'cach' *); { Contains various cache files for different clients }
  265. kFrameworksFolderType = $6672616D (* 'fram' *); { Contains MacOS X Framework folders }
  266. kPrivateFrameworksFolderType = $7066726D (* 'pfrm' *); { Contains MacOS X Private Framework folders }
  267. kClassicDesktopFolderType = $7364736B (* 'sdsk' *); { MacOS 9 compatible desktop folder - same as }
  268. { kSystemDesktopFolderType but with a more appropriate }
  269. { name for Mac OS X code. }
  270. kDeveloperFolderType = $64657666 (* 'devf' *); { Contains MacOS X Developer Resources }
  271. kSystemSoundsFolderType = $73736E64 (* 'ssnd' *); { Contains Mac OS X System Sound Files }
  272. kComponentsFolderType = $636D7064 (* 'cmpd' *); { Contains Mac OS X components }
  273. kQuickTimeComponentsFolderType = $77636D70 (* 'wcmp' *); { Contains QuickTime components for Mac OS X }
  274. kCoreServicesFolderType = $63737276 (* 'csrv' *); { Refers to the "CoreServices" folder on Mac OS X }
  275. kPictureDocumentsFolderType = $70646F63 (* 'pdoc' *); { Refers to the "Pictures" folder in a users home directory }
  276. kMovieDocumentsFolderType = $6D646F63 (* 'mdoc' *); { Refers to the "Movies" folder in a users home directory }
  277. kMusicDocumentsFolderType = $C2B5646F (* 'µdoc' *); { Refers to the "Music" folder in a users home directory }
  278. kInternetSitesFolderType = $73697465 (* 'site' *); { Refers to the "Sites" folder in a users home directory }
  279. kPublicFolderType = $70756262 (* 'pubb' *); { Refers to the "Public" folder in a users home directory }
  280. kAudioSupportFolderType = $6164696F (* 'adio' *); { Refers to the Audio support folder for Mac OS X }
  281. kAudioSoundsFolderType = $61736E64 (* 'asnd' *); { Refers to the Sounds subfolder of Audio Support }
  282. kAudioSoundBanksFolderType = $62616E6B (* 'bank' *); { Refers to the Banks subfolder of the Sounds Folder }
  283. kAudioAlertSoundsFolderType = $616C7274 (* 'alrt' *); { Refers to the Alert Sounds subfolder of the Sound Folder }
  284. kAudioPlugInsFolderType = $61706C67 (* 'aplg' *); { Refers to the Plug-ins subfolder of the Audio Folder }
  285. kAudioComponentsFolderType = $61636D70 (* 'acmp' *); { Refers to the Components subfolder of the Audio Plug-ins Folder }
  286. kKernelExtensionsFolderType = $6B657874 (* 'kext' *); { Refers to the Kernel Extensions Folder on Mac OS X }
  287. kDirectoryServicesFolderType = $64737276 (* 'dsrv' *); { Refers to the Directory Services folder on Mac OS X }
  288. kDirectoryServicesPlugInsFolderType = $64706C67 (* 'dplg' *); { Refers to the Directory Services Plug-Ins folder on Mac OS X }
  289. kInstallerReceiptsFolderType = $72637074 (* 'rcpt' *); { Refers to the "Receipts" folder in Mac OS X }
  290. kFileSystemSupportFolderType = $66737973 (* 'fsys' *); { Refers to the [domain]/Library/Filesystems folder in Mac OS X }
  291. kAppleShareSupportFolderType = $73686172 (* 'shar' *); { Refers to the [domain]/Library/Filesystems/AppleShare folder in Mac OS X }
  292. kAppleShareAuthenticationFolderType = $61757468 (* 'auth' *); { Refers to the [domain]/Library/Filesystems/AppleShare/Authentication folder in Mac OS X }
  293. kMIDIDriversFolderType = $6D696469 (* 'midi' *); { Refers to the MIDI Drivers folder on Mac OS X }
  294. kLocalesFolderType = $C6926C6F (* 'Äloc' *); { PKE for Locales folder }
  295. kFindByContentPluginsFolderType = $66626370 (* 'fbcp' *); { Find By Content Plug-ins }
  296. kUsersFolderType = $75737273 (* 'usrs' *); { "Users" folder, contains one folder for each user. }
  297. kCurrentUserFolderType = $63757372 (* 'cusr' *); { The folder for the currently logged on user. }
  298. kCurrentUserRemoteFolderLocation = $72757366 (* 'rusf' *); { The remote folder for the currently logged on user }
  299. kCurrentUserRemoteFolderType = $72757372 (* 'rusr' *); { The remote folder location for the currently logged on user }
  300. kSharedUserDataFolderType = $73646174 (* 'sdat' *); { A Shared "Documents" folder, readable & writeable by all users }
  301. kVolumeSettingsFolderType = $76736664 (* 'vsfd' *); { Volume specific user information goes here }
  302. kAppleshareAutomountServerAliasesFolderType = $737276C6 (* 'srvÄ' *); { Appleshare puts volumes to automount inside this folder. }
  303. kPreMacOS91ApplicationsFolderType = $C3A57070 (* 'Œpps' *); { The "Applications" folder, pre Mac OS 9.1 }
  304. kPreMacOS91InstallerLogsFolderType = $C3AE6C67 (* '”lgf' *); { The "Installer Logs" folder, pre Mac OS 9.1 }
  305. kPreMacOS91AssistantsFolderType = $C3A57374 (* 'ŒstÄ' *); { The "Assistants" folder, pre Mac OS 9.1 }
  306. kPreMacOS91UtilitiesFolderType = $C3BC7469 (* 'ŸtiÄ' *); { The "Utilities" folder, pre Mac OS 9.1 }
  307. kPreMacOS91AppleExtrasFolderType = $C3A56578 (* 'ŒexÄ' *); { The "Apple Extras" folder, pre Mac OS 9.1 }
  308. kPreMacOS91MacOSReadMesFolderType = $C2B56F72 (* 'µorÄ' *); { The "Mac OS ReadMes" folder, pre Mac OS 9.1 }
  309. kPreMacOS91InternetFolderType = $C3AE6E74 (* '”ntÄ' *); { The "Internet" folder, pre Mac OS 9.1 }
  310. kPreMacOS91AutomountedServersFolderType = $C39F7276 (* '§rvÄ' *); { The "Servers" folder, pre Mac OS 9.1 }
  311. kPreMacOS91StationeryFolderType = $C3B86473 (* '¿dst' *); { The "Stationery" folder, pre Mac OS 9.1 }
  312. { FolderDescFlags values }
  313. kCreateFolderAtBoot = $00000002;
  314. kCreateFolderAtBootBit = 1;
  315. kFolderCreatedInvisible = $00000004;
  316. kFolderCreatedInvisibleBit = 2;
  317. kFolderCreatedNameLocked = $00000008;
  318. kFolderCreatedNameLockedBit = 3;
  319. kFolderCreatedAdminPrivs = $00000010;
  320. kFolderCreatedAdminPrivsBit = 4;
  321. kFolderInUserFolder = $00000020;
  322. kFolderInUserFolderBit = 5;
  323. kFolderTrackedByAlias = $00000040;
  324. kFolderTrackedByAliasBit = 6;
  325. kFolderInRemoteUserFolderIfAvailable = $00000080;
  326. kFolderInRemoteUserFolderIfAvailableBit = 7;
  327. kFolderNeverMatchedInIdentifyFolder = $00000100;
  328. kFolderNeverMatchedInIdentifyFolderBit = 8;
  329. kFolderMustStayOnSameVolume = $00000200;
  330. kFolderMustStayOnSameVolumeBit = 9;
  331. kFolderManagerFolderInMacOS9FolderIfMacOSXIsInstalledMask = $00000400;
  332. kFolderManagerFolderInMacOS9FolderIfMacOSXIsInstalledBit = 10;
  333. kFolderInLocalOrRemoteUserFolder = $000000A0;
  334. type
  335. FolderDescFlags = UInt32;
  336. { FolderClass values }
  337. const
  338. kRelativeFolder = $72656C66 (* 'relf' *);
  339. kSpecialFolder = $73706366 (* 'spcf' *);
  340. type
  341. FolderClass = OSType;
  342. { special folder locations }
  343. const
  344. kBlessedFolder = $626C7366 (* 'blsf' *);
  345. kRootFolder = $726F7466 (* 'rotf' *);
  346. kCurrentUserFolderLocation = $63757366 (* 'cusf' *); { the magic 'Current User' folder location }
  347. type
  348. FolderType = OSType;
  349. FolderLocation = OSType;
  350. FolderDescPtr = ^FolderDesc;
  351. FolderDesc = record
  352. descSize: Size;
  353. foldType: FolderType;
  354. flags: FolderDescFlags;
  355. foldClass: FolderClass;
  356. foldLocation: FolderType;
  357. badgeSignature: OSType;
  358. badgeType: OSType;
  359. reserved: UInt32;
  360. name: StrFileName; { Str63 on MacOS }
  361. end;
  362. RoutingFlags = UInt32;
  363. FolderRoutingPtr = ^FolderRouting;
  364. FolderRouting = record
  365. descSize: Size;
  366. fileType: OSType;
  367. routeFromFolder: FolderType;
  368. routeToFolder: FolderType;
  369. flags: RoutingFlags;
  370. end;
  371. { routing constants }
  372. { These are bits in the .flags field of the FindFolderUserRedirectionGlobals struct }
  373. const
  374. { Set this bit to 1 in the .flags field of a FindFolderUserRedirectionGlobals }
  375. { structure if the userName in the struct should be used as the current }
  376. { "User" name }
  377. kFindFolderRedirectionFlagUseDistinctUserFoldersBit = 0; { Set this bit to 1 and the currentUserFolderVRefNum and currentUserFolderDirID }
  378. { fields of the user record will get used instead of finding the user folder }
  379. { with the userName field. }
  380. kFindFolderRedirectionFlagUseGivenVRefAndDirIDAsUserFolderBit = 1; { Set this bit to 1 and the remoteUserFolderVRefNum and remoteUserFolderDirID }
  381. { fields of the user record will get used instead of finding the user folder }
  382. { with the userName field. }
  383. kFindFolderRedirectionFlagsUseGivenVRefNumAndDirIDAsRemoteUserFolderBit = 2;
  384. type
  385. FindFolderUserRedirectionGlobalsPtr = ^FindFolderUserRedirectionGlobals;
  386. FindFolderUserRedirectionGlobals = record
  387. version: UInt32;
  388. flags: UInt32;
  389. userName: Str31;
  390. userNameScript: SInt16;
  391. currentUserFolderVRefNum: SInt16;
  392. currentUserFolderDirID: UInt32;
  393. remoteUserFolderVRefNum: SInt16;
  394. remoteUserFolderDirID: UInt32;
  395. end;
  396. const
  397. kFolderManagerUserRedirectionGlobalsCurrentVersion = 1;
  398. {
  399. These are passed into FindFolderExtended(), FindFolderInternalExtended(), and
  400. FindFolderNewInstallerEntryExtended() in the flags field.
  401. }
  402. kFindFolderExtendedFlagsDoNotFollowAliasesBit = 0;
  403. kFindFolderExtendedFlagsDoNotUseUserFolderBit = 1;
  404. kFindFolderExtendedFlagsUseOtherUserRecord = $01000000;
  405. type
  406. {$ifc TYPED_FUNCTION_POINTERS}
  407. FolderManagerNotificationProcPtr = function(message: OSType; arg: UnivPtr; userRefCon: UnivPtr): OSStatus;
  408. {$elsec}
  409. FolderManagerNotificationProcPtr = ProcPtr;
  410. {$endc}
  411. {$ifc OPAQUE_UPP_TYPES}
  412. FolderManagerNotificationUPP = ^SInt32; { an opaque UPP }
  413. {$elsec}
  414. FolderManagerNotificationUPP = UniversalProcPtr;
  415. {$endc}
  416. const
  417. uppFolderManagerNotificationProcInfo = $00000FF0;
  418. {
  419. * NewFolderManagerNotificationUPP()
  420. *
  421. * Availability:
  422. * Non-Carbon CFM: available as macro/inline
  423. * CarbonLib: in CarbonLib 1.0.2 and later
  424. * Mac OS X: in version 10.0 and later
  425. }
  426. function NewFolderManagerNotificationUPP(userRoutine: FolderManagerNotificationProcPtr): FolderManagerNotificationUPP; external name '_NewFolderManagerNotificationUPP'; { old name was NewFolderManagerNotificationProc }
  427. {
  428. * DisposeFolderManagerNotificationUPP()
  429. *
  430. * Availability:
  431. * Non-Carbon CFM: available as macro/inline
  432. * CarbonLib: in CarbonLib 1.0.2 and later
  433. * Mac OS X: in version 10.0 and later
  434. }
  435. procedure DisposeFolderManagerNotificationUPP(userUPP: FolderManagerNotificationUPP); external name '_DisposeFolderManagerNotificationUPP';
  436. {
  437. * InvokeFolderManagerNotificationUPP()
  438. *
  439. * Availability:
  440. * Non-Carbon CFM: available as macro/inline
  441. * CarbonLib: in CarbonLib 1.0.2 and later
  442. * Mac OS X: in version 10.0 and later
  443. }
  444. function InvokeFolderManagerNotificationUPP(message: OSType; arg: UnivPtr; userRefCon: UnivPtr; userRoutine: FolderManagerNotificationUPP): OSStatus; external name '_InvokeFolderManagerNotificationUPP'; { old name was CallFolderManagerNotificationProc }
  445. const
  446. kFolderManagerNotificationMessageUserLogIn = $6C6F672B (* 'log+' *); { Sent by system & third party software after a user logs in. arg should point to a valid FindFolderUserRedirectionGlobals structure or nil for the owner }
  447. kFolderManagerNotificationMessagePreUserLogIn = $6C6F676A (* 'logj' *); { Sent by system & third party software before a user logs in. arg should point to a valid FindFolderUserRedirectionGlobals structure or nil for the owner }
  448. kFolderManagerNotificationMessageUserLogOut = $6C6F672D (* 'log-' *); { Sent by system & third party software before a user logs out. arg should point to a valid FindFolderUserRedirectionGlobals structure or nil for the owner }
  449. kFolderManagerNotificationMessagePostUserLogOut = $6C6F6770 (* 'logp' *); { Sent by system & third party software after a user logs out. arg should point to a valid FindFolderUserRedirectionGlobals structure or nil for the owner }
  450. kFolderManagerNotificationDiscardCachedData = $64636865 (* 'dche' *); { Sent by system & third party software when the entire Folder Manager cache should be flushed }
  451. kFolderManagerNotificationMessageLoginStartup = $73747570 (* 'stup' *); { Sent by 'Login' application the first time it starts up after each boot }
  452. { These get used in the options parameter of FolderManagerRegisterNotificationProc() }
  453. kDoNotRemoveWhenCurrentApplicationQuitsBit = 0;
  454. kDoNotRemoveWheCurrentApplicationQuitsBit = 0; { Going away soon, use kDoNotRemoveWheCurrentApplicationQuitsBit }
  455. { These get used in the options parameter of FolderManagerCallNotificationProcs() }
  456. kStopIfAnyNotificationProcReturnsErrorBit = 31;
  457. { ************************* }
  458. { Folder Manager routines }
  459. { ************************* }
  460. { Folder Manager administration routines }
  461. {
  462. * AddFolderDescriptor()
  463. *
  464. * Availability:
  465. * Non-Carbon CFM: in FoldersLib 1.0 and later
  466. * CarbonLib: in CarbonLib 1.0 and later
  467. * Mac OS X: in version 10.0 and later
  468. }
  469. function AddFolderDescriptor(foldType: FolderType; flags: FolderDescFlags; foldClass: FolderClass; foldLocation: FolderLocation; badgeSignature: OSType; badgeType: OSType; const (*var*) name: StrFileName; replaceFlag: boolean): OSErr; external name '_AddFolderDescriptor';
  470. {
  471. * GetFolderDescriptor()
  472. *
  473. * Availability:
  474. * Non-Carbon CFM: in FoldersLib 1.0 and later
  475. * CarbonLib: in CarbonLib 1.0 and later
  476. * Mac OS X: in version 10.0 and later
  477. }
  478. function GetFolderDescriptor(foldType: FolderType; descSize: Size; var foldDesc: FolderDesc): OSErr; external name '_GetFolderDescriptor';
  479. {
  480. * GetFolderTypes()
  481. *
  482. * Availability:
  483. * Non-Carbon CFM: in FoldersLib 1.0 and later
  484. * CarbonLib: in CarbonLib 1.0 and later
  485. * Mac OS X: in version 10.0 and later
  486. }
  487. function GetFolderTypes(requestedTypeCount: UInt32; var totalTypeCount: UInt32; var theTypes: FolderType): OSErr; external name '_GetFolderTypes';
  488. {
  489. * RemoveFolderDescriptor()
  490. *
  491. * Availability:
  492. * Non-Carbon CFM: in FoldersLib 1.0 and later
  493. * CarbonLib: in CarbonLib 1.0 and later
  494. * Mac OS X: in version 10.0 and later
  495. }
  496. function RemoveFolderDescriptor(foldType: FolderType): OSErr; external name '_RemoveFolderDescriptor';
  497. { legacy routines }
  498. {
  499. * GetFolderName()
  500. *
  501. * Availability:
  502. * Non-Carbon CFM: in FoldersLib 1.0 and later
  503. * CarbonLib: in CarbonLib 1.0 and later
  504. * Mac OS X: in version 10.0 and later
  505. }
  506. function GetFolderName(vRefNum: SInt16; foldType: OSType; var foundVRefNum: SInt16; var name: StrFileName): OSErr; external name '_GetFolderName';
  507. { routing routines }
  508. {
  509. * AddFolderRouting()
  510. *
  511. * Availability:
  512. * Non-Carbon CFM: in FoldersLib 1.0 and later
  513. * CarbonLib: in CarbonLib 1.0 and later
  514. * Mac OS X: in version 10.0 and later
  515. }
  516. function AddFolderRouting(fileType: OSType; routeFromFolder: FolderType; routeToFolder: FolderType; flags: RoutingFlags; replaceFlag: boolean): OSErr; external name '_AddFolderRouting';
  517. {
  518. * RemoveFolderRouting()
  519. *
  520. * Availability:
  521. * Non-Carbon CFM: in FoldersLib 1.0 and later
  522. * CarbonLib: in CarbonLib 1.0 and later
  523. * Mac OS X: in version 10.0 and later
  524. }
  525. function RemoveFolderRouting(fileType: OSType; routeFromFolder: FolderType): OSErr; external name '_RemoveFolderRouting';
  526. {
  527. * FindFolderRouting()
  528. *
  529. * Availability:
  530. * Non-Carbon CFM: in FoldersLib 1.0 and later
  531. * CarbonLib: in CarbonLib 1.0 and later
  532. * Mac OS X: in version 10.0 and later
  533. }
  534. function FindFolderRouting(fileType: OSType; routeFromFolder: FolderType; var routeToFolder: FolderType; var flags: RoutingFlags): OSErr; external name '_FindFolderRouting';
  535. {
  536. * GetFolderRoutings()
  537. *
  538. * Availability:
  539. * Non-Carbon CFM: in FoldersLib 1.0 and later
  540. * CarbonLib: in CarbonLib 1.0 and later
  541. * Mac OS X: in version 10.0 and later
  542. }
  543. function GetFolderRoutings(requestedRoutingCount: UInt32; var totalRoutingCount: UInt32; routingSize: Size; var theRoutings: FolderRouting): OSErr; external name '_GetFolderRoutings';
  544. {
  545. * InvalidateFolderDescriptorCache()
  546. *
  547. * Availability:
  548. * Non-Carbon CFM: in FoldersLib 1.0 and later
  549. * CarbonLib: in CarbonLib 1.0 and later
  550. * Mac OS X: in version 10.0 and later
  551. }
  552. function InvalidateFolderDescriptorCache(vRefNum: SInt16; dirID: UInt32): OSErr; external name '_InvalidateFolderDescriptorCache';
  553. {
  554. * IdentifyFolder()
  555. *
  556. * Availability:
  557. * Non-Carbon CFM: in FoldersLib 1.0 and later
  558. * CarbonLib: in CarbonLib 1.0 and later
  559. * Mac OS X: in version 10.0 and later
  560. }
  561. function IdentifyFolder(vRefNum: SInt16; dirID: UInt32; var foldType: FolderType): OSErr; external name '_IdentifyFolder';
  562. {
  563. * FolderManagerRegisterNotificationProc()
  564. *
  565. * Availability:
  566. * Non-Carbon CFM: in InterfaceLib 9.0 and later
  567. * CarbonLib: in CarbonLib 1.0 and later
  568. * Mac OS X: in version 10.0 and later
  569. }
  570. function FolderManagerRegisterNotificationProc(notificationProc: FolderManagerNotificationUPP; refCon: UnivPtr; options: UInt32): OSErr; external name '_FolderManagerRegisterNotificationProc';
  571. {
  572. * FolderManagerUnregisterNotificationProc()
  573. *
  574. * Availability:
  575. * Non-Carbon CFM: in InterfaceLib 9.0 and later
  576. * CarbonLib: in CarbonLib 1.0 and later
  577. * Mac OS X: in version 10.0 and later
  578. }
  579. function FolderManagerUnregisterNotificationProc(notificationProc: FolderManagerNotificationUPP; refCon: UnivPtr): OSErr; external name '_FolderManagerUnregisterNotificationProc';
  580. {
  581. * FolderManagerRegisterCallNotificationProcs()
  582. *
  583. * Availability:
  584. * Non-Carbon CFM: in InterfaceLib 9.0 and later
  585. * CarbonLib: in CarbonLib 1.0 and later
  586. * Mac OS X: in version 10.0 and later
  587. }
  588. function FolderManagerRegisterCallNotificationProcs(message: OSType; arg: UnivPtr; options: UInt32): OSStatus; external name '_FolderManagerRegisterCallNotificationProcs';
  589. {*****************************}
  590. { MultiUser (At Ease) globals }
  591. {*****************************}
  592. {
  593. This structure has been through some evolution since the early days of At Ease 1.0. The structure
  594. has been expanded (and developers should assume that it will continue this way into the future). Older
  595. fields have been obsoleted as the features have changed in newer versions of the code.
  596. }
  597. { Some fields in here are really only valid for the network version of Macintosh Manager }
  598. type
  599. MultiUserGestaltPtr = ^MultiUserGestalt;
  600. MultiUserGestalt = record
  601. { Version 1 fields. }
  602. giVersion: SInt16; { structure version: 0 = invalid, 6 = OS 9 }
  603. giReserved0: SInt16; { [OBSOLETE with v3] giIsActive: if true then At Ease is currently running }
  604. giReserved1: SInt16; { [OBSOLETE] if true then auto create alias }
  605. giReserved2: SInt16; { [OBSOLETE with v6] if true then request floppy on new saves }
  606. giReserved3: SInt16; { [OBSOLETE] if true then hypercard stacks are shown on Applications panel }
  607. giReserved4: FSSpec; { [OBSOLETE with v6] location of At Ease Items folder }
  608. { Version 2 fields. }
  609. giDocsVRefNum: SInt16; { vrefnum of user's documents location (only valid if not on floppy) }
  610. giDocsDirID: UInt32; { directory id of user's documents folder (only valid if not on floppy) }
  611. giForceSaves: SInt16; { true if user is forced to save to their documents folder }
  612. giForceOpens: SInt16; { true if user is forced to open from their documents folder }
  613. giSetupName: Str31; { name of current setup }
  614. giUserName: Str31; { name of current user }
  615. giFrontAppName: Str31; { name of the frontmost application }
  616. giReserved5: SInt16; { [OBSOLETE with v6] true if user has Go To Finder menu item }
  617. giIsOn: SInt16; { true if Multiple Users/Macintosh Manager is on right now }
  618. { Version 3 fields. }
  619. { There were no additional fields for version 3.x }
  620. { Version 4 fields. }
  621. giUserLoggedInType: SInt16; { 0 = normal user, 1 = workgroup admin, 2 = global admin }
  622. giUserEncryptPwd: packed array [0..15] of char; { encrypted user password (our digest form) }
  623. giUserEnvironment: SInt16; { 0 = panels, 1 = normal Finder, 2 = limited/restricted Finder }
  624. giReserved6: SInt32; { [OBSOLETE] }
  625. giReserved7: SInt32; { [OBSOLETE] }
  626. giDisableScrnShots: boolean; { true if screen shots are not allowed }
  627. { Version 5 fields. }
  628. giSupportsAsyncFSCalls: boolean; { Finder uses this to tell if our patches support async trap patches }
  629. giPrefsVRefNum: SInt16; { vrefnum of preferences }
  630. giPrefsDirID: UInt32; { dirID of the At Ease Items folder on preferences volume }
  631. giUserLogInTime: UInt32; { time in seconds we've been logged in (0 or 1 mean not logged in) }
  632. giUsingPrintQuotas: boolean; { true if logged in user is using printer quotas }
  633. giUsingDiskQuotas: boolean; { true if logged in user has disk quotas active }
  634. { Version 6 fields - As of Mac OS 9's "Multiple Users 1.0" }
  635. giInSystemAccess: boolean; { true if system is in System Access (i.e., owner logged in) }
  636. giUserFolderEnabled: boolean; { true if FindFolder is redirecting folders (uses giUserName for user) }
  637. giReserved8: SInt16;
  638. giReserved9: SInt32;
  639. giInLoginScreen: boolean; { true if no user has logged in (including owner) }
  640. { May have more fields added in future, so never check for sizeof(GestaltRec) }
  641. end;
  642. MultiUserGestaltHandle = ^MultiUserGestaltPtr;
  643. {$ALIGN MAC68K}
  644. end.