view dstep/coreservices/carboncore/Folders.d @ 16:19885b43130e

Huge update, the bridge actually works now
author Jacob Carlborg <doob@me.com>
date Sun, 03 Jan 2010 22:06:11 +0100
parents 07194b026fa4
children
line wrap: on
line source

/**
 * Copyright: Copyright (c) 2009 Jacob Carlborg.
 * Authors: Jacob Carlborg
 * Version: Initial created: Jul 21, 2009 
 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
 */
module dstep.coreservices.carboncore.Folders;

//import dstep.AvailabilityMacros;
import dstep.coreservices.carboncore.Files;
import dstep.coreservices.carboncore.MacTypes;
import dstep.coreservices.carboncore.MixedMode;
import dstep.objc.bridge.TypeEncoding;

alias uint FolderDescFlags;
alias uint FolderClass;
alias uint FolderType;
alias uint FolderLocation;
alias FolderDesc* FolderDescPtr;
alias uint RoutingFlags;
alias FolderRouting* FolderRoutingPtr;
alias FolderManagerNotificationProcPtr FolderManagerNotificationUPP;

extern (C)
{
	alias int function (uint, void*, void*) FolderManagerNotificationProcPtr;
}

// This is needed otherwise the enums will fail compiling with gdc
version (GNU)
{
	private
	{
		const __kDesktopFolderType = getOSType!("desk");
		const __kTrashFolderType = getOSType!("trsh");
		const __kWhereToEmptyTrashFolderType = getOSType!("empt");
		const __kFontsFolderType = getOSType!("font");
		const __kPreferencesFolderType = getOSType!("pref");
		const __kSystemPreferencesFolderType = getOSType!("sprf");
		const __kTemporaryFolderType = getOSType!("temp");
		const __kChewableItemsFolderType = getOSType!("flnt");
		const __kTemporaryItemsInCacheDataFolderType = getOSType!("vtmp");
		const __kApplicationsFolderType = getOSType!("apps");
		const __kVolumeRootFolderType = getOSType!("root");
		const __kDomainTopLevelFolderType = getOSType!("dtop");
		const __kDomainLibraryFolderType = getOSType!("dlib");
		const __kUsersFolderType = getOSType!("usrs");
		const __kCurrentUserFolderType = getOSType!("cusr");
		const __kSharedUserDataFolderType = getOSType!("sdat");

	}
}

// This is needed otherwise the enums will fail compiling with gdc
version (GNU)
{
	private
	{
		const __kDocumentsFolderType = getOSType!("docs");
		const __kPictureDocumentsFolderType = getOSType!("pdoc");
		const __kMovieDocumentsFolderType = getOSType!("mdoc");
		const __kInternetSitesFolderType = getOSType!("site");
		const __kPublicFolderType = getOSType!("pubb");

	}
}

// This is needed otherwise the enums will fail compiling with gdc
version (GNU)
{
	private
	{
		const __kVoicesFolderType = getOSType!("fvoc");
		const __kThemesFolderType = getOSType!("thme");
		const __kFavoritesFolderType = getOSType!("favs");
		const __kInternetSearchSitesFolderType = getOSType!("issf");
		const __kInstallerLogsFolderType = getOSType!("ilgf");
		const __kFolderActionsFolderType = getOSType!("fasf");
		const __kSpeakableItemsFolderType = getOSType!("spki");
		const __kKeychainFolderType = getOSType!("kchn");

	}
}

