xpfe/appshell/src/nsAppShellWindowEnumerator.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #ifndef nsAppShellWindowEnumerator_h
michael@0 7 #define nsAppShellWindowEnumerator_h
michael@0 8
michael@0 9 #include "nsCOMPtr.h"
michael@0 10 #include "nsString.h"
michael@0 11
michael@0 12 #include "nsISimpleEnumerator.h"
michael@0 13 #include "nsIXULWindow.h"
michael@0 14
michael@0 15 class nsWindowMediator;
michael@0 16
michael@0 17 //
michael@0 18 // nsWindowInfo
michael@0 19 //
michael@0 20
michael@0 21 struct nsWindowInfo
michael@0 22 {
michael@0 23 nsWindowInfo(nsIXULWindow* inWindow, int32_t inTimeStamp);
michael@0 24 ~nsWindowInfo();
michael@0 25
michael@0 26 nsCOMPtr<nsIXULWindow> mWindow;
michael@0 27 int32_t mTimeStamp;
michael@0 28 uint32_t mZLevel;
michael@0 29
michael@0 30 // each struct is in two, independent, circular, doubly-linked lists
michael@0 31 nsWindowInfo *mYounger, // next younger in sequence
michael@0 32 *mOlder;
michael@0 33 nsWindowInfo *mLower, // next lower in z-order
michael@0 34 *mHigher;
michael@0 35
michael@0 36 bool TypeEquals(const nsAString &aType);
michael@0 37 void InsertAfter(nsWindowInfo *inOlder, nsWindowInfo *inHigher);
michael@0 38 void Unlink(bool inAge, bool inZ);
michael@0 39 void ReferenceSelf(bool inAge, bool inZ);
michael@0 40 };
michael@0 41
michael@0 42 //
michael@0 43 // virtual enumerators
michael@0 44 //
michael@0 45
michael@0 46 class nsAppShellWindowEnumerator : public nsISimpleEnumerator {
michael@0 47
michael@0 48 friend class nsWindowMediator;
michael@0 49
michael@0 50 public:
michael@0 51 nsAppShellWindowEnumerator(const char16_t* aTypeString,
michael@0 52 nsWindowMediator& inMediator);
michael@0 53 virtual ~nsAppShellWindowEnumerator();
michael@0 54 NS_IMETHOD GetNext(nsISupports **retval) = 0;
michael@0 55 NS_IMETHOD HasMoreElements(bool *retval);
michael@0 56
michael@0 57 NS_DECL_ISUPPORTS
michael@0 58
michael@0 59 protected:
michael@0 60
michael@0 61 void AdjustInitialPosition();
michael@0 62 virtual nsWindowInfo *FindNext() = 0;
michael@0 63
michael@0 64 void WindowRemoved(nsWindowInfo *inInfo);
michael@0 65
michael@0 66 nsWindowMediator *mWindowMediator;
michael@0 67 nsString mType;
michael@0 68 nsWindowInfo *mCurrentPosition;
michael@0 69 };
michael@0 70
michael@0 71 class nsASDOMWindowEnumerator : public nsAppShellWindowEnumerator {
michael@0 72
michael@0 73 public:
michael@0 74 nsASDOMWindowEnumerator(const char16_t* aTypeString,
michael@0 75 nsWindowMediator& inMediator);
michael@0 76 virtual ~nsASDOMWindowEnumerator();
michael@0 77 NS_IMETHOD GetNext(nsISupports **retval);
michael@0 78 };
michael@0 79
michael@0 80 class nsASXULWindowEnumerator : public nsAppShellWindowEnumerator {
michael@0 81
michael@0 82 public:
michael@0 83 nsASXULWindowEnumerator(const char16_t* aTypeString,
michael@0 84 nsWindowMediator& inMediator);
michael@0 85 virtual ~nsASXULWindowEnumerator();
michael@0 86 NS_IMETHOD GetNext(nsISupports **retval);
michael@0 87 };
michael@0 88
michael@0 89 //
michael@0 90 // concrete enumerators
michael@0 91 //
michael@0 92
michael@0 93 class nsASDOMWindowEarlyToLateEnumerator : public nsASDOMWindowEnumerator {
michael@0 94
michael@0 95 public:
michael@0 96 nsASDOMWindowEarlyToLateEnumerator(const char16_t* aTypeString,
michael@0 97 nsWindowMediator& inMediator);
michael@0 98
michael@0 99 virtual ~nsASDOMWindowEarlyToLateEnumerator();
michael@0 100
michael@0 101 protected:
michael@0 102 virtual nsWindowInfo *FindNext();
michael@0 103 };
michael@0 104
michael@0 105 class nsASXULWindowEarlyToLateEnumerator : public nsASXULWindowEnumerator {
michael@0 106
michael@0 107 public:
michael@0 108 nsASXULWindowEarlyToLateEnumerator(const char16_t* aTypeString,
michael@0 109 nsWindowMediator& inMediator);
michael@0 110
michael@0 111 virtual ~nsASXULWindowEarlyToLateEnumerator();
michael@0 112
michael@0 113 protected:
michael@0 114 virtual nsWindowInfo *FindNext();
michael@0 115 };
michael@0 116
michael@0 117 class nsASDOMWindowFrontToBackEnumerator : public nsASDOMWindowEnumerator {
michael@0 118
michael@0 119 public:
michael@0 120 nsASDOMWindowFrontToBackEnumerator(const char16_t* aTypeString,
michael@0 121 nsWindowMediator& inMediator);
michael@0 122
michael@0 123 virtual ~nsASDOMWindowFrontToBackEnumerator();
michael@0 124
michael@0 125 protected:
michael@0 126 virtual nsWindowInfo *FindNext();
michael@0 127 };
michael@0 128
michael@0 129 class nsASXULWindowFrontToBackEnumerator : public nsASXULWindowEnumerator {
michael@0 130
michael@0 131 public:
michael@0 132 nsASXULWindowFrontToBackEnumerator(const char16_t* aTypeString,
michael@0 133 nsWindowMediator& inMediator);
michael@0 134
michael@0 135 virtual ~nsASXULWindowFrontToBackEnumerator();
michael@0 136
michael@0 137 protected:
michael@0 138 virtual nsWindowInfo *FindNext();
michael@0 139 };
michael@0 140
michael@0 141 class nsASDOMWindowBackToFrontEnumerator : public nsASDOMWindowEnumerator {
michael@0 142
michael@0 143 public:
michael@0 144 nsASDOMWindowBackToFrontEnumerator(const char16_t* aTypeString,
michael@0 145 nsWindowMediator& inMediator);
michael@0 146
michael@0 147 virtual ~nsASDOMWindowBackToFrontEnumerator();
michael@0 148
michael@0 149 protected:
michael@0 150 virtual nsWindowInfo *FindNext();
michael@0 151 };
michael@0 152
michael@0 153 class nsASXULWindowBackToFrontEnumerator : public nsASXULWindowEnumerator {
michael@0 154
michael@0 155 public:
michael@0 156 nsASXULWindowBackToFrontEnumerator(const char16_t* aTypeString,
michael@0 157 nsWindowMediator& inMediator);
michael@0 158
michael@0 159 virtual ~nsASXULWindowBackToFrontEnumerator();
michael@0 160
michael@0 161 protected:
michael@0 162 virtual nsWindowInfo *FindNext();
michael@0 163 };
michael@0 164
michael@0 165 #endif

mercurial