Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

822 lines
38 KiB

  1. /*
  2. File: Folders.h
  3. Contains: Folder Manager Interfaces.
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 1995-2001 by Apple Computer, Inc., all rights reserved.
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://developer.apple.com/bugreporter/
  9. */
  10. #ifndef __FOLDERS__
  11. #define __FOLDERS__
  12. #ifndef __MACTYPES__
  13. #include <MacTypes.h>
  14. #endif
  15. #ifndef __MIXEDMODE__
  16. #include <MixedMode.h>
  17. #endif
  18. #ifndef __FILES__
  19. #include <Files.h>
  20. #endif
  21. #if PRAGMA_ONCE
  22. #pragma once
  23. #endif
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. #if PRAGMA_IMPORT
  28. #pragma import on
  29. #endif
  30. #if PRAGMA_STRUCT_ALIGN
  31. #pragma options align=mac68k
  32. #elif PRAGMA_STRUCT_PACKPUSH
  33. #pragma pack(push, 2)
  34. #elif PRAGMA_STRUCT_PACK
  35. #pragma pack(2)
  36. #endif
  37. enum {
  38. kOnSystemDisk = -32768L, /* previously was 0x8000 but that is an unsigned value whereas vRefNum is signed*/
  39. kOnAppropriateDisk = -32767, /* Generally, the same as kOnSystemDisk, but it's clearer that this isn't always the 'boot' disk.*/
  40. /* Folder Domains - Carbon only. The constants above can continue to be used, but the folder/volume returned will*/
  41. /* be from one of the domains below.*/
  42. kSystemDomain = -32766, /* Read-only system hierarchy.*/
  43. kLocalDomain = -32765, /* All users of a single machine have access to these resources.*/
  44. kNetworkDomain = -32764, /* All users configured to use a common network server has access to these resources.*/
  45. kUserDomain = -32763, /* Read/write. Resources that are private to the user.*/
  46. kClassicDomain = -32762 /* Domain referring to the currently configured Classic System Folder*/
  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. /*
  72. * FindFolder()
  73. *
  74. * Availability:
  75. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  76. * CarbonLib: in CarbonLib 1.0 and later
  77. * Mac OS X: in version 10.0 and later
  78. */
  79. EXTERN_API( OSErr )
  80. FindFolder(
  81. short vRefNum,
  82. OSType folderType,
  83. Boolean createFolder,
  84. short * foundVRefNum,
  85. long * foundDirID) TWOWORDINLINE(0x7000, 0xA823);
  86. /*
  87. * FindFolderExtended()
  88. *
  89. * Availability:
  90. * Non-Carbon CFM: in InterfaceLib 9.0 and later
  91. * CarbonLib: in CarbonLib 1.0 and later
  92. * Mac OS X: in version 10.0 and later
  93. */
  94. EXTERN_API( OSErr )
  95. FindFolderExtended(
  96. short vol,
  97. OSType foldType,
  98. Boolean createFolder,
  99. UInt32 flags,
  100. void * data,
  101. short * vRefNum,
  102. long * dirID) THREEWORDINLINE(0x303C, 0x0B2C, 0xA823);
  103. /*
  104. * ReleaseFolder()
  105. *
  106. * Availability:
  107. * Non-Carbon CFM: in FoldersLib 1.0 and later
  108. * CarbonLib: in CarbonLib 1.0 and later
  109. * Mac OS X: in version 10.0 and later
  110. */
  111. EXTERN_API( OSErr )
  112. ReleaseFolder(
  113. short vRefNum,
  114. OSType folderType) TWOWORDINLINE(0x700B, 0xA823);
  115. #if !TARGET_OS_MAC
  116. /* Since non-mac targets don't know about VRef's or DirID's, the Ex version returns
  117. the found folder path.
  118. */
  119. #if CALL_NOT_IN_CARBON
  120. /*
  121. * FindFolderEx()
  122. *
  123. * Availability:
  124. * Non-Carbon CFM: not available
  125. * CarbonLib: not available
  126. * Mac OS X: not available
  127. */
  128. EXTERN_API_C( OSErr )
  129. FindFolderEx(
  130. short vRefNum,
  131. OSType folderType,
  132. Boolean createFolder,
  133. short * foundVRefNum,
  134. long * foundDirID,
  135. char * foundFolder);
  136. #endif /* CALL_NOT_IN_CARBON */
  137. #endif /* !TARGET_OS_MAC */
  138. /******************************************/
  139. /* Extensible Folder Manager declarations */
  140. /******************************************/
  141. /****************************/
  142. /* Folder Manager constants */
  143. /****************************/
  144. enum {
  145. kExtensionDisabledFolderType = FOUR_CHAR_CODE('extD'),
  146. kControlPanelDisabledFolderType = FOUR_CHAR_CODE('ctrD'),
  147. kSystemExtensionDisabledFolderType = FOUR_CHAR_CODE('macD'),
  148. kStartupItemsDisabledFolderType = FOUR_CHAR_CODE('strD'),
  149. kShutdownItemsDisabledFolderType = FOUR_CHAR_CODE('shdD'),
  150. kApplicationsFolderType = FOUR_CHAR_CODE('apps'),
  151. kDocumentsFolderType = FOUR_CHAR_CODE('docs')
  152. };
  153. enum {
  154. /* new constants */
  155. kVolumeRootFolderType = FOUR_CHAR_CODE('root'), /* root folder of a volume */
  156. kChewableItemsFolderType = FOUR_CHAR_CODE('flnt'), /* items deleted at boot */
  157. kApplicationSupportFolderType = FOUR_CHAR_CODE('asup'), /* third-party items and folders */
  158. kTextEncodingsFolderType = 0xC4746578, /* encoding tables */
  159. kStationeryFolderType = FOUR_CHAR_CODE('odst'), /* stationery */
  160. kOpenDocFolderType = FOUR_CHAR_CODE('odod'), /* OpenDoc root */
  161. kOpenDocShellPlugInsFolderType = FOUR_CHAR_CODE('odsp'), /* OpenDoc Shell Plug-Ins in OpenDoc folder */
  162. kEditorsFolderType = FOUR_CHAR_CODE('oded'), /* OpenDoc editors in MacOS Folder */
  163. kOpenDocEditorsFolderType = 0xC46F6466, /* OpenDoc subfolder of Editors folder */
  164. kOpenDocLibrariesFolderType = FOUR_CHAR_CODE('odlb'), /* OpenDoc libraries folder */
  165. kGenEditorsFolderType = 0xC4656469, /* CKH general editors folder at root level of Sys folder */
  166. kHelpFolderType = 0xC4686C70, /* CKH help folder currently at root of system folder */
  167. kInternetPlugInFolderType = 0xC46E6574, /* CKH internet plug ins for browsers and stuff */
  168. kModemScriptsFolderType = 0xC46D6F64, /* CKH modem scripts, get 'em OUT of the Extensions folder */
  169. kPrinterDescriptionFolderType = FOUR_CHAR_CODE('ppdf'), /* CKH new folder at root of System folder for printer descs. */
  170. kPrinterDriverFolderType = 0xC4707264, /* CKH new folder at root of System folder for printer drivers */
  171. kScriptingAdditionsFolderType = 0xC4736372, /* CKH at root of system folder */
  172. kSharedLibrariesFolderType = 0xC46C6962, /* CKH for general shared libs. */
  173. kVoicesFolderType = FOUR_CHAR_CODE('fvoc'), /* CKH macintalk can live here */
  174. kControlStripModulesFolderType = FOUR_CHAR_CODE('sdev'), /* CKH for control strip modules */
  175. kAssistantsFolderType = 0x617374C4, /* SJF for Assistants (MacOS Setup Assistant, etc) */
  176. kUtilitiesFolderType = 0x757469C4, /* SJF for Utilities folder */
  177. kAppleExtrasFolderType = 0x616578C4, /* SJF for Apple Extras folder */
  178. kContextualMenuItemsFolderType = FOUR_CHAR_CODE('cmnu'), /* SJF for Contextual Menu items */
  179. kMacOSReadMesFolderType = 0x6D6F72C4, /* SJF for MacOS ReadMes folder */
  180. kALMModulesFolderType = FOUR_CHAR_CODE('walk'), /* EAS for Location Manager Module files except type 'thng' (within kExtensionFolderType) */
  181. kALMPreferencesFolderType = FOUR_CHAR_CODE('trip'), /* EAS for Location Manager Preferences (within kPreferencesFolderType; contains kALMLocationsFolderType) */
  182. kALMLocationsFolderType = FOUR_CHAR_CODE('fall'), /* EAS for Location Manager Locations (within kALMPreferencesFolderType) */
  183. kColorSyncProfilesFolderType = FOUR_CHAR_CODE('prof'), /* for ColorSync(tm) Profiles */
  184. kThemesFolderType = FOUR_CHAR_CODE('thme'), /* for Theme data files */
  185. kFavoritesFolderType = FOUR_CHAR_CODE('favs'), /* Favorties folder for Navigation Services */
  186. kInternetFolderType = 0x696E74C4, /* Internet folder (root level of startup volume) */
  187. kAppearanceFolderType = FOUR_CHAR_CODE('appr'), /* Appearance folder (root of system folder) */
  188. kSoundSetsFolderType = FOUR_CHAR_CODE('snds'), /* Sound Sets folder (in Appearance folder) */
  189. kDesktopPicturesFolderType = 0x647470C4, /* Desktop Pictures folder (in Appearance folder) */
  190. kInternetSearchSitesFolderType = FOUR_CHAR_CODE('issf'), /* Internet Search Sites folder */
  191. kFindSupportFolderType = FOUR_CHAR_CODE('fnds'), /* Find support folder */
  192. kFindByContentFolderType = FOUR_CHAR_CODE('fbcf'), /* Find by content folder */
  193. kInstallerLogsFolderType = FOUR_CHAR_CODE('ilgf'), /* Installer Logs folder */
  194. kScriptsFolderType = 0x736372C4, /* Scripts folder */
  195. kFolderActionsFolderType = FOUR_CHAR_CODE('fasf'), /* Folder Actions Scripts folder */
  196. kLauncherItemsFolderType = FOUR_CHAR_CODE('laun'), /* Launcher Items folder */
  197. kRecentApplicationsFolderType = FOUR_CHAR_CODE('rapp'), /* Recent Applications folder */
  198. kRecentDocumentsFolderType = FOUR_CHAR_CODE('rdoc'), /* Recent Documents folder */
  199. kRecentServersFolderType = FOUR_CHAR_CODE('rsvr'), /* Recent Servers folder */
  200. kSpeakableItemsFolderType = FOUR_CHAR_CODE('spki'), /* Speakable Items folder */
  201. kKeychainFolderType = FOUR_CHAR_CODE('kchn'), /* Keychain folder */
  202. kQuickTimeExtensionsFolderType = FOUR_CHAR_CODE('qtex'), /* QuickTime Extensions Folder (in Extensions folder) */
  203. kDisplayExtensionsFolderType = FOUR_CHAR_CODE('dspl'), /* Display Extensions Folder (in Extensions folder) */
  204. kMultiprocessingFolderType = FOUR_CHAR_CODE('mpxf'), /* Multiprocessing Folder (in Extensions folder) */
  205. kPrintingPlugInsFolderType = FOUR_CHAR_CODE('pplg') /* Printing Plug-Ins Folder (in Extensions folder) */
  206. };
  207. /* New Folder Types to accommodate the Mac OS X Folder Manager */
  208. /* These folder types are not applicable on Mac OS 9. */
  209. enum {
  210. kDomainTopLevelFolderType = FOUR_CHAR_CODE('dtop'), /* The top-level of a Folder domain, e.g. "/System"*/
  211. kDomainLibraryFolderType = FOUR_CHAR_CODE('dlib'), /* the Library subfolder of a particular domain*/
  212. kColorSyncFolderType = FOUR_CHAR_CODE('sync'), /* Contains ColorSync-related folders*/
  213. kColorSyncCMMFolderType = FOUR_CHAR_CODE('ccmm'), /* ColorSync CMMs*/
  214. kColorSyncScriptingFolderType = FOUR_CHAR_CODE('cscr'), /* ColorSync Scripting support*/
  215. kPrintersFolderType = FOUR_CHAR_CODE('impr'), /* Contains Printing-related folders*/
  216. kSpeechFolderType = FOUR_CHAR_CODE('spch'), /* Contains Speech-related folders*/
  217. kCarbonLibraryFolderType = FOUR_CHAR_CODE('carb'), /* Contains Carbon-specific file*/
  218. kDocumentationFolderType = FOUR_CHAR_CODE('info'), /* Contains Documentation files (not user documents)*/
  219. kDeveloperDocsFolderType = FOUR_CHAR_CODE('ddoc'), /* Contains Developer Documentation files and folders*/
  220. kDeveloperHelpFolderType = FOUR_CHAR_CODE('devh'), /* Contains Developer Help related files*/
  221. kISSDownloadsFolderType = FOUR_CHAR_CODE('issd'), /* Contains Internet Search Sites downloaded from the Internet*/
  222. kUserSpecificTmpFolderType = FOUR_CHAR_CODE('utmp'), /* Contains temporary items created on behalf of the current user*/
  223. kCachedDataFolderType = FOUR_CHAR_CODE('cach'), /* Contains various cache files for different clients*/
  224. kFrameworksFolderType = FOUR_CHAR_CODE('fram'), /* Contains MacOS X Framework folders */
  225. kPrivateFrameworksFolderType = FOUR_CHAR_CODE('pfrm'), /* Contains MacOS X Private Framework folders */
  226. kClassicDesktopFolderType = FOUR_CHAR_CODE('sdsk'), /* MacOS 9 compatible desktop folder - same as */
  227. /* kSystemDesktopFolderType but with a more appropriate*/
  228. /* name for Mac OS X code.*/
  229. kDeveloperFolderType = FOUR_CHAR_CODE('devf'), /* Contains MacOS X Developer Resources*/
  230. kSystemSoundsFolderType = FOUR_CHAR_CODE('ssnd'), /* Contains Mac OS X System Sound Files*/
  231. kComponentsFolderType = FOUR_CHAR_CODE('cmpd'), /* Contains Mac OS X components*/
  232. kQuickTimeComponentsFolderType = FOUR_CHAR_CODE('wcmp'), /* Contains QuickTime components for Mac OS X*/
  233. kCoreServicesFolderType = FOUR_CHAR_CODE('csrv'), /* Refers to the "CoreServices" folder on Mac OS X*/
  234. kPictureDocumentsFolderType = FOUR_CHAR_CODE('pdoc'), /* Refers to the "Pictures" folder in a users home directory*/
  235. kMovieDocumentsFolderType = FOUR_CHAR_CODE('mdoc'), /* Refers to the "Movies" folder in a users home directory*/
  236. kMusicDocumentsFolderType = 0xB5646F63, /* Refers to the "Music" folder in a users home directory*/
  237. kInternetSitesFolderType = FOUR_CHAR_CODE('site'), /* Refers to the "Sites" folder in a users home directory*/
  238. kPublicFolderType = FOUR_CHAR_CODE('pubb'), /* Refers to the "Public" folder in a users home directory*/
  239. kAudioSupportFolderType = FOUR_CHAR_CODE('adio'), /* Refers to the Audio support folder for Mac OS X*/
  240. kAudioSoundsFolderType = FOUR_CHAR_CODE('asnd'), /* Refers to the Sounds subfolder of Audio Support*/
  241. kAudioSoundBanksFolderType = FOUR_CHAR_CODE('bank'), /* Refers to the Banks subfolder of the Sounds Folder*/
  242. kAudioAlertSoundsFolderType = FOUR_CHAR_CODE('alrt'), /* Refers to the Alert Sounds subfolder of the Sound Folder*/
  243. kAudioPlugInsFolderType = FOUR_CHAR_CODE('aplg'), /* Refers to the Plug-ins subfolder of the Audio Folder */
  244. kAudioComponentsFolderType = FOUR_CHAR_CODE('acmp'), /* Refers to the Components subfolder of the Audio Plug-ins Folder */
  245. kKernelExtensionsFolderType = FOUR_CHAR_CODE('kext'), /* Refers to the Kernel Extensions Folder on Mac OS X*/
  246. kDirectoryServicesFolderType = FOUR_CHAR_CODE('dsrv'), /* Refers to the Directory Services folder on Mac OS X*/
  247. kDirectoryServicesPlugInsFolderType = FOUR_CHAR_CODE('dplg'), /* Refers to the Directory Services Plug-Ins folder on Mac OS X */
  248. kInstallerReceiptsFolderType = FOUR_CHAR_CODE('rcpt'), /* Refers to the "Receipts" folder in Mac OS X*/
  249. kFileSystemSupportFolderType = FOUR_CHAR_CODE('fsys'), /* Refers to the [domain]/Library/Filesystems folder in Mac OS X*/
  250. kAppleShareSupportFolderType = FOUR_CHAR_CODE('shar'), /* Refers to the [domain]/Library/Filesystems/AppleShare folder in Mac OS X*/
  251. kAppleShareAuthenticationFolderType = FOUR_CHAR_CODE('auth'), /* Refers to the [domain]/Library/Filesystems/AppleShare/Authentication folder in Mac OS X*/
  252. kMIDIDriversFolderType = FOUR_CHAR_CODE('midi'), /* Refers to the MIDI Drivers folder on Mac OS X*/
  253. kKeyboardLayoutsFolderType = FOUR_CHAR_CODE('klay'), /* Refers to the [domain]/Library/KeyboardLayouts folder in Mac OS X*/
  254. kIndexFilesFolderType = FOUR_CHAR_CODE('indx'), /* Refers to the [domain]/Library/Indexes folder in Mac OS X*/
  255. kFindByContentIndexesFolderType = FOUR_CHAR_CODE('fbcx'), /* Refers to the [domain]/Library/Indexes/FindByContent folder in Mac OS X*/
  256. kManagedItemsFolderType = FOUR_CHAR_CODE('mang'), /* Refers to the Managed Items folder for Mac OS X */
  257. kBootTimeStartupItemsFolderType = FOUR_CHAR_CODE('empz') /* Refers to the "StartupItems" folder of Mac OS X */
  258. };
  259. enum {
  260. kLocalesFolderType = 0xC46C6F63, /* PKE for Locales folder */
  261. kFindByContentPluginsFolderType = FOUR_CHAR_CODE('fbcp') /* Find By Content Plug-ins */
  262. };
  263. enum {
  264. kUsersFolderType = FOUR_CHAR_CODE('usrs'), /* "Users" folder, contains one folder for each user. */
  265. kCurrentUserFolderType = FOUR_CHAR_CODE('cusr'), /* The folder for the currently logged on user. */
  266. kCurrentUserRemoteFolderLocation = FOUR_CHAR_CODE('rusf'), /* The remote folder for the currently logged on user */
  267. kCurrentUserRemoteFolderType = FOUR_CHAR_CODE('rusr'), /* The remote folder location for the currently logged on user */
  268. kSharedUserDataFolderType = FOUR_CHAR_CODE('sdat'), /* A Shared "Documents" folder, readable & writeable by all users */
  269. kVolumeSettingsFolderType = FOUR_CHAR_CODE('vsfd') /* Volume specific user information goes here */
  270. };
  271. /* FolderDescFlags values */
  272. enum {
  273. kCreateFolderAtBoot = 0x00000002,
  274. kCreateFolderAtBootBit = 1,
  275. kFolderCreatedInvisible = 0x00000004,
  276. kFolderCreatedInvisibleBit = 2,
  277. kFolderCreatedNameLocked = 0x00000008,
  278. kFolderCreatedNameLockedBit = 3,
  279. kFolderCreatedAdminPrivs = 0x00000010,
  280. kFolderCreatedAdminPrivsBit = 4
  281. };
  282. enum {
  283. kFolderInUserFolder = 0x00000020,
  284. kFolderInUserFolderBit = 5,
  285. kFolderTrackedByAlias = 0x00000040,
  286. kFolderTrackedByAliasBit = 6,
  287. kFolderInRemoteUserFolderIfAvailable = 0x00000080,
  288. kFolderInRemoteUserFolderIfAvailableBit = 7,
  289. kFolderNeverMatchedInIdentifyFolder = 0x00000100,
  290. kFolderNeverMatchedInIdentifyFolderBit = 8,
  291. kFolderMustStayOnSameVolume = 0x00000200,
  292. kFolderMustStayOnSameVolumeBit = 9,
  293. kFolderManagerFolderInMacOS9FolderIfMacOSXIsInstalledMask = 0x00000400,
  294. kFolderManagerFolderInMacOS9FolderIfMacOSXIsInstalledBit = 10,
  295. kFolderInLocalOrRemoteUserFolder = kFolderInUserFolder | kFolderInRemoteUserFolderIfAvailable
  296. };
  297. typedef UInt32 FolderDescFlags;
  298. /* FolderClass values */
  299. enum {
  300. kRelativeFolder = FOUR_CHAR_CODE('relf'),
  301. kSpecialFolder = FOUR_CHAR_CODE('spcf')
  302. };
  303. typedef OSType FolderClass;
  304. /* special folder locations */
  305. enum {
  306. kBlessedFolder = FOUR_CHAR_CODE('blsf'),
  307. kRootFolder = FOUR_CHAR_CODE('rotf')
  308. };
  309. enum {
  310. kCurrentUserFolderLocation = FOUR_CHAR_CODE('cusf') /* the magic 'Current User' folder location*/
  311. };
  312. typedef OSType FolderType;
  313. typedef OSType FolderLocation;
  314. struct FolderDesc {
  315. Size descSize;
  316. FolderType foldType;
  317. FolderDescFlags flags;
  318. FolderClass foldClass;
  319. FolderType foldLocation;
  320. OSType badgeSignature;
  321. OSType badgeType;
  322. UInt32 reserved;
  323. StrFileName name; /* Str63 on MacOS*/
  324. };
  325. typedef struct FolderDesc FolderDesc;
  326. typedef FolderDesc * FolderDescPtr;
  327. typedef UInt32 RoutingFlags;
  328. struct FolderRouting {
  329. Size descSize;
  330. OSType fileType;
  331. FolderType routeFromFolder;
  332. FolderType routeToFolder;
  333. RoutingFlags flags;
  334. };
  335. typedef struct FolderRouting FolderRouting;
  336. typedef FolderRouting * FolderRoutingPtr;
  337. /* routing constants */
  338. /* These are bits in the .flags field of the FindFolderUserRedirectionGlobals struct*/
  339. enum {
  340. /* Set this bit to 1 in the .flags field of a FindFolderUserRedirectionGlobals*/
  341. /* structure if the userName in the struct should be used as the current*/
  342. /* "User" name*/
  343. kFindFolderRedirectionFlagUseDistinctUserFoldersBit = 0, /* Set this bit to 1 and the currentUserFolderVRefNum and currentUserFolderDirID*/
  344. /* fields of the user record will get used instead of finding the user folder*/
  345. /* with the userName field.*/
  346. kFindFolderRedirectionFlagUseGivenVRefAndDirIDAsUserFolderBit = 1, /* Set this bit to 1 and the remoteUserFolderVRefNum and remoteUserFolderDirID*/
  347. /* fields of the user record will get used instead of finding the user folder*/
  348. /* with the userName field.*/
  349. kFindFolderRedirectionFlagsUseGivenVRefNumAndDirIDAsRemoteUserFolderBit = 2
  350. };
  351. struct FindFolderUserRedirectionGlobals {
  352. UInt32 version;
  353. UInt32 flags;
  354. Str31 userName;
  355. short userNameScript;
  356. short currentUserFolderVRefNum;
  357. long currentUserFolderDirID;
  358. short remoteUserFolderVRefNum;
  359. long remoteUserFolderDirID;
  360. };
  361. typedef struct FindFolderUserRedirectionGlobals FindFolderUserRedirectionGlobals;
  362. typedef FindFolderUserRedirectionGlobals * FindFolderUserRedirectionGlobalsPtr;
  363. enum {
  364. kFolderManagerUserRedirectionGlobalsCurrentVersion = 1
  365. };
  366. /*
  367. These are passed into FindFolderExtended(), FindFolderInternalExtended(), and
  368. FindFolderNewInstallerEntryExtended() in the flags field.
  369. */
  370. enum {
  371. kFindFolderExtendedFlagsDoNotFollowAliasesBit = 0,
  372. kFindFolderExtendedFlagsDoNotUseUserFolderBit = 1,
  373. kFindFolderExtendedFlagsUseOtherUserRecord = 0x01000000
  374. };
  375. typedef CALLBACK_API( OSStatus , FolderManagerNotificationProcPtr )(OSType message, void *arg, void *userRefCon);
  376. typedef STACK_UPP_TYPE(FolderManagerNotificationProcPtr) FolderManagerNotificationUPP;
  377. /*
  378. * NewFolderManagerNotificationUPP()
  379. *
  380. * Availability:
  381. * Non-Carbon CFM: available as macro/inline
  382. * CarbonLib: in CarbonLib 1.0.2 and later
  383. * Mac OS X: in version 10.0 and later
  384. */
  385. EXTERN_API_C( FolderManagerNotificationUPP )
  386. NewFolderManagerNotificationUPP(FolderManagerNotificationProcPtr userRoutine);
  387. #if !OPAQUE_UPP_TYPES
  388. enum { uppFolderManagerNotificationProcInfo = 0x00000FF0 }; /* pascal 4_bytes Func(4_bytes, 4_bytes, 4_bytes) */
  389. #ifdef __cplusplus
  390. inline DEFINE_API_C(FolderManagerNotificationUPP) NewFolderManagerNotificationUPP(FolderManagerNotificationProcPtr userRoutine) { return (FolderManagerNotificationUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppFolderManagerNotificationProcInfo, GetCurrentArchitecture()); }
  391. #else
  392. #define NewFolderManagerNotificationUPP(userRoutine) (FolderManagerNotificationUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppFolderManagerNotificationProcInfo, GetCurrentArchitecture())
  393. #endif
  394. #endif
  395. /*
  396. * DisposeFolderManagerNotificationUPP()
  397. *
  398. * Availability:
  399. * Non-Carbon CFM: available as macro/inline
  400. * CarbonLib: in CarbonLib 1.0.2 and later
  401. * Mac OS X: in version 10.0 and later
  402. */
  403. EXTERN_API_C( void )
  404. DisposeFolderManagerNotificationUPP(FolderManagerNotificationUPP userUPP);
  405. #if !OPAQUE_UPP_TYPES
  406. #ifdef __cplusplus
  407. inline DEFINE_API_C(void) DisposeFolderManagerNotificationUPP(FolderManagerNotificationUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  408. #else
  409. #define DisposeFolderManagerNotificationUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  410. #endif
  411. #endif
  412. /*
  413. * InvokeFolderManagerNotificationUPP()
  414. *
  415. * Availability:
  416. * Non-Carbon CFM: available as macro/inline
  417. * CarbonLib: in CarbonLib 1.0.2 and later
  418. * Mac OS X: in version 10.0 and later
  419. */
  420. EXTERN_API_C( OSStatus )
  421. InvokeFolderManagerNotificationUPP(
  422. OSType message,
  423. void * arg,
  424. void * userRefCon,
  425. FolderManagerNotificationUPP userUPP);
  426. #if !OPAQUE_UPP_TYPES
  427. #ifdef __cplusplus
  428. inline DEFINE_API_C(OSStatus) InvokeFolderManagerNotificationUPP(OSType message, void * arg, void * userRefCon, FolderManagerNotificationUPP userUPP) { return (OSStatus)CALL_THREE_PARAMETER_UPP(userUPP, uppFolderManagerNotificationProcInfo, message, arg, userRefCon); }
  429. #else
  430. #define InvokeFolderManagerNotificationUPP(message, arg, userRefCon, userUPP) (OSStatus)CALL_THREE_PARAMETER_UPP((userUPP), uppFolderManagerNotificationProcInfo, (message), (arg), (userRefCon))
  431. #endif
  432. #endif
  433. #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
  434. /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
  435. #define NewFolderManagerNotificationProc(userRoutine) NewFolderManagerNotificationUPP(userRoutine)
  436. #define CallFolderManagerNotificationProc(userRoutine, message, arg, userRefCon) InvokeFolderManagerNotificationUPP(message, arg, userRefCon, userRoutine)
  437. #endif /* CALL_NOT_IN_CARBON */
  438. enum {
  439. kFolderManagerNotificationMessageUserLogIn = FOUR_CHAR_CODE('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*/
  440. kFolderManagerNotificationMessagePreUserLogIn = FOUR_CHAR_CODE('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*/
  441. kFolderManagerNotificationMessageUserLogOut = FOUR_CHAR_CODE('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*/
  442. kFolderManagerNotificationMessagePostUserLogOut = FOUR_CHAR_CODE('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*/
  443. kFolderManagerNotificationDiscardCachedData = FOUR_CHAR_CODE('dche'), /* Sent by system & third party software when the entire Folder Manager cache should be flushed*/
  444. kFolderManagerNotificationMessageLoginStartup = FOUR_CHAR_CODE('stup') /* Sent by 'Login' application the first time it starts up after each boot*/
  445. };
  446. /* These get used in the options parameter of FolderManagerRegisterNotificationProc()*/
  447. enum {
  448. kDoNotRemoveWhenCurrentApplicationQuitsBit = 0,
  449. kDoNotRemoveWheCurrentApplicationQuitsBit = kDoNotRemoveWhenCurrentApplicationQuitsBit /* Going away soon, use kDoNotRemoveWheCurrentApplicationQuitsBit*/
  450. };
  451. /* These get used in the options parameter of FolderManagerCallNotificationProcs()*/
  452. enum {
  453. kStopIfAnyNotificationProcReturnsErrorBit = 31
  454. };
  455. /***************************/
  456. /* Folder Manager routines */
  457. /***************************/
  458. /* Folder Manager administration routines */
  459. /*
  460. * AddFolderDescriptor()
  461. *
  462. * Availability:
  463. * Non-Carbon CFM: in FoldersLib 1.0 and later
  464. * CarbonLib: in CarbonLib 1.0 and later
  465. * Mac OS X: in version 10.0 and later
  466. */
  467. EXTERN_API( OSErr )
  468. AddFolderDescriptor(
  469. FolderType foldType,
  470. FolderDescFlags flags,
  471. FolderClass foldClass,
  472. FolderLocation foldLocation,
  473. OSType badgeSignature,
  474. OSType badgeType,
  475. ConstStrFileNameParam name,
  476. Boolean replaceFlag) TWOWORDINLINE(0x7020, 0xA823);
  477. /*
  478. * GetFolderDescriptor()
  479. *
  480. * Availability:
  481. * Non-Carbon CFM: in FoldersLib 1.0 and later
  482. * CarbonLib: in CarbonLib 1.0 and later
  483. * Mac OS X: in version 10.0 and later
  484. */
  485. EXTERN_API( OSErr )
  486. GetFolderDescriptor(
  487. FolderType foldType,
  488. Size descSize,
  489. FolderDesc * foldDesc) TWOWORDINLINE(0x7023, 0xA823);
  490. /*
  491. * GetFolderTypes()
  492. *
  493. * Availability:
  494. * Non-Carbon CFM: in FoldersLib 1.0 and later
  495. * CarbonLib: in CarbonLib 1.0 and later
  496. * Mac OS X: in version 10.0 and later
  497. */
  498. EXTERN_API( OSErr )
  499. GetFolderTypes(
  500. UInt32 requestedTypeCount,
  501. UInt32 * totalTypeCount,
  502. FolderType * theTypes) TWOWORDINLINE(0x7024, 0xA823);
  503. /*
  504. * RemoveFolderDescriptor()
  505. *
  506. * Availability:
  507. * Non-Carbon CFM: in FoldersLib 1.0 and later
  508. * CarbonLib: in CarbonLib 1.0 and later
  509. * Mac OS X: in version 10.0 and later
  510. */
  511. EXTERN_API( OSErr )
  512. RemoveFolderDescriptor(FolderType foldType) TWOWORDINLINE(0x7021, 0xA823);
  513. /* legacy routines */
  514. /*
  515. * GetFolderName()
  516. *
  517. * Availability:
  518. * Non-Carbon CFM: in FoldersLib 1.0 and later
  519. * CarbonLib: in CarbonLib 1.0 and later
  520. * Mac OS X: in version 10.0 and later
  521. */
  522. EXTERN_API( OSErr )
  523. GetFolderName(
  524. short vRefNum,
  525. OSType foldType,
  526. short * foundVRefNum,
  527. StrFileName name) TWOWORDINLINE(0x700E, 0xA823);
  528. /* routing routines */
  529. /*
  530. * AddFolderRouting()
  531. *
  532. * Availability:
  533. * Non-Carbon CFM: in FoldersLib 1.0 and later
  534. * CarbonLib: in CarbonLib 1.0 and later
  535. * Mac OS X: in version 10.0 and later
  536. */
  537. EXTERN_API( OSErr )
  538. AddFolderRouting(
  539. OSType fileType,
  540. FolderType routeFromFolder,
  541. FolderType routeToFolder,
  542. RoutingFlags flags,
  543. Boolean replaceFlag) THREEWORDINLINE(0x303C, 0x0926, 0xA823);
  544. /*
  545. * RemoveFolderRouting()
  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. EXTERN_API( OSErr )
  553. RemoveFolderRouting(
  554. OSType fileType,
  555. FolderType routeFromFolder) THREEWORDINLINE(0x303C, 0x0427, 0xA823);
  556. /*
  557. * FindFolderRouting()
  558. *
  559. * Availability:
  560. * Non-Carbon CFM: in FoldersLib 1.0 and later
  561. * CarbonLib: in CarbonLib 1.0 and later
  562. * Mac OS X: in version 10.0 and later
  563. */
  564. EXTERN_API( OSErr )
  565. FindFolderRouting(
  566. OSType fileType,
  567. FolderType routeFromFolder,
  568. FolderType * routeToFolder,
  569. RoutingFlags * flags) THREEWORDINLINE(0x303C, 0x0822, 0xA823);
  570. /*
  571. * GetFolderRoutings()
  572. *
  573. * Availability:
  574. * Non-Carbon CFM: in FoldersLib 1.0 and later
  575. * CarbonLib: in CarbonLib 1.0 and later
  576. * Mac OS X: in version 10.0 and later
  577. */
  578. EXTERN_API( OSErr )
  579. GetFolderRoutings(
  580. UInt32 requestedRoutingCount,
  581. UInt32 * totalRoutingCount,
  582. Size routingSize,
  583. FolderRouting * theRoutings) THREEWORDINLINE(0x303C, 0x081E, 0xA823);
  584. /*
  585. * InvalidateFolderDescriptorCache()
  586. *
  587. * Availability:
  588. * Non-Carbon CFM: in FoldersLib 1.0 and later
  589. * CarbonLib: in CarbonLib 1.0 and later
  590. * Mac OS X: in version 10.0 and later
  591. */
  592. EXTERN_API( OSErr )
  593. InvalidateFolderDescriptorCache(
  594. short vRefNum,
  595. long dirID) THREEWORDINLINE(0x303C, 0x0325, 0xA823);
  596. /*
  597. * IdentifyFolder()
  598. *
  599. * Availability:
  600. * Non-Carbon CFM: in FoldersLib 1.0 and later
  601. * CarbonLib: in CarbonLib 1.0 and later
  602. * Mac OS X: in version 10.0 and later
  603. */
  604. EXTERN_API( OSErr )
  605. IdentifyFolder(
  606. short vRefNum,
  607. long dirID,
  608. FolderType * foldType) THREEWORDINLINE(0x303C, 0x051F, 0xA823);
  609. /*
  610. * FolderManagerRegisterNotificationProc()
  611. *
  612. * Availability:
  613. * Non-Carbon CFM: in InterfaceLib 9.0 and later
  614. * CarbonLib: in CarbonLib 1.0 and later
  615. * Mac OS X: in version 10.0 and later
  616. */
  617. EXTERN_API( OSErr )
  618. FolderManagerRegisterNotificationProc(
  619. FolderManagerNotificationUPP notificationProc,
  620. void * refCon,
  621. UInt32 options) THREEWORDINLINE(0x303C, 0x062F, 0xA823);
  622. /*
  623. * FolderManagerUnregisterNotificationProc()
  624. *
  625. * Availability:
  626. * Non-Carbon CFM: in InterfaceLib 9.0 and later
  627. * CarbonLib: in CarbonLib 1.0 and later
  628. * Mac OS X: in version 10.0 and later
  629. */
  630. EXTERN_API( OSErr )
  631. FolderManagerUnregisterNotificationProc(
  632. FolderManagerNotificationUPP notificationProc,
  633. void * refCon) THREEWORDINLINE(0x303C, 0x0430, 0xA823);
  634. /*
  635. * FolderManagerRegisterCallNotificationProcs()
  636. *
  637. * Availability:
  638. * Non-Carbon CFM: in InterfaceLib 9.0 and later
  639. * CarbonLib: in CarbonLib 1.0 and later
  640. * Mac OS X: in version 10.0 and later
  641. */
  642. EXTERN_API( OSStatus )
  643. FolderManagerRegisterCallNotificationProcs(
  644. OSType message,
  645. void * arg,
  646. UInt32 options) THREEWORDINLINE(0x303C, 0x0631, 0xA823);
  647. /*******************************/
  648. /* MultiUser (At Ease) globals */
  649. /*******************************/
  650. /*
  651. This structure has been through some evolution since the early days of At Ease 1.0. The structure
  652. has been expanded (and developers should assume that it will continue this way into the future). Older
  653. fields have been obsoleted as the features have changed in newer versions of the code.
  654. */
  655. /* Some fields in here are really only valid for the network version of Macintosh Manager*/
  656. struct MultiUserGestalt {
  657. /* Version 1 fields.*/
  658. short giVersion; /* structure version: 0 = invalid, 6 = OS 9*/
  659. short giReserved0; /* [OBSOLETE with v3] giIsActive: if true then At Ease is currently running*/
  660. short giReserved1; /* [OBSOLETE] if true then auto create alias*/
  661. short giReserved2; /* [OBSOLETE with v6] if true then request floppy on new saves*/
  662. short giReserved3; /* [OBSOLETE] if true then hypercard stacks are shown on Applications panel*/
  663. FSSpec giReserved4; /* [OBSOLETE with v6] location of At Ease Items folder*/
  664. /* Version 2 fields.*/
  665. short giDocsVRefNum; /* vrefnum of user's documents location (only valid if not on floppy)*/
  666. long giDocsDirID; /* directory id of user's documents folder (only valid if not on floppy)*/
  667. short giForceSaves; /* true if user is forced to save to their documents folder*/
  668. short giForceOpens; /* true if user is forced to open from their documents folder*/
  669. Str31 giSetupName; /* name of current setup*/
  670. Str31 giUserName; /* name of current user*/
  671. Str31 giFrontAppName; /* name of the frontmost application*/
  672. short giReserved5; /* [OBSOLETE with v6] true if user has Go To Finder menu item*/
  673. short giIsOn; /* true if Multiple Users/Macintosh Manager is on right now*/
  674. /* Version 3 fields.*/
  675. /* There were no additional fields for version 3.x*/
  676. /* Version 4 fields.*/
  677. short giUserLoggedInType; /* 0 = normal user, 1 = workgroup admin, 2 = global admin*/
  678. char giUserEncryptPwd[16]; /* encrypted user password (our digest form)*/
  679. short giUserEnvironment; /* 0 = panels, 1 = normal Finder, 2 = limited/restricted Finder*/
  680. long giReserved6; /* [OBSOLETE]*/
  681. long giReserved7; /* [OBSOLETE]*/
  682. Boolean giDisableScrnShots; /* true if screen shots are not allowed*/
  683. /* Version 5 fields.*/
  684. Boolean giSupportsAsyncFSCalls; /* Finder uses this to tell if our patches support async trap patches*/
  685. short giPrefsVRefNum; /* vrefnum of preferences*/
  686. long giPrefsDirID; /* dirID of the At Ease Items folder on preferences volume*/
  687. unsigned long giUserLogInTime; /* time in seconds we've been logged in (0 or 1 mean not logged in)*/
  688. Boolean giUsingPrintQuotas; /* true if logged in user is using printer quotas*/
  689. Boolean giUsingDiskQuotas; /* true if logged in user has disk quotas active*/
  690. /* Version 6 fields - As of Mac OS 9's "Multiple Users 1.0"*/
  691. Boolean giInSystemAccess; /* true if system is in System Access (i.e., owner logged in)*/
  692. Boolean giUserFolderEnabled; /* true if FindFolder is redirecting folders (uses giUserName for user)*/
  693. short giReserved8;
  694. long giReserved9;
  695. Boolean giInLoginScreen; /* true if no user has logged in (including owner)*/
  696. /* May have more fields added in future, so never check for sizeof(GestaltRec)*/
  697. };
  698. typedef struct MultiUserGestalt MultiUserGestalt;
  699. typedef MultiUserGestalt * MultiUserGestaltPtr;
  700. typedef MultiUserGestaltPtr * MultiUserGestaltHandle;
  701. #if PRAGMA_STRUCT_ALIGN
  702. #pragma options align=reset
  703. #elif PRAGMA_STRUCT_PACKPUSH
  704. #pragma pack(pop)
  705. #elif PRAGMA_STRUCT_PACK
  706. #pragma pack()
  707. #endif
  708. #ifdef PRAGMA_IMPORT_OFF
  709. #pragma import off
  710. #elif PRAGMA_IMPORT
  711. #pragma import reset
  712. #endif
  713. #ifdef __cplusplus
  714. }
  715. #endif
  716. #endif /* __FOLDERS__ */