// This is needed otherwise the enums will fail compiling with gdc
version (GNU)
{
	private
	{
		const __kColorSyncFolderType = getOSType!("sync");
		const __kColorSyncCMMFolderType = getOSType!("ccmm");
		const __kColorSyncScriptingFolderType = getOSType!("cscr");
		const __kPrintersFolderType = getOSType!("impr");
		const __kSpeechFolderType = getOSType!("spch");
		const __kCarbonLibraryFolderType = getOSType!("carb");
		const __kDocumentationFolderType = getOSType!("info");
		const __kISSDownloadsFolderType = getOSType!("issd");
		const __kUserSpecificTmpFolderType = getOSType!("utmp");
		const __kCachedDataFolderType = getOSType!("cach");
		const __kFrameworksFolderType = getOSType!("fram");
		const __kPrivateFrameworksFolderType = getOSType!("pfrm");
		const __kClassicDesktopFolderType = getOSType!("sdsk");
		const __kSystemSoundsFolderType = getOSType!("ssnd");
		const __kComponentsFolderType = getOSType!("cmpd");
		const __kQuickTimeComponentsFolderType = getOSType!("wcmp");
		const __kCoreServicesFolderType = getOSType!("csrv");
		const __kAudioSupportFolderType = getOSType!("adio");
		const __kAudioPresetsFolderType = getOSType!("apst");
		const __kAudioSoundsFolderType = getOSType!("asnd");
		const __kAudioSoundBanksFolderType = getOSType!("bank");
		const __kAudioAlertSoundsFolderType = getOSType!("alrt");
		const __kAudioPlugInsFolderType = getOSType!("aplg");
		const __kAudioComponentsFolderType = getOSType!("acmp");
		const __kKernelExtensionsFolderType = getOSType!("kext");
		const __kDirectoryServicesFolderType = getOSType!("dsrv");
		const __kDirectoryServicesPlugInsFolderType = getOSType!("dplg");
		const __kInstallerReceiptsFolderType = getOSType!("rcpt");
		const __kFileSystemSupportFolderType = getOSType!("fsys");
		const __kAppleShareSupportFolderType = getOSType!("shar");
		const __kAppleShareAuthenticationFolderType = getOSType!("auth");
		const __kMIDIDriversFolderType = getOSType!("midi");
		const __kKeyboardLayoutsFolderType = getOSType!("klay");
		const __kIndexFilesFolderType = getOSType!("indx");
		const __kFindByContentIndexesFolderType = getOSType!("fbcx");
		const __kManagedItemsFolderType = getOSType!("mang");
		const __kBootTimeStartupItemsFolderType = getOSType!("empz");
		const __kAutomatorWorkflowsFolderType = getOSType!("flow");
		const __kAutosaveInformationFolderType = getOSType!("asav");
		const __kSpotlightSavedSearchesFolderType = getOSType!("spot");
		const __kSpotlightImportersFolderType = getOSType!("simp");
		const __kSpotlightMetadataCacheFolderType = getOSType!("scch");
		const __kInputManagersFolderType = getOSType!("inpt");
		const __kInputMethodsFolderType = getOSType!("inpf");
		const __kLibraryAssistantsFolderType = getOSType!("astl");
		const __kAudioDigidesignFolderType = getOSType!("adig");
		const __kAudioVSTFolderType = getOSType!("avst");
		const __kColorPickersFolderType = getOSType!("cpkr");
		const __kCompositionsFolderType = getOSType!("cmps");
		const __kFontCollectionsFolderType = getOSType!("fncl");
		const __kiMovieFolderType = getOSType!("imov");
		const __kiMoviePlugInsFolderType = getOSType!("impi");
		const __kiMovieSoundEffectsFolderType = getOSType!("imse");
		const __kDownloadsFolderType = getOSType!("down");

	}
}

// This is needed otherwise the enums will fail compiling with gdc
version (GNU)
{
	private
	{
		const __kColorSyncProfilesFolderType = getOSType!("prof");
		const __kApplicationSupportFolderType = getOSType!("asup");
		const __kPrinterDescriptionFolderType = getOSType!("ppdf");
	}
}

// This is needed otherwise the enums will fail compiling with gdc
version (GNU)
{
	private
	{
		const __kClassicPreferencesFolderType = getOSType!("cprf");

	}
}

