tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

MsaaRootAccessible.h (1616B)


      1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* This Source Code Form is subject to the terms of the Mozilla Public
      3 * License, v. 2.0. If a copy of the MPL was not distributed with this
      4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      5 
      6 #ifndef mozilla_a11y_MsaaRootAccessible_h__
      7 #define mozilla_a11y_MsaaRootAccessible_h__
      8 
      9 #include "mozilla/mscom/Aggregation.h"
     10 #include "MsaaDocAccessible.h"
     11 #include "UiaRoot.h"
     12 
     13 namespace mozilla {
     14 
     15 namespace a11y {
     16 class RootAccessible;
     17 
     18 class MsaaRootAccessible : public MsaaDocAccessible, public UiaRoot {
     19 public:
     20  explicit MsaaRootAccessible(Accessible* aAcc)
     21      : MsaaDocAccessible(aAcc), mOuter(&mInternalUnknown) {}
     22 
     23  /**
     24   * This method enables a RootAccessibleWrap to be wrapped by a
     25   * LazyInstantiator.
     26   *
     27   * @param aOuter The IUnknown of the object that is wrapping this
     28   *               RootAccessibleWrap, or nullptr to unwrap the aOuter from
     29   *               a previous call.
     30   * @return This objects own IUnknown (as opposed to aOuter's IUnknown).
     31   */
     32  already_AddRefed<IUnknown> Aggregate(IUnknown* aOuter);
     33 
     34  /**
     35   * @return This object's own IUnknown, as opposed to its wrapper's IUnknown
     36   *         which is what would be returned by QueryInterface(IID_IUnknown).
     37   */
     38  already_AddRefed<IUnknown> GetInternalUnknown();
     39 
     40 private:
     41  // DECLARE_AGGREGATABLE declares the internal IUnknown methods as well as
     42  // mInternalUnknown.
     43  DECLARE_AGGREGATABLE(MsaaRootAccessible);
     44  IUnknown* mOuter;
     45 
     46  RootAccessible* RootAcc();
     47 };
     48 
     49 }  // namespace a11y
     50 }  // namespace mozilla
     51 
     52 #endif