1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/accessible/src/windows/ia2/ia2AccessibleRelation.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,82 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* vim:expandtab:shiftwidth=2:tabstop=2: 1.6 + */ 1.7 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.8 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.9 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.10 + 1.11 +#ifndef _NS_ACCESSIBLE_RELATION_WRAP_H 1.12 +#define _NS_ACCESSIBLE_RELATION_WRAP_H 1.13 + 1.14 +#include "Accessible.h" 1.15 +#include "IUnknownImpl.h" 1.16 +#include "nsIAccessibleRelation.h" 1.17 + 1.18 +#include <utility> 1.19 +#include "nsTArray.h" 1.20 + 1.21 +#include "AccessibleRelation.h" 1.22 + 1.23 +namespace mozilla { 1.24 +namespace a11y { 1.25 + 1.26 +class ia2AccessibleRelation MOZ_FINAL : public IAccessibleRelation 1.27 +{ 1.28 +public: 1.29 + ia2AccessibleRelation(RelationType aType, Relation* aRel); 1.30 + 1.31 + // IUnknown 1.32 + DECL_IUNKNOWN 1.33 + 1.34 + // IAccessibleRelation 1.35 + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_relationType( 1.36 + /* [retval][out] */ BSTR *relationType); 1.37 + 1.38 + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_localizedRelationType( 1.39 + /* [retval][out] */ BSTR *localizedRelationType); 1.40 + 1.41 + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_nTargets( 1.42 + /* [retval][out] */ long *nTargets); 1.43 + 1.44 + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_target( 1.45 + /* [in] */ long targetIndex, 1.46 + /* [retval][out] */ IUnknown **target); 1.47 + 1.48 + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_targets( 1.49 + /* [in] */ long maxTargets, 1.50 + /* [length_is][size_is][out] */ IUnknown **target, 1.51 + /* [retval][out] */ long *nTargets); 1.52 + 1.53 + inline bool HasTargets() const 1.54 + { return mTargets.Length(); } 1.55 + 1.56 +private: 1.57 + ia2AccessibleRelation(); 1.58 + ia2AccessibleRelation(const ia2AccessibleRelation&); 1.59 + ia2AccessibleRelation& operator = (const ia2AccessibleRelation&); 1.60 + 1.61 + RelationType mType; 1.62 + nsTArray<nsRefPtr<Accessible> > mTargets; 1.63 +}; 1.64 + 1.65 + 1.66 +/** 1.67 + * Gecko to IAccessible2 relation types map. 1.68 + */ 1.69 + 1.70 +const WCHAR *const IA2_RELATION_NULL = L""; 1.71 + 1.72 +#define RELATIONTYPE(geckoType, name, atkType, msaaType, ia2Type) \ 1.73 + std::pair<RelationType, const WCHAR *const>(RelationType::geckoType, ia2Type), 1.74 + 1.75 +static const std::pair<RelationType, const WCHAR *const> sRelationTypePairs[] = { 1.76 +#include "RelationTypeMap.h" 1.77 +}; 1.78 + 1.79 +#undef RELATIONTYPE 1.80 + 1.81 +} // namespace a11y 1.82 +} // namespace mozilla 1.83 + 1.84 +#endif 1.85 +