// This is needed otherwise the enums will fail compiling with gdc
version (GNU)
{
	private
	{
		const __kSystemFolderType = getOSType!("macs");
		const __kSystemDesktopFolderType = getOSType!("sdsk");
		const __kSystemTrashFolderType = getOSType!("strs");
		const __kPrintMonitorDocsFolderType = getOSType!("prnt");
		const __kALMModulesFolderType = getOSType!("walk");
		const __kALMPreferencesFolderType = getOSType!("trip");
		const __kALMLocationsFolderType = getOSType!("fall");
		const __kContextualMenuItemsFolderType = getOSType!("cmnu");
		const __kStartupFolderType = getOSType!("strt");
		const __kShutdownFolderType = getOSType!("shdf");
		const __kAppleMenuFolderType = getOSType!("amnu");
		const __kControlPanelFolderType = getOSType!("ctrl");
		const __kSystemControlPanelFolderType = getOSType!("sctl");
		const __kExtensionFolderType = getOSType!("extn");
		const __kExtensionDisabledFolderType = getOSType!("extD");
		const __kControlPanelDisabledFolderType = getOSType!("ctrD");
		const __kSystemExtensionDisabledFolderType = getOSType!("macD");
		const __kStartupItemsDisabledFolderType = getOSType!("strD");
		const __kShutdownItemsDisabledFolderType = getOSType!("shdD");
		const __kStationeryFolderType = getOSType!("odst");
		const __kOpenDocFolderType = getOSType!("odod");
		const __kOpenDocShellPlugInsFolderType = getOSType!("odsp");
		const __kEditorsFolderType = getOSType!("oded");
		const __kOpenDocLibrariesFolderType = getOSType!("odlb");
		const __kControlStripModulesFolderType = getOSType!("sdev");
		const __kAppearanceFolderType = getOSType!("appr");
		const __kSoundSetsFolderType = getOSType!("snds");
		const __kFindSupportFolderType = getOSType!("fnds");
		const __kRecentApplicationsFolderType = getOSType!("rapp");
		const __kRecentDocumentsFolderType = getOSType!("rdoc");
		const __kRecentServersFolderType = getOSType!("rsvr");
		const __kLauncherItemsFolderType = getOSType!("laun");
		const __kQuickTimeExtensionsFolderType = getOSType!("qtex");
		const __kDisplayExtensionsFolderType = getOSType!("dspl");
		const __kMultiprocessingFolderType = getOSType!("mpxf");
		const __kPrintingPlugInsFolderType = getOSType!("pplg");
		const __kVolumeSettingsFolderType = getOSType!("vsfd");
		const __kFindByContentPluginsFolderType = getOSType!("fbcp");
		const __kFindByContentFolderType = getOSType!("fbcf");

	}
}

// This is needed otherwise the enums will fail compiling with gdc
version (GNU)
{
	private
	{
		const __kMagicTemporaryItemsFolderType = getOSType!("mtmp");
		const __kTemporaryItemsInUserDomainFolderType = getOSType!("temq");
		const __kCurrentUserRemoteFolderLocation = getOSType!("rusf");
		const __kCurrentUserRemoteFolderType = getOSType!("rusr");

	}
}

// This is needed otherwise the enums will fail compiling with gdc
version (GNU)
{
	private
	{
		const __kDeveloperDocsFolderType = getOSType!("ddoc");
		const __kDeveloperHelpFolderType = getOSType!("devh");
		const __kDeveloperFolderType = getOSType!("devf");
		const __kDeveloperApplicationsFolderType = getOSType!("dapp");

	}
}

// This is needed otherwise the enums will fail compiling with gdc
version (GNU)
{
	private
	{
		const __kRelativeFolder = getOSType!("relf");
		const __kRedirectedRelativeFolder = getOSType!("rrel");
		const __kSpecialFolder = getOSType!("spcf");

	}
}

// This is needed otherwise the enums will fail compiling with gdc
version (GNU)
{
	private
	{
		const __kBlessedFolder = getOSType!("blsf");
		const __kRootFolder = getOSType!("rotf");

	}
}

// This is needed otherwise the enums will fail compiling with gdc
version (GNU)
{
	private
	{
		const __kCurrentUserFolderLocation = getOSType!("cusf");

	}
}

// This is needed otherwise the enums will fail compiling with gdc
version (GNU)
{
	private
	{
		const __kDictionariesFolderType = getOSType!("dict");
		const __kLogsFolderType = getOSType!("logs");
		const __kPreferencePanesFolderType = getOSType!("ppan");

	}
}

