/packages/univint/src/HIAccessibility.pas

https://github.com/slibre/freepascal · Pascal · 1071 lines · 34 code · 48 blank · 989 comment · 0 complexity · 206aa7f359c1cf9ca007d0b4a58633c3 MD5 · raw file

  1. {
  2. File: HIToolbox/HIAccessibility.h
  3. Contains: Accessibility Carbon events and API for HIToolbox
  4. Version: HIToolbox-624~3
  5. Copyright: © 2005-2008 by Apple Computer, Inc., all rights reserved.
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://www.freepascal.org/bugs.html
  9. }
  10. { Pascal Translation: Jonas Maebe, <jonas@freepascal.org>, October 2009 }
  11. { Pascal Translation Updated: Jonas Maebe, <jonas@freepascal.org>, October 2012 }
  12. {
  13. Modified for use with Free Pascal
  14. Version 308
  15. Please report any bugs to <gpc@microbizz.nl>
  16. }
  17. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  18. {$mode macpas}
  19. {$packenum 1}
  20. {$macro on}
  21. {$inline on}
  22. {$calling mwpascal}
  23. unit HIAccessibility;
  24. interface
  25. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  26. {$setc GAP_INTERFACES_VERSION := $0308}
  27. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  28. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  29. {$endc}
  30. {$ifc defined CPUPOWERPC and defined CPUI386}
  31. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  32. {$endc}
  33. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  34. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  35. {$endc}
  36. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  37. {$setc __ppc__ := 1}
  38. {$elsec}
  39. {$setc __ppc__ := 0}
  40. {$endc}
  41. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  42. {$setc __ppc64__ := 1}
  43. {$elsec}
  44. {$setc __ppc64__ := 0}
  45. {$endc}
  46. {$ifc not defined __i386__ and defined CPUI386}
  47. {$setc __i386__ := 1}
  48. {$elsec}
  49. {$setc __i386__ := 0}
  50. {$endc}
  51. {$ifc not defined __x86_64__ and defined CPUX86_64}
  52. {$setc __x86_64__ := 1}
  53. {$elsec}
  54. {$setc __x86_64__ := 0}
  55. {$endc}
  56. {$ifc not defined __arm__ and defined CPUARM}
  57. {$setc __arm__ := 1}
  58. {$elsec}
  59. {$setc __arm__ := 0}
  60. {$endc}
  61. {$ifc defined cpu64}
  62. {$setc __LP64__ := 1}
  63. {$elsec}
  64. {$setc __LP64__ := 0}
  65. {$endc}
  66. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  67. {$error Conflicting definitions for __ppc__ and __i386__}
  68. {$endc}
  69. {$ifc defined __ppc__ and __ppc__}
  70. {$setc TARGET_CPU_PPC := TRUE}
  71. {$setc TARGET_CPU_PPC64 := FALSE}
  72. {$setc TARGET_CPU_X86 := FALSE}
  73. {$setc TARGET_CPU_X86_64 := FALSE}
  74. {$setc TARGET_CPU_ARM := FALSE}
  75. {$setc TARGET_OS_MAC := TRUE}
  76. {$setc TARGET_OS_IPHONE := FALSE}
  77. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  78. {$setc TARGET_OS_EMBEDDED := FALSE}
  79. {$elifc defined __ppc64__ and __ppc64__}
  80. {$setc TARGET_CPU_PPC := FALSE}
  81. {$setc TARGET_CPU_PPC64 := TRUE}
  82. {$setc TARGET_CPU_X86 := FALSE}
  83. {$setc TARGET_CPU_X86_64 := FALSE}
  84. {$setc TARGET_CPU_ARM := FALSE}
  85. {$setc TARGET_OS_MAC := TRUE}
  86. {$setc TARGET_OS_IPHONE := FALSE}
  87. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  88. {$setc TARGET_OS_EMBEDDED := FALSE}
  89. {$elifc defined __i386__ and __i386__}
  90. {$setc TARGET_CPU_PPC := FALSE}
  91. {$setc TARGET_CPU_PPC64 := FALSE}
  92. {$setc TARGET_CPU_X86 := TRUE}
  93. {$setc TARGET_CPU_X86_64 := FALSE}
  94. {$setc TARGET_CPU_ARM := FALSE}
  95. {$ifc defined(iphonesim)}
  96. {$setc TARGET_OS_MAC := FALSE}
  97. {$setc TARGET_OS_IPHONE := TRUE}
  98. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  99. {$elsec}
  100. {$setc TARGET_OS_MAC := TRUE}
  101. {$setc TARGET_OS_IPHONE := FALSE}
  102. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  103. {$endc}
  104. {$setc TARGET_OS_EMBEDDED := FALSE}
  105. {$elifc defined __x86_64__ and __x86_64__}
  106. {$setc TARGET_CPU_PPC := FALSE}
  107. {$setc TARGET_CPU_PPC64 := FALSE}
  108. {$setc TARGET_CPU_X86 := FALSE}
  109. {$setc TARGET_CPU_X86_64 := TRUE}
  110. {$setc TARGET_CPU_ARM := FALSE}
  111. {$setc TARGET_OS_MAC := TRUE}
  112. {$setc TARGET_OS_IPHONE := FALSE}
  113. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  114. {$setc TARGET_OS_EMBEDDED := FALSE}
  115. {$elifc defined __arm__ and __arm__}
  116. {$setc TARGET_CPU_PPC := FALSE}
  117. {$setc TARGET_CPU_PPC64 := FALSE}
  118. {$setc TARGET_CPU_X86 := FALSE}
  119. {$setc TARGET_CPU_X86_64 := FALSE}
  120. {$setc TARGET_CPU_ARM := TRUE}
  121. { will require compiler define when/if other Apple devices with ARM cpus ship }
  122. {$setc TARGET_OS_MAC := FALSE}
  123. {$setc TARGET_OS_IPHONE := TRUE}
  124. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  125. {$setc TARGET_OS_EMBEDDED := TRUE}
  126. {$elsec}
  127. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
  128. {$endc}
  129. {$ifc defined __LP64__ and __LP64__ }
  130. {$setc TARGET_CPU_64 := TRUE}
  131. {$elsec}
  132. {$setc TARGET_CPU_64 := FALSE}
  133. {$endc}
  134. {$ifc defined FPC_BIG_ENDIAN}
  135. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  136. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  137. {$elifc defined FPC_LITTLE_ENDIAN}
  138. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  139. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  140. {$elsec}
  141. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  142. {$endc}
  143. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  144. {$setc CALL_NOT_IN_CARBON := FALSE}
  145. {$setc OLDROUTINENAMES := FALSE}
  146. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  147. {$setc OPAQUE_UPP_TYPES := TRUE}
  148. {$setc OTCARBONAPPLICATION := TRUE}
  149. {$setc OTKERNEL := FALSE}
  150. {$setc PM_USE_SESSION_APIS := TRUE}
  151. {$setc TARGET_API_MAC_CARBON := TRUE}
  152. {$setc TARGET_API_MAC_OS8 := FALSE}
  153. {$setc TARGET_API_MAC_OSX := TRUE}
  154. {$setc TARGET_CARBON := TRUE}
  155. {$setc TARGET_CPU_68K := FALSE}
  156. {$setc TARGET_CPU_MIPS := FALSE}
  157. {$setc TARGET_CPU_SPARC := FALSE}
  158. {$setc TARGET_OS_UNIX := FALSE}
  159. {$setc TARGET_OS_WIN32 := FALSE}
  160. {$setc TARGET_RT_MAC_68881 := FALSE}
  161. {$setc TARGET_RT_MAC_CFM := FALSE}
  162. {$setc TARGET_RT_MAC_MACHO := TRUE}
  163. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  164. {$setc TYPE_BOOL := FALSE}
  165. {$setc TYPE_EXTENDED := FALSE}
  166. {$setc TYPE_LONGLONG := TRUE}
  167. uses MacTypes,CFBase,CarbonEvents,Events,Menus,Controls,MacWindows,HIObject,AXUIElement;
  168. {$endc} {not MACOSALLINCLUDE}
  169. {$ifc TARGET_OS_MAC}
  170. {$ALIGN POWER}
  171. {--------------------------------------------------------------------------------------}
  172. { Accessibility Events }
  173. {--------------------------------------------------------------------------------------}
  174. {
  175. kEventClassAccessibility quick reference:
  176. kEventAccessibleGetChildAtPoint = 1,
  177. kEventAccessibleGetFocusedChild = 2,
  178. kEventAccessibleGetAllAttributeNames = 21,
  179. kEventAccessibleGetAllParameterizedAttributeNames = 25,
  180. kEventAccessibleGetNamedAttribute = 22,
  181. kEventAccessibleSetNamedAttribute = 23,
  182. kEventAccessibleIsNamedAttributeSettable = 24,
  183. kEventAccessibleGetAllActionNames = 41,
  184. kEventAccessiblePerformNamedAction = 42,
  185. kEventAccessibleGetNamedActionDescription = 44
  186. }
  187. {
  188. * kEventClassAccessibility / kEventAccessibleGetChildAtPoint
  189. *
  190. * Summary:
  191. * Finds the child of an accessible object at a given point.
  192. *
  193. * Discussion:
  194. * The kEventParamMouseLocation parameter will contain a global
  195. * point. Your handler for this event should find the child of
  196. * yourself which is underneath that point and return it in the
  197. * kEventParamAccessibleChild parameter.
  198. *
  199. * Mac OS X threading:
  200. * Not thread safe
  201. *
  202. * Parameters:
  203. *
  204. * --> kEventParamAccessibleObject (in, typeCFTypeRef)
  205. * The accessible object, in the form of an AXUIElementRef.
  206. *
  207. * --> kEventParamMouseLocation (in, typeHIPoint)
  208. * The location in global coordinates.
  209. *
  210. * <-- kEventParamAccessibleChild (out, typeCFTypeRef)
  211. * On exit, contains the child of the accessible object at the
  212. * specified point, in the form of an AXUIElementRef. If there
  213. * is no child at the given point, you should still return
  214. * noErr, but leave the parameter empty (do not call
  215. * SetEventParameter). Only return immediate children; do not
  216. * return grandchildren of yourself.
  217. *
  218. * Availability:
  219. * Mac OS X: in version 10.2 and later in Carbon.framework
  220. * CarbonLib: not available
  221. }
  222. const
  223. kEventAccessibleGetChildAtPoint = 1;
  224. {
  225. * kEventClassAccessibility / kEventAccessibleGetFocusedChild
  226. *
  227. * Summary:
  228. * Finds the focused child of an accessible object.
  229. *
  230. * Discussion:
  231. * Your handler for this event should find the child of itself which
  232. * is part of the focus chain and return it in the
  233. * kEventParamAccessibleChild parameter.
  234. *
  235. * Mac OS X threading:
  236. * Not thread safe
  237. *
  238. * Parameters:
  239. *
  240. * --> kEventParamAccessibleObject (in, typeCFTypeRef)
  241. * The accessible object, in the form of an AXUIElementRef.
  242. *
  243. * <-- kEventParamAccessibleChild (out, typeCFTypeRef)
  244. * On exit, contains the focused child of the accessible
  245. * object, in the form of an AXUIElementRef. If there is no
  246. * child in the focus chain, you should still return noErr,
  247. * but leave the parameter empty (do not call
  248. * SetEventParameter). Only return immediate children; do not
  249. * return grandchildren of yourself.
  250. *
  251. * Availability:
  252. * Mac OS X: in version 10.2 and later in Carbon.framework
  253. * CarbonLib: not available
  254. }
  255. const
  256. kEventAccessibleGetFocusedChild = 2;
  257. {
  258. * kEventClassAccessibility / kEventAccessibleGetAllAttributeNames
  259. *
  260. * Summary:
  261. * Returns the attributes supported by an accessible object. You
  262. * must only return the names of your regular (non-parameterized)
  263. * attributes via this event. If you support parameterized
  264. * attributes, you must return them via the new
  265. * kEventAccessibleGetAllParameterizedAttributeNames event.
  266. *
  267. * Mac OS X threading:
  268. * Not thread safe
  269. *
  270. * Parameters:
  271. *
  272. * --> kEventParamAccessibleObject (in, typeCFTypeRef)
  273. * The accessible object, in the form of an AXUIElementRef.
  274. *
  275. * <-> kEventParamAccessibleAttributeNames (in/out, typeCFMutableArrayRef)
  276. * Add each of the regular (non-parameterized) attribute names
  277. * supported by the accessible object to this array, as
  278. * CFStringRefs.
  279. *
  280. * Availability:
  281. * Mac OS X: in version 10.2 and later in Carbon.framework
  282. * CarbonLib: not available
  283. }
  284. const
  285. kEventAccessibleGetAllAttributeNames = 21;
  286. {
  287. * kEventClassAccessibility / kEventAccessibleGetAllParameterizedAttributeNames
  288. *
  289. * Summary:
  290. * Returns the parameterized attributes supported by an accessible
  291. * object. You must not return the names of your regular
  292. * (non-parameterized) attributes via this event. If you support
  293. * regular attributes, you must return them via the original
  294. * kEventAccessibleGetAllAttributeNames event. Parameterized
  295. * attributes are introduced in Mac OS X 10.3.
  296. *
  297. * Mac OS X threading:
  298. * Not thread safe
  299. *
  300. * Parameters:
  301. *
  302. * --> kEventParamAccessibleObject (in, typeCFTypeRef)
  303. * The accessible object, in the form of an AXUIElementRef.
  304. *
  305. * <-> kEventParamAccessibleAttributeNames (in/out, typeCFMutableArrayRef)
  306. * Add each of the parameterized attribute names supported by
  307. * the accessible object to this array, as CFStringRefs.
  308. *
  309. * Availability:
  310. * Mac OS X: in version 10.3 and later in Carbon.framework
  311. * CarbonLib: not available
  312. }
  313. const
  314. kEventAccessibleGetAllParameterizedAttributeNames = 25;
  315. {
  316. * kEventClassAccessibility / kEventAccessibleGetNamedAttribute
  317. *
  318. * Summary:
  319. * Returns the value of an attribute of an accessible object.
  320. *
  321. * Discussion:
  322. * The kEventParamAccessibleAttributeName parameter will contain an
  323. * attribute name in the form of a CFStringRef. If you support the
  324. * named attribute, return the attributeÕs value in the
  325. * kEventParamAccessibleAttributeValue parameter.
  326. *
  327. * Mac OS X threading:
  328. * Not thread safe
  329. *
  330. * Parameters:
  331. *
  332. * --> kEventParamAccessibleObject (in, typeCFTypeRef)
  333. * The accessible object, in the form of an AXUIElementRef.
  334. *
  335. * --> kEventParamAccessibleAttributeName (in, typeCFStringRef)
  336. * The name of the requested attribute.
  337. *
  338. * --> kEventParamAccessibleAttributeParameter (in, typeCFTypeRef)
  339. * This parameter is optional and will only exist if your
  340. * accessible object is being asked for the value of a
  341. * parameterized attribute. When present, this event parameter
  342. * will contain a CFTypeRef describing the parameters of the
  343. * request. Parameterized attributes are introduced in Mac OS
  344. * X 10.3.
  345. *
  346. * <-- kEventParamAccessibleAttributeValue (out, typeCFTypeRef)
  347. * On exit, contains the attribute's value. The type of this
  348. * parameter varies according to the attribute; it might
  349. * typically be typeCFStringRef (for a textual attribute),
  350. * typeBoolean (for a boolean attribute), or typeSInt32 (for
  351. * an integer-valued attribute).
  352. *
  353. * Availability:
  354. * Mac OS X: in version 10.2 and later in Carbon.framework
  355. * CarbonLib: not available
  356. }
  357. const
  358. kEventAccessibleGetNamedAttribute = 22;
  359. {
  360. * kEventClassAccessibility / kEventAccessibleSetNamedAttribute
  361. *
  362. * Summary:
  363. * Sets the value of an attribute of an accessible object.
  364. *
  365. * Discussion:
  366. * The kEventParamAccessibleAttributeName parameter will contain an
  367. * attribute name in the form of a CFStringRef. The
  368. * kEventParamAccessibleAttributeValue parameter will contain data
  369. * in an arbitrary format. If you support the named attribute, set
  370. * the named attributeÕs value to the data provided in the event.
  371. *
  372. * Mac OS X threading:
  373. * Not thread safe
  374. *
  375. * Parameters:
  376. *
  377. * --> kEventParamAccessibleObject (in, typeCFTypeRef)
  378. * The accessible object, in the form of an AXUIElementRef.
  379. *
  380. * --> kEventParamAccessibleAttributeName (in, typeCFStringRef)
  381. * The name of the requested attribute.
  382. *
  383. * --> kEventParamAccessibleAttributeValue (in, typeCFTypeRef)
  384. * The new value of the attribute. The type of this parameter
  385. * varies according to the attribute; it might typically be
  386. * typeCFStringRef (for a textual attribute), typeBoolean (for
  387. * a boolean attribute), or typeSInt32 (for an integer-valued
  388. * attribute).
  389. *
  390. * Availability:
  391. * Mac OS X: in version 10.2 and later in Carbon.framework
  392. * CarbonLib: not available
  393. }
  394. const
  395. kEventAccessibleSetNamedAttribute = 23;
  396. {
  397. * kEventClassAccessibility / kEventAccessibleIsNamedAttributeSettable
  398. *
  399. * Summary:
  400. * Determines whether an attribute of an accessible object can be
  401. * modified.
  402. *
  403. * Discussion:
  404. * The kEventParamAccessibleAttributeName parameter will contain an
  405. * attribute name in the form of a CFStringRef. If you support the
  406. * named attribute, set the kEventParamAccessibleAttributeSettable
  407. * parameter to a Boolean indicating whether the named attribute can
  408. * have its value changed via the kEventAccessibleSetNamedAttribute
  409. * event.
  410. *
  411. * Mac OS X threading:
  412. * Not thread safe
  413. *
  414. * Parameters:
  415. *
  416. * --> kEventParamAccessibleObject (in, typeCFTypeRef)
  417. * The accessible object, in the form of an AXUIElementRef.
  418. *
  419. * --> kEventParamAccessibleAttributeName (in, typeCFStringRef)
  420. * The name of the requested attribute.
  421. *
  422. * <-- kEventParamAccessibleAttributeSettable (out, typeBoolean)
  423. * On exit, indicates whether the attribute may be modified.
  424. *
  425. * Availability:
  426. * Mac OS X: in version 10.2 and later in Carbon.framework
  427. * CarbonLib: not available
  428. }
  429. const
  430. kEventAccessibleIsNamedAttributeSettable = 24;
  431. {
  432. * kEventClassAccessibility / kEventAccessibleGetAllActionNames
  433. *
  434. * Summary:
  435. * Returns the actions supported by an accessible object.
  436. *
  437. * Discussion:
  438. * The kEventParamAccessibleActionNames parameter will contain a
  439. * CFMutableArrayRef. Add each of the action names you support to
  440. * this array in the form of a CFStringRef.
  441. *
  442. * Mac OS X threading:
  443. * Not thread safe
  444. *
  445. * Parameters:
  446. *
  447. * --> kEventParamAccessibleObject (in, typeCFTypeRef)
  448. * The accessible object, in the form of an AXUIElementRef.
  449. *
  450. * <-> kEventParamAccessibleActionNames (in/out, typeCFMutableArrayRef)
  451. * Add each of the actions supported by the accessible object
  452. * to this array, as CFStringRefs.
  453. *
  454. * Availability:
  455. * Mac OS X: in version 10.2 and later in Carbon.framework
  456. * CarbonLib: not available
  457. }
  458. const
  459. kEventAccessibleGetAllActionNames = 41;
  460. {
  461. * kEventClassAccessibility / kEventAccessiblePerformNamedAction
  462. *
  463. * Summary:
  464. * Requests that a specific action be performed by an accessible
  465. * object.
  466. *
  467. * Discussion:
  468. * The kEventParamAccessibleActionName parameter will contain an
  469. * attribute name in the form of a CFStringRef. If you support the
  470. * named action, perform the action. There are times, however, when
  471. * performing an action causes an accessible object to call a
  472. * routine which may not return immediately, such as StandardAlert
  473. * or PopUpMenuSelect. You should only call such routines when you
  474. * receive an action request that was queued; if you call such a
  475. * routine when processing an event that was directly dispatched,
  476. * you will probably cause the assistive app to receive a timeout
  477. * error. On Mac OS X 10.3 and later, the
  478. * kEventParamAccessibilityEventQueued parameter will indicate
  479. * whether the event was queued. If so, process the request
  480. * normally. If not, you can request that the event be posted to the
  481. * queue and sent to you later by returning
  482. * eventDeferAccessibilityEventErr from your handler. On Mac OS X
  483. * 10.2, the parameter will not exist, the event will always be
  484. * directly dispatched, and there is no way to request that it be
  485. * posted to the queue; in this case, you should perform the action
  486. * even if it will cause the assistive app to receive a timeout
  487. * error.
  488. *
  489. * Mac OS X threading:
  490. * Not thread safe
  491. *
  492. * Parameters:
  493. *
  494. * --> kEventParamAccessibleObject (in, typeCFTypeRef)
  495. * The accessible object, in the form of an AXUIElementRef.
  496. *
  497. * --> kEventParamAccessibleActionName (in, typeCFStringRef)
  498. * The name of the requested action.
  499. *
  500. * --> kEventParamAccessibilityEventQueued (in, typeBoolean)
  501. * An indication of whether this event was delivered to you
  502. * via the main event queue. This parameter only exists on Mac
  503. * OS X 10.3 and later. See the discussion for more details.
  504. *
  505. * Availability:
  506. * Mac OS X: in version 10.2 and later in Carbon.framework
  507. * CarbonLib: not available
  508. }
  509. const
  510. kEventAccessiblePerformNamedAction = 42;
  511. {
  512. * kEventClassAccessibility / kEventAccessibleGetNamedActionDescription
  513. *
  514. * Summary:
  515. * Returns a human-language description of an action supported by an
  516. * accessible object.
  517. *
  518. * Discussion:
  519. * The kEventParamAccessibleActionName parameter will contain an
  520. * attribute name in the form of a CFStringRef. The
  521. * kEventParamAccessibleActionDescription parameter will contain a
  522. * CFMutableStringRef. If you support the named action, alter the
  523. * mutable string to contain a textual description of the actionÕs
  524. * significance.
  525. *
  526. * Mac OS X threading:
  527. * Not thread safe
  528. *
  529. * Parameters:
  530. *
  531. * --> kEventParamAccessibleObject (in, typeCFTypeRef)
  532. * The accessible object, in the form of an AXUIElementRef.
  533. *
  534. * --> kEventParamAccessibleActionName (in, typeCFStringRef)
  535. * The name of the requested action.
  536. *
  537. * <-> kEventParamAccessibleActionDescription (in/out, typeCFMutableStringRef)
  538. * If you support the action, extract this parameter from the
  539. * event and set the contents of the mutable string to contain
  540. * a description of the action. Do not set this event
  541. * parameter to a CFStringRef of your own creation; you must
  542. * modify the preexisting mutable string stored in the event
  543. * parameter.
  544. *
  545. * Availability:
  546. * Mac OS X: in version 10.2 and later in Carbon.framework
  547. * CarbonLib: not available
  548. }
  549. const
  550. kEventAccessibleGetNamedActionDescription = 44;
  551. {$ifc not TARGET_CPU_64}
  552. {
  553. * AXUIElementCreateWithHIObjectAndIdentifier()
  554. *
  555. * Discussion:
  556. * This routine creates an AXUIElementRef to represent an accessible
  557. * object for a Carbon application. A Carbon accessible object is
  558. * comprised of an HIObjectRef and a 64-bit identifier. The
  559. * resulting AXUIElementRef is a CFTypeRef, and must be managed as
  560. * such. You can create a new AXUIElementRef every time you need
  561. * one. Even though the actual hex values of two AXUIElementRefs
  562. * might be different, they may represent the same accessible
  563. * object; because AXUIElementRefs are Core Foundation objects, you
  564. * can use CFEqual to compare them.
  565. *
  566. * Mac OS X threading:
  567. * Not thread safe
  568. *
  569. * Parameters:
  570. *
  571. * inHIObject:
  572. * The HIObjectRef of the accessible object.
  573. *
  574. * inIdentifier:
  575. * The 64-bit identifier of the accessible object.
  576. *
  577. * Result:
  578. * An AXUIElementRef that represents the Carbon accessible object
  579. * identified by the given HIObjectRef and 64-bit identifier. This
  580. * follows CoreFoundation semantics in that it will return NULL for
  581. * failure, and because it is a "Create" function you will need to
  582. * CFRelease() this AXUIElementRef when it is no longer needed.
  583. *
  584. * Availability:
  585. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  586. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  587. * Non-Carbon CFM: not available
  588. }
  589. function AXUIElementCreateWithHIObjectAndIdentifier( inHIObject: HIObjectRef; inIdentifier: UInt64 ): AXUIElementRef; external name '_AXUIElementCreateWithHIObjectAndIdentifier';
  590. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  591. {
  592. * AXUIElementGetHIObject()
  593. *
  594. * Discussion:
  595. * If the incoming AXUIElementRef is a Carbon accessible object,
  596. * this routine will return the HIObjectRef of the accessible object.
  597. *
  598. * Mac OS X threading:
  599. * Not thread safe
  600. *
  601. * Parameters:
  602. *
  603. * inUIElement:
  604. * The AXUIElementRef of whom you'd like to get the HIObjectRef.
  605. *
  606. * Result:
  607. * The HIObjectRef of the AXUIElementRef. If the incoming
  608. * AXUIElementRef is not a Carbon accessible object, this routine
  609. * will return NULL.
  610. *
  611. * Availability:
  612. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  613. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  614. * Non-Carbon CFM: not available
  615. }
  616. function AXUIElementGetHIObject( inUIElement: AXUIElementRef ): HIObjectRef; external name '_AXUIElementGetHIObject';
  617. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  618. {
  619. * AXUIElementGetIdentifier()
  620. *
  621. * Discussion:
  622. * If the incoming AXUIElementRef is a Carbon accessible object,
  623. * this routine will pass back the 64-bit identifier of the
  624. * accessible object.
  625. *
  626. * Mac OS X threading:
  627. * Not thread safe
  628. *
  629. * Parameters:
  630. *
  631. * inUIElement:
  632. * The AXUIElementRef of whom you'd like to get the 64-bit
  633. * identifier.
  634. *
  635. * outIdentifier:
  636. * The 64-bit identifier of the AXUIElementRef. If the incoming
  637. * AXUIElementRef is not a Carbon accessible object, this routine
  638. * will pass back zero. Note that zero is often a legal value for
  639. * Carbon accessible object, so do not assume that the accessible
  640. * object is not a Carbon accessible object just because you get a
  641. * result of zero.
  642. *
  643. * Availability:
  644. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  645. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  646. * Non-Carbon CFM: not available
  647. }
  648. procedure AXUIElementGetIdentifier( inUIElement: AXUIElementRef; var outIdentifier: UInt64 ); external name '_AXUIElementGetIdentifier';
  649. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  650. {
  651. * AXNotificationHIObjectNotify()
  652. *
  653. * Discussion:
  654. * Posts a notification for the given pseudo-AXUIElementRef. Though
  655. * an actual AXUIElementRef is not actually passed in to this
  656. * function, its component parts are. This saves the implementation
  657. * the hassle of dismantling the AXUIElementRef into its component
  658. * parts.
  659. *
  660. * Mac OS X threading:
  661. * Not thread safe
  662. *
  663. * Parameters:
  664. *
  665. * inNotification:
  666. * The notification name string.
  667. *
  668. * inHIObject:
  669. * The HIObjectRef component of the AXUIElementRef to whom the
  670. * notification applies.
  671. *
  672. * inIdentifier:
  673. * The 64-bit identifier component of the AXUIElementRef to whom
  674. * the notification applies.
  675. *
  676. * Availability:
  677. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  678. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  679. * Non-Carbon CFM: not available
  680. }
  681. procedure AXNotificationHIObjectNotify( inNotification: CFStringRef; inHIObject: HIObjectRef; inIdentifier: UInt64 ); external name '_AXNotificationHIObjectNotify';
  682. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  683. {
  684. * HICopyAccessibilityRoleDescription()
  685. *
  686. * Summary:
  687. * Returns the role description string for a standard role or a
  688. * standard role-subrole pair.
  689. *
  690. * Discussion:
  691. * This routine is useful if you are implementing an accessible
  692. * object that has a standard role or role-subrole pair and you want
  693. * to make sure your object provides the same role description
  694. * string that the equivalent system-supplied object provides. In
  695. * other words, if you are implementing an accessible object of role
  696. * kAXButtonRole, you can use this routine to make sure it provides
  697. * the same role description that the standard push button provides.
  698. *
  699. * This routine can provide role description strings for all roles
  700. * and role-subrole pairs that are used in the standard/system
  701. * accessible objects on Mac OS X 10.4 and later. Once this routine
  702. * is able to provide a role description string for a role or
  703. * role-subrole pair, it will continue to do so on subsequent system
  704. * releases, even if the system no longer produces a standard
  705. * accessible object with that role or role-subrole pair.
  706. *
  707. * Mac OS X threading:
  708. * Not thread safe
  709. *
  710. * Parameters:
  711. *
  712. * inRole:
  713. * The role CFStringRef for your accessible object. Callers
  714. * typically pass one of the kAXFooRole constant strings from
  715. * within the HIServices framework.
  716. *
  717. * inSubrole:
  718. * The subrole CFStringRef for your accessible object. Callers
  719. * typically pass one of the kAXFooSubrole constant strings from
  720. * within the HIServices framework. Pass NULL if your accessible
  721. * object does not have a subrole.
  722. *
  723. * Result:
  724. * A CFStringRef with the standard role description for the role or
  725. * role-subrole pair. You must release the role description when you
  726. * are finished with it. If there is no standard role description
  727. * for the role or role-subrole pair, this routine will return NULL.
  728. * If you pass either an unknown role or an unknown subrole, this
  729. * routine will return NULL.
  730. *
  731. * Availability:
  732. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  733. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  734. * Non-Carbon CFM: not available
  735. }
  736. function HICopyAccessibilityRoleDescription( inRole: CFStringRef; inSubrole: CFStringRef { can be NULL } ): CFStringRef; external name '_HICopyAccessibilityRoleDescription';
  737. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  738. {
  739. * HICopyAccessibilityActionDescription()
  740. *
  741. * Summary:
  742. * Returns the action description string for a standard
  743. * accessibility action.
  744. *
  745. * Discussion:
  746. * This routine is useful if you are implementing an accessible
  747. * object that implements a standard action and you want to make
  748. * sure your object provides the same role action string that the a
  749. * system-supplied object provides.
  750. * This routine can provide action description strings for all
  751. * actions that are used in the standard/system accessible objects
  752. * on Mac OS X 10.4 and later. Once this routine is able to provide
  753. * a description string for an action, it will continue to do so on
  754. * subsequent system releases, even if the system no longer produces
  755. * a standard accessible object that supports the action.
  756. *
  757. * Mac OS X threading:
  758. * Not thread safe
  759. *
  760. * Parameters:
  761. *
  762. * inAction:
  763. * The action CFStringRef for which you'd like to generate a
  764. * description. Callers must pass one of the kAXFooAction constant
  765. * strings from within the HIServices framework.
  766. *
  767. * Result:
  768. * A CFStringRef with the standard description for the action. You
  769. * must release the description when you are finished with it. If
  770. * you pass an unsupported action to this routine, the behavior is
  771. * undefined.
  772. *
  773. * Availability:
  774. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  775. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  776. * Non-Carbon CFM: not available
  777. }
  778. function HICopyAccessibilityActionDescription( inAction: CFStringRef ): CFStringRef; external name '_HICopyAccessibilityActionDescription';
  779. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  780. {
  781. * HIObjectIsAccessibilityIgnored()
  782. *
  783. * Discussion:
  784. * Reports whether or not the given HIObject is marked as ignored
  785. * for accessibility.
  786. *
  787. * See the discussion of HIObjectSetAccessibilityIgnored for details
  788. * on what it means to be accessibility ignored.
  789. *
  790. * Mac OS X threading:
  791. * Not thread safe
  792. *
  793. * Parameters:
  794. *
  795. * inObject:
  796. * The object whose accessibility ignored state you wish to query.
  797. *
  798. * Result:
  799. * A Boolean value indicating whether or not the HIObject is ignored
  800. * for accessibility.
  801. *
  802. * Availability:
  803. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  804. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  805. * Non-Carbon CFM: not available
  806. }
  807. function HIObjectIsAccessibilityIgnored( inObject: HIObjectRef ): Boolean; external name '_HIObjectIsAccessibilityIgnored';
  808. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  809. {
  810. * HIObjectSetAccessibilityIgnored()
  811. *
  812. * Discussion:
  813. * Marks an HIObject as ignored (or not) for the purposes of the
  814. * accessibility APIs.
  815. *
  816. * An HIObject that is ignored for accessibility will never be shown
  817. * to an assistive application that uses the accessibility APIs to
  818. * examine an interface. Your application's accessibility
  819. * implementation can (and should) still report an ignored HIObject
  820. * as usual. Carbon's accessibility engine will automatically prune
  821. * any ignored HIObjects out of the data that is shown to an
  822. * assistive application.
  823. * <BR>By default, an HIObject is *not* accessibility ignored.
  824. *
  825. * Mac OS X threading:
  826. * Not thread safe
  827. *
  828. * Parameters:
  829. *
  830. * inObject:
  831. * The object whose accessibility ignored state you wish to change.
  832. *
  833. * inIgnored:
  834. * A Boolean value indicating whether or not to ignore the object.
  835. *
  836. * Result:
  837. * An OSStatus signifying success or failure.
  838. *
  839. * Availability:
  840. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only]
  841. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  842. * Non-Carbon CFM: not available
  843. }
  844. function HIObjectSetAccessibilityIgnored( inObject: HIObjectRef; inIgnored: Boolean ): OSStatus; external name '_HIObjectSetAccessibilityIgnored';
  845. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  846. {
  847. * HIObjectSetAuxiliaryAccessibilityAttribute()
  848. *
  849. * Summary:
  850. * Associates an additional accessibility attribute with a UIElement
  851. * that is used to represent a given HIObject or a part thereof.
  852. *
  853. * Discussion:
  854. * This routine lets your application provide the name of and data
  855. * for an accessibility attribute that you want to add to the
  856. * UIElement used to represent a given HIObject-identifier pair.
  857. * Normally, accessibility attributes can only be supplied
  858. * dynamically via Carbon Events, but this routine allows you to
  859. * supply them statically.
  860. *
  861. * When an accessibility attribute Carbon Event is handled by the
  862. * HIObject with a given identifier, the toolbox automatically
  863. * supplies the names and/or values of any auxiliary attributes
  864. * associated with that HIObject- identifier pair.
  865. *
  866. * This routine is particularly useful for supplying values for the
  867. * kAXDescriptionAttribute, kAXTitleUIElementAttribute,
  868. * kAXServesAsTitleUIElementAttribute, kAXLinkedUIElementsAttribute
  869. * and other attributes whose value is specific to the layout and
  870. * usage of your application.
  871. *
  872. * This routine only allows you to associate attributes whose values
  873. * never change. If you need to supply attributes whose values are
  874. * determined dynamically or whose values are settable, you must
  875. * install the normal accessibility Carbon Event handlers.
  876. *
  877. * The auxiliary attribute store is consulted during the HIObject's
  878. * default handling of the accessibility attribute Carbon Events.
  879. * This means that any programmatic handling of a given
  880. * accessibility attribute will have a chance to override or block
  881. * the consultation of the store. The general rule is that if the
  882. * toolbox or a Carbon Event handler can provide the attribute value
  883. * some other way, the store will not be consulted.
  884. *
  885. * Mac OS X threading:
  886. * Not thread safe
  887. *
  888. * Parameters:
  889. *
  890. * inHIObject:
  891. * The HIObjectRef part of the object-identifier pair to which the
  892. * attribute data is associated.
  893. *
  894. * inIdentifier:
  895. * The 64-bit identifier part of the object-identifier pair to
  896. * which the attribute data is associated. When you want to
  897. * associate the attribute data to the HIObject as a whole -- such
  898. * as when you want to give a description attribute to a push
  899. * button -- you should pass zero in this parameter.
  900. *
  901. * inAttributeName:
  902. * A CFStringRef of the name of the attribute you wish to
  903. * associate with the object-identifier pair. This string will be
  904. * retained before adding it to the auxiliary attribute store.
  905. *
  906. * inAttributeData:
  907. * A CFTypeRef with the data to be supplied as the attribute's
  908. * value. This data will be retained before adding it to the
  909. * auxiliary attribute store; you may release inAttributeData
  910. * after you have called this routine. The inAttributeData
  911. * parameter may also be NULL, which indicates that the named
  912. * auxiliary attribute should no longer be associated with the
  913. * object-identifier pair; any named attribute data previously
  914. * associated with the object-identifier pair will be released.
  915. *
  916. * Result:
  917. * An OSStatus result code. The function will return noErr if it was
  918. * able to associate the attribute data with the HIObjectRef. If the
  919. * HIObjectRef is invalid, paramErr will be returned. Other results
  920. * may be returned in other situations.
  921. *
  922. * Availability:
  923. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  924. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  925. * Non-Carbon CFM: not available
  926. }
  927. function HIObjectSetAuxiliaryAccessibilityAttribute( inHIObject: HIObjectRef; inIdentifier: UInt64; inAttributeName: CFStringRef; inAttributeData: CFTypeRef { can be NULL } ): OSStatus; external name '_HIObjectSetAuxiliaryAccessibilityAttribute';
  928. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  929. {
  930. * HIObjectOverrideAccessibilityContainment()
  931. *
  932. * Summary:
  933. * Allows you to override the AXUIElementRefs that an HIObject would
  934. * normally supply as the values of its AXParent, AXWindow, and
  935. * AXTopLevelUIElement attributes.
  936. *
  937. * Discussion:
  938. * This routine allows you to change the parent that an HIObject
  939. * would normally supply in the accessibility hierarchy. For
  940. * instance, a popup control could call this routine on its menu so
  941. * that the menu returned the popup control as the menu's parent;
  942. * normally the menu would return the application as its parent.
  943. * Optionally, this routine also allows you to change the window and
  944. * top-level element that an HIObject would normally supply.
  945. *
  946. * If the input HIObject is a standard toolbox construct like an
  947. * HIView or a Menu, the input HIObject will not be added as an
  948. * accessibility child of its normal parent. In all other cases, it
  949. * is the client's responsibility to ensure that the input HIObject
  950. * is not added as an accessibility child of its normal parent.
  951. *
  952. * If the desired AXUIElementRef parent represents an HIView, a
  953. * Menu, or a Window, the input HIObject will be automatically added
  954. * as an accessibility child of the specified parent. In all other
  955. * cases, it is the client's responsibility to manually add the
  956. * input HIObject as a child of the specified parent. To represent
  957. * an HIView, a Menu, or a Window, an AXUIElementRef must contain
  958. * the appropriate HIObjectRef as well as an identifier value of
  959. * zero.
  960. *
  961. * Similar rules don't have to apply for the handling of the window
  962. * and top-level element attributes because those attributes don't
  963. * represent two-way relationships.
  964. *
  965. * A containment override is not necessarily supported by every type
  966. * of HIObject. Currently, it is supported by HIViews, Menus, and
  967. * Windows.
  968. *
  969. * Mac OS X threading:
  970. * Not thread safe
  971. *
  972. * Parameters:
  973. *
  974. * inHIObject:
  975. * The HIObjectRef whose parent attribute you want to override.
  976. *
  977. * inDesiredParent:
  978. * The AXUIElementRef that you wish the HIObject to return as the
  979. * value of its AXParent attribute. This routine makes a copy of
  980. * the AXUIElementRef; you must release inDesiredParent after you
  981. * have called this routine. Passing NULL indicates that you want
  982. * the HIObject to revert to its normal, un-overridden behavior.
  983. *
  984. * inDesiredWindow:
  985. * The AXUIElementRef that you wish the HIObject to return as the
  986. * value of its AXWindow attribute. This routine makes a copy of
  987. * the AXUIElementRef; you must release inDesiredWindow after you
  988. * have called this routine. Passing NULL indicates that you want
  989. * the HIObject to report its normal window, if any.
  990. *
  991. * inDesiredTopLevelUIElement:
  992. * The AXUIElementRef that you wish the HIObject to return as the
  993. * value of its AXTopLevelUIElement attribute. This routine makes
  994. * a copy of the AXUIElementRef; you must release
  995. * inDesiredTopLevelUIElement after you have called this routine.
  996. * Passing NULL indicates that you want the HIObject to report its
  997. * normal top-level element, if any.
  998. *
  999. * Result:
  1000. * An OSStatus result code. If the HIObjectRef is invalid, this
  1001. * routine will return paramErr.
  1002. *
  1003. * Availability:
  1004. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only]
  1005. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1006. * Non-Carbon CFM: not available
  1007. }
  1008. function HIObjectOverrideAccessibilityContainment( inHIObject: HIObjectRef; inDesiredParent: AXUIElementRef; inDesiredWindow: AXUIElementRef; inDesiredTopLevelUIElement: AXUIElementRef ): OSStatus; external name '_HIObjectOverrideAccessibilityContainment';
  1009. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  1010. {$endc} {not TARGET_CPU_64}
  1011. {$endc} {TARGET_OS_MAC}
  1012. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  1013. end.
  1014. {$endc} {not MACOSALLINCLUDE}