michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsWebShellWindow_h__ michael@0: #define nsWebShellWindow_h__ michael@0: michael@0: #include "mozilla/Mutex.h" michael@0: #include "nsIWebProgressListener.h" michael@0: #include "nsITimer.h" michael@0: #include "nsCOMPtr.h" michael@0: #include "nsXULWindow.h" michael@0: #include "nsIWidgetListener.h" michael@0: michael@0: /* Forward declarations.... */ michael@0: class nsIURI; michael@0: michael@0: struct nsWidgetInitData; michael@0: michael@0: namespace mozilla { michael@0: class WebShellWindowTimerCallback; michael@0: } // namespace mozilla michael@0: michael@0: class nsWebShellWindow : public nsXULWindow, michael@0: public nsIWebProgressListener, michael@0: public nsIWidgetListener michael@0: { michael@0: public: michael@0: nsWebShellWindow(uint32_t aChromeFlags); michael@0: michael@0: // nsISupports interface... michael@0: NS_DECL_ISUPPORTS_INHERITED michael@0: michael@0: // nsWebShellWindow methods... michael@0: nsresult Initialize(nsIXULWindow * aParent, nsIXULWindow * aOpener, michael@0: nsIURI* aUrl, michael@0: int32_t aInitialWidth, int32_t aInitialHeight, michael@0: bool aIsHiddenWindow, michael@0: nsWidgetInitData& widgetInitData); michael@0: michael@0: nsresult Toolbar(); michael@0: michael@0: // nsIWebProgressListener michael@0: NS_DECL_NSIWEBPROGRESSLISTENER michael@0: michael@0: // nsIBaseWindow michael@0: NS_IMETHOD Destroy(); michael@0: michael@0: // nsIWidgetListener michael@0: virtual nsIXULWindow* GetXULWindow() { return this; } michael@0: virtual nsIPresShell* GetPresShell(); michael@0: virtual bool WindowMoved(nsIWidget* aWidget, int32_t x, int32_t y); michael@0: virtual bool WindowResized(nsIWidget* aWidget, int32_t aWidth, int32_t aHeight); michael@0: virtual bool RequestWindowClose(nsIWidget* aWidget); michael@0: virtual void SizeModeChanged(nsSizeMode sizeMode); michael@0: virtual void OSToolbarButtonPressed(); michael@0: virtual bool ZLevelChanged(bool aImmediate, nsWindowZ *aPlacement, michael@0: nsIWidget* aRequestBelow, nsIWidget** aActualBelow); michael@0: virtual void WindowActivated(); michael@0: virtual void WindowDeactivated(); michael@0: michael@0: protected: michael@0: friend class mozilla::WebShellWindowTimerCallback; michael@0: michael@0: virtual ~nsWebShellWindow(); michael@0: michael@0: void LoadContentAreas(); michael@0: bool ExecuteCloseHandler(); michael@0: void ConstrainToOpenerScreen(int32_t* aX, int32_t* aY); michael@0: michael@0: nsCOMPtr mSPTimer; michael@0: mozilla::Mutex mSPTimerLock; michael@0: michael@0: void SetPersistenceTimer(uint32_t aDirtyFlags); michael@0: void FirePersistenceTimer(); michael@0: }; michael@0: michael@0: michael@0: #endif /* nsWebShellWindow_h__ */