2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07: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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-12-03 14:03:45 -08:00
|
|
|
#ifndef nsAppShellWindowEnumerator_h
|
|
|
|
#define nsAppShellWindowEnumerator_h
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsString.h"
|
|
|
|
|
|
|
|
#include "nsISimpleEnumerator.h"
|
|
|
|
#include "nsIXULWindow.h"
|
|
|
|
|
|
|
|
class nsWindowMediator;
|
|
|
|
|
2009-01-02 20:06:52 -08:00
|
|
|
//
|
|
|
|
// nsWindowInfo
|
|
|
|
//
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
struct nsWindowInfo
|
|
|
|
{
|
2012-08-22 08:56:38 -07:00
|
|
|
nsWindowInfo(nsIXULWindow* inWindow, int32_t inTimeStamp);
|
2007-03-22 10:30:00 -07:00
|
|
|
~nsWindowInfo();
|
|
|
|
|
|
|
|
nsCOMPtr<nsIXULWindow> mWindow;
|
2012-08-22 08:56:38 -07:00
|
|
|
int32_t mTimeStamp;
|
|
|
|
uint32_t mZLevel;
|
2007-03-22 10:30:00 -07: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;
|
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
bool TypeEquals(const nsAString &aType);
|
2007-03-22 10:30:00 -07:00
|
|
|
void InsertAfter(nsWindowInfo *inOlder, nsWindowInfo *inHigher);
|
2011-09-28 23:19:26 -07:00
|
|
|
void Unlink(bool inAge, bool inZ);
|
|
|
|
void ReferenceSelf(bool inAge, bool inZ);
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
2009-01-02 20:06:52 -08:00
|
|
|
//
|
|
|
|
// virtual enumerators
|
|
|
|
//
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
class nsAppShellWindowEnumerator : public nsISimpleEnumerator {
|
|
|
|
|
|
|
|
friend class nsWindowMediator;
|
|
|
|
|
|
|
|
public:
|
2014-01-04 07:02:17 -08:00
|
|
|
nsAppShellWindowEnumerator(const char16_t* aTypeString,
|
2009-01-05 10:58:59 -08:00
|
|
|
nsWindowMediator& inMediator);
|
2015-01-06 20:46:46 -08:00
|
|
|
NS_IMETHOD GetNext(nsISupports **retval) MOZ_OVERRIDE = 0;
|
|
|
|
NS_IMETHOD HasMoreElements(bool *retval) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2014-06-24 09:36:45 -07:00
|
|
|
virtual ~nsAppShellWindowEnumerator();
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
void AdjustInitialPosition();
|
|
|
|
virtual nsWindowInfo *FindNext() = 0;
|
|
|
|
|
|
|
|
void WindowRemoved(nsWindowInfo *inInfo);
|
|
|
|
|
|
|
|
nsWindowMediator *mWindowMediator;
|
|
|
|
nsString mType;
|
|
|
|
nsWindowInfo *mCurrentPosition;
|
|
|
|
};
|
|
|
|
|
|
|
|
class nsASDOMWindowEnumerator : public nsAppShellWindowEnumerator {
|
|
|
|
|
|
|
|
public:
|
2014-01-04 07:02:17 -08:00
|
|
|
nsASDOMWindowEnumerator(const char16_t* aTypeString,
|
2009-01-05 10:58:59 -08:00
|
|
|
nsWindowMediator& inMediator);
|
2007-03-22 10:30:00 -07:00
|
|
|
virtual ~nsASDOMWindowEnumerator();
|
|
|
|
NS_IMETHOD GetNext(nsISupports **retval);
|
|
|
|
};
|
|
|
|
|
|
|
|
class nsASXULWindowEnumerator : public nsAppShellWindowEnumerator {
|
|
|
|
|
|
|
|
public:
|
2014-01-04 07:02:17 -08:00
|
|
|
nsASXULWindowEnumerator(const char16_t* aTypeString,
|
2009-01-05 10:58:59 -08:00
|
|
|
nsWindowMediator& inMediator);
|
2007-03-22 10:30:00 -07:00
|
|
|
virtual ~nsASXULWindowEnumerator();
|
|
|
|
NS_IMETHOD GetNext(nsISupports **retval);
|
|
|
|
};
|
|
|
|
|
2009-01-02 20:06:52 -08:00
|
|
|
//
|
|
|
|
// concrete enumerators
|
|
|
|
//
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
class nsASDOMWindowEarlyToLateEnumerator : public nsASDOMWindowEnumerator {
|
|
|
|
|
|
|
|
public:
|
2014-01-04 07:02:17 -08:00
|
|
|
nsASDOMWindowEarlyToLateEnumerator(const char16_t* aTypeString,
|
2009-01-05 10:58:59 -08:00
|
|
|
nsWindowMediator& inMediator);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
virtual ~nsASDOMWindowEarlyToLateEnumerator();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual nsWindowInfo *FindNext();
|
|
|
|
};
|
|
|
|
|
|
|
|
class nsASXULWindowEarlyToLateEnumerator : public nsASXULWindowEnumerator {
|
|
|
|
|
|
|
|
public:
|
2014-01-04 07:02:17 -08:00
|
|
|
nsASXULWindowEarlyToLateEnumerator(const char16_t* aTypeString,
|
2009-01-05 10:58:59 -08:00
|
|
|
nsWindowMediator& inMediator);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
virtual ~nsASXULWindowEarlyToLateEnumerator();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual nsWindowInfo *FindNext();
|
|
|
|
};
|
|
|
|
|
|
|
|
class nsASDOMWindowFrontToBackEnumerator : public nsASDOMWindowEnumerator {
|
|
|
|
|
|
|
|
public:
|
2014-01-04 07:02:17 -08:00
|
|
|
nsASDOMWindowFrontToBackEnumerator(const char16_t* aTypeString,
|
2009-01-05 10:58:59 -08:00
|
|
|
nsWindowMediator& inMediator);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
virtual ~nsASDOMWindowFrontToBackEnumerator();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual nsWindowInfo *FindNext();
|
|
|
|
};
|
|
|
|
|
|
|
|
class nsASXULWindowFrontToBackEnumerator : public nsASXULWindowEnumerator {
|
|
|
|
|
|
|
|
public:
|
2014-01-04 07:02:17 -08:00
|
|
|
nsASXULWindowFrontToBackEnumerator(const char16_t* aTypeString,
|
2009-01-05 10:58:59 -08:00
|
|
|
nsWindowMediator& inMediator);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
virtual ~nsASXULWindowFrontToBackEnumerator();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual nsWindowInfo *FindNext();
|
|
|
|
};
|
|
|
|
|
|
|
|
class nsASDOMWindowBackToFrontEnumerator : public nsASDOMWindowEnumerator {
|
|
|
|
|
|
|
|
public:
|
2014-01-04 07:02:17 -08:00
|
|
|
nsASDOMWindowBackToFrontEnumerator(const char16_t* aTypeString,
|
2009-01-05 10:58:59 -08:00
|
|
|
nsWindowMediator& inMediator);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
virtual ~nsASDOMWindowBackToFrontEnumerator();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual nsWindowInfo *FindNext();
|
|
|
|
};
|
|
|
|
|
|
|
|
class nsASXULWindowBackToFrontEnumerator : public nsASXULWindowEnumerator {
|
|
|
|
|
|
|
|
public:
|
2014-01-04 07:02:17 -08:00
|
|
|
nsASXULWindowBackToFrontEnumerator(const char16_t* aTypeString,
|
2009-01-05 10:58:59 -08:00
|
|
|
nsWindowMediator& inMediator);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
virtual ~nsASXULWindowBackToFrontEnumerator();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual nsWindowInfo *FindNext();
|
|
|
|
};
|
2013-12-03 14:03:45 -08:00
|
|
|
|
|
|
|
#endif
|