michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim:expandtab:shiftwidth=2:tabstop=2: michael@0: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef _NS_ACCESSIBLE_RELATION_WRAP_H michael@0: #define _NS_ACCESSIBLE_RELATION_WRAP_H michael@0: michael@0: #include "Accessible.h" michael@0: #include "IUnknownImpl.h" michael@0: #include "nsIAccessibleRelation.h" michael@0: michael@0: #include michael@0: #include "nsTArray.h" michael@0: michael@0: #include "AccessibleRelation.h" michael@0: michael@0: namespace mozilla { michael@0: namespace a11y { michael@0: michael@0: class ia2AccessibleRelation MOZ_FINAL : public IAccessibleRelation michael@0: { michael@0: public: michael@0: ia2AccessibleRelation(RelationType aType, Relation* aRel); michael@0: michael@0: // IUnknown michael@0: DECL_IUNKNOWN michael@0: michael@0: // IAccessibleRelation michael@0: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_relationType( michael@0: /* [retval][out] */ BSTR *relationType); michael@0: michael@0: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_localizedRelationType( michael@0: /* [retval][out] */ BSTR *localizedRelationType); michael@0: michael@0: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_nTargets( michael@0: /* [retval][out] */ long *nTargets); michael@0: michael@0: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_target( michael@0: /* [in] */ long targetIndex, michael@0: /* [retval][out] */ IUnknown **target); michael@0: michael@0: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_targets( michael@0: /* [in] */ long maxTargets, michael@0: /* [length_is][size_is][out] */ IUnknown **target, michael@0: /* [retval][out] */ long *nTargets); michael@0: michael@0: inline bool HasTargets() const michael@0: { return mTargets.Length(); } michael@0: michael@0: private: michael@0: ia2AccessibleRelation(); michael@0: ia2AccessibleRelation(const ia2AccessibleRelation&); michael@0: ia2AccessibleRelation& operator = (const ia2AccessibleRelation&); michael@0: michael@0: RelationType mType; michael@0: nsTArray > mTargets; michael@0: }; michael@0: michael@0: michael@0: /** michael@0: * Gecko to IAccessible2 relation types map. michael@0: */ michael@0: michael@0: const WCHAR *const IA2_RELATION_NULL = L""; michael@0: michael@0: #define RELATIONTYPE(geckoType, name, atkType, msaaType, ia2Type) \ michael@0: std::pair(RelationType::geckoType, ia2Type), michael@0: michael@0: static const std::pair sRelationTypePairs[] = { michael@0: #include "RelationTypeMap.h" michael@0: }; michael@0: michael@0: #undef RELATIONTYPE michael@0: michael@0: } // namespace a11y michael@0: } // namespace mozilla michael@0: michael@0: #endif michael@0: