accessible/windows/msaa/RootAccessibleWrap.h
author Sylvestre Ledru <sledru@mozilla.com>
Fri, 30 Nov 2018 11:46:48 +0100
changeset 448947 6f3709b3878117466168c40affa7bca0b60cf75b
parent 394994 d856b4067e8047a3d2f2b0426ba7247cb0ba2dd7
child 452446 f0a91d36587266d7454a450c6044d573664fbed5
permissions -rw-r--r--
Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format # ignore-this-changeset

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_a11y_RootAccessibleWrap_h__
#define mozilla_a11y_RootAccessibleWrap_h__

#include "mozilla/mscom/Aggregation.h"
#include "RootAccessible.h"

namespace mozilla {
namespace a11y {

class RootAccessibleWrap : public RootAccessible {
 public:
  RootAccessibleWrap(nsIDocument* aDocument, nsIPresShell* aPresShell);
  virtual ~RootAccessibleWrap();

  // RootAccessible
  virtual void DocumentActivated(DocAccessible* aDocument);

  /**
   * This method enables a RootAccessibleWrap to be wrapped by a
   * LazyInstantiator.
   *
   * @param aOuter The IUnknown of the object that is wrapping this
   *               RootAccessibleWrap, or nullptr to unwrap the aOuter from
   *               a previous call.
   * @return This objects own IUnknown (as opposed to aOuter's IUnknown).
   */
  already_AddRefed<IUnknown> Aggregate(IUnknown* aOuter);

  /**
   * @return This object's own IUnknown, as opposed to its wrapper's IUnknown
   *         which is what would be returned by QueryInterface(IID_IUnknown).
   */
  already_AddRefed<IUnknown> GetInternalUnknown();

  virtual /* [id] */ HRESULT STDMETHODCALLTYPE accNavigate(
      /* [in] */ long navDir,
      /* [optional][in] */ VARIANT varStart,
      /* [retval][out] */ VARIANT __RPC_FAR* pvarEndUpAt) override;

  virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_accFocus(
      /* [retval][out] */ VARIANT __RPC_FAR* pvarChild) override;

 private:
  // DECLARE_AGGREGATABLE declares the internal IUnknown methods as well as
  // mInternalUnknown.
  DECLARE_AGGREGATABLE(RootAccessibleWrap);
  IUnknown* mOuter;
};

}  // namespace a11y
}  // namespace mozilla

#endif