xpfe/appshell/src/nsWebShellWindow.h

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:72a399c79121
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/. */
5
6 #ifndef nsWebShellWindow_h__
7 #define nsWebShellWindow_h__
8
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
16 /* Forward declarations.... */
17 class nsIURI;
18
19 struct nsWidgetInitData;
20
21 namespace mozilla {
22 class WebShellWindowTimerCallback;
23 } // namespace mozilla
24
25 class nsWebShellWindow : public nsXULWindow,
26 public nsIWebProgressListener,
27 public nsIWidgetListener
28 {
29 public:
30 nsWebShellWindow(uint32_t aChromeFlags);
31
32 // nsISupports interface...
33 NS_DECL_ISUPPORTS_INHERITED
34
35 // nsWebShellWindow methods...
36 nsresult Initialize(nsIXULWindow * aParent, nsIXULWindow * aOpener,
37 nsIURI* aUrl,
38 int32_t aInitialWidth, int32_t aInitialHeight,
39 bool aIsHiddenWindow,
40 nsWidgetInitData& widgetInitData);
41
42 nsresult Toolbar();
43
44 // nsIWebProgressListener
45 NS_DECL_NSIWEBPROGRESSLISTENER
46
47 // nsIBaseWindow
48 NS_IMETHOD Destroy();
49
50 // nsIWidgetListener
51 virtual nsIXULWindow* GetXULWindow() { return this; }
52 virtual nsIPresShell* GetPresShell();
53 virtual bool WindowMoved(nsIWidget* aWidget, int32_t x, int32_t y);
54 virtual bool WindowResized(nsIWidget* aWidget, int32_t aWidth, int32_t aHeight);
55 virtual bool RequestWindowClose(nsIWidget* aWidget);
56 virtual void SizeModeChanged(nsSizeMode sizeMode);
57 virtual void OSToolbarButtonPressed();
58 virtual bool ZLevelChanged(bool aImmediate, nsWindowZ *aPlacement,
59 nsIWidget* aRequestBelow, nsIWidget** aActualBelow);
60 virtual void WindowActivated();
61 virtual void WindowDeactivated();
62
63 protected:
64 friend class mozilla::WebShellWindowTimerCallback;
65
66 virtual ~nsWebShellWindow();
67
68 void LoadContentAreas();
69 bool ExecuteCloseHandler();
70 void ConstrainToOpenerScreen(int32_t* aX, int32_t* aY);
71
72 nsCOMPtr<nsITimer> mSPTimer;
73 mozilla::Mutex mSPTimerLock;
74
75 void SetPersistenceTimer(uint32_t aDirtyFlags);
76 void FirePersistenceTimer();
77 };
78
79
80 #endif /* nsWebShellWindow_h__ */

mercurial