comparison dstep/coreservices/launchservices/LSInfo.d @ 11:07194b026fa4

Added bindings to a couple of frameworks, new license + some other things
author Jacob Carlborg <doob@me.com>
date Sat, 01 Aug 2009 15:03:28 +0200
parents
children
comparison
equal deleted inserted replaced
10:27e00625790b 11:07194b026fa4
1 /**
2 * Copyright: Copyright (c) 2009 Jacob Carlborg.
3 * Authors: Jacob Carlborg
4 * Version: Initial created: Jul 22, 2009
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
6 */
7 module dstep.coreservices.launchservices.LSInfo;
8
9 //import dstep.AvailabilityMacros;
10 import dstep.coreservices.carboncore.CarbonCore;
11 import dstep.corefoundation.CoreFoundation;
12
13 alias uint LSInitializeFlags;
14 alias uint LSRequestedInfo;
15 alias uint LSItemInfoFlags;
16 alias uint LSRolesMask;
17 alias uint LSAcceptanceFlags;
18 alias uint LSHandlerOptions;
19
20 extern (C)
21 {
22 extern
23 {
24 const CFStringRef kLSItemContentType;
25 const CFStringRef kLSItemFileType;
26 const CFStringRef kLSItemFileCreator;
27 const CFStringRef kLSItemExtension;
28 const CFStringRef kLSItemDisplayName;
29 const CFStringRef kLSItemDisplayKind;
30 const CFStringRef kLSItemRoleHandlerDisplayName;
31 const CFStringRef kLSItemIsInvisible;
32 const CFStringRef kLSItemExtensionIsHidden;
33 const CFStringRef kLSItemQuarantineProperties;
34 }
35 }
36
37 enum
38 {
39 kLSAppInTrashErr = -10660,
40 kLSExecutableIncorrectFormat = -10661,
41 kLSAttributeNotFoundErr = -10662,
42 kLSAttributeNotSettableErr = -10663,
43 kLSUnknownErr = -10810,
44 kLSNotAnApplicationErr = -10811,
45 kLSNotInitializedErr = -10812,
46 kLSDataUnavailableErr = -10813,
47 kLSApplicationNotFoundErr = -10814,
48 kLSUnknownTypeErr = -10815,
49 kLSDataTooOldErr = -10816,
50 kLSDataErr = -10817,
51 kLSLaunchInProgressErr = -10818,
52 kLSNotRegisteredErr = -10819,
53 kLSAppDoesNotClaimTypeErr = -10820,
54 kLSAppDoesNotSupportSchemeWarning = -10821,
55 kLSServerCommunicationErr = -10822,
56 kLSCannotSetInfoErr = -10823,
57 kLSNoRegistrationInfoErr = -10824,
58 kLSIncompatibleSystemVersionErr = -10825,
59 kLSNoLaunchPermissionErr = -10826,
60 kLSNoExecutableErr = -10827,
61 kLSNoClassicEnvironmentErr = -10828,
62 kLSMultipleSessionsNotSupportedErr = -10829
63 }
64
65 enum
66 {
67 kLSInitializeDefaults = 0x00000001
68 }
69
70 enum
71 {
72 kLSMinCatInfoBitmap = (kFSCatInfoNodeFlags | kFSCatInfoParentDirID | kFSCatInfoFinderInfo | kFSCatInfoFinderXInfo)
73 }
74
75 enum
76 {
77 kLSRequestExtension = 0x00000001,
78 kLSRequestTypeCreator = 0x00000002,
79 kLSRequestBasicFlagsOnly = 0x00000004,
80 kLSRequestAppTypeFlags = 0x00000008,
81 kLSRequestAllFlags = 0x00000010,
82 kLSRequestIconAndKind = 0x00000020,
83 kLSRequestExtensionFlagsOnly = 0x00000040,
84 kLSRequestAllInfo = cast(uint)0xFFFFFFFF
85 }
86
87 enum
88 {
89 kLSItemInfoIsPlainFile = 0x00000001,
90 kLSItemInfoIsPackage = 0x00000002,
91 kLSItemInfoIsApplication = 0x00000004,
92 kLSItemInfoIsContainer = 0x00000008,
93 kLSItemInfoIsAliasFile = 0x00000010,
94 kLSItemInfoIsSymlink = 0x00000020,
95 kLSItemInfoIsInvisible = 0x00000040,
96 kLSItemInfoIsNativeApp = 0x00000080,
97 kLSItemInfoIsClassicApp = 0x00000100,
98 kLSItemInfoAppPrefersNative = 0x00000200,
99 kLSItemInfoAppPrefersClassic = 0x00000400,
100 kLSItemInfoAppIsScriptable = 0x00000800,
101 kLSItemInfoIsVolume = 0x00001000,
102 kLSItemInfoExtensionIsHidden = 0x00100000
103 }
104
105 enum
106 {
107 kLSRolesNone = 0x00000001,
108 kLSRolesViewer = 0x00000002,
109 kLSRolesEditor = 0x00000004,
110 kLSRolesShell = 0x00000008,
111 kLSRolesAll = cast(uint)0xFFFFFFFF
112 }
113
114 enum
115 {
116 kLSUnknownType = 0,
117 kLSUnknownCreator = 0
118 }
119
120 enum
121 {
122 kLSAcceptDefault = 0x00000001,
123 kLSAcceptAllowLoginUI = 0x00000002
124 }
125
126 enum
127 {
128 kLSHandlerOptionsDefault = 0,
129 kLSHandlerOptionsIgnoreCreator = 1
130 }
131
132 struct LSItemInfoRecord
133 {
134 uint flags;
135 uint filetype;
136 uint creator;
137 CFStringRef extension;
138 }
139
140 extern (C)
141 {
142 int LSInit (uint inFlags);
143 int LSTerm ();
144 int LSCopyItemInfoForRef (FSRef* inItemRef, uint inWhichInfo, LSItemInfoRecord* outItemInfo);
145 int LSCopyItemInfoForURL (CFURLRef inURL, uint inWhichInfo, LSItemInfoRecord* outItemInfo);
146 int LSGetExtensionInfo (uint inNameLen, wchar* inNameBuffer, UniCharCount* outExtStartIndex);
147 int LSCopyDisplayNameForRef (FSRef* inRef, CFStringRef* outDisplayName);
148 int LSCopyDisplayNameForURL (CFURLRef inURL, CFStringRef* outDisplayName);
149 int LSSetExtensionHiddenForRef (FSRef* inRef, ubyte inHide);
150 int LSSetExtensionHiddenForURL (CFURLRef inURL, ubyte inHide);
151 int LSCopyKindStringForRef (FSRef* inFSRef, CFStringRef* outKindString);
152 int LSCopyKindStringForURL (CFURLRef inURL, CFStringRef* outKindString);
153 int LSCopyKindStringForTypeInfo (uint inType, uint inCreator, CFStringRef inExtension, CFStringRef* outKindString);
154 int LSCopyKindStringForMIMEType (CFStringRef inMIMEType, CFStringRef* outKindString);
155 int LSGetApplicationForItem (FSRef* inItemRef, uint inRoleMask, FSRef* outAppRef, CFURLRef* outAppURL);
156 int LSGetApplicationForInfo (uint inType, uint inCreator, CFStringRef inExtension, uint inRoleMask, FSRef* outAppRef, CFURLRef* outAppURL);
157 int LSCopyApplicationForMIMEType (CFStringRef inMIMEType, uint inRoleMask, CFURLRef* outAppURL);
158 int LSGetApplicationForURL (CFURLRef inURL, uint inRoleMask, FSRef* outAppRef, CFURLRef* outAppURL);
159 int LSFindApplicationForInfo (uint inCreator, CFStringRef inBundleID, CFStringRef inName, FSRef* outAppRef, CFURLRef* outAppURL);
160 int LSCanRefAcceptItem (FSRef* inItemFSRef, FSRef* inTargetRef, uint inRoleMask, uint inFlags, char* outAcceptsItem);
161 int LSCanURLAcceptURL (CFURLRef inItemURL, CFURLRef inTargetURL, uint inRoleMask, uint inFlags, char* outAcceptsItem);
162 int LSRegisterURL (CFURLRef inURL, ubyte inUpdate);
163 int LSRegisterFSRef (FSRef* inRef, ubyte inUpdate);
164 CFArrayRef LSCopyApplicationURLsForURL (CFURLRef inURL, uint inRoleMask);
165 int LSCopyItemAttribute (FSRef* inItem, uint inRoles, CFStringRef inAttributeName, CFTypeRef* outValue);
166 int LSCopyItemAttributes (FSRef* inItem, uint inRoles, CFArrayRef inAttributeNames, CFDictionaryRef* outValues);
167 int LSSetItemAttribute (FSRef* inItem, uint inRoles, CFStringRef inAttributeName, CFTypeRef inValue);
168 CFStringRef LSCopyDefaultRoleHandlerForContentType (CFStringRef inContentType, uint inRole);
169 CFArrayRef LSCopyAllRoleHandlersForContentType (CFStringRef inContentType, uint inRole);
170 int LSSetDefaultRoleHandlerForContentType (CFStringRef inContentType, uint inRole, CFStringRef inHandlerBundleID);
171 uint LSGetHandlerOptionsForContentType (CFStringRef inContentType);
172 int LSSetHandlerOptionsForContentType (CFStringRef inContentType, uint inOptions);
173 CFStringRef LSCopyDefaultHandlerForURLScheme (CFStringRef inURLScheme);
174 CFArrayRef LSCopyAllHandlersForURLScheme (CFStringRef inURLScheme);
175 int LSSetDefaultHandlerForURLScheme (CFStringRef inURLScheme, CFStringRef inHandlerBundleID);
176 }