1 {
2      File:       AE/AppleEvents.h
3 
4      Contains:   AppleEvent Package Interfaces.
5 
6 
7 
8      Copyright:  � 1989-2008 by Apple Computer, Inc., all rights reserved
9 
10      Bugs?:      For bug reports, consult the following page on
11                  the World Wide Web:
12 
13                      http://bugs.freepascal.org
14 
15 }
16 {  Pascal Translation Updated:  Jonas Maebe, <jonas@freepascal.org>, October 2009 }
17 {  Pascal Translation Updated:  Jonas Maebe, <jonas@freepascal.org>, September 2012 }
18 {
19     Modified for use with Free Pascal
20     Version 308
21     Please report any bugs to <gpc@microbizz.nl>
22 }
23 
24 {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
25 {$mode macpas}
26 {$modeswitch cblocks}
27 {$packenum 1}
28 {$macro on}
29 {$inline on}
30 {$calling mwpascal}
31 
32 unit AppleEvents;
33 interface
34 {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
35 {$setc GAP_INTERFACES_VERSION := $0308}
36 
37 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
38     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
39 {$endc}
40 
41 {$ifc defined CPUPOWERPC and defined CPUI386}
42 	{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
43 {$endc}
44 {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
45 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
46 {$endc}
47 
48 {$ifc not defined __ppc__ and defined CPUPOWERPC32}
49 	{$setc __ppc__ := 1}
50 {$elsec}
51 	{$setc __ppc__ := 0}
52 {$endc}
53 {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
54 	{$setc __ppc64__ := 1}
55 {$elsec}
56 	{$setc __ppc64__ := 0}
57 {$endc}
58 {$ifc not defined __i386__ and defined CPUI386}
59 	{$setc __i386__ := 1}
60 {$elsec}
61 	{$setc __i386__ := 0}
62 {$endc}
63 {$ifc not defined __x86_64__ and defined CPUX86_64}
64 	{$setc __x86_64__ := 1}
65 {$elsec}
66 	{$setc __x86_64__ := 0}
67 {$endc}
68 {$ifc not defined __arm__ and defined CPUARM}
69 	{$setc __arm__ := 1}
70 {$elsec}
71 	{$setc __arm__ := 0}
72 {$endc}
73 {$ifc not defined __arm64__ and defined CPUAARCH64}
74   {$setc __arm64__ := 1}
75 {$elsec}
76   {$setc __arm64__ := 0}
77 {$endc}
78 
79 {$ifc defined cpu64}
80   {$setc __LP64__ := 1}
81 {$elsec}
82   {$setc __LP64__ := 0}
83 {$endc}
84 
85 
86 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
87 	{$error Conflicting definitions for __ppc__ and __i386__}
88 {$endc}
89 
90 {$ifc defined __ppc__ and __ppc__}
91 	{$setc TARGET_CPU_PPC := TRUE}
92 	{$setc TARGET_CPU_PPC64 := FALSE}
93 	{$setc TARGET_CPU_X86 := FALSE}
94 	{$setc TARGET_CPU_X86_64 := FALSE}
95 	{$setc TARGET_CPU_ARM := FALSE}
96 	{$setc TARGET_CPU_ARM64 := FALSE}
97 	{$setc TARGET_OS_MAC := TRUE}
98 	{$setc TARGET_OS_IPHONE := FALSE}
99 	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
100 	{$setc TARGET_OS_EMBEDDED := FALSE}
101 {$elifc defined __ppc64__ and __ppc64__}
102 	{$setc TARGET_CPU_PPC := FALSE}
103 	{$setc TARGET_CPU_PPC64 := TRUE}
104 	{$setc TARGET_CPU_X86 := FALSE}
105 	{$setc TARGET_CPU_X86_64 := FALSE}
106 	{$setc TARGET_CPU_ARM := FALSE}
107 	{$setc TARGET_CPU_ARM64 := FALSE}
108 	{$setc TARGET_OS_MAC := TRUE}
109 	{$setc TARGET_OS_IPHONE := FALSE}
110 	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
111 	{$setc TARGET_OS_EMBEDDED := FALSE}
112 {$elifc defined __i386__ and __i386__}
113 	{$setc TARGET_CPU_PPC := FALSE}
114 	{$setc TARGET_CPU_PPC64 := FALSE}
115 	{$setc TARGET_CPU_X86 := TRUE}
116 	{$setc TARGET_CPU_X86_64 := FALSE}
117 	{$setc TARGET_CPU_ARM := FALSE}
118 	{$setc TARGET_CPU_ARM64 := FALSE}
119 {$ifc defined iphonesim}
120  	{$setc TARGET_OS_MAC := FALSE}
121 	{$setc TARGET_OS_IPHONE := TRUE}
122 	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
123 {$elsec}
124 	{$setc TARGET_OS_MAC := TRUE}
125 	{$setc TARGET_OS_IPHONE := FALSE}
126 	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
127 {$endc}
128 	{$setc TARGET_OS_EMBEDDED := FALSE}
129 {$elifc defined __x86_64__ and __x86_64__}
130 	{$setc TARGET_CPU_PPC := FALSE}
131 	{$setc TARGET_CPU_PPC64 := FALSE}
132 	{$setc TARGET_CPU_X86 := FALSE}
133 	{$setc TARGET_CPU_X86_64 := TRUE}
134 	{$setc TARGET_CPU_ARM := FALSE}
135 	{$setc TARGET_CPU_ARM64 := FALSE}
136 {$ifc defined iphonesim}
137  	{$setc TARGET_OS_MAC := FALSE}
138 	{$setc TARGET_OS_IPHONE := TRUE}
139 	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
140 {$elsec}
141 	{$setc TARGET_OS_MAC := TRUE}
142 	{$setc TARGET_OS_IPHONE := FALSE}
143 	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
144 {$endc}
145 	{$setc TARGET_OS_EMBEDDED := FALSE}
146 {$elifc defined __arm__ and __arm__}
147 	{$setc TARGET_CPU_PPC := FALSE}
148 	{$setc TARGET_CPU_PPC64 := FALSE}
149 	{$setc TARGET_CPU_X86 := FALSE}
150 	{$setc TARGET_CPU_X86_64 := FALSE}
151 	{$setc TARGET_CPU_ARM := TRUE}
152 	{$setc TARGET_CPU_ARM64 := FALSE}
153 	{$setc TARGET_OS_MAC := FALSE}
154 	{$setc TARGET_OS_IPHONE := TRUE}
155 	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
156 	{$setc TARGET_OS_EMBEDDED := TRUE}
157 {$elifc defined __arm64__ and __arm64__}
158 	{$setc TARGET_CPU_PPC := FALSE}
159 	{$setc TARGET_CPU_PPC64 := FALSE}
160 	{$setc TARGET_CPU_X86 := FALSE}
161 	{$setc TARGET_CPU_X86_64 := FALSE}
162 	{$setc TARGET_CPU_ARM := FALSE}
163 	{$setc TARGET_CPU_ARM64 := TRUE}
164 {$ifc defined ios}
165 	{$setc TARGET_OS_MAC := FALSE}
166 	{$setc TARGET_OS_IPHONE := TRUE}
167 	{$setc TARGET_OS_EMBEDDED := TRUE}
168 {$elsec}
169 	{$setc TARGET_OS_MAC := TRUE}
170 	{$setc TARGET_OS_IPHONE := FALSE}
171 	{$setc TARGET_OS_EMBEDDED := FALSE}
172 {$endc}
173 	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
174 {$elsec}
175 	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
176 {$endc}
177 
178 {$ifc defined __LP64__ and __LP64__ }
179   {$setc TARGET_CPU_64 := TRUE}
180 {$elsec}
181   {$setc TARGET_CPU_64 := FALSE}
182 {$endc}
183 
184 {$ifc defined FPC_BIG_ENDIAN}
185 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
186 	{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
187 {$elifc defined FPC_LITTLE_ENDIAN}
188 	{$setc TARGET_RT_BIG_ENDIAN := FALSE}
189 	{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
190 {$elsec}
191 	{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
192 {$endc}
193 {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
194 {$setc CALL_NOT_IN_CARBON := FALSE}
195 {$setc OLDROUTINENAMES := FALSE}
196 {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
197 {$setc OPAQUE_UPP_TYPES := TRUE}
198 {$setc OTCARBONAPPLICATION := TRUE}
199 {$setc OTKERNEL := FALSE}
200 {$setc PM_USE_SESSION_APIS := TRUE}
201 {$setc TARGET_API_MAC_CARBON := TRUE}
202 {$setc TARGET_API_MAC_OS8 := FALSE}
203 {$setc TARGET_API_MAC_OSX := TRUE}
204 {$setc TARGET_CARBON := TRUE}
205 {$setc TARGET_CPU_68K := FALSE}
206 {$setc TARGET_CPU_MIPS := FALSE}
207 {$setc TARGET_CPU_SPARC := FALSE}
208 {$setc TARGET_OS_UNIX := FALSE}
209 {$setc TARGET_OS_WIN32 := FALSE}
210 {$setc TARGET_RT_MAC_68881 := FALSE}
211 {$setc TARGET_RT_MAC_CFM := FALSE}
212 {$setc TARGET_RT_MAC_MACHO := TRUE}
213 {$setc TYPED_FUNCTION_POINTERS := TRUE}
214 {$setc TYPE_BOOL := FALSE}
215 {$setc TYPE_EXTENDED := FALSE}
216 {$setc TYPE_LONGLONG := TRUE}
217 uses MacTypes,MixedMode,AEDataModel,AEInteraction, CFArray, CFBase, CFRunLoop, CFStream, CFURL;
218 {$endc} {not MACOSALLINCLUDE}
219 
220 
221 {$ifc TARGET_OS_MAC}
222 
223 {
224     Note:   The functions and types for the building and parsing AppleEvent
225             messages has moved to AEDataModel.h
226 }
227 
228 
229 {$ALIGN MAC68K}
230 
231 const
232 { Keywords for Apple event parameters }
233 	keyDirectObject = FourCharCode('----');
234 	keyErrorNumber = FourCharCode('errn');
235 	keyErrorString = FourCharCode('errs');
236 	keyProcessSerialNumber = FourCharCode('psn '); { Keywords for special handlers }
237 	keyPreDispatch = FourCharCode('phac'); { preHandler accessor call }
238 	keySelectProc = FourCharCode('selh'); { more selector call }
239                                         { Keyword for recording }
240 	keyAERecorderCount = FourCharCode('recr'); { available only in vers 1.0.1 and greater }
241                                         { Keyword for version information }
242 	keyAEVersion = FourCharCode('vers'); { available only in vers 1.0.1 and greater }
243 
244 { Event Class }
245 const
246 	kCoreEventClass = FourCharCode('aevt');
247 
248 { Event ID's }
249 const
250 	kAEOpenApplication = FourCharCode('oapp');
251 	kAEOpenDocuments = FourCharCode('odoc');
252 	kAEPrintDocuments = FourCharCode('pdoc');
253 	kAEOpenContents = FourCharCode('ocon');
254 	kAEQuitApplication = FourCharCode('quit'); { may include a property kAEQuitReason indicating what lead to the quit being sent. }
255 	kAEAnswer = FourCharCode('ansr');
256 	kAEApplicationDied = FourCharCode('obit');
257 	kAEShowPreferences = FourCharCode('pref'); { sent by Mac OS X when the user chooses the Preferences item }
258 
259 { Constants for recording }
260 const
261 	kAEStartRecording = FourCharCode('reca'); { available only in vers 1.0.1 and greater }
262 	kAEStopRecording = FourCharCode('recc'); { available only in vers 1.0.1 and greater }
263 	kAENotifyStartRecording = FourCharCode('rec1'); { available only in vers 1.0.1 and greater }
264 	kAENotifyStopRecording = FourCharCode('rec0'); { available only in vers 1.0.1 and greater }
265 	kAENotifyRecording = FourCharCode('recr'); { available only in vers 1.0.1 and greater }
266 
267 
268 {
269  * AEEventSource is defined as an SInt8 for compatability with pascal.
270  * Important note: keyEventSourceAttr is returned by AttributePtr as a typeShortInteger.
271  * Be sure to pass at least two bytes of storage to AEGetAttributePtr - the result can be
272  * compared directly against the following enums.
273  }
274 type
275 	AEEventSource = SInt8;
276 const
277 	kAEUnknownSource = 0;
278 	kAEDirectCall = 1;
279 	kAESameProcess = 2;
280 	kAELocalProcess = 3;
281 	kAERemoteProcess = 4;
282 
283 
284 { if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 }
285 const
286 	errAETargetAddressNotPermitted = -1742;	{ Mac OS X 10.8 and later, the target of an AppleEvent is not accessible to this process, perhaps due to sandboxing }
287 	errAEEventNotPermitted = -1743;			{ Mac OS X 10.8 and later, the target of the AppleEvent does not allow this sender to execute this event }
288 { endif }
289 
290 
291 {*************************************************************************
292   These calls are used to set up and modify the event dispatch table.
293 *************************************************************************}
294 {
295  *  AEInstallEventHandler()
296  *
297  *  Mac OS X threading:
298  *    Thread safe since version 10.2
299  *
300  *  Availability:
301  *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
302  *    CarbonLib:        in CarbonLib 1.0 and later
303  *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
304  }
AEInstallEventHandlernull305 function AEInstallEventHandler( theAEEventClass: AEEventClass; theAEEventID: AEEventID; handler: AEEventHandlerUPP; handlerRefcon: SRefCon; isSysHandler: Boolean ): OSErr; external name '_AEInstallEventHandler';
306 (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
307 
308 
309 {
310  *  AERemoveEventHandler()
311  *
312  *  Mac OS X threading:
313  *    Thread safe since version 10.2
314  *
315  *  Availability:
316  *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
317  *    CarbonLib:        in CarbonLib 1.0 and later
318  *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
319  }
AERemoveEventHandlernull320 function AERemoveEventHandler( theAEEventClass: AEEventClass; theAEEventID: AEEventID; handler: AEEventHandlerUPP; isSysHandler: Boolean ): OSErr; external name '_AERemoveEventHandler';
321 (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
322 
323 
324 {
325  *  AEGetEventHandler()
326  *
327  *  Mac OS X threading:
328  *    Thread safe since version 10.2
329  *
330  *  Availability:
331  *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
332  *    CarbonLib:        in CarbonLib 1.0 and later
333  *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
334  }
AEGetEventHandlernull335 function AEGetEventHandler( theAEEventClass: AEEventClass; theAEEventID: AEEventID; var handler: AEEventHandlerUPP; var handlerRefcon: SRefCon; isSysHandler: Boolean ): OSErr; external name '_AEGetEventHandler';
336 (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
337 
338 
339 {*************************************************************************
340   These calls are used to set up and modify special hooks into the
341   AppleEvent manager.
342 *************************************************************************}
343 {
344  *  AEInstallSpecialHandler()
345  *
346  *  Mac OS X threading:
347  *    Thread safe since version 10.2
348  *
349  *  Availability:
350  *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
351  *    CarbonLib:        in CarbonLib 1.0 and later
352  *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
353  }
AEInstallSpecialHandlernull354 function AEInstallSpecialHandler( functionClass: AEKeyword; handler: AEEventHandlerUPP; isSysHandler: Boolean ): OSErr; external name '_AEInstallSpecialHandler';
355 (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
356 
357 
358 {
359  *  AERemoveSpecialHandler()
360  *
361  *  Mac OS X threading:
362  *    Thread safe since version 10.2
363  *
364  *  Availability:
365  *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
366  *    CarbonLib:        in CarbonLib 1.0 and later
367  *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
368  }
AERemoveSpecialHandlernull369 function AERemoveSpecialHandler( functionClass: AEKeyword; handler: AEEventHandlerUPP; isSysHandler: Boolean ): OSErr; external name '_AERemoveSpecialHandler';
370 (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
371 
372 
373 {
374  *  AEGetSpecialHandler()
375  *
376  *  Mac OS X threading:
377  *    Thread safe since version 10.2
378  *
379  *  Availability:
380  *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
381  *    CarbonLib:        in CarbonLib 1.0 and later
382  *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
383  }
AEGetSpecialHandlernull384 function AEGetSpecialHandler( functionClass: AEKeyword; var handler: AEEventHandlerUPP; isSysHandler: Boolean ): OSErr; external name '_AEGetSpecialHandler';
385 (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
386 
387 
388 {*************************************************************************
389   This call was added in version 1.0.1. If called with the keyword
390   keyAERecorderCount ('recr'), the number of recorders that are
391   currently active is returned in 'result'
392   (available only in vers 1.0.1 and greater).
393 *************************************************************************}
394 {
395  *  AEManagerInfo()
396  *
397  *  Mac OS X threading:
398  *    Thread safe since version 10.2
399  *
400  *  Availability:
401  *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
402  *    CarbonLib:        in CarbonLib 1.0 and later
403  *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
404  }
AEManagerInfonull405 function AEManagerInfo( keyWord: AEKeyword; var result: SIGNEDLONG ): OSErr; external name '_AEManagerInfo';
406 (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
407 
408 
409 {
410   AERemoteProcessResolver:
411 
412   These calls subsume the functionality of using the PPCToolbox on Mac
413   OS 9 to locate processes on remote computers.  (PPCToolbox is not
414   part of Carbon.)  These calls are supported on Mac OS X 10.3 or
415   later.
416 
417   The model is to create a resolver for a particular URL and schedule
418   it on a CFRunLoop to retrieve the results asynchronously.  If
419   synchronous behavior is desired, just call
420   AERemoteProcessResolverGetProcesses to get the array; the call will
421   block until the request is completed.
422 
423   A resolver can only be used once; once it has fetched the data or
424   gotten an error it can no longer be scheduled.
425 
426   The data obtained from the resolver is a CFArrayRef of
427   CFDictionaryRef objects.  Each dictionary contains the URL of the
428   remote application and its human readable name.
429 }
430 
431 {
432  *  kAERemoteProcessURLKey
433  *
434  *  Discussion:
435  *    the full URL to this application, a CFURLRef.
436  *
437  *  Availability:
438  *    Mac OS X:         in version 10.3 and later in ApplicationServices.framework
439  *    CarbonLib:        not available
440  *    Non-Carbon CFM:   not available
441  }
442 var kAERemoteProcessURLKey: CFStringRef; external name '_kAERemoteProcessURLKey'; (* attribute const *)
443 (* __OSX_AVAILABLE_STARTING( __MAC_10_3, __IPHONE_NA ) *)
444 {
445  *  kAERemoteProcessNameKey
446  *
447  *  Discussion:
448  *    the visible name to this application, in the localization
449  *    supplied by the server, a CFStringRef.
450  *
451  *  Availability:
452  *    Mac OS X:         in version 10.3 and later in ApplicationServices.framework
453  *    CarbonLib:        not available
454  *    Non-Carbon CFM:   not available
455  }
456 var kAERemoteProcessNameKey: CFStringRef; external name '_kAERemoteProcessNameKey'; (* attribute const *)
457 (* __OSX_AVAILABLE_STARTING( __MAC_10_3, __IPHONE_NA ) *)
458 {
459  *  kAERemoteProcessUserIDKey
460  *
461  *  Discussion:
462  *    the userid of this application, if available.  If present, a
463  *    CFNumberRef.
464  *
465  *  Availability:
466  *    Mac OS X:         in version 10.3 and later in ApplicationServices.framework
467  *    CarbonLib:        not available
468  *    Non-Carbon CFM:   not available
469  }
470 var kAERemoteProcessUserIDKey: CFStringRef; external name '_kAERemoteProcessUserIDKey'; (* attribute const *)
471 (* __OSX_AVAILABLE_STARTING( __MAC_10_3, __IPHONE_NA ) *)
472 {
473  *  kAERemoteProcessProcessIDKey
474  *
475  *  Discussion:
476  *    the process id of this application, if available.  If present, a
477  *    CFNumberRef.
478  *
479  *  Availability:
480  *    Mac OS X:         in version 10.3 and later in ApplicationServices.framework
481  *    CarbonLib:        not available
482  *    Non-Carbon CFM:   not available
483  }
484 var kAERemoteProcessProcessIDKey: CFStringRef; external name '_kAERemoteProcessProcessIDKey'; (* attribute const *)
485 (* __OSX_AVAILABLE_STARTING( __MAC_10_3, __IPHONE_NA ) *)
486 
487 {
488  *  AERemoteProcessResolverContext
489  *
490  *  Discussion:
491  *    An optional context parameter for asynchronous resolution.  The
492  *    context is copied and the info pointer retained.  When the
493  *    callback is made, the info pointer is passed to the callback.
494  }
495 type
496 	AERemoteProcessResolverContextPtr = ^AERemoteProcessResolverContext;
497 	AERemoteProcessResolverContext = record
498 {
499    * set to zero (0)
500    }
501 		version: CFIndex;
502 
503   {
504    * info pointer to be passed to the callback
505    }
506 		info: UnivPtr;
507 
508   {
509    * callback made on the info pointer. This field may be NULL.
510    }
511 		retain: CFAllocatorRetainCallBack;
512 
513   {
514    * callback made on the info pointer. This field may be NULL.
515    }
516 		release: CFAllocatorReleaseCallBack;
517 
518   {
519    * callback made on the info pointer. This field may be NULL.
520    }
521 		copyDescription: CFAllocatorCopyDescriptionCallBack;
522 	end;
523 
524 {
525  *  AERemoteProcessResolverRef
526  *
527  *  Discussion:
528  *    An opaque reference to an object that encapsulates the mechnanism
529  *    by which a list of processes running on a remote machine are
530  *    obtained.  Created by AECreateRemoteProcessResolver, and must be
531  *    disposed of by AEDisposeRemoteProcessResolver. A
532  *    AERemoteProcessResolverRef is not a CFType.
533  }
534 type
535 	AERemoteProcessResolverRef = ^SInt32; { an opaque type }
536 {
537  *  AECreateRemoteProcessResolver()
538  *
539  *  Discussion:
540  *    Create a Remote Process List Resolver object.  The allocator is
541  *    used for any CoreFoundation types created or returned by this
542  *    API.  The resulting object can be scheduled on a run loop, or
543  *    queried synchronously.  Once the object has retreived results
544  *    from the server, or got an error doing so, it will not re-fetch
545  *    the data.  To retrieve a new list of processes, create a new
546  *    instance of this object.
547  *
548  *  Mac OS X threading:
549  *    Thread safe since version 10.3
550  *
551  *  Parameters:
552  *
553  *    allocator:
554  *      a CFAllocatorRef to use when creating CFTypes
555  *
556  *    url:
557  *      a CFURL identifying the remote host and port.
558  *
559  *  Result:
560  *    a AECreateRemoteProcessResolverRef, which must be disposed of
561  *    with AEDisposeRemoteProcessResolver.
562  *
563  *  Availability:
564  *    Mac OS X:         in version 10.3 and later in ApplicationServices.framework
565  *    CarbonLib:        not available
566  *    Non-Carbon CFM:   not available
567  }
AECreateRemoteProcessResolvernull568 function AECreateRemoteProcessResolver( allocator: CFAllocatorRef; url: CFURLRef ): AERemoteProcessResolverRef; external name '_AECreateRemoteProcessResolver';
569 (* __OSX_AVAILABLE_STARTING( __MAC_10_3, __IPHONE_NA ) *)
570 
571 
572 {
573  *  AEDisposeRemoteProcessResolver()
574  *
575  *  Discussion:
576  *    Disposes of a AERemoteProcessResolverRef.  If this resolver is
577  *    currently scheduled on a run loop, it is unscheduled.  In this
578  *    case, the asynchronous callback will not be executed.
579  *
580  *  Mac OS X threading:
581  *    Thread safe since version 10.3
582  *
583  *  Parameters:
584  *
585  *    ref:
586  *      The AERemoteProcessResolverRef to dispose
587  *
588  *  Availability:
589  *    Mac OS X:         in version 10.3 and later in ApplicationServices.framework
590  *    CarbonLib:        not available
591  *    Non-Carbon CFM:   not available
592  }
593 procedure AEDisposeRemoteProcessResolver( ref: AERemoteProcessResolverRef ); external name '_AEDisposeRemoteProcessResolver';
594 (* __OSX_AVAILABLE_STARTING( __MAC_10_3, __IPHONE_NA ) *)
595 
596 
597 {
598  *  AERemoteProcessResolverGetProcesses()
599  *
600  *  Discussion:
601  *    Returns a CFArrayRef containing CFDictionary objects containing
602  *    information about processses running on a remote machine.  If the
603  *    result array is NULL, the query failed and the error out
604  *    parameter will contain information about the failure.  If the
605  *    resolver had not been previously scheduled for execution, this
606  *    call will block until the resulting array is available or an
607  *    error occurs.  If the resolver had been scheduled but had not yet
608  *    completed fetching the array, this call will block until the
609  *    resolver does complete.  The array returned is owned by the
610  *    resolver, so callers must retain it before disposing of the
611  *    resolver object itself.
612  *
613  *  Mac OS X threading:
614  *    Thread safe since version 10.3
615  *
616  *  Parameters:
617  *
618  *    ref:
619  *      The AERemoteProcessResolverRef to query
620  *
621  *    outError:
622  *      If the result is NULL, outError will contain a CFStreamError
623  *      with information about the type of failure
624  *
625  *  Result:
626  *    a CFArray of CFDictionary objects containing information about
627  *    the remote applications.
628  *
629  *  Availability:
630  *    Mac OS X:         in version 10.3 and later in ApplicationServices.framework
631  *    CarbonLib:        not available
632  *    Non-Carbon CFM:   not available
633  }
AERemoteProcessResolverGetProcessesnull634 function AERemoteProcessResolverGetProcesses( ref: AERemoteProcessResolverRef; var outError: CFStreamError ): CFArrayRef; external name '_AERemoteProcessResolverGetProcesses';
635 (* __OSX_AVAILABLE_STARTING( __MAC_10_3, __IPHONE_NA ) *)
636 
637 
638 {
639  *  AERemoteProcessResolverCallback
640  *
641  *  Discussion:
642  *    A callback made when the asynchronous execution of a resolver
643  *    completes, either due to success or failure. The data itself
644  *    should be obtained with AERemoteProcessResolverGetProcesses.
645  }
646 type
647 	AERemoteProcessResolverCallback = procedure( ref: AERemoteProcessResolverRef; info: UnivPtr );
648 {
649  *  AERemoteProcessResolverScheduleWithRunLoop()
650  *
651  *  Discussion:
652  *    Schedules a resolver for execution on a given runloop in a given
653  *    mode.   The resolver will move through various internal states as
654  *    long as the specified run loop is run.  When the resolver
655  *    completes, either with success or an error condition, the
656  *    callback is executed.  There is no explicit unschedule of the
657  *    resolver; you must dispose of it to remove it from the run loop.
658  *
659  *  Mac OS X threading:
660  *    Thread safe since version 10.3
661  *
662  *  Parameters:
663  *
664  *    ref:
665  *      The AERemoteProcessResolverRef to scheduile
666  *
667  *    runLoop:
668  *      a CFRunLoop
669  *
670  *    runLoopMode:
671  *      a CFString specifying the run loop mode
672  *
673  *    callback:
674  *      a callback to be executed when the reolver completes
675  *
676  *    ctx:
677  *      a AERemoteProcessResolverContext.  If this parameter is not
678  *      NULL, the info field of this structure will be passed to the
679  *      callback (otherwise, the callback info parameter will
680  *      explicitly be NULL.)
681  *
682  *  Availability:
683  *    Mac OS X:         in version 10.3 and later in ApplicationServices.framework
684  *    CarbonLib:        not available
685  *    Non-Carbon CFM:   not available
686  }
687 procedure AERemoteProcessResolverScheduleWithRunLoop( ref: AERemoteProcessResolverRef; runLoop: CFRunLoopRef; runLoopMode: CFStringRef; callback: AERemoteProcessResolverCallback; {const} ctx: AERemoteProcessResolverContextPtr { can be NULL } ); external name '_AERemoteProcessResolverScheduleWithRunLoop';
688 (* __OSX_AVAILABLE_STARTING( __MAC_10_3, __IPHONE_NA ) *)
689 
690 
691 
692 {$endc} {TARGET_OS_MAC}
693 {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
694 
695 end.
696 {$endc} {not MACOSALLINCLUDE}
697