2001-09-29 00:14:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2001-09-05 03:30:24 +04:00
|
|
|
|
2013-12-04 02:03:45 +04:00
|
|
|
#ifndef nsAppShellWindowEnumerator_h
|
|
|
|
#define nsAppShellWindowEnumerator_h
|
|
|
|
|
2001-09-05 03:30:24 +04:00
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsString.h"
|
|
|
|
|
2018-08-19 00:22:47 +03:00
|
|
|
#include "nsSimpleEnumerator.h"
|
2001-09-05 03:30:24 +04:00
|
|
|
#include "nsIXULWindow.h"
|
|
|
|
|
|
|
|
class nsWindowMediator;
|
|
|
|
|
2009-01-03 07:06:52 +03:00
|
|
|
//
|
|
|
|
// nsWindowInfo
|
|
|
|
//
|
2001-09-05 03:30:24 +04:00
|
|
|
|
|
|
|
struct nsWindowInfo {
|
2019-05-01 11:47:10 +03:00
|
|
|
nsWindowInfo(nsIXULWindow* inWindow, int32_t inTimeStamp);
|
2001-09-05 03:30:24 +04:00
|
|
|
~nsWindowInfo();
|
|
|
|
|
|
|
|
nsCOMPtr<nsIXULWindow> mWindow;
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t mTimeStamp;
|
|
|
|
uint32_t mZLevel;
|
2001-09-05 03:30:24 +04:00
|
|
|
|
|
|
|
// each struct is in two, independent, circular, doubly-linked lists
|
|
|
|
nsWindowInfo *mYounger, // next younger in sequence
|
|
|
|
*mOlder;
|
|
|
|
nsWindowInfo *mLower, // next lower in z-order
|
|
|
|
*mHigher;
|
2017-07-06 15:00:35 +03:00
|
|
|
|
2019-05-01 11:47:10 +03:00
|
|
|
bool TypeEquals(const nsAString& aType);
|
|
|
|
void InsertAfter(nsWindowInfo* inOlder, nsWindowInfo* inHigher);
|
2011-09-29 10:19:26 +04:00
|
|
|
void Unlink(bool inAge, bool inZ);
|
|
|
|
void ReferenceSelf(bool inAge, bool inZ);
|
2001-09-05 03:30:24 +04:00
|
|
|
};
|
|
|
|
|
2009-01-03 07:06:52 +03:00
|
|
|
//
|
|
|
|
// virtual enumerators
|
|
|
|
//
|
2001-09-05 03:30:24 +04:00
|
|
|
|
2018-08-19 00:22:47 +03:00
|
|
|
class nsAppShellWindowEnumerator : public nsSimpleEnumerator {
|
2001-09-05 03:30:24 +04:00
|
|
|
friend class nsWindowMediator;
|
|
|
|
|
|
|
|
public:
|
2019-05-01 11:47:10 +03:00
|
|
|
nsAppShellWindowEnumerator(const char16_t* aTypeString,
|
|
|
|
nsWindowMediator& inMediator);
|
|
|
|
NS_IMETHOD GetNext(nsISupports** retval) override = 0;
|
|
|
|
NS_IMETHOD HasMoreElements(bool* retval) override;
|
2001-09-05 03:30:24 +04:00
|
|
|
|
|
|
|
protected:
|
2018-08-19 00:22:47 +03:00
|
|
|
~nsAppShellWindowEnumerator() override;
|
2014-06-24 20:36:45 +04:00
|
|
|
|
2001-09-05 03:30:24 +04:00
|
|
|
void AdjustInitialPosition();
|
2019-05-01 11:47:10 +03:00
|
|
|
virtual nsWindowInfo* FindNext() = 0;
|
2001-09-05 03:30:24 +04:00
|
|
|
|
2019-05-01 11:47:10 +03:00
|
|
|
void WindowRemoved(nsWindowInfo* inInfo);
|
2001-09-05 03:30:24 +04:00
|
|
|
|
2019-05-01 11:47:10 +03:00
|
|
|
nsWindowMediator* mWindowMediator;
|
2001-09-05 03:30:24 +04:00
|
|
|
nsString mType;
|
2019-05-01 11:47:10 +03:00
|
|
|
nsWindowInfo* mCurrentPosition;
|
2001-09-05 03:30:24 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
class nsASDOMWindowEnumerator : public nsAppShellWindowEnumerator {
|
|
|
|
public:
|
2019-05-01 11:47:10 +03:00
|
|
|
nsASDOMWindowEnumerator(const char16_t* aTypeString,
|
|
|
|
nsWindowMediator& inMediator);
|
2001-09-05 03:30:24 +04:00
|
|
|
virtual ~nsASDOMWindowEnumerator();
|
2019-05-01 11:47:10 +03:00
|
|
|
NS_IMETHOD GetNext(nsISupports** retval) override;
|
2001-09-05 03:30:24 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
class nsASXULWindowEnumerator : public nsAppShellWindowEnumerator {
|
|
|
|
public:
|
2019-05-01 11:47:10 +03:00
|
|
|
nsASXULWindowEnumerator(const char16_t* aTypeString,
|
|
|
|
nsWindowMediator& inMediator);
|
2001-09-05 03:30:24 +04:00
|
|
|
virtual ~nsASXULWindowEnumerator();
|
2019-05-01 11:47:10 +03:00
|
|
|
NS_IMETHOD GetNext(nsISupports** retval) override;
|
2018-08-19 07:06:32 +03:00
|
|
|
|
2019-05-01 11:47:10 +03:00
|
|
|
const nsID& DefaultInterface() override { return NS_GET_IID(nsIXULWindow); }
|
2001-09-05 03:30:24 +04:00
|
|
|
};
|
|
|
|
|
2009-01-03 07:06:52 +03:00
|
|
|
//
|
|
|
|
// concrete enumerators
|
|
|
|
//
|
2001-09-05 03:30:24 +04:00
|
|
|
|
|
|
|
class nsASDOMWindowEarlyToLateEnumerator : public nsASDOMWindowEnumerator {
|
|
|
|
public:
|
2019-05-01 11:47:10 +03:00
|
|
|
nsASDOMWindowEarlyToLateEnumerator(const char16_t* aTypeString,
|
|
|
|
nsWindowMediator& inMediator);
|
2001-09-05 03:30:24 +04:00
|
|
|
|
|
|
|
virtual ~nsASDOMWindowEarlyToLateEnumerator();
|
|
|
|
|
|
|
|
protected:
|
2019-05-01 11:47:10 +03:00
|
|
|
virtual nsWindowInfo* FindNext() override;
|
2001-09-05 03:30:24 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
class nsASXULWindowEarlyToLateEnumerator : public nsASXULWindowEnumerator {
|
|
|
|
public:
|
2019-05-01 11:47:10 +03:00
|
|
|
nsASXULWindowEarlyToLateEnumerator(const char16_t* aTypeString,
|
|
|
|
nsWindowMediator& inMediator);
|
2001-09-05 03:30:24 +04:00
|
|
|
|
|
|
|
virtual ~nsASXULWindowEarlyToLateEnumerator();
|
|
|
|
|
|
|
|
protected:
|
2019-05-01 11:47:10 +03:00
|
|
|
virtual nsWindowInfo* FindNext() override;
|
2001-09-05 03:30:24 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
class nsASXULWindowFrontToBackEnumerator : public nsASXULWindowEnumerator {
|
|
|
|
public:
|
2019-05-01 11:47:10 +03:00
|
|
|
nsASXULWindowFrontToBackEnumerator(const char16_t* aTypeString,
|
|
|
|
nsWindowMediator& inMediator);
|
2001-09-05 03:30:24 +04:00
|
|
|
|
|
|
|
virtual ~nsASXULWindowFrontToBackEnumerator();
|
|
|
|
|
|
|
|
protected:
|
2019-05-01 11:47:10 +03:00
|
|
|
virtual nsWindowInfo* FindNext() override;
|
2001-09-05 03:30:24 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
class nsASXULWindowBackToFrontEnumerator : public nsASXULWindowEnumerator {
|
|
|
|
public:
|
2019-05-01 11:47:10 +03:00
|
|
|
nsASXULWindowBackToFrontEnumerator(const char16_t* aTypeString,
|
|
|
|
nsWindowMediator& inMediator);
|
2001-09-05 03:30:24 +04:00
|
|
|
|
|
|
|
virtual ~nsASXULWindowBackToFrontEnumerator();
|
|
|
|
|
|
|
|
protected:
|
2019-05-01 11:47:10 +03:00
|
|
|
virtual nsWindowInfo* FindNext() override;
|
2001-09-05 03:30:24 +04:00
|
|
|
};
|
2013-12-04 02:03:45 +04:00
|
|
|
|
|
|
|
#endif
|