// This is needed otherwise the enums will fail compiling with gdc
version (GNU)
{
	private
	{
		const __kWidgetsFolderType = getOSType!("wdgt");
		const __kScreenSaversFolderType = getOSType!("scrn");

	}
}

enum
{
	kOnSystemDisk = -32768L,
	kOnAppropriateDisk = -32767,
	kSystemDomain = -32766,
	kLocalDomain = -32765,
	kNetworkDomain = -32764,
	kUserDomain = -32763,
	kClassicDomain = -32762,
	kFolderManagerLastDomain = -32760
}

enum
{
	kLastDomainConstant = -32760
}

enum
{
	kCreateFolder = 1,
	kDontCreateFolder = 0
}

enum
{
	kDesktopFolderType = getOSType!("desk"),
	kTrashFolderType = getOSType!("trsh"),
	kWhereToEmptyTrashFolderType = getOSType!("empt"),
	kFontsFolderType = getOSType!("font"),
	kPreferencesFolderType = getOSType!("pref"),
	kSystemPreferencesFolderType = getOSType!("sprf"),
	kTemporaryFolderType = getOSType!("temp"),
	kChewableItemsFolderType = getOSType!("flnt"),
	kTemporaryItemsInCacheDataFolderType = getOSType!("vtmp"),
	kApplicationsFolderType = getOSType!("apps"),
	kVolumeRootFolderType = getOSType!("root"),
	kDomainTopLevelFolderType = getOSType!("dtop"),
	kDomainLibraryFolderType = getOSType!("dlib"),
	kUsersFolderType = getOSType!("usrs"),
	kCurrentUserFolderType = getOSType!("cusr"),
	kSharedUserDataFolderType = getOSType!("sdat")
}

enum
{
	kDocumentsFolderType = getOSType!("docs"),
	kPictureDocumentsFolderType = getOSType!("pdoc"),
	kMovieDocumentsFolderType = getOSType!("mdoc"),
	kMusicDocumentsFolderType = 0xB5646F63,
	kInternetSitesFolderType = getOSType!("site"),
	kPublicFolderType = getOSType!("pubb")
}

enum
{
	kSharedLibrariesFolderType = 0xC46C6962,
	kVoicesFolderType = getOSType!("fvoc"),
	kUtilitiesFolderType = 0x757469C4,
	kThemesFolderType = getOSType!("thme"),
	kFavoritesFolderType = getOSType!("favs"),
	kInternetSearchSitesFolderType = getOSType!("issf"),
	kInstallerLogsFolderType = getOSType!("ilgf"),
	kScriptsFolderType = 0x736372C4,
	kFolderActionsFolderType = getOSType!("fasf"),
	kSpeakableItemsFolderType = getOSType!("spki"),
	kKeychainFolderType = getOSType!("kchn")
}

