|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* vim:expandtab:shiftwidth=2:tabstop=2: |
|
3 */ |
|
4 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
5 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
7 |
|
8 #ifndef _NS_ACCESSIBLE_RELATION_WRAP_H |
|
9 #define _NS_ACCESSIBLE_RELATION_WRAP_H |
|
10 |
|
11 #include "Accessible.h" |
|
12 #include "IUnknownImpl.h" |
|
13 #include "nsIAccessibleRelation.h" |
|
14 |
|
15 #include <utility> |
|
16 #include "nsTArray.h" |
|
17 |
|
18 #include "AccessibleRelation.h" |
|
19 |
|
20 namespace mozilla { |
|
21 namespace a11y { |
|
22 |
|
23 class ia2AccessibleRelation MOZ_FINAL : public IAccessibleRelation |
|
24 { |
|
25 public: |
|
26 ia2AccessibleRelation(RelationType aType, Relation* aRel); |
|
27 |
|
28 // IUnknown |
|
29 DECL_IUNKNOWN |
|
30 |
|
31 // IAccessibleRelation |
|
32 virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_relationType( |
|
33 /* [retval][out] */ BSTR *relationType); |
|
34 |
|
35 virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_localizedRelationType( |
|
36 /* [retval][out] */ BSTR *localizedRelationType); |
|
37 |
|
38 virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_nTargets( |
|
39 /* [retval][out] */ long *nTargets); |
|
40 |
|
41 virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_target( |
|
42 /* [in] */ long targetIndex, |
|
43 /* [retval][out] */ IUnknown **target); |
|
44 |
|
45 virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_targets( |
|
46 /* [in] */ long maxTargets, |
|
47 /* [length_is][size_is][out] */ IUnknown **target, |
|
48 /* [retval][out] */ long *nTargets); |
|
49 |
|
50 inline bool HasTargets() const |
|
51 { return mTargets.Length(); } |
|
52 |
|
53 private: |
|
54 ia2AccessibleRelation(); |
|
55 ia2AccessibleRelation(const ia2AccessibleRelation&); |
|
56 ia2AccessibleRelation& operator = (const ia2AccessibleRelation&); |
|
57 |
|
58 RelationType mType; |
|
59 nsTArray<nsRefPtr<Accessible> > mTargets; |
|
60 }; |
|
61 |
|
62 |
|
63 /** |
|
64 * Gecko to IAccessible2 relation types map. |
|
65 */ |
|
66 |
|
67 const WCHAR *const IA2_RELATION_NULL = L""; |
|
68 |
|
69 #define RELATIONTYPE(geckoType, name, atkType, msaaType, ia2Type) \ |
|
70 std::pair<RelationType, const WCHAR *const>(RelationType::geckoType, ia2Type), |
|
71 |
|
72 static const std::pair<RelationType, const WCHAR *const> sRelationTypePairs[] = { |
|
73 #include "RelationTypeMap.h" |
|
74 }; |
|
75 |
|
76 #undef RELATIONTYPE |
|
77 |
|
78 } // namespace a11y |
|
79 } // namespace mozilla |
|
80 |
|
81 #endif |
|
82 |