Bumping gaia.json for 1 gaia revision(s) a=gaia-bump
[gecko.git] / xpfe / appshell / nsWebShellWindow.h
blobcd703704ba7dfe72369e114fa98932a4f73d60c8
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 nsWebShellWindow_h__
7 #define nsWebShellWindow_h__
9 #include "mozilla/Mutex.h"
10 #include "nsIWebProgressListener.h"
11 #include "nsITimer.h"
12 #include "nsCOMPtr.h"
13 #include "nsXULWindow.h"
14 #include "nsIWidgetListener.h"
15 #include "nsITabParent.h"
17 /* Forward declarations.... */
18 class nsIURI;
20 struct nsWidgetInitData;
22 namespace mozilla {
23 class WebShellWindowTimerCallback;
24 } // namespace mozilla
26 class nsWebShellWindow MOZ_FINAL : public nsXULWindow,
27 public nsIWebProgressListener,
28 public nsIWidgetListener
30 public:
31 explicit nsWebShellWindow(uint32_t aChromeFlags);
33 // nsISupports interface...
34 NS_DECL_ISUPPORTS_INHERITED
36 // nsWebShellWindow methods...
37 nsresult Initialize(nsIXULWindow * aParent, nsIXULWindow * aOpener,
38 nsIURI* aUrl,
39 int32_t aInitialWidth, int32_t aInitialHeight,
40 bool aIsHiddenWindow,
41 nsITabParent *aOpeningTab,
42 nsWidgetInitData& widgetInitData);
44 nsresult Toolbar();
46 // nsIWebProgressListener
47 NS_DECL_NSIWEBPROGRESSLISTENER
49 // nsIBaseWindow
50 NS_IMETHOD Destroy();
52 // nsIWidgetListener
53 virtual nsIXULWindow* GetXULWindow() { return this; }
54 virtual nsIPresShell* GetPresShell();
55 virtual bool WindowMoved(nsIWidget* aWidget, int32_t x, int32_t y);
56 virtual bool WindowResized(nsIWidget* aWidget, int32_t aWidth, int32_t aHeight);
57 virtual bool RequestWindowClose(nsIWidget* aWidget);
58 virtual void SizeModeChanged(nsSizeMode sizeMode);
59 virtual void OSToolbarButtonPressed();
60 virtual bool ZLevelChanged(bool aImmediate, nsWindowZ *aPlacement,
61 nsIWidget* aRequestBelow, nsIWidget** aActualBelow);
62 virtual void WindowActivated();
63 virtual void WindowDeactivated();
65 protected:
66 friend class mozilla::WebShellWindowTimerCallback;
68 virtual ~nsWebShellWindow();
70 void LoadContentAreas();
71 bool ExecuteCloseHandler();
72 void ConstrainToOpenerScreen(int32_t* aX, int32_t* aY);
74 nsCOMPtr<nsITimer> mSPTimer;
75 mozilla::Mutex mSPTimerLock;
77 void SetPersistenceTimer(uint32_t aDirtyFlags);
78 void FirePersistenceTimer();
82 #endif /* nsWebShellWindow_h__ */