Bug 1885337 - Part 2: Implement to/from base64 methods. r=dminor
[gecko.git] / docshell / base / nsDocShellEnumerator.h
blob668ddee7e9142d5f34823f2fee3fa36cc5b42d3e
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/. */
7 #ifndef nsDocShellEnumerator_h___
8 #define nsDocShellEnumerator_h___
10 #include "nsTArray.h"
12 class nsDocShell;
13 class nsIDocShell;
15 class MOZ_STACK_CLASS nsDocShellEnumerator {
16 public:
17 enum class EnumerationDirection : uint8_t { Forwards, Backwards };
19 nsDocShellEnumerator(EnumerationDirection aDirection, int32_t aDocShellType,
20 nsDocShell& aRootItem);
22 public:
23 nsresult BuildDocShellArray(nsTArray<RefPtr<nsIDocShell>>& aItemArray);
25 private:
26 nsresult BuildArrayRecursiveForwards(
27 nsDocShell* aItem, nsTArray<RefPtr<nsIDocShell>>& aItemArray);
28 nsresult BuildArrayRecursiveBackwards(
29 nsDocShell* aItem, nsTArray<RefPtr<nsIDocShell>>& aItemArray);
31 private:
32 const RefPtr<nsDocShell> mRootItem;
34 const int32_t mDocShellType; // only want shells of this type
36 const EnumerationDirection mDirection;
39 #endif // nsDocShellEnumerator_h___