1 {
2 File: LSInfo.h
3
4 Contains: Public interfaces for LaunchServices.framework
5
6 Copyright: (c) 2001-2012 by Apple Inc. All rights reserved.
7
8 Bugs?: For bug reports, consult the following page on
9 the World Wide Web:
10
11 http://bugs.freepascal.org
12 }
13
14 {
15 Modified for use with Free Pascal
16 Version 308
17 Please report any bugs to <gpc@microbizz.nl>
18 }
19
20 {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
21 {$mode macpas}
22 {$modeswitch cblocks}
23 {$packenum 1}
24 {$macro on}
25 {$inline on}
26 {$calling mwpascal}
27
28 unit LSInfo;
29 interface
30 {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
31 {$setc GAP_INTERFACES_VERSION := $0308}
32
33 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
34 {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
35 {$endc}
36
37 {$ifc defined CPUPOWERPC and defined CPUI386}
38 {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
39 {$endc}
40 {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
41 {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
42 {$endc}
43
44 {$ifc not defined __ppc__ and defined CPUPOWERPC32}
45 {$setc __ppc__ := 1}
46 {$elsec}
47 {$setc __ppc__ := 0}
48 {$endc}
49 {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
50 {$setc __ppc64__ := 1}
51 {$elsec}
52 {$setc __ppc64__ := 0}
53 {$endc}
54 {$ifc not defined __i386__ and defined CPUI386}
55 {$setc __i386__ := 1}
56 {$elsec}
57 {$setc __i386__ := 0}
58 {$endc}
59 {$ifc not defined __x86_64__ and defined CPUX86_64}
60 {$setc __x86_64__ := 1}
61 {$elsec}
62 {$setc __x86_64__ := 0}
63 {$endc}
64 {$ifc not defined __arm__ and defined CPUARM}
65 {$setc __arm__ := 1}
66 {$elsec}
67 {$setc __arm__ := 0}
68 {$endc}
69 {$ifc not defined __arm64__ and defined CPUAARCH64}
70 {$setc __arm64__ := 1}
71 {$elsec}
72 {$setc __arm64__ := 0}
73 {$endc}
74
75 {$ifc defined cpu64}
76 {$setc __LP64__ := 1}
77 {$elsec}
78 {$setc __LP64__ := 0}
79 {$endc}
80
81
82 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
83 {$error Conflicting definitions for __ppc__ and __i386__}
84 {$endc}
85
86 {$ifc defined __ppc__ and __ppc__}
87 {$setc TARGET_CPU_PPC := TRUE}
88 {$setc TARGET_CPU_PPC64 := FALSE}
89 {$setc TARGET_CPU_X86 := FALSE}
90 {$setc TARGET_CPU_X86_64 := FALSE}
91 {$setc TARGET_CPU_ARM := FALSE}
92 {$setc TARGET_CPU_ARM64 := FALSE}
93 {$setc TARGET_OS_MAC := TRUE}
94 {$setc TARGET_OS_IPHONE := FALSE}
95 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
96 {$setc TARGET_OS_EMBEDDED := FALSE}
97 {$elifc defined __ppc64__ and __ppc64__}
98 {$setc TARGET_CPU_PPC := FALSE}
99 {$setc TARGET_CPU_PPC64 := TRUE}
100 {$setc TARGET_CPU_X86 := FALSE}
101 {$setc TARGET_CPU_X86_64 := FALSE}
102 {$setc TARGET_CPU_ARM := FALSE}
103 {$setc TARGET_CPU_ARM64 := FALSE}
104 {$setc TARGET_OS_MAC := TRUE}
105 {$setc TARGET_OS_IPHONE := FALSE}
106 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
107 {$setc TARGET_OS_EMBEDDED := FALSE}
108 {$elifc defined __i386__ and __i386__}
109 {$setc TARGET_CPU_PPC := FALSE}
110 {$setc TARGET_CPU_PPC64 := FALSE}
111 {$setc TARGET_CPU_X86 := TRUE}
112 {$setc TARGET_CPU_X86_64 := FALSE}
113 {$setc TARGET_CPU_ARM := FALSE}
114 {$setc TARGET_CPU_ARM64 := FALSE}
115 {$ifc defined iphonesim}
116 {$setc TARGET_OS_MAC := FALSE}
117 {$setc TARGET_OS_IPHONE := TRUE}
118 {$setc TARGET_IPHONE_SIMULATOR := TRUE}
119 {$elsec}
120 {$setc TARGET_OS_MAC := TRUE}
121 {$setc TARGET_OS_IPHONE := FALSE}
122 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
123 {$endc}
124 {$setc TARGET_OS_EMBEDDED := FALSE}
125 {$elifc defined __x86_64__ and __x86_64__}
126 {$setc TARGET_CPU_PPC := FALSE}
127 {$setc TARGET_CPU_PPC64 := FALSE}
128 {$setc TARGET_CPU_X86 := FALSE}
129 {$setc TARGET_CPU_X86_64 := TRUE}
130 {$setc TARGET_CPU_ARM := FALSE}
131 {$setc TARGET_CPU_ARM64 := FALSE}
132 {$ifc defined iphonesim}
133 {$setc TARGET_OS_MAC := FALSE}
134 {$setc TARGET_OS_IPHONE := TRUE}
135 {$setc TARGET_IPHONE_SIMULATOR := TRUE}
136 {$elsec}
137 {$setc TARGET_OS_MAC := TRUE}
138 {$setc TARGET_OS_IPHONE := FALSE}
139 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
140 {$endc}
141 {$setc TARGET_OS_EMBEDDED := FALSE}
142 {$elifc defined __arm__ and __arm__}
143 {$setc TARGET_CPU_PPC := FALSE}
144 {$setc TARGET_CPU_PPC64 := FALSE}
145 {$setc TARGET_CPU_X86 := FALSE}
146 {$setc TARGET_CPU_X86_64 := FALSE}
147 {$setc TARGET_CPU_ARM := TRUE}
148 {$setc TARGET_CPU_ARM64 := FALSE}
149 {$setc TARGET_OS_MAC := FALSE}
150 {$setc TARGET_OS_IPHONE := TRUE}
151 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
152 {$setc TARGET_OS_EMBEDDED := TRUE}
153 {$elifc defined __arm64__ and __arm64__}
154 {$setc TARGET_CPU_PPC := FALSE}
155 {$setc TARGET_CPU_PPC64 := FALSE}
156 {$setc TARGET_CPU_X86 := FALSE}
157 {$setc TARGET_CPU_X86_64 := FALSE}
158 {$setc TARGET_CPU_ARM := FALSE}
159 {$setc TARGET_CPU_ARM64 := TRUE}
160 {$ifc defined ios}
161 {$setc TARGET_OS_MAC := FALSE}
162 {$setc TARGET_OS_IPHONE := TRUE}
163 {$setc TARGET_OS_EMBEDDED := TRUE}
164 {$elsec}
165 {$setc TARGET_OS_MAC := TRUE}
166 {$setc TARGET_OS_IPHONE := FALSE}
167 {$setc TARGET_OS_EMBEDDED := FALSE}
168 {$endc}
169 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
170 {$elsec}
171 {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
172 {$endc}
173
174 {$ifc defined __LP64__ and __LP64__ }
175 {$setc TARGET_CPU_64 := TRUE}
176 {$elsec}
177 {$setc TARGET_CPU_64 := FALSE}
178 {$endc}
179
180 {$ifc defined FPC_BIG_ENDIAN}
181 {$setc TARGET_RT_BIG_ENDIAN := TRUE}
182 {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
183 {$elifc defined FPC_LITTLE_ENDIAN}
184 {$setc TARGET_RT_BIG_ENDIAN := FALSE}
185 {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
186 {$elsec}
187 {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
188 {$endc}
189 {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
190 {$setc CALL_NOT_IN_CARBON := FALSE}
191 {$setc OLDROUTINENAMES := FALSE}
192 {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
193 {$setc OPAQUE_UPP_TYPES := TRUE}
194 {$setc OTCARBONAPPLICATION := TRUE}
195 {$setc OTKERNEL := FALSE}
196 {$setc PM_USE_SESSION_APIS := TRUE}
197 {$setc TARGET_API_MAC_CARBON := TRUE}
198 {$setc TARGET_API_MAC_OS8 := FALSE}
199 {$setc TARGET_API_MAC_OSX := TRUE}
200 {$setc TARGET_CARBON := TRUE}
201 {$setc TARGET_CPU_68K := FALSE}
202 {$setc TARGET_CPU_MIPS := FALSE}
203 {$setc TARGET_CPU_SPARC := FALSE}
204 {$setc TARGET_OS_UNIX := FALSE}
205 {$setc TARGET_OS_WIN32 := FALSE}
206 {$setc TARGET_RT_MAC_68881 := FALSE}
207 {$setc TARGET_RT_MAC_CFM := FALSE}
208 {$setc TARGET_RT_MAC_MACHO := TRUE}
209 {$setc TYPED_FUNCTION_POINTERS := TRUE}
210 {$setc TYPE_BOOL := FALSE}
211 {$setc TYPE_EXTENDED := FALSE}
212 {$setc TYPE_LONGLONG := TRUE}
213 uses MacTypes,CFBase,CFArray,CFDictionary,CFURL,Files;
214 {$endc} {not MACOSALLINCLUDE}
215
216
217 {$ifc TARGET_OS_MAC}
218
219
220 {$ALIGN MAC68K}
221
222 { ======================================================================================================== }
223 { LaunchServices Type & Constants }
224 { ======================================================================================================== }
225
226 const
227 kLSAppInTrashErr = -10660; { The app cannot be run when inside a Trash folder}
228 kLSExecutableIncorrectFormat = -10661; { No compatible executable was found}
229 kLSAttributeNotFoundErr = -10662; { An item attribute value could not be found with the specified name}
230 kLSAttributeNotSettableErr = -10663; { The attribute is not settable}
231 kLSIncompatibleApplicationVersionErr = -10664; { The app is incompatible with the current OS}
232 kLSNoRosettaEnvironmentErr = -10665; { The Rosetta environment was required not available}
233 kLSUnknownErr = -10810; { Unexpected internal error}
234 kLSNotAnApplicationErr = -10811; { Item needs to be an application, but is not}
235 kLSNotInitializedErr = -10812; { Not used in 10.2 and later}
236 kLSDataUnavailableErr = -10813; { E.g. no kind string}
237 kLSApplicationNotFoundErr = -10814; { E.g. no application claims the file}
238 kLSUnknownTypeErr = -10815; { Don't know anything about the type of the item}
239 kLSDataTooOldErr = -10816; { Not used in 10.3 and later}
240 kLSDataErr = -10817; { Not used in 10.4 and later}
241 kLSLaunchInProgressErr = -10818; { E.g. launching an already launching application}
242 kLSNotRegisteredErr = -10819; { Not used in 10.3 and later}
243 kLSAppDoesNotClaimTypeErr = -10820; { Not used in 10.3 and later}
244 kLSAppDoesNotSupportSchemeWarning = -10821; { Not used in 10.2 and later}
245 kLSServerCommunicationErr = -10822; { The server process (registration and recent items) is not available}
246 kLSCannotSetInfoErr = -10823; { The extension visibility on this item cannot be changed}
247 kLSNoRegistrationInfoErr = -10824; { The item contains no registration info}
248 kLSIncompatibleSystemVersionErr = -10825; { The app cannot run on the current OS version}
249 kLSNoLaunchPermissionErr = -10826; { User doesn't have permission to launch the app (managed networks)}
250 kLSNoExecutableErr = -10827; { The executable is missing}
251 kLSNoClassicEnvironmentErr = -10828; { The Classic environment was required but is not available}
252 kLSMultipleSessionsNotSupportedErr = -10829; { The app cannot run simultaneously in two different sessions}
253
254 type
255 LSInitializeFlags = OptionBits;
256 const
257 kLSInitializeDefaults = $00000001;
258
259 const
260 kLSMinCatInfoBitmap = kFSCatInfoNodeFlags or kFSCatInfoParentDirID or kFSCatInfoFinderInfo or kFSCatInfoFinderXInfo; { do not use }
261
262 { #define kLSInvalidExtensionIndex ULONG_MAX }
263 const
264 kLSInvalidExtensionIndex = high(UNSIGNEDLONG); // Index returned from LSGetExtensionInfo when name has no extension
265
266 type
267 LSRequestedInfo = OptionBits;
268 const
269 kLSRequestExtension = $00000001; { thread-safe in 10.0}
270 kLSRequestTypeCreator = $00000002; { thread-safe in 10.0}
271 kLSRequestBasicFlagsOnly = $00000004; { thread-safe in 10.2}
272 kLSRequestAppTypeFlags = $00000008; { thread-safe in 10.2}
273 kLSRequestAllFlags = $00000010; { thread-safe in 10.2}
274 kLSRequestIconAndKind = $00000020; { thread-safe in 10.2}
275 kLSRequestExtensionFlagsOnly = $00000040; { thread-safe in 10.0}
276 kLSRequestAllInfo = $FFFFFFFF; { thread-safe in 10.2}
277
278 type
279 LSItemInfoFlags = OptionBits;
280 const
281 kLSItemInfoIsPlainFile = $00000001; { Not a directory, volume, or symlink}
282 kLSItemInfoIsPackage = $00000002; { Packaged directory}
283 kLSItemInfoIsApplication = $00000004; { Single-file or packaged application}
284 kLSItemInfoIsContainer = $00000008; { Directory (includes packages) or volume}
285 kLSItemInfoIsAliasFile = $00000010; { Alias file (includes sym links)}
286 kLSItemInfoIsSymlink = $00000020; { UNIX sym link}
287 kLSItemInfoIsInvisible = $00000040; { Invisible by any known mechanism}
288 kLSItemInfoIsNativeApp = $00000080; { Carbon or Cocoa native app}
289 kLSItemInfoIsClassicApp = $00000100; { CFM/68K Classic app}
290 kLSItemInfoAppPrefersNative = $00000200; { Carbon app that prefers to be launched natively}
291 kLSItemInfoAppPrefersClassic = $00000400; { Carbon app that prefers to be launched in Classic}
292 kLSItemInfoAppIsScriptable = $00000800; { App can be scripted}
293 kLSItemInfoIsVolume = $00001000; { Item is a volume}
294 kLSItemInfoExtensionIsHidden = $00100000; { Item has a hidden extension}
295
296 type
297 LSRolesMask = OptionBits;
298 const
299 kLSRolesNone = $00000001; { no claim is made about support for this type/scheme}
300 kLSRolesViewer = $00000002; { claim to view items of this type}
301 kLSRolesEditor = $00000004; { claim to edit items of this type/scheme}
302 kLSRolesShell = $00000008; { claim to execute items of this type}
303 kLSRolesAll = $FFFFFFFF; { claim to do it all}
304
305 {$ifc not TARGET_CPU_64}
306 type
307 LSKindID = UInt32;
308 const
309 kLSUnknownKindID = 0;
310
311 {$endc} { TARGET_CPU_64 }
312
313 const
314 kLSUnknownType = 0;
315 kLSUnknownCreator = 0;
316
317 type
318 LSItemInfoRecord = record
319 flags: LSItemInfoFlags;
320 filetype: OSType;
321 creator: OSType;
322 extension: CFStringRef; { release when finished}
323 {$ifc not TARGET_CPU_64}
324 iconFileName: CFStringRef; { not for general use}
325 kindID: LSKindID; { not for general use}
326 {$endc} { TARGET_CPU_64 }
327 end;
328
329 type
330 LSAcceptanceFlags = OptionBits;
331 const
332 kLSAcceptDefault = $00000001;
333 kLSAcceptAllowLoginUI = $00000002; { show UI to log in if necessary}
334
335
336 { ======================================================================================================== }
337 { LaunchServices API }
338 { ======================================================================================================== }
339
340 {
341 * LSInit() *** DEPRECATED ***
342 *
343 * Discussion:
344 * LSInit is deprecated. Do not use.
345 *
346 * Availability:
347 * Mac OS X: in version 10.0 and later in CoreServices.framework but deprecated in 10.3
348 * CarbonLib: not available in CarbonLib 1.x
349 * Non-Carbon CFM: not available
350 }
LSInitnull351 function LSInit( inFlags: LSInitializeFlags ): OSStatus; external name '_LSInit';
352 (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_3, __IPHONE_NA, __IPHONE_NA) *)
353
354
355 {
356 * LSTerm() *** DEPRECATED ***
357 *
358 * Discussion:
359 * LSTerm is deprecated. It does nothing.
360 *
361 * Availability:
362 * Mac OS X: in version 10.0 and later in CoreServices.framework but deprecated in 10.3
363 * CarbonLib: not available in CarbonLib 1.x
364 * Non-Carbon CFM: not available
365 }
LSTermnull366 function LSTerm: OSStatus; external name '_LSTerm';
367 (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_3, __IPHONE_NA, __IPHONE_NA) *)
368
369
370 {
371 * LSCopyItemInfoForRef()
372 *
373 * Summary:
374 * Return information about an item.
375 *
376 * Discussion:
377 * Returns as much or as little information as requested about
378 * inItemRef.
379 *
380 * Mac OS X threading:
381 * Thread safe since version 10.2
382 *
383 * Parameters:
384 *
385 * inItemRef:
386 * The FSRef of the item about which information is requested.
387 *
388 * inWhichInfo:
389 * Flags indicating which information to return
390 *
391 * outItemInfo:
392 * Information is returned in this structure. Must not be NULL
393 *
394 * Availability:
395 * Mac OS X: in version 10.0 and later in CoreServices.framework
396 * CarbonLib: not available in CarbonLib 1.x
397 * Non-Carbon CFM: not available
398 }
LSCopyItemInfoForRefnull399 function LSCopyItemInfoForRef( const (*var*) inItemRef: FSRef; inWhichInfo: LSRequestedInfo; var outItemInfo: LSItemInfoRecord ): OSStatus; external name '_LSCopyItemInfoForRef';
400 (* __OSX_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_NA) *)
401
402
403 {
404 * LSCopyItemInfoForURL()
405 *
406 * Summary:
407 * Return information about an item.
408 *
409 * Discussion:
410 * Returns as much or as little information as requested about inURL.
411 *
412 * Mac OS X threading:
413 * Thread safe since version 10.2
414 *
415 * Parameters:
416 *
417 * inURL:
418 * The CFURLRef of the item about which information is requested.
419 *
420 * inWhichInfo:
421 * Flags indicating which information to return
422 *
423 * outItemInfo:
424 * Information is returned in this structure. Must not be NULL
425 *
426 * Availability:
427 * Mac OS X: in version 10.0 and later in CoreServices.framework
428 * CarbonLib: not available in CarbonLib 1.x
429 * Non-Carbon CFM: not available
430 }
LSCopyItemInfoForURLnull431 function LSCopyItemInfoForURL( inURL: CFURLRef; inWhichInfo: LSRequestedInfo; var outItemInfo: LSItemInfoRecord ): OSStatus; external name '_LSCopyItemInfoForURL';
432 (* __OSX_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_NA) *)
433
434
435 {
436 * LSGetExtensionInfo()
437 *
438 * Summary:
439 * Get information about the extension for a file system name.
440 *
441 * Discussion:
442 * Returns the starting index of the extension (not including the
443 * period) or kLSInvalidExtensionIndex if the input name has no
444 * extension.
445 *
446 * Mac OS X threading:
447 * Thread safe since version 10.2
448 *
449 * Parameters:
450 *
451 * inNameLen:
452 * The number of the UniChars in inNameBuffer.
453 *
454 * inNameBuffer:
455 * The buffer containing the name's Unicode characters.
456 *
457 * outExtStartIndex:
458 * On success, the starting index of the extension if there is one
459 * (not including the period). Set to kLSInvalidExtensionIndex if
460 * inNameBuffer does not contain a valid extension.
461 *
462 * Availability:
463 * Mac OS X: in version 10.1 and later in CoreServices.framework
464 * CarbonLib: not available in CarbonLib 1.x
465 * Non-Carbon CFM: not available
466 }
LSGetExtensionInfonull467 function LSGetExtensionInfo( inNameLen: UniCharCount; {const} inNameBuffer: {variable-size-array} UniCharPtr; var outExtStartIndex: UniCharCount ): OSStatus; external name '_LSGetExtensionInfo';
468 (* __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_NA) *)
469
470
471 {
472 * LSCopyDisplayNameForRef()
473 *
474 * Summary:
475 * Get the display name for an FSRef.
476 *
477 * Discussion:
478 * Return a copy of the display name for an FSRef. Takes into
479 * consideration whether this item has a hidden extension or not.
480 *
481 * Mac OS X threading:
482 * Thread safe since version 10.2
483 *
484 * Parameters:
485 *
486 * inRef:
487 * The FSRef for which the display name is desired.
488 *
489 * outDisplayName:
490 * Pointer to the CFString into which the display name should be
491 * copied. Callers must dispose of the resulting CFString.
492 *
493 * Availability:
494 * Mac OS X: in version 10.1 and later in CoreServices.framework
495 * CarbonLib: not available in CarbonLib 1.x
496 * Non-Carbon CFM: not available
497 }
LSCopyDisplayNameForRefnull498 function LSCopyDisplayNameForRef( const (*var*) inRef: FSRef; var outDisplayName: CFStringRef ): OSStatus; external name '_LSCopyDisplayNameForRef';
499 (* __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_NA) *)
500
501
502 {
503 * LSCopyDisplayNameForURL()
504 *
505 * Summary:
506 * Get the display name for a CFURLRef.
507 *
508 * Discussion:
509 * Return a copy of the display name for a CFURLRef. Takes into
510 * consideration whether this item has a hidden extension or not.
511 *
512 * Mac OS X threading:
513 * Thread safe since version 10.2
514 *
515 * Parameters:
516 *
517 * inURL:
518 * The URL for which the display name is desired.
519 *
520 * outDisplayName:
521 * Pointer to the CFString into which the display name should be
522 * copied. Callers must dispose of the resulting CFString.
523 *
524 * Availability:
525 * Mac OS X: in version 10.1 and later in CoreServices.framework
526 * CarbonLib: not available in CarbonLib 1.x
527 * Non-Carbon CFM: not available
528 }
LSCopyDisplayNameForURLnull529 function LSCopyDisplayNameForURL( inURL: CFURLRef; var outDisplayName: CFStringRef ): OSStatus; external name '_LSCopyDisplayNameForURL';
530 (* __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_NA) *)
531
532
533 {
534 * LSSetExtensionHiddenForRef()
535 *
536 * Summary:
537 * Sets whether the extension for an FSRef is hidden or not.
538 *
539 * Discussion:
540 * Sets the necessary file system state to indicate that the
541 * extension for inRef is hidden, as in the Finder. You can
542 * determine if an FSRef's extension is hidden using
543 * LSCopyItemInfoForRef.
544 *
545 * Mac OS X threading:
546 * Thread safe since version 10.2
547 *
548 * Parameters:
549 *
550 * inRef:
551 * The FSRef for which the extension is to be hidden or shown.
552 *
553 * inHide:
554 * True to hide inRef's extension, false to show it.
555 *
556 * Availability:
557 * Mac OS X: in version 10.1 and later in CoreServices.framework
558 * CarbonLib: not available in CarbonLib 1.x
559 * Non-Carbon CFM: not available
560 }
LSSetExtensionHiddenForRefnull561 function LSSetExtensionHiddenForRef( const (*var*) inRef: FSRef; inHide: Boolean ): OSStatus; external name '_LSSetExtensionHiddenForRef';
562 (* __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_NA) *)
563
564
565 {
566 * LSSetExtensionHiddenForURL()
567 *
568 * Summary:
569 * Sets whether the extension for a CFURLRef is hidden or not.
570 *
571 * Discussion:
572 * Sets the necessary file system state to indicate that the
573 * extension for inURL is hidden, as in the Finder. You can
574 * determine if a CFURLRef's extension is hidden using
575 * LSCopyItemInfoForURL.
576 *
577 * Mac OS X threading:
578 * Thread safe since version 10.2
579 *
580 * Parameters:
581 *
582 * inURL:
583 * The CFURLRef for which the extension is to be hidden or shown.
584 *
585 * inHide:
586 * True to hide inURL's extension, false to show it.
587 *
588 * Availability:
589 * Mac OS X: in version 10.1 and later in CoreServices.framework
590 * CarbonLib: not available in CarbonLib 1.x
591 * Non-Carbon CFM: not available
592 }
LSSetExtensionHiddenForURLnull593 function LSSetExtensionHiddenForURL( inURL: CFURLRef; inHide: Boolean ): OSStatus; external name '_LSSetExtensionHiddenForURL';
594 (* __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_NA) *)
595
596
597 {
598 * LSCopyKindStringForRef()
599 *
600 * Summary:
601 * Get the kind string for an item.
602 *
603 * Discussion:
604 * Returns the kind string as used in the Finder and elsewhere for
605 * inFSRef. The CFStringRef must be released after use.
606 *
607 * Mac OS X threading:
608 * Thread safe since version 10.2
609 *
610 * Parameters:
611 *
612 * inFSRef:
613 * The item for which the kind string is requested.
614 *
615 * outKindString:
616 * A CFStringRef* to receive the copied kind string object. This
617 * CFStringRef must be released eventually.
618 *
619 * Availability:
620 * Mac OS X: in version 10.0 and later in CoreServices.framework
621 * CarbonLib: not available in CarbonLib 1.x
622 * Non-Carbon CFM: not available
623 }
LSCopyKindStringForRefnull624 function LSCopyKindStringForRef( const (*var*) inFSRef: FSRef; var outKindString: CFStringRef ): OSStatus; external name '_LSCopyKindStringForRef';
625 (* __OSX_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_NA) *)
626
627
628 {
629 * LSCopyKindStringForURL()
630 *
631 * Summary:
632 * Get the kind string for an item.
633 *
634 * Discussion:
635 * Returns the kind string as used in the Finder and elsewhere for
636 * inURL. The CFStringRef must be released after use.
637 *
638 * Mac OS X threading:
639 * Thread safe since version 10.2
640 *
641 * Parameters:
642 *
643 * inURL:
644 * The item for which the kind string is requested.
645 *
646 * outKindString:
647 * A CFStringRef* to receive the copied kind string object. This
648 * CFStringRef must be released eventually.
649 *
650 * Availability:
651 * Mac OS X: in version 10.0 and later in CoreServices.framework
652 * CarbonLib: not available in CarbonLib 1.x
653 * Non-Carbon CFM: not available
654 }
LSCopyKindStringForURLnull655 function LSCopyKindStringForURL( inURL: CFURLRef; var outKindString: CFStringRef ): OSStatus; external name '_LSCopyKindStringForURL';
656 (* __OSX_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_NA) *)
657
658
659 {
660 * LSCopyKindStringForTypeInfo()
661 *
662 * Summary:
663 * Return the kind string for items like the provided info
664 *
665 * Discussion:
666 * Returns the kind string as shown in the Finder for the those
667 * items whose type, creator, and/or extension match the provided
668 * information. The kind string returned will be the one that most
669 * closely describes all the information provided. The kind string
670 * is subject to the document binding preferences that have been
671 * specified by the user. For example, if a creator is specified but
672 * the user has asked for files with the given
673 * creator/type/extension combination to open in an application with
674 * a different creator, the kind string will be loaded from the
675 * user's preferred application.
676 *
677 * Mac OS X threading:
678 * Thread safe since version 10.2
679 *
680 * Parameters:
681 *
682 * inType:
683 * The OSType file type for which you want a kind string. Specify
684 * kLSUnknownType if no file type information is available.
685 *
686 * inCreator:
687 * The OSType creator for which you want a kind string. Specify
688 * kLSUnknownCreator if no creator information is available.
689 *
690 * inExtension:
691 * The extension for which you want a kind string. Specify NULL if
692 * no extension information is available.
693 *
694 * outKindString:
695 * A CFStringRef* to receive the copied kind string object. This
696 * CFStringRef must be released eventually.
697 *
698 * Availability:
699 * Mac OS X: in version 10.2 and later in CoreServices.framework
700 * CarbonLib: not available in CarbonLib 1.x
701 * Non-Carbon CFM: not available
702 }
LSCopyKindStringForTypeInfonull703 function LSCopyKindStringForTypeInfo( inType: OSType; inCreator: OSType; inExtension: CFStringRef { can be NULL }; var outKindString: CFStringRef ): OSStatus; external name '_LSCopyKindStringForTypeInfo';
704 (* __OSX_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_NA) *)
705
706
707 {
708 * LSCopyKindStringForMIMEType()
709 *
710 * Summary:
711 * Get the kind string for the specified MIME type.
712 *
713 * Discussion:
714 * Returns the localized kind string describing the specified MIME
715 * type.
716 *
717 * Mac OS X threading:
718 * Thread safe since version 10.2
719 *
720 * Parameters:
721 *
722 * inMIMEType:
723 * The string specifying the MIME type.
724 *
725 * outKindString:
726 * A CFStringRef* to receive the copied kind string object. This
727 * CFStringRef must be released eventually.
728 *
729 * Availability:
730 * Mac OS X: in version 10.2 and later in CoreServices.framework
731 * CarbonLib: not available in CarbonLib 1.x
732 * Non-Carbon CFM: not available
733 }
LSCopyKindStringForMIMETypenull734 function LSCopyKindStringForMIMEType( inMIMEType: CFStringRef; var outKindString: CFStringRef ): OSStatus; external name '_LSCopyKindStringForMIMEType';
735 (* __OSX_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_NA) *)
736
737
738 {
739 * LSGetApplicationForItem()
740 *
741 * Summary:
742 * Return the application used to open an item.
743 *
744 * Discussion:
745 * Consults the binding tables to return the application that would
746 * be used to open inItemRef if it were double-clicked in the
747 * Finder. This application will be the user-specified override if
748 * appropriate or the default otherwise. If no application is known
749 * to LaunchServices suitable for opening this item,
750 * kLSApplicationNotFoundErr will be returned.
751 *
752 * Mac OS X threading:
753 * Thread safe since version 10.2
754 *
755 * Parameters:
756 *
757 * inItemRef:
758 * The FSRef of the item for which the application is requested.
759 *
760 * inRoleMask:
761 * Whether to return the editor or viewer for inItemRef. If you
762 * don't care which, use kLSRolesAll.
763 *
764 * outAppRef:
765 * Filled in with the FSRef of the application if not NULL.
766 *
767 * outAppURL:
768 * Filled in with the CFURLRef of the application if not NULL.
769 * THIS FUNCTION, DESPITE ITS NAME, RETAINS THE URL REFERENCE ON
770 * BEHALF OF THE CALLER. THE CALLER MUST EVENTUALLY RELEASE THE
771 * RETURNED URL REFERENCE.
772 *
773 * Availability:
774 * Mac OS X: in version 10.0 and later in CoreServices.framework
775 * CarbonLib: not available in CarbonLib 1.x
776 * Non-Carbon CFM: not available
777 }
LSGetApplicationForItemnull778 function LSGetApplicationForItem( const (*var*) inItemRef: FSRef; inRoleMask: LSRolesMask; outAppRef: FSRefPtr { can be NULL }; outAppURL: CFURLRefPtr { can be NULL } ): OSStatus; external name '_LSGetApplicationForItem';
779 (* __OSX_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_NA) *)
780
781
782 {
783 * LSGetApplicationForInfo()
784 *
785 * Summary:
786 * Return the application used to open items with particular data.
787 *
788 * Discussion:
789 * Consults the binding tables to return the application that would
790 * be used to open items with type, creator, and/or extension as
791 * provided if they were double-clicked in the Finder. This
792 * application will be the default for items like this if one has
793 * been set. If no application is known to LaunchServices suitable
794 * for opening such items, kLSApplicationNotFoundErr will be
795 * returned. Not all three input parameters can be NULL at the same
796 * time nor can both output parameters be NULL at the same time.
797 *
798 * Mac OS X threading:
799 * Thread safe since version 10.2
800 *
801 * Parameters:
802 *
803 * inType:
804 * The file type to consider. Can be kLSUnknownType.
805 *
806 * inCreator:
807 * The file creator to consider. Can be kLSUnknownCreator.
808 *
809 * inExtension:
810 * The file name extension to consider. Can be NULL.
811 *
812 * inRoleMask:
813 * Whether to return the editor or viewer for inItemRef. If you
814 * don't care which, use kLSRolesAll.
815 *
816 * outAppRef:
817 * Filled in with the FSRef of the application if not NULL.
818 *
819 * outAppURL:
820 * Filled in with the CFURLRef of the application if not NULL.
821 * THIS FUNCTION, DESPITE ITS NAME, RETAINS THE URL REFERENCE ON
822 * BEHALF OF THE CALLER. THE CALLER MUST EVENTUALLY RELEASE THE
823 * RETURNED URL REFERENCE.
824 *
825 * Availability:
826 * Mac OS X: in version 10.0 and later in CoreServices.framework
827 * CarbonLib: not available in CarbonLib 1.x
828 * Non-Carbon CFM: not available
829 }
LSGetApplicationForInfonull830 function LSGetApplicationForInfo( inType: OSType; inCreator: OSType; inExtension: CFStringRef { can be NULL }; inRoleMask: LSRolesMask; outAppRef: FSRefPtr { can be NULL }; outAppURL: CFURLRefPtr { can be NULL } ): OSStatus; external name '_LSGetApplicationForInfo';
831 (* __OSX_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_NA) *)
832
833
834 {
835 * LSCopyApplicationForMIMEType()
836 *
837 * Summary:
838 * Return the application used to handle data with the specified
839 * MIME type.
840 *
841 * Discussion:
842 * The returned application URL will be the user's preferred handler
843 * for the MIME type if one has been set. If no user preferred
844 * application has been set, Launch Services will select a default
845 * handler for the MIME type. If no application is known to handle
846 * the MIME type, kLSApplicationNotFoundErr will be returned.
847 *
848 * Mac OS X threading:
849 * Thread safe since version 10.2
850 *
851 * Parameters:
852 *
853 * inMIMEType:
854 * The string specifying the MIME type.
855 *
856 * inRoleMask:
857 * A role mask that the chosen application must satisfy. Use
858 * kLSRolesAll if the role is not important.
859 *
860 * outAppURL:
861 * Receives the copied CFURLRef, which must be released by the
862 * caller.
863 *
864 * Availability:
865 * Mac OS X: in version 10.2 and later in CoreServices.framework
866 * CarbonLib: not available in CarbonLib 1.x
867 * Non-Carbon CFM: not available
868 }
LSCopyApplicationForMIMETypenull869 function LSCopyApplicationForMIMEType( inMIMEType: CFStringRef; inRoleMask: LSRolesMask; var outAppURL: CFURLRef ): OSStatus; external name '_LSCopyApplicationForMIMEType';
870 (* __OSX_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_NA) *)
871
872
873 {
874 * LSGetApplicationForURL()
875 *
876 * Summary:
877 * Return the application used to open an item.
878 *
879 * Discussion:
880 * Consults the binding tables to return the application that would
881 * be used to open inURL if it were double-clicked in the Finder.
882 * This application will be the user-specified override if
883 * appropriate or the default otherwise. If no application is known
884 * to LaunchServices suitable for opening this item,
885 * kLSApplicationNotFoundErr will be returned.
886 *
887 * Mac OS X threading:
888 * Thread safe since version 10.2
889 *
890 * Parameters:
891 *
892 * inURL:
893 * The CFURLRef of the item for which the application is requested.
894 *
895 * inRoleMask:
896 * Whether to return the editor or viewer for inItemRef. If you
897 * don't care which, use kLSRolesAll.
898 *
899 * outAppRef:
900 * Filled in with the FSRef of the application if not NULL.
901 *
902 * outAppURL:
903 * Filled in with the CFURLRef of the application if not NULL.
904 * THIS FUNCTION, DESPITE ITS NAME, RETAINS THE URL REFERENCE ON
905 * BEHALF OF THE CALLER. THE CALLER MUST EVENTUALLY RELEASE THE
906 * RETURNED URL REFERENCE.
907 *
908 * Availability:
909 * Mac OS X: in version 10.0 and later in CoreServices.framework
910 * CarbonLib: not available in CarbonLib 1.x
911 * Non-Carbon CFM: not available
912 }
LSGetApplicationForURLnull913 function LSGetApplicationForURL( inURL: CFURLRef; inRoleMask: LSRolesMask; outAppRef: FSRefPtr { can be NULL }; outAppURL: CFURLRefPtr { can be NULL } ): OSStatus; external name '_LSGetApplicationForURL';
914 (* __OSX_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_NA) *)
915
916
917 {
918 * LSFindApplicationForInfo()
919 *
920 * Summary:
921 * Locate a specific application.
922 *
923 * Discussion:
924 * Returns the application with the corresponding input information.
925 * The registry of applications is consulted first in order of
926 * bundleID, then creator, then name. All comparisons are case
927 * insensitive and 'ties' are decided first by version, then by
928 * native vs. Classic.
929 *
930 * Mac OS X threading:
931 * Thread safe since version 10.2
932 *
933 * Parameters:
934 *
935 * inCreator:
936 * The file creator to consider. Can be kLSUnknownCreator.
937 *
938 * inBundleID:
939 * The bundle ID to consider. Can be NULL.
940 *
941 * inName:
942 * The name to consider. Can be NULL. Must include any extensions
943 * that are part of the file system name, e.g. '.app'.
944 *
945 * outAppRef:
946 * Filled in with the FSRef of the application if not NULL.
947 *
948 * outAppURL:
949 * Filled in with the CFURLRef of the application if not NULL.
950 * THIS FUNCTION, DESPITE ITS NAME, RETAINS THE URL REFERENCE ON
951 * BEHALF OF THE CALLER. THE CALLER MUST EVENTUALLY RELEASE THE
952 * RETURNED URL REFERENCE.
953 *
954 * Availability:
955 * Mac OS X: in version 10.0 and later in CoreServices.framework
956 * CarbonLib: not available in CarbonLib 1.x
957 * Non-Carbon CFM: not available
958 }
LSFindApplicationForInfonull959 function LSFindApplicationForInfo( inCreator: OSType; inBundleID: CFStringRef { can be NULL }; inName: CFStringRef { can be NULL }; outAppRef: FSRefPtr { can be NULL }; outAppURL: CFURLRefPtr { can be NULL } ): OSStatus; external name '_LSFindApplicationForInfo';
960 (* __OSX_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_NA) *)
961
962
963 {
964 * LSCanRefAcceptItem()
965 *
966 * Summary:
967 * Determine whether an item can accept another item.
968 *
969 * Discussion:
970 * Returns in outAcceptsItem whether inTargetRef can accept
971 * inItemFSRef as in a drag and drop operation. If inRoleMask is
972 * other than kLSRolesAll then make sure inTargetRef claims to
973 * fulfill the requested role.
974 *
975 * Mac OS X threading:
976 * Thread safe since version 10.2
977 *
978 * Parameters:
979 *
980 * inItemFSRef:
981 * FSRef of the item about which acceptance is requested.
982 *
983 * inTargetRef:
984 * FSRef of the potential target.
985 *
986 * inRoleMask:
987 * The role(s) the target must claim in order to consider
988 * acceptance.
989 *
990 * inFlags:
991 * Use kLSAcceptDefault.
992 *
993 * outAcceptsItem:
994 * Filled in with result. Must not be NULL.
995 *
996 * Availability:
997 * Mac OS X: in version 10.0 and later in CoreServices.framework
998 * CarbonLib: not available in CarbonLib 1.x
999 * Non-Carbon CFM: not available
1000 }
LSCanRefAcceptItemnull1001 function LSCanRefAcceptItem( const (*var*) inItemFSRef: FSRef; const (*var*) inTargetRef: FSRef; inRoleMask: LSRolesMask; inFlags: LSAcceptanceFlags; var outAcceptsItem: Boolean ): OSStatus; external name '_LSCanRefAcceptItem';
1002 (* __OSX_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_NA) *)
1003
1004
1005 {
1006 * LSCanURLAcceptURL()
1007 *
1008 * Summary:
1009 * Determine whether an item can accept another item.
1010 *
1011 * Discussion:
1012 * Returns in outAcceptsItem whether inTargetURL can accept
1013 * inItemURL as in a drag and drop operation. If inRoleMask is other
1014 * than kLSRolesAll then make sure inTargetRef claims to fulfill the
1015 * requested role.
1016 *
1017 * Mac OS X threading:
1018 * Thread safe since version 10.2
1019 *
1020 * Parameters:
1021 *
1022 * inItemURL:
1023 * CFURLRef of the item about which acceptance is requested.
1024 *
1025 * inTargetURL:
1026 * CFURLRef of the potential target.
1027 *
1028 * inRoleMask:
1029 * The role(s) the target must claim in order to consider
1030 * acceptance.
1031 *
1032 * inFlags:
1033 * Use kLSAcceptDefault.
1034 *
1035 * outAcceptsItem:
1036 * Filled in with result. Must not be NULL.
1037 *
1038 * Availability:
1039 * Mac OS X: in version 10.0 and later in CoreServices.framework
1040 * CarbonLib: not available in CarbonLib 1.x
1041 * Non-Carbon CFM: not available
1042 }
LSCanURLAcceptURLnull1043 function LSCanURLAcceptURL( inItemURL: CFURLRef; inTargetURL: CFURLRef; inRoleMask: LSRolesMask; inFlags: LSAcceptanceFlags; var outAcceptsItem: Boolean ): OSStatus; external name '_LSCanURLAcceptURL';
1044 (* __OSX_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_NA) *)
1045
1046
1047 {
1048 * LSRegisterURL()
1049 *
1050 * Discussion:
1051 * If the specified URL refers to an application or other bundle
1052 * claiming to handle documents or URLs, add the bundle's document
1053 * and URL claims to the Launch Services database.
1054 *
1055 * Mac OS X threading:
1056 * Thread safe since version 10.3
1057 *
1058 * Parameters:
1059 *
1060 * inURL:
1061 * The CFURLRef of the item (a directory or file) to be registered.
1062 *
1063 * inUpdate:
1064 * When false, LSRegisterURL does not register the item if it has
1065 * already been registered and the current modification date of
1066 * the item has not changed from when it was last registered. When
1067 * true, the item's registered info is updated, even if the
1068 * modification has not changed.
1069 *
1070 * Result:
1071 * An OSStatus value: noErr - Success kLSNoRegistrationInfoErr - The
1072 * item does not contain info requiring registration kLSDataErr -
1073 * The item's property list info is malformed.
1074 *
1075 * Availability:
1076 * Mac OS X: in version 10.3 and later in CoreServices.framework
1077 * CarbonLib: not available in CarbonLib 1.x
1078 * Non-Carbon CFM: not available
1079 }
LSRegisterURLnull1080 function LSRegisterURL( inURL: CFURLRef; inUpdate: Boolean ): OSStatus; external name '_LSRegisterURL';
1081 (* __OSX_AVAILABLE_STARTING(__MAC_10_3, __IPHONE_NA) *)
1082
1083
1084 {
1085 * LSRegisterFSRef()
1086 *
1087 * Discussion:
1088 * If the specified FSRef refers to an application or other bundle
1089 * claiming to handle documents or URLs, add the bundle's document
1090 * and URL claims to the Launch Services database.
1091 *
1092 * Mac OS X threading:
1093 * Thread safe since version 10.3
1094 *
1095 * Parameters:
1096 *
1097 * inRef:
1098 * The FSRef of the item to be registered.
1099 *
1100 * inUpdate:
1101 * When false, LSRegisterFSRef does not register the item if it
1102 * has already been registered and the current modification date
1103 * of the item has not changed from when it was last registered.
1104 * When true, the item's registered info is updated, even if the
1105 * modification has not changed.
1106 *
1107 * Result:
1108 * An OSStatus value: noErr - Success kLSNoRegistrationInfoErr - The
1109 * item does not contain info requiring registration kLSDataErr -
1110 * The item's property list info is malformed.
1111 *
1112 * Availability:
1113 * Mac OS X: in version 10.3 and later in CoreServices.framework
1114 * CarbonLib: not available in CarbonLib 1.x
1115 * Non-Carbon CFM: not available
1116 }
LSRegisterFSRefnull1117 function LSRegisterFSRef( const (*var*) inRef: FSRef; inUpdate: Boolean ): OSStatus; external name '_LSRegisterFSRef';
1118 (* __OSX_AVAILABLE_STARTING(__MAC_10_3, __IPHONE_NA) *)
1119
1120
1121 {
1122 * LSCopyApplicationURLsForURL()
1123 *
1124 * Discussion:
1125 * Returns an array of URLs to applications that offer the requested
1126 * role(s) for the input item.
1127 *
1128 * Mac OS X threading:
1129 * Thread safe since version 10.3
1130 *
1131 * Parameters:
1132 *
1133 * inURL:
1134 * The CFURLRef of the item for which all suitable applications
1135 * are desired. If the URL is a file URL, it is treated as a
1136 * document, and applications are selected based on the document's
1137 * type information. Otherwise, applications are selected based on
1138 * the URL's scheme.
1139 *
1140 * inRoleMask:
1141 * The role(s) which must intersect with the role provided by an
1142 * application for the specified item in order for the application
1143 * to be included in the result. Pass kLSRolesAll if any role is
1144 * acceptable.
1145 *
1146 * Result:
1147 * An array of CFURLRefs, one for each application which can open
1148 * inURL with at least one of the roles in inRoleMask, or NULL if no
1149 * applications can open the item. When an array is returned, you
1150 * must eventually release it.
1151 *
1152 * Availability:
1153 * Mac OS X: in version 10.3 and later in CoreServices.framework
1154 * CarbonLib: not available in CarbonLib 1.x
1155 * Non-Carbon CFM: not available
1156 }
LSCopyApplicationURLsForURLnull1157 function LSCopyApplicationURLsForURL( inURL: CFURLRef; inRoleMask: LSRolesMask ): CFArrayRef; external name '_LSCopyApplicationURLsForURL';
1158 (* __OSX_AVAILABLE_STARTING(__MAC_10_3, __IPHONE_NA) *)
1159
1160
1161 { ================================================================================== }
1162 { API for retrieving item attributes }
1163 { ================================================================================== }
1164 {
1165 * Attributes Names
1166 *
1167 * kLSItemContentType
1168 *
1169 * The item's content type identifier (a uniform type identifier string)
1170 * Value type CFStringRef
1171 *
1172 *
1173 * kLSItemFileType
1174 *
1175 * The item's file type (OSType)
1176 * Value type CFStringRef
1177 *
1178 *
1179 * kLSItemFileCreator
1180 *
1181 * The item's file creator (OSType)
1182 * Value type CFStringRef
1183 *
1184 *
1185 * kLSItemExtension
1186 *
1187 * The item's filename extension
1188 * Value type CFStringRef
1189 *
1190 *
1191 * kLSItemDisplayName
1192 *
1193 * The item's name as displayed to the user
1194 * (The display name reflects localization and
1195 * extension hiding which may be in effect)
1196 * Value type CFStringRef
1197 *
1198 *
1199 * kLSItemDisplayKind
1200 *
1201 * The localized kind string describing this item's type
1202 * Value type CFStringRef
1203 *
1204 *
1205 * kLSItemRoleHandlerDisplayName
1206 *
1207 * The display name of the application set to handle (open) this item
1208 * (subject to the role mask)
1209 * value type CFStringRef
1210 *
1211 *
1212 * kLSItemIsInvisible
1213 *
1214 * True if the item is normally hidden from users
1215 * Value type CFBooleanRef
1216 *
1217 *
1218 * kLSItemExtensionIsHidden
1219 *
1220 * True if the item's extension is set to be hidden
1221 * Value type CFBooleanRef
1222 *
1223 *
1224 * kLSItemQuarantineProperties (can be set)
1225 *
1226 * A dictionary of quarantine properties. See LSQuarantine.h for
1227 * quarantine property definitions. This attribute is not
1228 * present if the item is not quarantined.
1229 * Value type CFDictionaryRef. May be NULL.
1230 }
1231 {
1232 * kLSItemContentType
1233 *
1234 * Availability:
1235 * Mac OS X: in version 10.4 and later in CoreServices.framework
1236 * CarbonLib: not available
1237 * Non-Carbon CFM: not available
1238 }
1239 var kLSItemContentType: CFStringRef; external name '_kLSItemContentType'; (* attribute const *)
1240 (* __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA) *)
1241 {
1242 * kLSItemFileType
1243 *
1244 * Availability:
1245 * Mac OS X: in version 10.4 and later in CoreServices.framework
1246 * CarbonLib: not available
1247 * Non-Carbon CFM: not available
1248 }
1249 var kLSItemFileType: CFStringRef; external name '_kLSItemFileType'; (* attribute const *)
1250 (* __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA) *)
1251 {
1252 * kLSItemFileCreator
1253 *
1254 * Availability:
1255 * Mac OS X: in version 10.4 and later in CoreServices.framework
1256 * CarbonLib: not available
1257 * Non-Carbon CFM: not available
1258 }
1259 var kLSItemFileCreator: CFStringRef; external name '_kLSItemFileCreator'; (* attribute const *)
1260 (* __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA) *)
1261 {
1262 * kLSItemExtension
1263 *
1264 * Availability:
1265 * Mac OS X: in version 10.4 and later in CoreServices.framework
1266 * CarbonLib: not available
1267 * Non-Carbon CFM: not available
1268 }
1269 var kLSItemExtension: CFStringRef; external name '_kLSItemExtension'; (* attribute const *)
1270 (* __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA) *)
1271 {
1272 * kLSItemDisplayName
1273 *
1274 * Availability:
1275 * Mac OS X: in version 10.4 and later in CoreServices.framework
1276 * CarbonLib: not available
1277 * Non-Carbon CFM: not available
1278 }
1279 var kLSItemDisplayName: CFStringRef; external name '_kLSItemDisplayName'; (* attribute const *)
1280 (* __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA) *)
1281 {
1282 * kLSItemDisplayKind
1283 *
1284 * Availability:
1285 * Mac OS X: in version 10.4 and later in CoreServices.framework
1286 * CarbonLib: not available
1287 * Non-Carbon CFM: not available
1288 }
1289 var kLSItemDisplayKind: CFStringRef; external name '_kLSItemDisplayKind'; (* attribute const *)
1290 (* __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA) *)
1291 {
1292 * kLSItemRoleHandlerDisplayName
1293 *
1294 * Availability:
1295 * Mac OS X: in version 10.4 and later in CoreServices.framework
1296 * CarbonLib: not available
1297 * Non-Carbon CFM: not available
1298 }
1299 var kLSItemRoleHandlerDisplayName: CFStringRef; external name '_kLSItemRoleHandlerDisplayName'; (* attribute const *)
1300 (* __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA) *)
1301 {
1302 * kLSItemIsInvisible
1303 *
1304 * Availability:
1305 * Mac OS X: in version 10.4 and later in CoreServices.framework
1306 * CarbonLib: not available
1307 * Non-Carbon CFM: not available
1308 }
1309 var kLSItemIsInvisible: CFStringRef; external name '_kLSItemIsInvisible'; (* attribute const *)
1310 (* __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA) *)
1311 {
1312 * kLSItemExtensionIsHidden
1313 *
1314 * Availability:
1315 * Mac OS X: in version 10.4 and later in CoreServices.framework
1316 * CarbonLib: not available
1317 * Non-Carbon CFM: not available
1318 }
1319 var kLSItemExtensionIsHidden: CFStringRef; external name '_kLSItemExtensionIsHidden'; (* attribute const *)
1320 (* __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA) *)
1321 {
1322 * kLSItemQuarantineProperties
1323 *
1324 * Availability:
1325 * Mac OS X: in version 10.5 and later in CoreServices.framework
1326 * CarbonLib: not available
1327 * Non-Carbon CFM: not available
1328 }
1329 var kLSItemQuarantineProperties: CFStringRef; external name '_kLSItemQuarantineProperties'; (* attribute const *)
1330 (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
1331 {
1332 * LSCopyItemAttribute()
1333 *
1334 * Discussion:
1335 * Assigns the value of the specified item's attribute (or NULL, if
1336 * the item has no such attribute or an error occurs) to *outValue.
1337 *
1338 * Mac OS X threading:
1339 * Thread safe since version 10.4
1340 *
1341 * Parameters:
1342 *
1343 * inItem:
1344 * The FSRef of the item
1345 *
1346 * inRoles:
1347 * The role(s), at least one of which must be provided by the
1348 * application selected when computing attributes related to
1349 * document binding (such as kLSItemRoleHandlerDisplayName). Pass
1350 * kLSRolesAll if any role is acceptable.
1351 *
1352 * inAttributeName:
1353 * The name of the attribute to copy
1354 *
1355 * outValue:
1356 * Receives the attribute value
1357 *
1358 * Result:
1359 * an OSStatus value. Returns kLSAttributeNotFoundErr if the item
1360 * does not have the requested attribute.
1361 *
1362 * Availability:
1363 * Mac OS X: in version 10.4 and later in CoreServices.framework
1364 * CarbonLib: not available
1365 * Non-Carbon CFM: not available
1366 }
LSCopyItemAttributenull1367 function LSCopyItemAttribute( const (*var*) inItem: FSRef; inRoles: LSRolesMask; inAttributeName: CFStringRef; var outValue: CFTypeRef ): OSStatus; external name '_LSCopyItemAttribute';
1368 (* __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA) *)
1369
1370
1371 {
1372 * LSCopyItemAttributes()
1373 *
1374 * Discussion:
1375 * Creates a dictionary containing the specified attribute values
1376 * and assigns it to *outValues. The output dictionary keys are the
1377 * attribute names. The CFTypeID of each value in the dictionary
1378 * varies by attribute. See each attribute name constant for a
1379 * description of its value type. An attribute key will be absent
1380 * from the values dictionary if the item has no such attribute.
1381 *
1382 * Mac OS X threading:
1383 * Thread safe since version 10.4
1384 *
1385 * Parameters:
1386 *
1387 * inItem:
1388 * The FSRef of the item
1389 *
1390 * inRoles:
1391 * The role(s), at least one of which must be provided by the
1392 * application selected when computing attributes related to
1393 * document binding (such as kLSItemRoleHandlerDisplayName). Pass
1394 * kLSRolesAll if any role is acceptable.
1395 *
1396 * inAttributeNames:
1397 * The array of attribute names
1398 *
1399 * outValues:
1400 * Receives the dictionary of attribure name-value pairs
1401 *
1402 * Result:
1403 * an OSStatus value.
1404 *
1405 * Availability:
1406 * Mac OS X: in version 10.4 and later in CoreServices.framework
1407 * CarbonLib: not available
1408 * Non-Carbon CFM: not available
1409 }
LSCopyItemAttributesnull1410 function LSCopyItemAttributes( const (*var*) inItem: FSRef; inRoles: LSRolesMask; inAttributeNames: CFArrayRef; var outValues: CFDictionaryRef ): OSStatus; external name '_LSCopyItemAttributes';
1411 (* __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA) *)
1412
1413
1414 {
1415 * LSSetItemAttribute()
1416 *
1417 * Discussion:
1418 * Sets the value of a settable item's attribute. Currently, only
1419 * the kLSItemQuarantineProperties attribute may be set.
1420 *
1421 * Mac OS X threading:
1422 * Thread safe since version 10.5
1423 *
1424 * Parameters:
1425 *
1426 * inItem:
1427 * The FSRef of the item
1428 *
1429 * inRoles:
1430 * Reserved for future use. To ensure compatibility, pass
1431 * kLSRolesAll for this argument.
1432 *
1433 * inAttributeName:
1434 * The name of the attribute to set
1435 *
1436 * inValue:
1437 * The new value of the attribute. If NULL, removes the attribute
1438 * from the item.
1439 *
1440 * Result:
1441 * an OSStatus value. Returns kLSAttributeNotSettableErr if the
1442 * attribute is read-only.
1443 *
1444 * Availability:
1445 * Mac OS X: in version 10.5 and later in CoreServices.framework
1446 * CarbonLib: not available
1447 * Non-Carbon CFM: not available
1448 }
LSSetItemAttributenull1449 function LSSetItemAttribute( const (*var*) inItem: FSRef; inRoles: LSRolesMask; inAttributeName: CFStringRef; inValue: CFTypeRef { can be NULL } ): OSStatus; external name '_LSSetItemAttribute';
1450 (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
1451
1452
1453 { ================================================================================== }
1454 { API for accessing content and URL handler preferences }
1455 { ================================================================================== }
1456
1457 {
1458 * LSCopyDefaultRoleHandlerForContentType
1459 *
1460 * Returns the application bundle identifier of the default handler
1461 * for the specified content type (UTI), in the specified role(s).
1462 * For any role, specify kLSRolesAll. Returns NULL if no handler
1463 * is available.
1464 }
1465 {
1466 * LSCopyDefaultRoleHandlerForContentType()
1467 *
1468 * Mac OS X threading:
1469 * Thread safe since version 10.4
1470 *
1471 * Availability:
1472 * Mac OS X: in version 10.4 and later in CoreServices.framework
1473 * CarbonLib: not available
1474 * Non-Carbon CFM: not available
1475 }
LSCopyDefaultRoleHandlerForContentTypenull1476 function LSCopyDefaultRoleHandlerForContentType( inContentType: CFStringRef; inRole: LSRolesMask ): CFStringRef; external name '_LSCopyDefaultRoleHandlerForContentType';
1477 (* __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA) *)
1478
1479
1480 {
1481 * LSCopyAllRoleHandlersForContentType
1482 *
1483 * Returns an array of application bundle identifiers for
1484 * applications capable of handling the specified content type
1485 * (UTI) with the specified role(s). Application content handling
1486 * capabilities are determined according to the kCFBundleDocumentTypes
1487 * listed in an application's Info.plist). For any role, specify kLSRolesAll.
1488 * Returns NULL if no handlers are available.
1489 }
1490 {
1491 * LSCopyAllRoleHandlersForContentType()
1492 *
1493 * Mac OS X threading:
1494 * Thread safe since version 10.4
1495 *
1496 * Availability:
1497 * Mac OS X: in version 10.4 and later in CoreServices.framework
1498 * CarbonLib: not available
1499 * Non-Carbon CFM: not available
1500 }
LSCopyAllRoleHandlersForContentTypenull1501 function LSCopyAllRoleHandlersForContentType( inContentType: CFStringRef; inRole: LSRolesMask ): CFArrayRef; external name '_LSCopyAllRoleHandlersForContentType';
1502 (* __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA) *)
1503
1504
1505 {
1506 * LSSetDefaultRoleHandlerForContentType
1507 *
1508 * Sets the user's preferred handler for the specified content
1509 * type (UTI) in the specified role(s). For all roles, specify
1510 * kLSRolesAll. The handler is specified as an application
1511 * bundle identifier.
1512 }
1513 {
1514 * LSSetDefaultRoleHandlerForContentType()
1515 *
1516 * Mac OS X threading:
1517 * Thread safe since version 10.4
1518 *
1519 * Availability:
1520 * Mac OS X: in version 10.4 and later in CoreServices.framework
1521 * CarbonLib: not available
1522 * Non-Carbon CFM: not available
1523 }
LSSetDefaultRoleHandlerForContentTypenull1524 function LSSetDefaultRoleHandlerForContentType( inContentType: CFStringRef; inRole: LSRolesMask; inHandlerBundleID: CFStringRef ): OSStatus; external name '_LSSetDefaultRoleHandlerForContentType';
1525 (* __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA) *)
1526
1527
1528 {
1529 * LSHandlerOptions
1530 *
1531 * Options controlling how content handlers are selected.
1532 *
1533 * kLSHandlerOptionsDefault - by default, Launch Services will
1534 * use a content item's creator (when available) to select a handler
1535 * kLSHandlerOptionsIgnoreCreator - Launch Services will ignore content item
1536 * creator information when selecting a role handler for the specified
1537 * content type
1538 }
1539 type
1540 LSHandlerOptions = OptionBits;
1541 const
1542 kLSHandlerOptionsDefault = 0;
1543 kLSHandlerOptionsIgnoreCreator = 1;
1544
1545
1546 {
1547 * LSGetHandlerOptionsForContentType
1548 *
1549 * Get the handler options for the specified content type (UTI).
1550 }
1551 {
1552 * LSGetHandlerOptionsForContentType()
1553 *
1554 * Mac OS X threading:
1555 * Thread safe since version 10.4
1556 *
1557 * Availability:
1558 * Mac OS X: in version 10.4 and later in CoreServices.framework
1559 * CarbonLib: not available
1560 * Non-Carbon CFM: not available
1561 }
LSGetHandlerOptionsForContentTypenull1562 function LSGetHandlerOptionsForContentType( inContentType: CFStringRef ): LSHandlerOptions; external name '_LSGetHandlerOptionsForContentType';
1563 (* __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA) *)
1564
1565
1566 {
1567 * LSSetHandlerOptionsForContentType
1568 *
1569 * Set the handler options for the specified content type (UTI).
1570 }
1571 {
1572 * LSSetHandlerOptionsForContentType()
1573 *
1574 * Mac OS X threading:
1575 * Thread safe since version 10.4
1576 *
1577 * Availability:
1578 * Mac OS X: in version 10.4 and later in CoreServices.framework
1579 * CarbonLib: not available
1580 * Non-Carbon CFM: not available
1581 }
LSSetHandlerOptionsForContentTypenull1582 function LSSetHandlerOptionsForContentType( inContentType: CFStringRef; inOptions: LSHandlerOptions ): OSStatus; external name '_LSSetHandlerOptionsForContentType';
1583 (* __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA) *)
1584
1585
1586 {
1587 * LSCopyDefaultHandlerForURLScheme
1588 *
1589 * Returns the bundle identifier of the default handler for
1590 * the specified URL scheme. Returns NULL if no handler
1591 * is available.
1592 }
1593 {
1594 * LSCopyDefaultHandlerForURLScheme()
1595 *
1596 * Mac OS X threading:
1597 * Thread safe since version 10.4
1598 *
1599 * Availability:
1600 * Mac OS X: in version 10.4 and later in CoreServices.framework
1601 * CarbonLib: not available
1602 * Non-Carbon CFM: not available
1603 }
LSCopyDefaultHandlerForURLSchemenull1604 function LSCopyDefaultHandlerForURLScheme( inURLScheme: CFStringRef ): CFStringRef; external name '_LSCopyDefaultHandlerForURLScheme';
1605 (* __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA) *)
1606
1607
1608 {
1609 * LSCopyAllHandlersForURLScheme
1610 *
1611 * Returns an array of application bundle identifiers for
1612 * applications capable of handling the specified URL scheme.
1613 * URL handling capability is determined according to the
1614 * kCFBundleURLTypes listed in an application's Info.plist).
1615 * Returns NULL if no handlers are available.
1616 }
1617 {
1618 * LSCopyAllHandlersForURLScheme()
1619 *
1620 * Mac OS X threading:
1621 * Thread safe since version 10.4
1622 *
1623 * Availability:
1624 * Mac OS X: in version 10.4 and later in CoreServices.framework
1625 * CarbonLib: not available
1626 * Non-Carbon CFM: not available
1627 }
LSCopyAllHandlersForURLSchemenull1628 function LSCopyAllHandlersForURLScheme( inURLScheme: CFStringRef ): CFArrayRef; external name '_LSCopyAllHandlersForURLScheme';
1629 (* __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA) *)
1630
1631
1632 {
1633 * LSSetDefaultHandlerForURLScheme
1634 *
1635 * Sets the user's preferred handler for the specified URL
1636 * scheme. The handler is specified as an application
1637 * bundle identifier.
1638 }
1639 {
1640 * LSSetDefaultHandlerForURLScheme()
1641 *
1642 * Mac OS X threading:
1643 * Thread safe since version 10.4
1644 *
1645 * Availability:
1646 * Mac OS X: in version 10.4 and later in CoreServices.framework
1647 * CarbonLib: not available
1648 * Non-Carbon CFM: not available
1649 }
LSSetDefaultHandlerForURLSchemenull1650 function LSSetDefaultHandlerForURLScheme( inURLScheme: CFStringRef; inHandlerBundleID: CFStringRef ): OSStatus; external name '_LSSetDefaultHandlerForURLScheme';
1651 (* __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA) *)
1652
1653
1654 {$endc} {TARGET_OS_MAC}
1655
1656 {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
1657
1658 end.
1659 {$endc} {not MACOSALLINCLUDE}
1660