enum
{
	kColorSyncFolderType = getOSType!("sync"),
	kColorSyncCMMFolderType = getOSType!("ccmm"),
	kColorSyncScriptingFolderType = getOSType!("cscr"),
	kPrintersFolderType = getOSType!("impr"),
	kSpeechFolderType = getOSType!("spch"),
	kCarbonLibraryFolderType = getOSType!("carb"),
	kDocumentationFolderType = getOSType!("info"),
	kISSDownloadsFolderType = getOSType!("issd"),
	kUserSpecificTmpFolderType = getOSType!("utmp"),
	kCachedDataFolderType = getOSType!("cach"),
	kFrameworksFolderType = getOSType!("fram"),
	kPrivateFrameworksFolderType = getOSType!("pfrm"),
	kClassicDesktopFolderType = getOSType!("sdsk"),
	kSystemSoundsFolderType = getOSType!("ssnd"),
	kComponentsFolderType = getOSType!("cmpd"),
	kQuickTimeComponentsFolderType = getOSType!("wcmp"),
	kCoreServicesFolderType = getOSType!("csrv"),
	kAudioSupportFolderType = getOSType!("adio"),
	kAudioPresetsFolderType = getOSType!("apst"),
	kAudioSoundsFolderType = getOSType!("asnd"),
	kAudioSoundBanksFolderType = getOSType!("bank"),
	kAudioAlertSoundsFolderType = getOSType!("alrt"),
	kAudioPlugInsFolderType = getOSType!("aplg"),
	kAudioComponentsFolderType = getOSType!("acmp"),
	kKernelExtensionsFolderType = getOSType!("kext"),
	kDirectoryServicesFolderType = getOSType!("dsrv"),
	kDirectoryServicesPlugInsFolderType = getOSType!("dplg"),
	kInstallerReceiptsFolderType = getOSType!("rcpt"),
	kFileSystemSupportFolderType = getOSType!("fsys"),
	kAppleShareSupportFolderType = getOSType!("shar"),
	kAppleShareAuthenticationFolderType = getOSType!("auth"),
	kMIDIDriversFolderType = getOSType!("midi"),
	kKeyboardLayoutsFolderType = getOSType!("klay"),
	kIndexFilesFolderType = getOSType!("indx"),
	kFindByContentIndexesFolderType = getOSType!("fbcx"),
	kManagedItemsFolderType = getOSType!("mang"),
	kBootTimeStartupItemsFolderType = getOSType!("empz"),
	kAutomatorWorkflowsFolderType = getOSType!("flow"),
	kAutosaveInformationFolderType = getOSType!("asav"),
	kSpotlightSavedSearchesFolderType = getOSType!("spot"),
	kSpotlightImportersFolderType = getOSType!("simp"),
	kSpotlightMetadataCacheFolderType = getOSType!("scch"),
	kInputManagersFolderType = getOSType!("inpt"),
	kInputMethodsFolderType = getOSType!("inpf"),
	kLibraryAssistantsFolderType = getOSType!("astl"),
	kAudioDigidesignFolderType = getOSType!("adig"),
	kAudioVSTFolderType = getOSType!("avst"),
	kColorPickersFolderType = getOSType!("cpkr"),
	kCompositionsFolderType = getOSType!("cmps"),
	kFontCollectionsFolderType = getOSType!("fncl"),
	kiMovieFolderType = getOSType!("imov"),
	kiMoviePlugInsFolderType = getOSType!("impi"),
	kiMovieSoundEffectsFolderType = getOSType!("imse"),
	kDownloadsFolderType = getOSType!("down")
}

enum
{
	kColorSyncProfilesFolderType = getOSType!("prof"),
	kApplicationSupportFolderType = getOSType!("asup"),
	kTextEncodingsFolderType = 0xC4746578,
	kPrinterDescriptionFolderType = getOSType!("ppdf"),
	kPrinterDriverFolderType = 0xC4707264,
	kScriptingAdditionsFolderType = 0xC4736372
}

enum
{
	kClassicPreferencesFolderType = getOSType!("cprf")
}

