1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
|
/*
File: LaunchServices.h
Contains: Public interfaces for LaunchServices.framework
Version: QuickTime 7.3
Copyright: (c) 2007 (c) 2001 by Apple Computer, Inc., all rights reserved.
Bugs?: For bug reports, consult the following page on
the World Wide Web:
http://developer.apple.com/bugreporter/
*/
#ifndef __LAUNCHSERVICES__
#define __LAUNCHSERVICES__
#ifndef __MACTYPES__
#include <MacTypes.h>
#endif
#ifndef __CFSTRING__
#include <CFString.h>
#endif
#ifndef __FILES__
#include <Files.h>
#endif
#ifndef __CFURL__
#include <CFURL.h>
#endif
#ifndef __AEDATAMODEL__
#include <AEDataModel.h>
#endif
#if PRAGMA_ONCE
#pragma once
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if PRAGMA_IMPORT
#pragma import on
#endif
#if PRAGMA_STRUCT_ALIGN
#pragma options align=mac68k
#elif PRAGMA_STRUCT_PACKPUSH
#pragma pack(push, 2)
#elif PRAGMA_STRUCT_PACK
#pragma pack(2)
#endif
/* ======================================================================================================== */
/* LaunchServices Structures and Enums */
/* ======================================================================================================== */
enum {
kLSUnknownErr = -10810,
kLSNotAnApplicationErr = -10811,
kLSNotInitializedErr = -10812,
kLSDataUnavailableErr = -10813, /* e.g. no kind string*/
kLSApplicationNotFoundErr = -10814, /* e.g. no application claims the file*/
kLSUnknownTypeErr = -10815,
kLSDataTooOldErr = -10816,
kLSDataErr = -10817,
kLSLaunchInProgressErr = -10818, /* e.g. opening an alreay opening application*/
kLSNotRegisteredErr = -10819,
kLSAppDoesNotClaimTypeErr = -10820,
kLSAppDoesNotSupportSchemeWarning = -10821, /* not an error, just a warning*/
kLSServerCommunicationErr = -10822, /* cannot set recent items*/
kLSCannotSetInfoErr = -10823 /* you may not set item info for this item*/
};
typedef OptionBits LSInitializeFlags;
enum {
kLSInitializeDefaults = 0x00000001
};
enum {
kLSMinCatInfoBitmap = (kFSCatInfoNodeFlags | kFSCatInfoParentDirID | kFSCatInfoFinderInfo | kFSCatInfoFinderXInfo) /* minimum info needed to avoid a FSGetCatalogInfo call when fetching item information */
};
enum {
kLSInvalidExtensionIndex = (unsigned long)0xFFFFFFFF /* Index returned from LSGetExtensionInfo when name has no extension*/
};
typedef OptionBits LSRequestedInfo;
enum {
kLSRequestExtension = 0x00000001, /* safe to use from threads*/
kLSRequestTypeCreator = 0x00000002, /* safe to use from threads*/
kLSRequestBasicFlagsOnly = 0x00000004, /* all but type of application and extension flags - safe to use from threads*/
kLSRequestAppTypeFlags = 0x00000008, /* NOT SAFE to use from threads*/
kLSRequestAllFlags = 0x00000010, /* NOT SAFE to use from threads*/
kLSRequestIconAndKind = 0x00000020, /* NOT SAFE to use from threads*/
kLSRequestExtensionFlagsOnly = 0x00000040, /* safe to use from threads*/
kLSRequestAllInfo = (unsigned long)0xFFFFFFFF /* NOT SAFE to use from threads*/
};
typedef OptionBits LSItemInfoFlags;
enum {
kLSItemInfoIsPlainFile = 0x00000001, /* none of the following applies*/
kLSItemInfoIsPackage = 0x00000002, /* app, doc, or bundle package*/
kLSItemInfoIsApplication = 0x00000004, /* single-file or packaged*/
kLSItemInfoIsContainer = 0x00000008, /* folder or volume*/
kLSItemInfoIsAliasFile = 0x00000010, /* Alias file (includes sym links)*/
kLSItemInfoIsSymlink = 0x00000020, /* UNIX sym link*/
kLSItemInfoIsInvisible = 0x00000040, /* does not include '.' files or '.hidden' entries*/
kLSItemInfoIsNativeApp = 0x00000080, /* Carbon or Cocoa native app*/
kLSItemInfoIsClassicApp = 0x00000100, /* CFM Classic app*/
kLSItemInfoAppPrefersNative = 0x00000200, /* Carbon app that prefers to be launched natively*/
kLSItemInfoAppPrefersClassic = 0x00000400, /* Carbon app that prefers to be launched in Classic*/
kLSItemInfoAppIsScriptable = 0x00000800, /* App can be scripted*/
kLSItemInfoIsVolume = 0x00001000, /* item is a volume*/
kLSItemInfoExtensionIsHidden = 0x00100000 /* item has a hidden extension*/
};
typedef OptionBits LSRolesMask;
enum {
kLSRolesNone = 0x00000001, /* no claim is made about support for this type/scheme*/
kLSRolesViewer = 0x00000002, /* claim to be able to view this type/scheme*/
kLSRolesEditor = 0x00000004, /* claim to be able to edit this type/scheme*/
kLSRolesAll = (unsigned long)0xFFFFFFFF /* claim to do it all*/
};
typedef UInt32 LSKindID;
enum {
kLSUnknownKindID = 0
};
enum {
kLSUnknownType = 0,
kLSUnknownCreator = 0
};
struct LSItemInfoRecord {
LSItemInfoFlags flags;
OSType filetype;
OSType creator; /* release when finished*/
CFStringRef extension; /* release when finished*/
CFStringRef iconFileName; /* not for general use*/
LSKindID kindID; /* not for general use*/
};
typedef struct LSItemInfoRecord LSItemInfoRecord;
typedef OptionBits LSAcceptanceFlags;
enum {
kLSAcceptDefault = 0x00000001,
kLSAcceptAllowLoginUI = 0x00000002 /* show UI to log in if necessary*/
};
typedef OptionBits LSLaunchFlags;
enum {
kLSLaunchDefaults = 0x00000001, /* default = open, async, use Info.plist, start Classic*/
kLSLaunchAndPrint = 0x00000002, /* print items instead of open them*/
kLSLaunchReserved2 = 0x00000004,
kLSLaunchReserved3 = 0x00000008,
kLSLaunchReserved4 = 0x00000010,
kLSLaunchReserved5 = 0x00000020,
kLSLaunchReserved6 = 0x00000040,
kLSLaunchInhibitBGOnly = 0x00000080, /* causes launch to fail if target is background-only.*/
kLSLaunchDontAddToRecents = 0x00000100, /* do not add app or documents to recents menus.*/
kLSLaunchDontSwitch = 0x00000200, /* don't bring new app to the foreground.*/
kLSLaunchNoParams = 0x00000800, /* Use Info.plist to determine launch parameters*/
kLSLaunchAsync = 0x00010000, /* launch async; obtain results from kCPSNotifyLaunch.*/
kLSLaunchStartClassic = 0x00020000, /* start up Classic environment if required for app.*/
kLSLaunchInClassic = 0x00040000, /* force app to launch in Classic environment.*/
kLSLaunchNewInstance = 0x00080000, /* Instantiate app even if it is already running.*/
kLSLaunchAndHide = 0x00100000, /* Send child a "hide" request as soon as it checks in.*/
kLSLaunchAndHideOthers = 0x00200000 /* Hide all other apps when child checks in.*/
};
struct LSLaunchFSRefSpec {
const FSRef * appRef; /* app to use, can be NULL*/
UInt32 numDocs; /* items to open/print, can be NULL*/
const FSRef * itemRefs; /* array of FSRefs*/
const AEDesc * passThruParams; /* passed untouched to application as optional parameter*/
LSLaunchFlags launchFlags;
void * asyncRefCon; /* used if you register for app birth/death notification*/
};
typedef struct LSLaunchFSRefSpec LSLaunchFSRefSpec;
struct LSLaunchURLSpec {
CFURLRef appURL; /* app to use, can be NULL*/
CFArrayRef itemURLs; /* items to open/print, can be NULL*/
const AEDesc * passThruParams; /* passed untouched to application as optional parameter*/
LSLaunchFlags launchFlags;
void * asyncRefCon; /* used if you register for app birth/death notification*/
};
typedef struct LSLaunchURLSpec LSLaunchURLSpec;
/* ======================================================================================================== */
/* LaunchServices Public Entry Points */
/* ======================================================================================================== */
/*
* LSInit()
*
* Summary:
* Initialize LaunchServices for use.
*
* Discussion:
* LSInit is deprecated. Launch Services is initialized implicitly
* when first called.
*
* Parameters:
*
* inFlags:
* Use kLSInitializeDefaults.
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available in CarbonLib 1.x
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
LSInit(LSInitializeFlags inFlags);
/*
* LSTerm()
*
* Summary:
* Terminate LaunchServices use.
*
* Discussion:
* LSTerm is deprecated. It does not need to be called.
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available in CarbonLib 1.x
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
LSTerm(void);
/*
* LSCopyItemInfoForRef()
*
* Summary:
* Return information about an item.
*
* Discussion:
* Returns as much or as little information as requested about
* inItemRef. Some information is available in a thread-safe manner,
* some is not. All CFStrings must be released after use.
*
* Parameters:
*
* inItemRef:
* The FSRef of the item about which information is requested.
*
* inWhichInfo:
* Flags indicating which information to return
*
* outItemInfo:
* Information is returned in this structure. Must not be NULL
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available in CarbonLib 1.x
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
LSCopyItemInfoForRef(
const FSRef * inItemRef,
LSRequestedInfo inWhichInfo,
LSItemInfoRecord * outItemInfo);
/*
* LSCopyItemInfoForURL()
*
* Summary:
* Return information about an item.
*
* Discussion:
* Returns as much or as little information as requested about
* inURL. Some information is available in a thread-safe manner,
* some is not. All CFStrings must be released after use.
*
* Parameters:
*
* inURL:
* The CFURLRef of the item about which information is requested.
*
* inWhichInfo:
* Flags indicating which information to return
*
* outItemInfo:
* Information is returned in this structure. Must not be NULL
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available in CarbonLib 1.x
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
LSCopyItemInfoForURL(
CFURLRef inURL,
LSRequestedInfo inWhichInfo,
LSItemInfoRecord * outItemInfo);
/*
* LSGetExtensionInfo()
*
* Summary:
* Get information about the extension for a file system name.
*
* Discussion:
* Returns the starting index of the extension (not including the
* period) or kLSInvalidExtensionIndex if the input name has no
* extension.
*
* Parameters:
*
* inNameLen:
* The number of the UniChars in inNameBuffer.
*
* inNameBuffer:
* The buffer containing the name's Unicode characters.
*
* outExtStartIndex:
* On success, the starting index of the extension if there is one
* (not including the period). Set to kLSInvalidExtensionIndex if
* inNameBuffer does not contain a valid extension.
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available in CarbonLib 1.x
* Mac OS X: in version 10.1 and later
*/
EXTERN_API( OSStatus )
LSGetExtensionInfo(
UniCharCount inNameLen,
const UniChar inNameBuffer[],
UniCharCount * outExtStartIndex);
/*
* LSCopyDisplayNameForRef()
*
* Summary:
* Get the display name for an FSRef.
*
* Discussion:
* Return a copy of the display name for an FSRef. Takes into
* consideration whether this item has a hidden extension or not.
*
* Parameters:
*
* inRef:
* The FSRef for which the display name is desired.
*
* outDisplayName:
* Pointer to the CFString into which the display name should be
* copied. Callers must dispose of the resulting CFString.
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available in CarbonLib 1.x
* Mac OS X: in version 10.1 and later
*/
EXTERN_API( OSStatus )
LSCopyDisplayNameForRef(
const FSRef * inRef,
CFStringRef * outDisplayName);
/*
* LSCopyDisplayNameForURL()
*
* Summary:
* Get the display name for a CFURLRef.
*
* Discussion:
* Return a copy of the display name for a CFURLRef. Takes into
* consideration whether this item has a hidden extension or not.
*
* Parameters:
*
* inURL:
* The URL for which the display name is desired.
*
* outDisplayName:
* Pointer to the CFString into which the display name should be
* copied. Callers must dispose of the resulting CFString.
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available in CarbonLib 1.x
* Mac OS X: in version 10.1 and later
*/
EXTERN_API( OSStatus )
LSCopyDisplayNameForURL(
CFURLRef inURL,
CFStringRef * outDisplayName);
/*
* LSSetExtensionHiddenForRef()
*
* Summary:
* Sets whether the extension for an FSRef is hidden or not.
*
* Discussion:
* Sets the necessary file system state to indicate that the
* extension for inRef is hidden, as in the Finder. You can
* determine if an FSRef's extension is hidden using
* LSCopyItemInfoForRef.
*
* Parameters:
*
* inRef:
* The FSRef for which the extension is to be hidden or shown.
*
* inHide:
* True to hide inRef's extension, false to show it.
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available in CarbonLib 1.x
* Mac OS X: in version 10.1 and later
*/
EXTERN_API( OSStatus )
LSSetExtensionHiddenForRef(
const FSRef * inRef,
Boolean inHide);
/*
* LSSetExtensionHiddenForURL()
*
* Summary:
* Sets whether the extension for a CFURLRef is hidden or not.
*
* Discussion:
* Sets the necessary file system state to indicate that the
* extension for inURL is hidden, as in the Finder. You can
* determine if a CFURLRef's extension is hidden using
* LSCopyItemInfoForURL.
*
* Parameters:
*
* inURL:
* The CFURLRef for which the extension is to be hidden or shown.
*
* inHide:
* True to hide inURL's extension, false to show it.
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available in CarbonLib 1.x
* Mac OS X: in version 10.1 and later
*/
EXTERN_API( OSStatus )
LSSetExtensionHiddenForURL(
CFURLRef inURL,
Boolean inHide);
/*
* LSCopyKindStringForRef()
*
* Summary:
* Get the kind string for an item.
*
* Discussion:
* Returns the kind string as used in the Finder and elsewhere for
* inFSRef. The CFStringRef must be released after use.
*
* Parameters:
*
* inFSRef:
* The item for which the kind string is requested.
*
* outKindString:
* A CFStringRef* to receive the copied kind string object. This
* CFStringRef must be released eventually.
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available in CarbonLib 1.x
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
LSCopyKindStringForRef(
const FSRef * inFSRef,
CFStringRef * outKindString);
/*
* LSCopyKindStringForURL()
*
* Summary:
* Get the kind string for an item.
*
* Discussion:
* Returns the kind string as used in the Finder and elsewhere for
* inURL. The CFStringRef must be released after use.
*
* Parameters:
*
* inURL:
* The item for which the kind string is requested.
*
* outKindString:
* A CFStringRef* to receive the copied kind string object. This
* CFStringRef must be released eventually.
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available in CarbonLib 1.x
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
LSCopyKindStringForURL(
CFURLRef inURL,
CFStringRef * outKindString);
/*
* LSCopyKindStringForTypeInfo()
*
* Summary:
* Return the kind string for items like the provided info
*
* Discussion:
* Returns the kind string as shown in the Finder for the those
* items whose type, creator, and/or extension match the provided
* information. The kind string returned will be the one that most
* closely describes all the information provided. The kind string
* is subject to the document binding preferences that have been
* specified by the user. For example, if a creator is specified but
* the user has asked for files with the given
* creator/type/extension combination to open in an application with
* a different creator, the kind string will be loaded from the
* user's preferred application.
*
* Parameters:
*
* inType:
* The OSType file type for which you want a kind string. Specify
* kLSUnknownType if no file type information is available.
*
* inCreator:
* The OSType creator for which you want a kind string. Specify
* kLSUnknownCreator if no creator information is available.
*
* inExtension:
* The extension for which you want a kind string. Specify NULL if
* no extension information is available.
*
* outKindString:
* A CFStringRef* to receive the copied kind string object. This
* CFStringRef must be released eventually.
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available in CarbonLib 1.x
* Mac OS X: in version 10.2 and later
*/
EXTERN_API( OSStatus )
LSCopyKindStringForTypeInfo(
OSType inType,
OSType inCreator,
CFStringRef inExtension, /* can be NULL */
CFStringRef * outKindString);
/*
* LSCopyKindStringForMIMEType()
*
* Summary:
* Get the kind string for the specified MIME type.
*
* Discussion:
* Returns the localized kind string describing the specified MIME
* type.
*
* Parameters:
*
* inMIMEType:
* The string specifying the MIME type.
*
* outKindString:
* A CFStringRef* to receive the copied kind string object. This
* CFStringRef must be released eventually.
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available in CarbonLib 1.x
* Mac OS X: in version 10.2 and later
*/
EXTERN_API( OSStatus )
LSCopyKindStringForMIMEType(
CFStringRef inMIMEType,
CFStringRef * outKindString);
/*
* LSGetApplicationForItem()
*
* Summary:
* Return the application used to open an item.
*
* Discussion:
* Consults the binding tables to return the application that would
* be used to open inItemRef if it were double-clicked in the
* Finder. This application will be the user-specified override if
* appropriate or the default otherwise. If no application is known
* to LaunchServices suitable for opening this item,
* kLSApplicationNotFoundErr will be returned.
*
* Parameters:
*
* inItemRef:
* The FSRef of the item for which the application is requested.
*
* inRoleMask:
* Whether to return the editor or viewer for inItemRef. If you
* don't care which, use kLSRolesAll.
*
* outAppRef:
* Filled in with the FSRef of the application if not NULL.
*
* outAppURL:
* Filled in with the CFURLRef of the application if not NULL.
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available in CarbonLib 1.x
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
LSGetApplicationForItem(
const FSRef * inItemRef,
LSRolesMask inRoleMask,
FSRef * outAppRef, /* can be NULL */
CFURLRef * outAppURL); /* can be NULL */
/*
* LSGetApplicationForInfo()
*
* Summary:
* Return the application used to open items with particular data.
*
* Discussion:
* Consults the binding tables to return the application that would
* be used to open items with type, creator, and/or extension as
* provided if they were double-clicked in the Finder. This
* application will be the default for items like this if one has
* been set. If no application is known to LaunchServices suitable
* for opening such items, kLSApplicationNotFoundErr will be
* returned. Not all three input parameters can be NULL at the same
* time nor can both output parameters be NULL at the same time.
*
* Parameters:
*
* inType:
* The file type to consider. Can be kLSUnknownType.
*
* inCreator:
* The file creator to consider. Can be kLSUnknownCreator.
*
* inExtension:
* The file name extension to consider. Can be NULL.
*
* inRoleMask:
* Whether to return the editor or viewer for inItemRef. If you
* don't care which, use kLSRolesAll.
*
* outAppRef:
* Filled in with the FSRef of the application if not NULL.
*
* outAppURL:
* Filled in with the CFURLRef of the application if not NULL.
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available in CarbonLib 1.x
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
LSGetApplicationForInfo(
OSType inType,
OSType inCreator,
CFStringRef inExtension, /* can be NULL */
LSRolesMask inRoleMask,
FSRef * outAppRef, /* can be NULL */
CFURLRef * outAppURL); /* can be NULL */
/*
* LSCopyApplicationForMIMEType()
*
* Summary:
* Return the application used to handle data with the specified
* MIME type.
*
* Discussion:
* The returned application URL will be the user's preferred handler
* for the MIME type if one has been set. If no user preferred
* application has been set, Launch Services will select a default
* handler for the MIME type. If no application is known to handle
* the MIME type, kLSApplicationNotFoundErr will be returned.
*
* Parameters:
*
* inMIMEType:
* The string specifying the MIME type.
*
* inRoleMask:
* A role mask that the chosen application must satisfy. Use
* kLSRolesAll if the role is not important.
*
* outAppURL:
* Receives the copied CFURLRef, which must be released by the
* caller.
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available in CarbonLib 1.x
* Mac OS X: in version 10.2 and later
*/
EXTERN_API( OSStatus )
LSCopyApplicationForMIMEType(
CFStringRef inMIMEType,
LSRolesMask inRoleMask,
CFURLRef * outAppURL);
/*
* LSGetApplicationForURL()
*
* Summary:
* Return the application used to open an item.
*
* Discussion:
* Consults the binding tables to return the application that would
* be used to open inURL if it were double-clicked in the Finder.
* This application will be the user-specified override if
* appropriate or the default otherwise. If no application is known
* to LaunchServices suitable for opening this item,
* kLSApplicationNotFoundErr will be returned.
*
* Parameters:
*
* inURL:
* The CFURLRef of the item for which the application is requested.
*
* inRoleMask:
* Whether to return the editor or viewer for inItemRef. If you
* don't care which, use kLSRolesAll.
*
* outAppRef:
* Filled in with the FSRef of the application if not NULL.
*
* outAppURL:
* Filled in with the CFURLRef of the application if not NULL.
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available in CarbonLib 1.x
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
LSGetApplicationForURL(
CFURLRef inURL,
LSRolesMask inRoleMask,
FSRef * outAppRef, /* can be NULL */
CFURLRef * outAppURL); /* can be NULL */
/*
* LSFindApplicationForInfo()
*
* Summary:
* Locate a specific application.
*
* Discussion:
* Returns the application with the corresponding input information.
* The registry of applications is consulted first in order of
* bundleID, then creator, then name. All comparisons are case
* insensitive and 'ties' are decided first by version, then by
* native vs. Classic.
*
* Parameters:
*
* inCreator:
* The file creator to consider. Can be kLSUnknownCreator.
*
* inBundleID:
* The bundle ID to consider. Can be NULL.
*
* inName:
* The name to consider. Can be NULL. Must include any extensions
* that are part of the file system name, e.g. '.app'.
*
* outAppRef:
* Filled in with the FSRef of the application if not NULL.
*
* outAppURL:
* Filled in with the CFURLRef of the application if not NULL.
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available in CarbonLib 1.x
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
LSFindApplicationForInfo(
OSType inCreator,
CFStringRef inBundleID, /* can be NULL */
CFStringRef inName, /* can be NULL */
FSRef * outAppRef, /* can be NULL */
CFURLRef * outAppURL); /* can be NULL */
/*
* LSCanRefAcceptItem()
*
* Summary:
* Determine whether an item can accept another item.
*
* Discussion:
* Returns in outAcceptsItem whether inTargetRef can accept
* inItemFSRef as in a drag and drop operation. If inRoleMask is
* other than kLSRolesAll then make sure inTargetRef claims to
* fulfill the requested role.
*
* Parameters:
*
* inItemFSRef:
* FSRef of the item about which acceptance is requested.
*
* inTargetRef:
* FSRef of the potential target.
*
* inRoleMask:
* The role(s) the target must claim in order to consider
* acceptance.
*
* inFlags:
* Use kLSAcceptDefault.
*
* outAcceptsItem:
* Filled in with result. Must not be NULL.
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available in CarbonLib 1.x
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
LSCanRefAcceptItem(
const FSRef * inItemFSRef,
const FSRef * inTargetRef,
LSRolesMask inRoleMask,
LSAcceptanceFlags inFlags,
Boolean * outAcceptsItem);
/*
* LSCanURLAcceptURL()
*
* Summary:
* Determine whether an item can accept another item.
*
* Discussion:
* Returns in outAcceptsItem whether inTargetURL can accept
* inItemURL as in a drag and drop operation. If inRoleMask is other
* than kLSRolesAll then make sure inTargetRef claims to fulfill the
* requested role.
*
* Parameters:
*
* inItemURL:
* CFURLRef of the item about which acceptance is requested.
*
* inTargetURL:
* CFURLRef of the potential target.
*
* inRoleMask:
* The role(s) the target must claim in order to consider
* acceptance.
*
* inFlags:
* Use kLSAcceptDefault.
*
* outAcceptsItem:
* Filled in with result. Must not be NULL.
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available in CarbonLib 1.x
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
LSCanURLAcceptURL(
CFURLRef inItemURL,
CFURLRef inTargetURL,
LSRolesMask inRoleMask,
LSAcceptanceFlags inFlags,
Boolean * outAcceptsItem);
/*
* LSOpenFSRef()
*
* Summary:
* Open an application, document, or folder.
*
* Discussion:
* Opens applications, documents, and folders. Applications are
* opened via an 'oapp' or 'rapp' event. Documents are opened in
* their user-overridden or default applications as appropriate.
* Folders are opened in the Finder. Use the more specific
* LSOpenFromRefSpec for more control over launching.
*
* Parameters:
*
* inRef:
* The FSRef of the item to launch.
*
* outLaunchedRef:
* The FSRef of the item actually launched. For inRefs that are
* documents, outLaunchedRef will be the application used to
* launch the document. Can be NULL.
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available in CarbonLib 1.x
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
LSOpenFSRef(
const FSRef * inRef,
FSRef * outLaunchedRef); /* can be NULL */
/*
* LSOpenCFURLRef()
*
* Summary:
* Open an application, document, or folder.
*
* Discussion:
* Opens applications, documents, and folders. Applications are
* opened via an 'oapp' or 'rapp' event. Documents are opened in
* their user-overridden or default applications as appropriate.
* Folders are opened in the Finder. Use the more specific
* LSOpenFromURLSpec for more control over launching.
*
* Parameters:
*
* inURL:
* The CFURLRef of the item to launch.
*
* outLaunchedURL:
* The CFURLRef of the item actually launched. For inURLs that are
* documents, outLaunchedURL will be the application used to
* launch the document. Can be NULL.
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available in CarbonLib 1.x
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
LSOpenCFURLRef(
CFURLRef inURL,
CFURLRef * outLaunchedURL); /* can be NULL */
/*
* LSOpenFromRefSpec()
*
* Summary:
* Opens an application or one or more documents or folders.
*
* Discussion:
* Opens applications, documents, and folders.
*
* Parameters:
*
* inLaunchSpec:
* The specification of what to launch and how to launch it.
*
* outLaunchedRef:
* The FSRef of the item actually launched. For inRefs that are
* documents, outLaunchedRef will be the application used to
* launch the document. Can be NULL.
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available in CarbonLib 1.x
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
LSOpenFromRefSpec(
const LSLaunchFSRefSpec * inLaunchSpec,
FSRef * outLaunchedRef); /* can be NULL */
/*
* LSOpenFromURLSpec()
*
* Summary:
* Opens an application or one or more documents or folders.
*
* Discussion:
* Opens applications, documents, and folders.
*
* Parameters:
*
* inLaunchSpec:
* The specification of what to launch and how to launch it.
*
* outLaunchedURL:
* The CFURLRef of the item actually launched. For inURLs that are
* documents, outLaunchedURL will be the application used to
* launch the document. Can be NULL.
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available in CarbonLib 1.x
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSStatus )
LSOpenFromURLSpec(
const LSLaunchURLSpec * inLaunchSpec,
CFURLRef * outLaunchedURL); /* can be NULL */
#if PRAGMA_STRUCT_ALIGN
#pragma options align=reset
#elif PRAGMA_STRUCT_PACKPUSH
#pragma pack(pop)
#elif PRAGMA_STRUCT_PACK
#pragma pack()
#endif
#ifdef PRAGMA_IMPORT_OFF
#pragma import off
#elif PRAGMA_IMPORT
#pragma import reset
#endif
#ifdef __cplusplus
}
#endif
#endif /* __LAUNCHSERVICES__ */
|