1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=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 #if defined(MOZILLA_INTERNAL_API) 8 #error This code is NOT for internal Gecko use! 9 #endif // defined(MOZILLA_INTERNAL_API) 10 11 #ifndef mozilla_a11y_HandlerRelation_h 12 #define mozilla_a11y_HandlerRelation_h 13 14 #include "AccessibleHandler.h" 15 #include "IUnknownImpl.h" 16 #include "mozilla/RefPtr.h" 17 18 namespace mozilla { 19 namespace a11y { 20 21 class HandlerRelation final : public IAccessibleRelation { 22 public: 23 explicit HandlerRelation(AccessibleHandler* aHandler, IARelationData& aData); 24 25 DECL_IUNKNOWN 26 27 // IAccessibleRelation 28 STDMETHODIMP get_relationType(BSTR* aType) override; 29 STDMETHODIMP get_localizedRelationType(BSTR* aLocalizedType) override; 30 STDMETHODIMP get_nTargets(long* aNTargets) override; 31 STDMETHODIMP get_target(long aIndex, IUnknown** aTarget) override; 32 STDMETHODIMP get_targets(long aMaxTargets, IUnknown** aTargets, 33 long* aNTargets) override; 34 35 private: 36 virtual ~HandlerRelation(); 37 HRESULT GetTargets(); 38 RefPtr<AccessibleHandler> mHandler; 39 IARelationData mData; 40 IUnknown** mTargets; 41 }; 42 43 } // namespace a11y 44 } // namespace mozilla 45 46 #endif // mozilla_a11y_HandlerRelation_h 47