accessible/src/windows/ia2/ia2AccessibleRelation.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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/. */
     8 #ifndef _NS_ACCESSIBLE_RELATION_WRAP_H
     9 #define _NS_ACCESSIBLE_RELATION_WRAP_H
    11 #include "Accessible.h"
    12 #include "IUnknownImpl.h"
    13 #include "nsIAccessibleRelation.h"
    15 #include <utility>
    16 #include "nsTArray.h"
    18 #include "AccessibleRelation.h"
    20 namespace mozilla {
    21 namespace a11y {
    23 class ia2AccessibleRelation MOZ_FINAL : public IAccessibleRelation
    24 {
    25 public:
    26   ia2AccessibleRelation(RelationType aType, Relation* aRel);
    28   // IUnknown
    29   DECL_IUNKNOWN
    31   // IAccessibleRelation
    32   virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_relationType(
    33       /* [retval][out] */ BSTR *relationType);
    35   virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_localizedRelationType(
    36       /* [retval][out] */ BSTR *localizedRelationType);
    38   virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_nTargets(
    39       /* [retval][out] */ long *nTargets);
    41   virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_target(
    42       /* [in] */ long targetIndex,
    43       /* [retval][out] */ IUnknown **target);
    45   virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_targets(
    46       /* [in] */ long maxTargets,
    47       /* [length_is][size_is][out] */ IUnknown **target,
    48       /* [retval][out] */ long *nTargets);
    50   inline bool HasTargets() const
    51     { return mTargets.Length(); }
    53 private:
    54   ia2AccessibleRelation();
    55   ia2AccessibleRelation(const ia2AccessibleRelation&);
    56   ia2AccessibleRelation& operator = (const ia2AccessibleRelation&);
    58   RelationType mType;
    59   nsTArray<nsRefPtr<Accessible> > mTargets;
    60 };
    63 /**
    64  * Gecko to IAccessible2 relation types map.
    65  */
    67 const WCHAR *const IA2_RELATION_NULL = L"";
    69 #define RELATIONTYPE(geckoType, name, atkType, msaaType, ia2Type) \
    70   std::pair<RelationType, const WCHAR *const>(RelationType::geckoType, ia2Type),
    72 static const std::pair<RelationType, const WCHAR *const> sRelationTypePairs[] = {
    73 #include "RelationTypeMap.h"
    74 };
    76 #undef RELATIONTYPE
    78 } // namespace a11y
    79 } // namespace mozilla
    81 #endif

mercurial