Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

388 lines
7.8 KiB

  1. #include "priv.h"
  2. #include "accdel.h"
  3. CDelegateAccessibleImpl::CDelegateAccessibleImpl()
  4. {
  5. ASSERT(NULL == m_pDelegateAccObj);
  6. }
  7. CDelegateAccessibleImpl::~CDelegateAccessibleImpl()
  8. {
  9. if (NULL != m_pDelegateAccObj)
  10. {
  11. m_pDelegateAccObj->Release();
  12. }
  13. }
  14. HRESULT CDelegateAccessibleImpl::_DefQueryInterface(REFIID riid, void **ppvObj)
  15. {
  16. *ppvObj = NULL;
  17. if (IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_IAccessible) ||
  18. IsEqualIID(riid, IID_IDispatch))
  19. {
  20. *ppvObj = SAFECAST(this, IAccessible*);
  21. AddRef();
  22. }
  23. else if ((NULL != m_pDelegateAccObj) && IsEqualIID(riid, IID_IEnumVARIANT))
  24. {
  25. // Yikes! breaking COM identity rules -- trident does it, just following their lead here :)
  26. m_pDelegateAccObj->QueryInterface(IID_IEnumVARIANT, ppvObj);
  27. }
  28. return (NULL == *ppvObj) ? E_NOINTERFACE : S_OK;
  29. }
  30. // *** IDispatch ***
  31. STDMETHODIMP CDelegateAccessibleImpl::GetTypeInfoCount(
  32. UINT* pctinfo)
  33. {
  34. if (NULL != m_pDelegateAccObj)
  35. {
  36. return m_pDelegateAccObj->GetTypeInfoCount(pctinfo);
  37. }
  38. else
  39. {
  40. return E_UNEXPECTED;
  41. }
  42. }
  43. STDMETHODIMP CDelegateAccessibleImpl::GetTypeInfo(
  44. UINT itinfo, LCID lcid, ITypeInfo** pptinfo)
  45. {
  46. if (NULL != m_pDelegateAccObj)
  47. {
  48. return m_pDelegateAccObj->GetTypeInfo(itinfo, lcid, pptinfo);
  49. }
  50. else
  51. {
  52. return E_UNEXPECTED;
  53. }
  54. }
  55. STDMETHODIMP CDelegateAccessibleImpl::GetIDsOfNames(
  56. REFIID riid, OLECHAR** rgszNames, UINT cNames, LCID lcid, DISPID* rgdispid)
  57. {
  58. if (NULL != m_pDelegateAccObj)
  59. {
  60. return m_pDelegateAccObj->GetIDsOfNames(riid, rgszNames, cNames, lcid, rgdispid);
  61. }
  62. else
  63. {
  64. return E_UNEXPECTED;
  65. }
  66. }
  67. STDMETHODIMP CDelegateAccessibleImpl::Invoke(
  68. DISPID dispidMember, REFIID riid, LCID lcid, WORD wFlags,
  69. DISPPARAMS* pdispparams, VARIANT* pvarResult, EXCEPINFO* pexcepinfo,
  70. UINT* puArgErr)
  71. {
  72. if (NULL != m_pDelegateAccObj)
  73. {
  74. return m_pDelegateAccObj->Invoke(dispidMember, riid, lcid, wFlags,
  75. pdispparams, pvarResult, pexcepinfo, puArgErr);
  76. }
  77. else
  78. {
  79. return E_UNEXPECTED;
  80. }
  81. }
  82. // *** IAccessible ***
  83. STDMETHODIMP CDelegateAccessibleImpl::get_accParent(
  84. IDispatch **ppdispParent)
  85. {
  86. if (NULL != m_pDelegateAccObj)
  87. {
  88. return m_pDelegateAccObj->get_accParent(ppdispParent);
  89. }
  90. else
  91. {
  92. return E_UNEXPECTED;
  93. }
  94. }
  95. STDMETHODIMP CDelegateAccessibleImpl::get_accChildCount(
  96. long *pcountChildren)
  97. {
  98. if (NULL != m_pDelegateAccObj)
  99. {
  100. return m_pDelegateAccObj->get_accChildCount(pcountChildren);
  101. }
  102. else
  103. {
  104. return E_UNEXPECTED;
  105. }
  106. }
  107. STDMETHODIMP CDelegateAccessibleImpl::get_accChild(
  108. VARIANT varChild,
  109. IDispatch **ppdispChild)
  110. {
  111. if (NULL != m_pDelegateAccObj)
  112. {
  113. return m_pDelegateAccObj->get_accChild(varChild, ppdispChild);
  114. }
  115. else
  116. {
  117. return E_UNEXPECTED;
  118. }
  119. }
  120. STDMETHODIMP CDelegateAccessibleImpl::get_accName(
  121. VARIANT varChild,
  122. BSTR *pszName)
  123. {
  124. if (NULL != m_pDelegateAccObj)
  125. {
  126. return m_pDelegateAccObj->get_accName(varChild, pszName);
  127. }
  128. else
  129. {
  130. return E_UNEXPECTED;
  131. }
  132. }
  133. STDMETHODIMP CDelegateAccessibleImpl::get_accValue(
  134. VARIANT varChild,
  135. BSTR *pszValue)
  136. {
  137. if (NULL != m_pDelegateAccObj)
  138. {
  139. return m_pDelegateAccObj->get_accValue(varChild, pszValue);
  140. }
  141. else
  142. {
  143. return E_UNEXPECTED;
  144. }
  145. }
  146. STDMETHODIMP CDelegateAccessibleImpl::get_accDescription(
  147. VARIANT varChild,
  148. BSTR *pszDescription)
  149. {
  150. if (NULL != m_pDelegateAccObj)
  151. {
  152. return m_pDelegateAccObj->get_accDescription(varChild, pszDescription);
  153. }
  154. else
  155. {
  156. return E_UNEXPECTED;
  157. }
  158. }
  159. STDMETHODIMP CDelegateAccessibleImpl::get_accRole(
  160. VARIANT varChild,
  161. VARIANT *pvarRole)
  162. {
  163. if (NULL != m_pDelegateAccObj)
  164. {
  165. return m_pDelegateAccObj->get_accRole(varChild, pvarRole);
  166. }
  167. else
  168. {
  169. return E_UNEXPECTED;
  170. }
  171. }
  172. STDMETHODIMP CDelegateAccessibleImpl::get_accState(
  173. VARIANT varChild,
  174. VARIANT *pvarState)
  175. {
  176. if (NULL != m_pDelegateAccObj)
  177. {
  178. return m_pDelegateAccObj->get_accState(varChild, pvarState);
  179. }
  180. else
  181. {
  182. return E_UNEXPECTED;
  183. }
  184. }
  185. STDMETHODIMP CDelegateAccessibleImpl::get_accHelp(
  186. VARIANT varChild,
  187. BSTR *pszHelp)
  188. {
  189. if (NULL != m_pDelegateAccObj)
  190. {
  191. return m_pDelegateAccObj->get_accHelp(varChild, pszHelp);
  192. }
  193. else
  194. {
  195. return E_UNEXPECTED;
  196. }
  197. }
  198. STDMETHODIMP CDelegateAccessibleImpl::get_accHelpTopic(
  199. BSTR *pszHelpFile,
  200. VARIANT varChild,
  201. long *pidTopic)
  202. {
  203. if (NULL != m_pDelegateAccObj)
  204. {
  205. return m_pDelegateAccObj->get_accHelpTopic(pszHelpFile, varChild, pidTopic);
  206. }
  207. else
  208. {
  209. return E_UNEXPECTED;
  210. }
  211. }
  212. STDMETHODIMP CDelegateAccessibleImpl::get_accKeyboardShortcut(
  213. VARIANT varChild,
  214. BSTR *pszKeyboardShortcut)
  215. {
  216. if (NULL != m_pDelegateAccObj)
  217. {
  218. return m_pDelegateAccObj->get_accKeyboardShortcut(varChild, pszKeyboardShortcut);
  219. }
  220. else
  221. {
  222. return E_UNEXPECTED;
  223. }
  224. }
  225. STDMETHODIMP CDelegateAccessibleImpl::get_accFocus(
  226. VARIANT *pvarChild)
  227. {
  228. if (NULL != m_pDelegateAccObj)
  229. {
  230. return m_pDelegateAccObj->get_accFocus(pvarChild);
  231. }
  232. else
  233. {
  234. return E_UNEXPECTED;
  235. }
  236. }
  237. STDMETHODIMP CDelegateAccessibleImpl::get_accSelection(
  238. VARIANT *pvarChildren)
  239. {
  240. if (NULL != m_pDelegateAccObj)
  241. {
  242. return m_pDelegateAccObj->get_accSelection(pvarChildren);
  243. }
  244. else
  245. {
  246. return E_UNEXPECTED;
  247. }
  248. }
  249. STDMETHODIMP CDelegateAccessibleImpl::get_accDefaultAction(
  250. VARIANT varChild,
  251. BSTR *pszDefaultAction)
  252. {
  253. if (NULL != m_pDelegateAccObj)
  254. {
  255. return m_pDelegateAccObj->get_accDefaultAction(varChild, pszDefaultAction);
  256. }
  257. else
  258. {
  259. return E_UNEXPECTED;
  260. }
  261. }
  262. STDMETHODIMP CDelegateAccessibleImpl::accSelect(
  263. long flagsSelect,
  264. VARIANT varChild)
  265. {
  266. if (NULL != m_pDelegateAccObj)
  267. {
  268. return m_pDelegateAccObj->accSelect(flagsSelect, varChild);
  269. }
  270. else
  271. {
  272. return E_UNEXPECTED;
  273. }
  274. }
  275. STDMETHODIMP CDelegateAccessibleImpl::accLocation(
  276. long *pxLeft,
  277. long *pyTop,
  278. long *pcxWidth,
  279. long *pcyHeight,
  280. VARIANT varChild)
  281. {
  282. if (NULL != m_pDelegateAccObj)
  283. {
  284. return m_pDelegateAccObj->accLocation(pxLeft, pyTop, pcxWidth, pcyHeight, varChild);
  285. }
  286. else
  287. {
  288. return E_UNEXPECTED;
  289. }
  290. }
  291. STDMETHODIMP CDelegateAccessibleImpl::accNavigate(
  292. long navDir,
  293. VARIANT varStart,
  294. VARIANT *pvarEndUpAt)
  295. {
  296. if (NULL != m_pDelegateAccObj)
  297. {
  298. return m_pDelegateAccObj->accNavigate(navDir, varStart, pvarEndUpAt);
  299. }
  300. else
  301. {
  302. return E_UNEXPECTED;
  303. }
  304. }
  305. STDMETHODIMP CDelegateAccessibleImpl::accHitTest(
  306. long xLeft,
  307. long yTop,
  308. VARIANT *pvarChild)
  309. {
  310. if (NULL != m_pDelegateAccObj)
  311. {
  312. return m_pDelegateAccObj->accHitTest(xLeft, yTop, pvarChild);
  313. }
  314. else
  315. {
  316. return E_UNEXPECTED;
  317. }
  318. }
  319. STDMETHODIMP CDelegateAccessibleImpl::accDoDefaultAction(
  320. VARIANT varChild)
  321. {
  322. if (NULL != m_pDelegateAccObj)
  323. {
  324. return m_pDelegateAccObj->accDoDefaultAction(varChild);
  325. }
  326. else
  327. {
  328. return E_UNEXPECTED;
  329. }
  330. }
  331. STDMETHODIMP CDelegateAccessibleImpl::put_accName(
  332. VARIANT varChild,
  333. BSTR szName)
  334. {
  335. if (NULL != m_pDelegateAccObj)
  336. {
  337. return m_pDelegateAccObj->put_accName(varChild, szName);
  338. }
  339. else
  340. {
  341. return E_UNEXPECTED;
  342. }
  343. }
  344. STDMETHODIMP CDelegateAccessibleImpl::put_accValue(
  345. VARIANT varChild,
  346. BSTR szValue)
  347. {
  348. if (NULL != m_pDelegateAccObj)
  349. {
  350. return m_pDelegateAccObj->put_accValue(varChild, szValue);
  351. }
  352. else
  353. {
  354. return E_UNEXPECTED;
  355. }
  356. }