Bug 1888590 - Mark some subtests on trusted-types-event-handlers.html as failing...
[gecko.git] / xpfe / appshell / nsAppShellWindowEnumerator.h
blobb5dc828dcfc126a82abe49e9dbdd176b739ce4d2
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/. */
6 #ifndef nsAppShellWindowEnumerator_h
7 #define nsAppShellWindowEnumerator_h
9 #include "nsCOMPtr.h"
10 #include "nsString.h"
12 #include "nsSimpleEnumerator.h"
13 #include "nsIAppWindow.h"
15 class nsWindowMediator;
18 // nsWindowInfo
21 struct nsWindowInfo {
22 nsWindowInfo(nsIAppWindow* inWindow, int32_t inTimeStamp);
23 ~nsWindowInfo();
25 nsCOMPtr<nsIAppWindow> mWindow;
26 int32_t mTimeStamp;
27 uint32_t mZLevel;
29 // each struct is in two, independent, circular, doubly-linked lists
30 nsWindowInfo *mYounger, // next younger in sequence
31 *mOlder;
32 nsWindowInfo *mLower, // next lower in z-order
33 *mHigher;
35 bool TypeEquals(const nsAString& aType);
36 void InsertAfter(nsWindowInfo* inOlder, nsWindowInfo* inHigher);
37 void Unlink(bool inAge, bool inZ);
38 void ReferenceSelf(bool inAge, bool inZ);
42 // virtual enumerators
45 class nsAppShellWindowEnumerator : public nsSimpleEnumerator {
46 friend class nsWindowMediator;
48 public:
49 nsAppShellWindowEnumerator(const char16_t* aTypeString,
50 nsWindowMediator& inMediator);
51 NS_IMETHOD GetNext(nsISupports** retval) override = 0;
52 NS_IMETHOD HasMoreElements(bool* retval) override;
54 protected:
55 ~nsAppShellWindowEnumerator() override;
57 void AdjustInitialPosition();
58 virtual nsWindowInfo* FindNext() = 0;
60 void WindowRemoved(nsWindowInfo* inInfo);
62 nsWindowMediator* mWindowMediator;
63 nsString mType;
64 nsWindowInfo* mCurrentPosition;
67 class nsASDOMWindowEnumerator : public nsAppShellWindowEnumerator {
68 public:
69 nsASDOMWindowEnumerator(const char16_t* aTypeString,
70 nsWindowMediator& inMediator);
71 virtual ~nsASDOMWindowEnumerator();
72 NS_IMETHOD GetNext(nsISupports** retval) override;
75 class nsASAppWindowEnumerator : public nsAppShellWindowEnumerator {
76 public:
77 nsASAppWindowEnumerator(const char16_t* aTypeString,
78 nsWindowMediator& inMediator);
79 virtual ~nsASAppWindowEnumerator();
80 NS_IMETHOD GetNext(nsISupports** retval) override;
82 const nsID& DefaultInterface() override { return NS_GET_IID(nsIAppWindow); }
86 // concrete enumerators
89 class nsASDOMWindowEarlyToLateEnumerator : public nsASDOMWindowEnumerator {
90 public:
91 nsASDOMWindowEarlyToLateEnumerator(const char16_t* aTypeString,
92 nsWindowMediator& inMediator);
94 virtual ~nsASDOMWindowEarlyToLateEnumerator();
96 protected:
97 virtual nsWindowInfo* FindNext() override;
100 class nsASAppWindowEarlyToLateEnumerator : public nsASAppWindowEnumerator {
101 public:
102 nsASAppWindowEarlyToLateEnumerator(const char16_t* aTypeString,
103 nsWindowMediator& inMediator);
105 virtual ~nsASAppWindowEarlyToLateEnumerator();
107 protected:
108 virtual nsWindowInfo* FindNext() override;
111 class nsASAppWindowFrontToBackEnumerator : public nsASAppWindowEnumerator {
112 public:
113 nsASAppWindowFrontToBackEnumerator(const char16_t* aTypeString,
114 nsWindowMediator& inMediator);
116 virtual ~nsASAppWindowFrontToBackEnumerator();
118 protected:
119 virtual nsWindowInfo* FindNext() override;
122 class nsASAppWindowBackToFrontEnumerator : public nsASAppWindowEnumerator {
123 public:
124 nsASAppWindowBackToFrontEnumerator(const char16_t* aTypeString,
125 nsWindowMediator& inMediator);
127 virtual ~nsASAppWindowBackToFrontEnumerator();
129 protected:
130 virtual nsWindowInfo* FindNext() override;
133 #endif