enum
{
	kSystemFolderType = getOSType!("macs"),
	kSystemDesktopFolderType = getOSType!("sdsk"),
	kSystemTrashFolderType = getOSType!("strs"),
	kPrintMonitorDocsFolderType = getOSType!("prnt"),
	kALMModulesFolderType = getOSType!("walk"),
	kALMPreferencesFolderType = getOSType!("trip"),
	kALMLocationsFolderType = getOSType!("fall"),
	kAppleExtrasFolderType = 0x616578C4,
	kContextualMenuItemsFolderType = getOSType!("cmnu"),
	kMacOSReadMesFolderType = 0x6D6F72C4,
	kStartupFolderType = getOSType!("strt"),
	kShutdownFolderType = getOSType!("shdf"),
	kAppleMenuFolderType = getOSType!("amnu"),
	kControlPanelFolderType = getOSType!("ctrl"),
	kSystemControlPanelFolderType = getOSType!("sctl"),
	kExtensionFolderType = getOSType!("extn"),
	kExtensionDisabledFolderType = getOSType!("extD"),
	kControlPanelDisabledFolderType = getOSType!("ctrD"),
	kSystemExtensionDisabledFolderType = getOSType!("macD"),
	kStartupItemsDisabledFolderType = getOSType!("strD"),
	kShutdownItemsDisabledFolderType = getOSType!("shdD"),
	kAssistantsFolderType = 0x617374C4,
	kStationeryFolderType = getOSType!("odst"),
	kOpenDocFolderType = getOSType!("odod"),
	kOpenDocShellPlugInsFolderType = getOSType!("odsp"),
	kEditorsFolderType = getOSType!("oded"),
	kOpenDocEditorsFolderType = 0xC46F6466,
	kOpenDocLibrariesFolderType = getOSType!("odlb"),
	kGenEditorsFolderType = 0xC4656469,
	kHelpFolderType = 0xC4686C70,
	kInternetPlugInFolderType = 0xC46E6574,
	kModemScriptsFolderType = 0xC46D6F64,
	kControlStripModulesFolderType = getOSType!("sdev"),
	kInternetFolderType = 0x696E74C4,
	kAppearanceFolderType = getOSType!("appr"),
	kSoundSetsFolderType = getOSType!("snds"),
	kDesktopPicturesFolderType = 0x647470C4,
	kFindSupportFolderType = getOSType!("fnds"),
	kRecentApplicationsFolderType = getOSType!("rapp"),
	kRecentDocumentsFolderType = getOSType!("rdoc"),
	kRecentServersFolderType = getOSType!("rsvr"),
	kLauncherItemsFolderType = getOSType!("laun"),
	kQuickTimeExtensionsFolderType = getOSType!("qtex"),
	kDisplayExtensionsFolderType = getOSType!("dspl"),
	kMultiprocessingFolderType = getOSType!("mpxf"),
	kPrintingPlugInsFolderType = getOSType!("pplg"),
	kAppleshareAutomountServerAliasesFolderType = 0x737276C4,
	kVolumeSettingsFolderType = getOSType!("vsfd"),
	kPreMacOS91ApplicationsFolderType = 0x8C707073,
	kPreMacOS91InstallerLogsFolderType = 0x946C6766,
	kPreMacOS91AssistantsFolderType = 0x8C7374C4,
	kPreMacOS91UtilitiesFolderType = 0x9F7469C4,
	kPreMacOS91AppleExtrasFolderType = 0x8C6578C4,
	kPreMacOS91MacOSReadMesFolderType = 0xB56F72C4,
	kPreMacOS91InternetFolderType = 0x946E74C4,
	kPreMacOS91AutomountedServersFolderType = 0xA77276C4,
	kPreMacOS91StationeryFolderType = 0xBF647374,
	kLocalesFolderType = 0xC46C6F63,
	kFindByContentPluginsFolderType = getOSType!("fbcp"),
	kFindByContentFolderType = getOSType!("fbcf")
}

enum
{
	kMagicTemporaryItemsFolderType = getOSType!("mtmp"),
	kTemporaryItemsInUserDomainFolderType = getOSType!("temq"),
	kCurrentUserRemoteFolderLocation = getOSType!("rusf"),
	kCurrentUserRemoteFolderType = getOSType!("rusr")
}

enum
{
	kDeveloperDocsFolderType = getOSType!("ddoc"),
	kDeveloperHelpFolderType = getOSType!("devh"),
	kDeveloperFolderType = getOSType!("devf"),
	kDeveloperApplicationsFolderType = getOSType!("dapp")
}

enum
{
	kCreateFolderAtBoot = 0x00000002,
	kCreateFolderAtBootBit = 1,
	kFolderCreatedInvisible = 0x00000004,
	kFolderCreatedInvisibleBit = 2,
	kFolderCreatedNameLocked = 0x00000008,
	kFolderCreatedNameLockedBit = 3,
	kFolderCreatedAdminPrivs = 0x00000010,
	kFolderCreatedAdminPrivsBit = 4
}

