CSIdentityQuery.pas 20 KB

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