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___
15 class MOZ_STACK_CLASS nsDocShellEnumerator
{
17 enum class EnumerationDirection
: uint8_t { Forwards
, Backwards
};
19 nsDocShellEnumerator(EnumerationDirection aDirection
, int32_t aDocShellType
,
20 nsDocShell
& aRootItem
);
23 nsresult
BuildDocShellArray(nsTArray
<RefPtr
<nsIDocShell
>>& aItemArray
);
26 nsresult
BuildArrayRecursiveForwards(
27 nsDocShell
* aItem
, nsTArray
<RefPtr
<nsIDocShell
>>& aItemArray
);
28 nsresult
BuildArrayRecursiveBackwards(
29 nsDocShell
* aItem
, nsTArray
<RefPtr
<nsIDocShell
>>& aItemArray
);
32 const RefPtr
<nsDocShell
> mRootItem
;
34 const int32_t mDocShellType
; // only want shells of this type
36 const EnumerationDirection mDirection
;
39 #endif // nsDocShellEnumerator_h___