CSIdentityQuery.pas 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718
  1. {
  2. File: OSServices/CSIdentityQuery.h
  3. Contains: Identity Query APIs
  4. Copyright: (c) 2006-2011 Apple Inc. All rights reserved.
  5. Bugs?: For bug reports, consult the following page on
  6. the World Wide Web:
  7. http://bugs.freepascal.org
  8. }
  9. { Pascal Translation: Jonas Maebe, <[email protected]>, October 2009 }
  10. { Pascal Translation Updated: Jonas Maebe <[email protected]>, September 2012 }
  11. {
  12. Modified for use with Free Pascal
  13. Version 308
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  17. {$mode macpas}
  18. {$packenum 1}
  19. {$macro on}
  20. {$inline on}
  21. {$calling mwpascal}
  22. unit CSIdentityQuery;
  23. interface
  24. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  25. {$setc GAP_INTERFACES_VERSION := $0308}
  26. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  27. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  28. {$endc}
  29. {$ifc defined CPUPOWERPC and defined CPUI386}
  30. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  31. {$endc}
  32. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  33. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  34. {$endc}
  35. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  36. {$setc __ppc__ := 1}
  37. {$elsec}
  38. {$setc __ppc__ := 0}
  39. {$endc}
  40. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  41. {$setc __ppc64__ := 1}
  42. {$elsec}
  43. {$setc __ppc64__ := 0}
  44. {$endc}
  45. {$ifc not defined __i386__ and defined CPUI386}
  46. {$setc __i386__ := 1}
  47. {$elsec}
  48. {$setc __i386__ := 0}
  49. {$endc}
  50. {$ifc not defined __x86_64__ and defined CPUX86_64}
  51. {$setc __x86_64__ := 1}
  52. {$elsec}
  53. {$setc __x86_64__ := 0}
  54. {$endc}
  55. {$ifc not defined __arm__ and defined CPUARM}
  56. {$setc __arm__ := 1}
  57. {$elsec}
  58. {$setc __arm__ := 0}
  59. {$endc}
  60. {$ifc not defined __arm64__ and defined CPUAARCH64}
  61. {$setc __arm64__ := 1}
  62. {$elsec}
  63. {$setc __arm64__ := 0}
  64. {$endc}
  65. {$ifc defined cpu64}
  66. {$setc __LP64__ := 1}
  67. {$elsec}
  68. {$setc __LP64__ := 0}
  69. {$endc}
  70. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  71. {$error Conflicting definitions for __ppc__ and __i386__}
  72. {$endc}
  73. {$ifc defined __ppc__ and __ppc__}
  74. {$setc TARGET_CPU_PPC := TRUE}
  75. {$setc TARGET_CPU_PPC64 := FALSE}
  76. {$setc TARGET_CPU_X86 := FALSE}
  77. {$setc TARGET_CPU_X86_64 := FALSE}
  78. {$setc TARGET_CPU_ARM := FALSE}
  79. {$setc TARGET_CPU_ARM64 := FALSE}
  80. {$setc TARGET_OS_MAC := TRUE}
  81. {$setc TARGET_OS_IPHONE := FALSE}
  82. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  83. {$setc TARGET_OS_EMBEDDED := FALSE}
  84. {$elifc defined __ppc64__ and __ppc64__}
  85. {$setc TARGET_CPU_PPC := FALSE}
  86. {$setc TARGET_CPU_PPC64 := TRUE}
  87. {$setc TARGET_CPU_X86 := FALSE}
  88. {$setc TARGET_CPU_X86_64 := FALSE}
  89. {$setc TARGET_CPU_ARM := FALSE}
  90. {$setc TARGET_CPU_ARM64 := FALSE}
  91. {$setc TARGET_OS_MAC := TRUE}
  92. {$setc TARGET_OS_IPHONE := FALSE}
  93. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  94. {$setc TARGET_OS_EMBEDDED := FALSE}
  95. {$elifc defined __i386__ and __i386__}
  96. {$setc TARGET_CPU_PPC := FALSE}
  97. {$setc TARGET_CPU_PPC64 := FALSE}
  98. {$setc TARGET_CPU_X86 := TRUE}
  99. {$setc TARGET_CPU_X86_64 := FALSE}
  100. {$setc TARGET_CPU_ARM := FALSE}
  101. {$setc TARGET_CPU_ARM64 := FALSE}
  102. {$ifc defined(iphonesim)}
  103. {$setc TARGET_OS_MAC := FALSE}
  104. {$setc TARGET_OS_IPHONE := TRUE}
  105. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  106. {$elsec}
  107. {$setc TARGET_OS_MAC := TRUE}
  108. {$setc TARGET_OS_IPHONE := FALSE}
  109. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  110. {$endc}
  111. {$setc TARGET_OS_EMBEDDED := FALSE}
  112. {$elifc defined __x86_64__ and __x86_64__}
  113. {$setc TARGET_CPU_PPC := FALSE}
  114. {$setc TARGET_CPU_PPC64 := FALSE}
  115. {$setc TARGET_CPU_X86 := FALSE}
  116. {$setc TARGET_CPU_X86_64 := TRUE}
  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 __arm__ and __arm__}
  130. {$setc TARGET_CPU_PPC := FALSE}
  131. {$setc TARGET_CPU_PPC64 := FALSE}
  132. {$setc TARGET_CPU_X86 := FALSE}
  133. {$setc TARGET_CPU_X86_64 := FALSE}
  134. {$setc TARGET_CPU_ARM := TRUE}
  135. {$setc TARGET_CPU_ARM64 := FALSE}
  136. { will require compiler define when/if other Apple devices with ARM cpus ship }
  137. {$setc TARGET_OS_MAC := FALSE}
  138. {$setc TARGET_OS_IPHONE := TRUE}
  139. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  140. {$setc TARGET_OS_EMBEDDED := TRUE}
  141. {$elifc defined __arm64__ and __arm64__}
  142. {$setc TARGET_CPU_PPC := FALSE}
  143. {$setc TARGET_CPU_PPC64 := FALSE}
  144. {$setc TARGET_CPU_X86 := FALSE}
  145. {$setc TARGET_CPU_X86_64 := FALSE}
  146. {$setc TARGET_CPU_ARM := FALSE}
  147. {$setc TARGET_CPU_ARM64 := TRUE}
  148. { will require compiler define when/if other Apple devices with ARM cpus ship }
  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. {$elsec}
  154. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  155. {$endc}
  156. {$ifc defined __LP64__ and __LP64__ }
  157. {$setc TARGET_CPU_64 := TRUE}
  158. {$elsec}
  159. {$setc TARGET_CPU_64 := FALSE}
  160. {$endc}
  161. {$ifc defined FPC_BIG_ENDIAN}
  162. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  163. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  164. {$elifc defined FPC_LITTLE_ENDIAN}
  165. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  166. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  167. {$elsec}
  168. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  169. {$endc}
  170. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  171. {$setc CALL_NOT_IN_CARBON := FALSE}
  172. {$setc OLDROUTINENAMES := FALSE}
  173. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  174. {$setc OPAQUE_UPP_TYPES := TRUE}
  175. {$setc OTCARBONAPPLICATION := TRUE}
  176. {$setc OTKERNEL := FALSE}
  177. {$setc PM_USE_SESSION_APIS := TRUE}
  178. {$setc TARGET_API_MAC_CARBON := TRUE}
  179. {$setc TARGET_API_MAC_OS8 := FALSE}
  180. {$setc TARGET_API_MAC_OSX := TRUE}
  181. {$setc TARGET_CARBON := TRUE}
  182. {$setc TARGET_CPU_68K := FALSE}
  183. {$setc TARGET_CPU_MIPS := FALSE}
  184. {$setc TARGET_CPU_SPARC := FALSE}
  185. {$setc TARGET_OS_UNIX := FALSE}
  186. {$setc TARGET_OS_WIN32 := FALSE}
  187. {$setc TARGET_RT_MAC_68881 := FALSE}
  188. {$setc TARGET_RT_MAC_CFM := FALSE}
  189. {$setc TARGET_RT_MAC_MACHO := TRUE}
  190. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  191. {$setc TYPE_BOOL := FALSE}
  192. {$setc TYPE_EXTENDED := FALSE}
  193. {$setc TYPE_LONGLONG := TRUE}
  194. uses MacTypes,MacOSXPosix,CSIdentity,CSIdentityAuthority,CFBase,CFArray,CFData,CFError,CFRunLoop,CFUUID;
  195. {$endc} {not MACOSALLINCLUDE}
  196. {$ALIGN MAC68K}
  197. {
  198. * CSIdentityQueryGetTypeID()
  199. *
  200. * Summary:
  201. * Retrieve the CFTypeID of the CSIdentityQuery class
  202. *
  203. * Mac OS X threading:
  204. * Thread safe since version 10.5
  205. *
  206. * Availability:
  207. * Mac OS X: in version 10.5 and later in CoreServices.framework
  208. * CarbonLib: not available
  209. * Non-Carbon CFM: not available
  210. }
  211. function CSIdentityQueryGetTypeID: CFTypeID; external name '_CSIdentityQueryGetTypeID';
  212. (* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_5_0) *)
  213. {
  214. * CSIdentityQueryFlags
  215. *
  216. * Summary:
  217. * Execution options for an identity query
  218. *
  219. * Discussion:
  220. * A bit mask for setting execution options on a query
  221. }
  222. const
  223. {
  224. * After the intial query phase is complete, monitor the result set
  225. * for live updates
  226. }
  227. kCSIdentityQueryGenerateUpdateEvents = $0001;
  228. {
  229. * Include all matching identities in the result set, including
  230. * hidden "system" users and groups (root, www, etc.)
  231. }
  232. kCSIdentityQueryIncludeHiddenIdentities = $0002;
  233. type
  234. CSIdentityQueryFlags = CFOptionFlags;
  235. {
  236. * CSIdentityQueryStringComparisonMethod
  237. *
  238. * Summary:
  239. * Options for querying the database by name
  240. *
  241. * Discussion:
  242. * When searching for identities by name, this value specifies the
  243. * string comparison function
  244. }
  245. const
  246. {
  247. * The identity name must equal the search string
  248. }
  249. kCSIdentityQueryStringEquals = 1;
  250. {
  251. * The identity name must begin with the search string
  252. }
  253. kCSIdentityQueryStringBeginsWith = 2;
  254. type
  255. CSIdentityQueryStringComparisonMethod = CFIndex;
  256. {$ifc not TARGET_OS_IPHONE and not TARGET_IPHONE_SIMULATOR}
  257. {
  258. * CSIdentityQueryCreate()
  259. *
  260. * Summary:
  261. * Creates an identity query object for all identities in the
  262. * specified authority
  263. *
  264. * Discussion:
  265. * The results of this query include all of the identities in the
  266. * specified authority's database.
  267. *
  268. * Mac OS X threading:
  269. * Thread safe since version 10.5
  270. *
  271. * Parameters:
  272. *
  273. * allocator:
  274. * The allocator to use for this instance
  275. *
  276. * identityClass:
  277. * The class of identity to find
  278. *
  279. * authority:
  280. * The identity authority to query
  281. *
  282. * Result:
  283. * A new CSIdentityQuery object
  284. *
  285. * Availability:
  286. * Mac OS X: in version 10.5 and later in CoreServices.framework
  287. * CarbonLib: not available
  288. * Non-Carbon CFM: not available
  289. }
  290. function CSIdentityQueryCreate( allocator: CFAllocatorRef; identityClass: CSIdentityClass; authority: CSIdentityAuthorityRef ): CSIdentityQueryRef; external name '_CSIdentityQueryCreate';
  291. (* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA) *)
  292. {$endc} {!TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR}
  293. {
  294. * CSIdentityQueryCreateForName()
  295. *
  296. * Summary:
  297. * Creates an identity query object based on a name
  298. *
  299. * Discussion:
  300. * The query finds identities by name. It searches the full names,
  301. * posix names and aliases for matches.
  302. *
  303. * Mac OS X threading:
  304. * Thread safe since version 10.5
  305. *
  306. * Parameters:
  307. *
  308. * allocator:
  309. * The allocator to use for this instance
  310. *
  311. * name:
  312. * The name criteria for the query.
  313. *
  314. * comparisonMethod:
  315. * The comparision function (equal or begins with)
  316. *
  317. * identityClass:
  318. * The class of identity to find
  319. *
  320. * authority:
  321. * The identity authority to query
  322. *
  323. * Result:
  324. * A new CSIdentityQuery object
  325. *
  326. * Availability:
  327. * Mac OS X: in version 10.5 and later in CoreServices.framework
  328. * CarbonLib: not available
  329. * Non-Carbon CFM: not available
  330. }
  331. function CSIdentityQueryCreateForName( allocator: CFAllocatorRef; name: CFStringRef; comparisonMethod: CSIdentityQueryStringComparisonMethod; identityClass: CSIdentityClass; authority: CSIdentityAuthorityRef ): CSIdentityQueryRef; external name '_CSIdentityQueryCreateForName';
  332. (* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_5_0) *)
  333. {$ifc not TARGET_OS_IPHONE and not TARGET_IPHONE_SIMULATOR}
  334. {
  335. * CSIdentityQueryCreateForUUID()
  336. *
  337. * Summary:
  338. * Creates an identity query object based on a UUID
  339. *
  340. * Discussion:
  341. * Finds an identity by its UUID
  342. *
  343. * Mac OS X threading:
  344. * Thread safe since version 10.5
  345. *
  346. * Parameters:
  347. *
  348. * allocator:
  349. * The allocator to use for this instance
  350. *
  351. * uuid:
  352. * The UUID of the identity to find
  353. *
  354. * authority:
  355. * The identity authority to query
  356. *
  357. * Result:
  358. * A new CSIdentityQuery object
  359. *
  360. * Availability:
  361. * Mac OS X: in version 10.5 and later in CoreServices.framework
  362. * CarbonLib: not available
  363. * Non-Carbon CFM: not available
  364. }
  365. function CSIdentityQueryCreateForUUID( allocator: CFAllocatorRef; uuid: CFUUIDRef; authority: CSIdentityAuthorityRef ): CSIdentityQueryRef; external name '_CSIdentityQueryCreateForUUID';
  366. (* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA) *)
  367. {
  368. * CSIdentityQueryCreateForPosixID()
  369. *
  370. * Summary:
  371. * Creates an identity query object based on a POSIX ID
  372. *
  373. * Discussion:
  374. * Finds an identity by its UID or GID
  375. *
  376. * Mac OS X threading:
  377. * Thread safe since version 10.5
  378. *
  379. * Parameters:
  380. *
  381. * allocator:
  382. * The allocator to use for this instance
  383. *
  384. * posixID:
  385. * The UID or GID of the identity to find
  386. *
  387. * identityClass:
  388. * The class of identity to find
  389. *
  390. * authority:
  391. * The identity authority to query
  392. *
  393. * Result:
  394. * A new CSIdentityQuery object
  395. *
  396. * Availability:
  397. * Mac OS X: in version 10.5 and later in CoreServices.framework
  398. * CarbonLib: not available
  399. * Non-Carbon CFM: not available
  400. }
  401. function CSIdentityQueryCreateForPosixID( allocator: CFAllocatorRef; posixID: id_t; identityClass: CSIdentityClass; authority: CSIdentityAuthorityRef ): CSIdentityQueryRef; external name '_CSIdentityQueryCreateForPosixID';
  402. (* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA) *)
  403. {$endc} {!TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR}
  404. {
  405. * CSIdentityQueryCreateForPersistentReference()
  406. *
  407. * Summary:
  408. * Creates an identity query object based on an identity reference
  409. * data object
  410. *
  411. * Discussion:
  412. * Finds an identity by reference data obtained from
  413. * CSIdentityCreateReferenceData
  414. *
  415. * Mac OS X threading:
  416. * Thread safe since version 10.5
  417. *
  418. * Parameters:
  419. *
  420. * allocator:
  421. * The allocator to use for this instance
  422. *
  423. * referenceData:
  424. * The reference data that fully describes an identity
  425. *
  426. * Result:
  427. * A new CSIdentityQuery object
  428. *
  429. * Availability:
  430. * Mac OS X: in version 10.5 and later in CoreServices.framework
  431. * CarbonLib: not available
  432. * Non-Carbon CFM: not available
  433. }
  434. function CSIdentityQueryCreateForPersistentReference( allocator: CFAllocatorRef; referenceData: CFDataRef ): CSIdentityQueryRef; external name '_CSIdentityQueryCreateForPersistentReference';
  435. (* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_5_0) *)
  436. {$ifc not TARGET_OS_IPHONE and not TARGET_IPHONE_SIMULATOR}
  437. {
  438. * CSIdentityQueryCreateForCurrentUser()
  439. *
  440. * Summary:
  441. * Creates a query for the current session user's identity
  442. *
  443. * Mac OS X threading:
  444. * Thread safe since version 10.5
  445. *
  446. * Parameters:
  447. *
  448. * allocator:
  449. * The allocator to use for this instance
  450. *
  451. * Result:
  452. * A new CSIdentityQuery object
  453. *
  454. * Availability:
  455. * Mac OS X: in version 10.5 and later in CoreServices.framework
  456. * CarbonLib: not available
  457. * Non-Carbon CFM: not available
  458. }
  459. function CSIdentityQueryCreateForCurrentUser( allocator: CFAllocatorRef ): CSIdentityQueryRef; external name '_CSIdentityQueryCreateForCurrentUser';
  460. (* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA) *)
  461. {$endc} {!TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR}
  462. {
  463. * CSIdentityQueryCopyResults()
  464. *
  465. * Summary:
  466. * Retrieve the results of executing an identity query
  467. *
  468. * Discussion:
  469. * Returns an immutable array of CSIdentityRefs, reflecting the
  470. * current results of the query's execution.
  471. *
  472. * Mac OS X threading:
  473. * Thread safe since version 10.5
  474. *
  475. * Parameters:
  476. *
  477. * query:
  478. * The query object to access
  479. *
  480. * Result:
  481. * An array of zero or more CSIdentityRefs
  482. *
  483. * Availability:
  484. * Mac OS X: in version 10.5 and later in CoreServices.framework
  485. * CarbonLib: not available
  486. * Non-Carbon CFM: not available
  487. }
  488. function CSIdentityQueryCopyResults( query: CSIdentityQueryRef ): CFArrayRef; external name '_CSIdentityQueryCopyResults';
  489. (* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_5_0) *)
  490. {
  491. * CSIdentityQueryExecute()
  492. *
  493. * Summary:
  494. * Execute an identity query synchronously
  495. *
  496. * Mac OS X threading:
  497. * Thread safe since version 10.5
  498. *
  499. * Parameters:
  500. *
  501. * query:
  502. * The query object to execute
  503. *
  504. * flags:
  505. * Execution options
  506. *
  507. * error:
  508. * Optional pointer to a CFError object which must be released by
  509. * the caller if CSIdentityQueryExecute returns false
  510. *
  511. * Result:
  512. * Returns true if the query executed successfully, false if an
  513. * error occurred.
  514. *
  515. * Availability:
  516. * Mac OS X: in version 10.5 and later in CoreServices.framework
  517. * CarbonLib: not available
  518. * Non-Carbon CFM: not available
  519. }
  520. function CSIdentityQueryExecute( query: CSIdentityQueryRef; flags: CSIdentityQueryFlags; error: CFErrorRefPtr { can be NULL } ): Boolean; external name '_CSIdentityQueryExecute';
  521. (* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_5_0) *)
  522. {
  523. * CSIdentityQueryEvent
  524. *
  525. * Summary:
  526. * Results from executing an asynchronous query
  527. *
  528. * Discussion:
  529. * Events generated during asynchronous query execution
  530. }
  531. const
  532. {
  533. * Event generated when the initial lookup of identities has
  534. * finished. Live update events will follow if caller requests the
  535. * kCSIdentityQueryGenerateUpdateEvents option.
  536. }
  537. kCSIdentityQueryEventSearchPhaseFinished = 1;
  538. {
  539. * Event generated when identities are added to the query results
  540. }
  541. kCSIdentityQueryEventResultsAdded = 2;
  542. {
  543. * Event generated when identities already in the query results have
  544. * been modified
  545. }
  546. kCSIdentityQueryEventResultsChanged = 3;
  547. {
  548. * Event generated when identities are removed from the query results
  549. }
  550. kCSIdentityQueryEventResultsRemoved = 4;
  551. {
  552. * Used to report an error. Query execution stops (permanently) if
  553. * this event is sent.
  554. }
  555. kCSIdentityQueryEventErrorOccurred = 5;
  556. type
  557. CSIdentityQueryEvent = CFIndex;
  558. {
  559. * CSIdentityQueryReceiveEventCallback
  560. *
  561. * Summary:
  562. * The client event callback function for receiving asynchronous
  563. * query events
  564. *
  565. * Parameters:
  566. *
  567. * query:
  568. * The identity query object that has completed an event
  569. *
  570. * event:
  571. * The event the identity query object has completed
  572. *
  573. * identities:
  574. * a CFArray containing identities resulting from the query
  575. *
  576. * error:
  577. * A CFError object if there was an error from the query
  578. *
  579. * info:
  580. * Any other information you want passed to the callback function
  581. }
  582. type
  583. CSIdentityQueryReceiveEventCallback = procedure( query: CSIdentityQueryRef; event: CSIdentityQueryEvent; identities: CFArrayRef; error: CFErrorRef; info: UnivPtr );
  584. {
  585. * CSIdentityQueryClientContext
  586. *
  587. * Summary:
  588. * Client structure specifying callbacks and private context data
  589. }
  590. type
  591. CSIdentityQueryClientContext = record
  592. version: CFIndex;
  593. info: UnivPtr;
  594. retainInfo: CFAllocatorRetainCallBack;
  595. releaseInfo: CFAllocatorReleaseCallBack;
  596. copyInfoDescription: CFAllocatorCopyDescriptionCallBack;
  597. receiveEvent: CSIdentityQueryReceiveEventCallback;
  598. end;
  599. {
  600. * CSIdentityQueryExecuteAsynchronously()
  601. *
  602. * Summary:
  603. * Execute an identity query asynchronously
  604. *
  605. * Mac OS X threading:
  606. * Thread safe since version 10.5
  607. *
  608. * Parameters:
  609. *
  610. * query:
  611. * The query object to execute
  612. *
  613. * flags:
  614. * Execution options
  615. *
  616. * clientContext:
  617. * The client context and callbacks to be used during execution
  618. *
  619. * runLoop:
  620. * The run loop on which to schedule callbacks
  621. *
  622. * runLoopMode:
  623. * The run loop mode in which callbacks may be scheduled
  624. *
  625. * Result:
  626. * Returns true if query execution started, false if the query has
  627. * already been executed.
  628. *
  629. * Availability:
  630. * Mac OS X: in version 10.5 and later in CoreServices.framework
  631. * CarbonLib: not available
  632. * Non-Carbon CFM: not available
  633. }
  634. function CSIdentityQueryExecuteAsynchronously( query: CSIdentityQueryRef; flags: CSIdentityQueryFlags; const (*var*) clientContext: CSIdentityQueryClientContext; runLoop: CFRunLoopRef; runLoopMode: CFStringRef ): Boolean; external name '_CSIdentityQueryExecuteAsynchronously';
  635. (* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_5_0) *)
  636. {
  637. * CSIdentityQueryStop()
  638. *
  639. * Summary:
  640. * Invalidate an identity query client
  641. *
  642. * Discussion:
  643. * Invalidate a query client so that its callback will never be
  644. * called in the future. Clients should call CSIdentityQueryStop
  645. * when an query will no longer be used, prior to releasing the
  646. * final query reference.
  647. *
  648. * Mac OS X threading:
  649. * Thread safe since version 10.5
  650. *
  651. * Parameters:
  652. *
  653. * query:
  654. * The query to access
  655. *
  656. * Availability:
  657. * Mac OS X: in version 10.5 and later in CoreServices.framework
  658. * CarbonLib: not available
  659. * Non-Carbon CFM: not available
  660. }
  661. procedure CSIdentityQueryStop( query: CSIdentityQueryRef ); external name '_CSIdentityQueryStop';
  662. (* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_5_0) *)
  663. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  664. end.
  665. {$endc} {not MACOSALLINCLUDE}