PageRenderTime 23ms CodeModel.GetById 36ms RepoModel.GetById 0ms app.codeStats 0ms

/api/AccessibleAction.idl

https://bitbucket.org/nvaccess/ia2
IDL | 220 lines | 42 code | 11 blank | 167 comment | 0 complexity | 14a866f22d9881684a7e3c4b1afb094d MD5 | raw file
  1. /*************************************************************************
  2. *
  3. * File Name (AccessibleAction.idl)
  4. *
  5. * IAccessible2 IDL Specification
  6. *
  7. * Copyright (c) 2007, 2013 Linux Foundation
  8. * Copyright (c) 2006 IBM Corporation
  9. * Copyright (c) 2000, 2006 Sun Microsystems, Inc.
  10. * All rights reserved.
  11. *
  12. *
  13. * Redistribution and use in source and binary forms, with or without
  14. * modification, are permitted provided that the following conditions
  15. * are met:
  16. *
  17. * 1. Redistributions of source code must retain the above copyright
  18. * notice, this list of conditions and the following disclaimer.
  19. *
  20. * 2. Redistributions in binary form must reproduce the above
  21. * copyright notice, this list of conditions and the following
  22. * disclaimer in the documentation and/or other materials
  23. * provided with the distribution.
  24. *
  25. * 3. Neither the name of the Linux Foundation nor the names of its
  26. * contributors may be used to endorse or promote products
  27. * derived from this software without specific prior written
  28. * permission.
  29. *
  30. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
  31. * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
  32. * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  33. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  34. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  35. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  36. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  37. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  38. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  39. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  40. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  41. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  42. * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  43. *
  44. * This BSD License conforms to the Open Source Initiative "Simplified
  45. * BSD License" as published at:
  46. * http://www.opensource.org/licenses/bsd-license.php
  47. *
  48. * IAccessible2 is a trademark of the Linux Foundation. The IAccessible2
  49. * mark may be used in accordance with the Linux Foundation Trademark
  50. * Policy to indicate compliance with the IAccessible2 specification.
  51. *
  52. ************************************************************************/
  53. import "objidl.idl";
  54. import "oaidl.idl";
  55. import "oleacc.idl";
  56. /** This enum defines values which are predefined actions for use when implementing
  57. support for media.
  58. This enum is used when specifying an action for IAccessibleAction::doAction.
  59. */
  60. enum IA2Actions {
  61. IA2_ACTION_OPEN = -1, /**< Used to inform the server that the client will
  62. signal via IA2_ACTION_COMPLETE when it has consumed
  63. the content provided by the object. This action
  64. allows the object's server to wait for all clients
  65. to signal their readiness for additional content.
  66. Any form of content generation that requires
  67. synchronization with an AT would require use of this
  68. action. One example is the generation of text describing
  69. visual content not obvious from a video's sound track.
  70. In this scenario the Text to Speech or Braille output
  71. may take more time than the related length of silence
  72. in the video's sound track. */
  73. IA2_ACTION_COMPLETE = -2, /**< Used by the client to inform the server that it has
  74. consumed the most recent content provided by this object. */
  75. IA2_ACTION_CLOSE = -3 /**< Used to inform the server that the client no longer
  76. requires synchronization. */
  77. };
  78. /** @brief This interface gives access to actions that can be executed
  79. for accessible objects.
  80. Every accessible object that can be manipulated via the native GUI beyond the
  81. methods available either in the MSAA IAccessible interface or in the set of
  82. IAccessible2 interfaces (other than this IAccessibleAction interface) should
  83. support the IAccessibleAction interface in order to provide Assistive Technology
  84. access to all the actions that can be performed by the object. Each action can
  85. be performed or queried for a name, description or associated key bindings.
  86. Actions are needed more for ATs that assist the mobility impaired, such as
  87. on-screen keyboards and voice command software. By providing actions directly,
  88. the AT can present them to the user without the user having to perform the extra
  89. steps to navigate a context menu.
  90. The first action should be equivalent to the MSAA default action. If there is
  91. only one action, %IAccessibleAction should also be implemented.
  92. */
  93. [object, uuid(B70D9F59-3B5A-4dba-AB9E-22012F607DF5)]
  94. interface IAccessibleAction : IUnknown
  95. {
  96. /** @brief Returns the number of accessible actions available in this object.
  97. If there are more than one, the first one is considered the
  98. "default" action of the object.
  99. @param [out] nActions
  100. The returned value of the number of actions is zero if there are
  101. no actions.
  102. @retval S_OK
  103. @note This method is missing a [propget] prefix in the IDL. The result is the
  104. method is named nActions in generated C++ code instead of get_nActions.
  105. */
  106. HRESULT nActions
  107. (
  108. [out,retval] long* nActions
  109. );
  110. /** @brief Performs the specified Action on the object.
  111. @param [in] actionIndex
  112. 0 based index specifying the action to perform. If it lies outside
  113. the valid range no action is performed.
  114. @retval S_OK
  115. @retval S_FALSE if action could not be performed
  116. @retval E_INVALIDARG if bad [in] passed
  117. @note If implementing support for media, refer to the predefined constants in the ::IA2Actions enum.
  118. */
  119. HRESULT doAction
  120. (
  121. [in] long actionIndex
  122. );
  123. /** @brief Returns a description of the specified action of the object.
  124. @param [in] actionIndex
  125. 0 based index specifying which action's description to return.
  126. If it lies outside the valid range an empty string is returned.
  127. @param [out] description
  128. The returned value is a localized string of the specified action.
  129. @retval S_OK
  130. @retval S_FALSE if there is nothing to return, [out] value is NULL
  131. @retval E_INVALIDARG if bad [in] passed
  132. */
  133. [propget] HRESULT description
  134. (
  135. [in] long actionIndex,
  136. [out, retval] BSTR *description
  137. );
  138. /** @brief Returns an array of BSTRs describing one or more key bindings, if
  139. there are any, associated with the specified action.
  140. The returned strings are the localized human readable key sequences to be
  141. used to activate each action, e.g. "Ctrl+Shift+D". Since these key
  142. sequences are to be used when the object has focus, they are like
  143. mnemonics (access keys), and not like shortcut (accelerator) keys.
  144. There is no need to implement this method for single action controls since
  145. that would be redundant with the standard MSAA programming practice of
  146. getting the mnemonic from get_accKeyboardShortcut.
  147. An AT such as an On Screen Keyboard might not expose these bindings but
  148. provide alternative means of activation.
  149. Note: the client allocates and passes in an array of pointers. The server
  150. allocates the BSTRs and passes back one or more pointers to these BSTRs into
  151. the array of pointers allocated by the client. The client is responsible
  152. for deallocating the BSTRs.
  153. @param [in] actionIndex
  154. 0 based index specifying which action's key bindings should be returned.
  155. @param [in] nMaxBindings
  156. This parameter is ignored. Refer to @ref _arrayConsideration
  157. "Special Consideration when using Arrays" for more details.
  158. @param [out] keyBindings
  159. An array of BSTRs, allocated by the server, one for each key binding.
  160. The client must free it with CoTaskMemFree.
  161. @param [out] nBindings
  162. The number of key bindings returned; the size of the returned array.
  163. @retval S_OK
  164. @retval S_FALSE if there are no key bindings, [out] values are NULL and 0 respectively
  165. @retval E_INVALIDARG if bad [in] passed
  166. */
  167. [propget] HRESULT keyBinding
  168. (
  169. [in] long actionIndex,
  170. [in] long nMaxBindings,
  171. [out, size_is(,nMaxBindings), length_is(,*nBindings)] BSTR **keyBindings,
  172. [out, retval] long *nBindings
  173. );
  174. /** @brief Returns the non-localized name of specified action.
  175. @param [in] actionIndex
  176. 0 based index specifying which action's non-localized name should be returned.
  177. @param [out] name
  178. @retval S_OK
  179. @retval S_FALSE if there is nothing to return, [out] value is NULL
  180. @retval E_INVALIDARG if bad [in] passed
  181. */
  182. [propget] HRESULT name
  183. (
  184. [in] long actionIndex,
  185. [out, retval] BSTR *name
  186. );
  187. /** @brief Returns the localized name of specified action.
  188. @param [in] actionIndex
  189. 0 based index specifying which action's localized name should be returned.
  190. @param [out] localizedName
  191. @retval S_OK
  192. @retval S_FALSE if there is nothing to return, [out] value is NULL
  193. @retval E_INVALIDARG if bad [in] passed
  194. */
  195. [propget] HRESULT localizedName
  196. (
  197. [in] long actionIndex,
  198. [out, retval] BSTR *localizedName
  199. );
  200. }