|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* vim: set ts=2 et sw=2 tw=80: */ |
|
3 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
4 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
6 |
|
7 #ifndef mozilla_a11y_sdnAccessible_h_ |
|
8 #define mozilla_a11y_sdnAccessible_h_ |
|
9 |
|
10 #include "ISimpleDOMNode.h" |
|
11 #include "AccessibleWrap.h" |
|
12 #include "IUnknownImpl.h" |
|
13 |
|
14 #include "mozilla/Attributes.h" |
|
15 |
|
16 namespace mozilla { |
|
17 namespace a11y { |
|
18 |
|
19 class sdnAccessible MOZ_FINAL : public ISimpleDOMNode |
|
20 { |
|
21 public: |
|
22 sdnAccessible(nsINode* aNode) : |
|
23 mNode(aNode) |
|
24 { |
|
25 if (!mNode) |
|
26 MOZ_CRASH(); |
|
27 } |
|
28 ~sdnAccessible() { } |
|
29 |
|
30 /** |
|
31 * Retrun if the object is defunct. |
|
32 */ |
|
33 bool IsDefunct() const { return !GetDocument(); } |
|
34 |
|
35 /** |
|
36 * Return a document accessible it belongs to if any. |
|
37 */ |
|
38 DocAccessible* GetDocument() const; |
|
39 |
|
40 /* |
|
41 * Return associated accessible if any. |
|
42 */ |
|
43 Accessible* GetAccessible() const; |
|
44 |
|
45 //IUnknown |
|
46 DECL_IUNKNOWN |
|
47 |
|
48 virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_nodeInfo( |
|
49 /* [out] */ BSTR __RPC_FAR* aNodeName, |
|
50 /* [out] */ short __RPC_FAR* aNameSpaceID, |
|
51 /* [out] */ BSTR __RPC_FAR* aNodeValue, |
|
52 /* [out] */ unsigned int __RPC_FAR* aNumChildren, |
|
53 /* [out] */ unsigned int __RPC_FAR* aUniqueID, |
|
54 /* [out][retval] */ unsigned short __RPC_FAR* aNodeType); |
|
55 |
|
56 virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_attributes( |
|
57 /* [in] */ unsigned short aMaxAttribs, |
|
58 /* [length_is][size_is][out] */ BSTR __RPC_FAR* aAttribNames, |
|
59 /* [length_is][size_is][out] */ short __RPC_FAR* aNameSpaceIDs, |
|
60 /* [length_is][size_is][out] */ BSTR __RPC_FAR* aAttribValues, |
|
61 /* [out][retval] */ unsigned short __RPC_FAR* aNumAttribs); |
|
62 |
|
63 virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_attributesForNames( |
|
64 /* [in] */ unsigned short aMaxAttribs, |
|
65 /* [length_is][size_is][in] */ BSTR __RPC_FAR* aAttribNames, |
|
66 /* [length_is][size_is][in] */ short __RPC_FAR* aNameSpaceID, |
|
67 /* [length_is][size_is][retval] */ BSTR __RPC_FAR* aAttribValues); |
|
68 |
|
69 virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_computedStyle( |
|
70 /* [in] */ unsigned short aMaxStyleProperties, |
|
71 /* [in] */ boolean aUseAlternateView, |
|
72 /* [length_is][size_is][out] */ BSTR __RPC_FAR* aStyleProperties, |
|
73 /* [length_is][size_is][out] */ BSTR __RPC_FAR* aStyleValues, |
|
74 /* [out][retval] */ unsigned short __RPC_FAR* aNumStyleProperties); |
|
75 |
|
76 virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_computedStyleForProperties( |
|
77 /* [in] */ unsigned short aNumStyleProperties, |
|
78 /* [in] */ boolean aUseAlternateView, |
|
79 /* [length_is][size_is][in] */ BSTR __RPC_FAR* aStyleProperties, |
|
80 /* [length_is][size_is][out][retval] */ BSTR __RPC_FAR* aStyleValues); |
|
81 |
|
82 virtual HRESULT STDMETHODCALLTYPE scrollTo(/* [in] */ boolean aScrollTopLeft); |
|
83 |
|
84 virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_parentNode( |
|
85 /* [out][retval] */ ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode); |
|
86 |
|
87 virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_firstChild( |
|
88 /* [out][retval] */ ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode); |
|
89 |
|
90 virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_lastChild( |
|
91 /* [out][retval] */ ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode); |
|
92 |
|
93 virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_previousSibling( |
|
94 /* [out][retval] */ ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode); |
|
95 |
|
96 virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_nextSibling( |
|
97 /* [out][retval] */ ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode); |
|
98 |
|
99 virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_childAt( |
|
100 /* [in] */ unsigned aChildIndex, |
|
101 /* [out][retval] */ ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode); |
|
102 |
|
103 virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_innerHTML( |
|
104 /* [out][retval] */ BSTR __RPC_FAR* aInnerHTML); |
|
105 |
|
106 virtual /* [local][propget] */ HRESULT STDMETHODCALLTYPE get_localInterface( |
|
107 /* [retval][out] */ void __RPC_FAR *__RPC_FAR* aLocalInterface); |
|
108 |
|
109 virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_language( |
|
110 /* [out][retval] */ BSTR __RPC_FAR* aLanguage); |
|
111 |
|
112 private: |
|
113 nsCOMPtr<nsINode> mNode; |
|
114 }; |
|
115 |
|
116 } // namespace a11y |
|
117 } // namespace mozilla |
|
118 |
|
119 #endif // mozilla_a11y_sdnAccessible_h_ |