]>
Commit | Line | Data |
---|---|---|
a90939db JF |
1 | /* |
2 | * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | |
3 | * | |
4 | * This library is free software; you can redistribute it and/or | |
5 | * modify it under the terms of the GNU Library General Public | |
6 | * License as published by the Free Software Foundation; either | |
7 | * version 2 of the License, or (at your option) any later version. | |
8 | * | |
9 | * This library is distributed in the hope that it will be useful, | |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
12 | * Library General Public License for more details. | |
13 | * | |
14 | * You should have received a copy of the GNU Library General Public License | |
15 | * along with this library; see the file COPYING.LIB. If not, write to | |
16 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
17 | * Boston, MA 02110-1301, USA. | |
18 | */ | |
19 | ||
20 | #ifndef Chrome_h | |
21 | #define Chrome_h | |
22 | ||
23 | #include "FileChooser.h" | |
24 | #include "FocusDirection.h" | |
25 | #include "HostWindow.h" | |
26 | #include <wtf/Forward.h> | |
27 | #include <wtf/RefPtr.h> | |
28 | ||
29 | #ifndef __OBJC__ | |
30 | class WAKView; | |
31 | #else | |
32 | @class WAKView; | |
33 | #endif | |
34 | ||
35 | #if PLATFORM(MAC) | |
36 | #ifndef __OBJC__ | |
37 | class NSView; | |
38 | #endif | |
39 | #endif | |
40 | ||
41 | namespace WebCore { | |
42 | ||
43 | class ChromeClient; | |
44 | class ContextMenu; | |
45 | class FloatRect; | |
46 | class Frame; | |
47 | class Geolocation; | |
48 | class HitTestResult; | |
49 | class IntRect; | |
50 | class Page; | |
51 | class String; | |
52 | ||
53 | struct FrameLoadRequest; | |
54 | struct WindowFeatures; | |
55 | ||
56 | class Chrome : public HostWindow { | |
57 | public: | |
58 | Chrome(Page*, ChromeClient*); | |
59 | ~Chrome(); | |
60 | ||
61 | ChromeClient* client() { return m_client; } | |
62 | ||
63 | // HostWindow methods. | |
64 | virtual void repaint(const IntRect&, bool contentChanged, bool immediate = false, bool repaintContentOnly = false); | |
65 | virtual void scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect); | |
66 | virtual IntPoint screenToWindow(const IntPoint&) const; | |
67 | virtual IntRect windowToScreen(const IntRect&) const; | |
68 | virtual PlatformWidget platformWindow() const; | |
69 | virtual void scrollRectIntoView(const IntRect&, const ScrollView*) const; | |
70 | ||
71 | void contentsSizeChanged(Frame*, const IntSize&) const; | |
72 | ||
73 | void setWindowRect(const FloatRect&) const; | |
74 | FloatRect windowRect() const; | |
75 | ||
76 | FloatRect pageRect() const; | |
77 | ||
78 | float scaleFactor(); | |
79 | ||
80 | void focus(bool userGesture) const; | |
81 | void unfocus() const; | |
82 | ||
83 | bool canTakeFocus(FocusDirection) const; | |
84 | void takeFocus(FocusDirection) const; | |
85 | ||
86 | Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&, const bool) const; | |
87 | void show() const; | |
88 | ||
89 | bool canRunModal() const; | |
90 | bool canRunModalNow() const; | |
91 | void runModal() const; | |
92 | ||
93 | void setToolbarsVisible(bool) const; | |
94 | bool toolbarsVisible() const; | |
95 | ||
96 | void setStatusbarVisible(bool) const; | |
97 | bool statusbarVisible() const; | |
98 | ||
99 | void setScrollbarsVisible(bool) const; | |
100 | bool scrollbarsVisible() const; | |
101 | ||
102 | void setMenubarVisible(bool) const; | |
103 | bool menubarVisible() const; | |
104 | ||
105 | void setResizable(bool) const; | |
106 | ||
107 | bool canRunBeforeUnloadConfirmPanel(); | |
108 | bool runBeforeUnloadConfirmPanel(const String& message, Frame* frame); | |
109 | ||
110 | void closeWindowSoon(); | |
111 | ||
112 | void runJavaScriptAlert(Frame*, const String&); | |
113 | bool runJavaScriptConfirm(Frame*, const String&); | |
114 | bool runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result); | |
115 | void setStatusbarText(Frame*, const String&); | |
116 | bool shouldInterruptJavaScript(); | |
117 | ||
118 | IntRect windowResizerRect() const; | |
119 | ||
120 | void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags); | |
121 | ||
122 | void setToolTip(const HitTestResult&); | |
123 | ||
124 | void print(Frame*); | |
125 | ||
126 | void enableSuddenTermination(); | |
127 | void disableSuddenTermination(); | |
128 | ||
129 | bool requestGeolocationPermissionForFrame(Frame*, Geolocation*); | |
130 | ||
131 | void runOpenPanel(Frame*, PassRefPtr<FileChooser>); | |
132 | ||
133 | #if PLATFORM(MAC) | |
134 | void focusNSView(NSView*); | |
135 | #endif | |
136 | ||
137 | private: | |
138 | Page* m_page; | |
139 | ChromeClient* m_client; | |
140 | }; | |
141 | } | |
142 | ||
143 | #endif // Chrome_h |