tor-browser

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

EnumVariant.h (1705B)


      1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim: set ts=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 file,
      5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #ifndef mozilla_a11y_EnumVariant_h__
      8 #define mozilla_a11y_EnumVariant_h__
      9 
     10 #include "IUnknownImpl.h"
     11 #include "MsaaAccessible.h"
     12 
     13 namespace mozilla {
     14 namespace a11y {
     15 
     16 /**
     17 * Used to fetch accessible children.
     18 */
     19 class ChildrenEnumVariant final : public IEnumVARIANT {
     20 public:
     21  explicit ChildrenEnumVariant(MsaaAccessible* aAnchor)
     22      : mAnchorMsaa(aAnchor),
     23        mCurAcc(mAnchorMsaa->Acc()->ChildAt(0)),
     24        mCurIndex(0) {}
     25 
     26  // IUnknown
     27  DECL_IUNKNOWN
     28 
     29  // IEnumVariant
     30  virtual /* [local] */ HRESULT STDMETHODCALLTYPE Next(
     31      /* [in] */ ULONG aCount,
     32      /* [length_is][size_is][out] */ VARIANT* aItems,
     33      /* [out] */ ULONG* aCountFetched);
     34 
     35  virtual HRESULT STDMETHODCALLTYPE Skip(
     36      /* [in] */ ULONG aCount);
     37 
     38  virtual HRESULT STDMETHODCALLTYPE Reset();
     39 
     40  virtual HRESULT STDMETHODCALLTYPE Clone(
     41      /* [out] */ IEnumVARIANT** aEnumVaraint);
     42 
     43 private:
     44  ChildrenEnumVariant() = delete;
     45  ChildrenEnumVariant& operator=(const ChildrenEnumVariant&) = delete;
     46 
     47  ChildrenEnumVariant(const ChildrenEnumVariant& aEnumVariant)
     48      : mAnchorMsaa(aEnumVariant.mAnchorMsaa),
     49        mCurAcc(aEnumVariant.mCurAcc),
     50        mCurIndex(aEnumVariant.mCurIndex) {}
     51  virtual ~ChildrenEnumVariant() {}
     52 
     53 protected:
     54  RefPtr<MsaaAccessible> mAnchorMsaa;
     55  Accessible* mCurAcc;
     56  uint32_t mCurIndex;
     57 };
     58 
     59 }  // namespace a11y
     60 }  // namespace mozilla
     61 
     62 #endif