enum
{
	kFolderInUserFolder = 0x00000020,
	kFolderInUserFolderBit = 5,
	kFolderTrackedByAlias = 0x00000040,
	kFolderTrackedByAliasBit = 6,
	kFolderInRemoteUserFolderIfAvailable = 0x00000080,
	kFolderInRemoteUserFolderIfAvailableBit = 7,
	kFolderNeverMatchedInIdentifyFolder = 0x00000100,
	kFolderNeverMatchedInIdentifyFolderBit = 8,
	kFolderMustStayOnSameVolume = 0x00000200,
	kFolderMustStayOnSameVolumeBit = 9,
	kFolderManagerFolderInMacOS9FolderIfMacOSXIsInstalledMask = 0x00000400,
	kFolderManagerFolderInMacOS9FolderIfMacOSXIsInstalledBit = 10,
	kFolderInLocalOrRemoteUserFolder = kFolderInUserFolder | kFolderInRemoteUserFolderIfAvailable,
	kFolderManagerNotCreatedOnRemoteVolumesBit = 11,
	kFolderManagerNotCreatedOnRemoteVolumesMask = (1 << kFolderManagerNotCreatedOnRemoteVolumesBit),
	kFolderManagerNewlyCreatedFolderIsLocalizedBit = 12,
	kFolderManagerNewlyCreatedFolderShouldHaveDotLocalizedCreatedWithinMask = (1 << kFolderManagerNewlyCreatedFolderIsLocalizedBit)
}

enum
{
	kRelativeFolder = getOSType!("relf"),
	kRedirectedRelativeFolder = getOSType!("rrel"),
	kSpecialFolder = getOSType!("spcf")
}

enum
{
	kBlessedFolder = getOSType!("blsf"),
	kRootFolder = getOSType!("rotf")
}

enum
{
	kCurrentUserFolderLocation = getOSType!("cusf")
}

enum
{
	kDictionariesFolderType = getOSType!("dict"),
	kLogsFolderType = getOSType!("logs"),
	kPreferencePanesFolderType = getOSType!("ppan")
}

enum
{
	kWidgetsFolderType = getOSType!("wdgt"),
	kScreenSaversFolderType = getOSType!("scrn")
}

struct FolderDesc
{
	int descSize;
	uint foldType;
	uint flags;
	uint foldClass;
	uint foldLocation;
	uint badgeSignature;
	uint badgeType;
	uint reserved;
	ubyte[64] name;
}


struct FolderRouting
{
	int descSize;
	uint fileType;
	uint routeFromFolder;
	uint routeToFolder;
	uint flags;
}

extern (C)
{
	short FindFolder (short vRefNum, uint folderType, ubyte createFolder, FSVolumeRefNum* foundVRefNum, SInt32* foundDirID);
	short ReleaseFolder (short vRefNum, uint folderType);
	short FSFindFolder (short vRefNum, uint folderType, ubyte createFolder, FSRef* foundRef);
	short AddFolderDescriptor (uint foldType, uint flags, uint foldClass, uint foldLocation, uint badgeSignature, uint badgeType, char* name, ubyte replaceFlag);
	short GetFolderTypes (uint requestedTypeCount, UInt32* totalTypeCount, FolderType* theTypes);
	short RemoveFolderDescriptor (uint foldType);
	int GetFolderNameUnicode (short vRefNum, uint foldType, FSVolumeRefNum* foundVRefNum, HFSUniStr255* name);
	short InvalidateFolderDescriptorCache (short vRefNum, int dirID);
	short IdentifyFolder (short vRefNum, int dirID, FolderType* foldType);
	short FSDetermineIfRefIsEnclosedByFolder (short domainOrVRefNum, uint folderType, FSRef* inRef, char* outResult);
	short DetermineIfPathIsEnclosedByFolder (short domainOrVRefNum, uint folderType, char* utf8Path, ubyte pathIsRealPath, char* outResult);
	FolderManagerNotificationUPP NewFolderManagerNotificationUPP (FolderManagerNotificationProcPtr userRoutine);
	void DisposeFolderManagerNotificationUPP (FolderManagerNotificationUPP userUPP);
	int InvokeFolderManagerNotificationUPP (uint message, void* arg, void* userRefCon, FolderManagerNotificationUPP userUPP);
}