|
1 // -*- mode: c++; c-basic-offset: 4 -*- |
|
2 /* |
|
3 * Copyright (C) 2006-2007 Apple, Inc. |
|
4 * |
|
5 * This library is free software; you can redistribute it and/or |
|
6 * modify it under the terms of the GNU Library General Public |
|
7 * License as published by the Free Software Foundation; either |
|
8 * version 2 of the License, or (at your option) any later version. |
|
9 * |
|
10 * This library is distributed in the hope that it will be useful, |
|
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13 * Library General Public License for more details. |
|
14 * |
|
15 * You should have received a copy of the GNU Library General Public License |
|
16 * along with this library; see the file COPYING.LIB. If not, write to |
|
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
|
18 * Boston, MA 02110-1301, USA. |
|
19 */ |
|
20 |
|
21 #ifndef ChromeClient_h |
|
22 #define ChromeClient_h |
|
23 |
|
24 #include "FocusDirection.h" |
|
25 #include "chrome.h" |
|
26 |
|
27 namespace WebCore { |
|
28 |
|
29 class FloatRect; |
|
30 class Frame; |
|
31 class HitTestResult; |
|
32 class IntRect; |
|
33 class Page; |
|
34 class String; |
|
35 |
|
36 struct FrameLoadRequest; |
|
37 |
|
38 class ChromeClient { |
|
39 public: |
|
40 virtual ~ChromeClient() { } |
|
41 virtual void chromeDestroyed() = 0; |
|
42 |
|
43 virtual void setWindowRect(const FloatRect&) = 0; |
|
44 virtual FloatRect windowRect() = 0; |
|
45 |
|
46 virtual FloatRect pageRect() = 0; |
|
47 |
|
48 virtual float scaleFactor() = 0; |
|
49 |
|
50 virtual void focus() = 0; |
|
51 virtual void unfocus() = 0; |
|
52 |
|
53 virtual bool canTakeFocus(FocusDirection) = 0; |
|
54 virtual void takeFocus(FocusDirection) = 0; |
|
55 |
|
56 // The Frame pointer provides the ChromeClient with context about which |
|
57 // Frame wants to create the new Page. Also, the newly created window |
|
58 // should not be shown to the user until the ChromeClient of the newly |
|
59 // created Page has its show method called. |
|
60 virtual Page* createWindow(Frame*, const FrameLoadRequest&) = 0; |
|
61 virtual Page* createModalDialog(Frame*, const FrameLoadRequest&) = 0; |
|
62 virtual void show() = 0; |
|
63 |
|
64 virtual bool canRunModal() = 0; |
|
65 virtual void runModal() = 0; |
|
66 |
|
67 virtual void setToolbarsVisible(bool) = 0; |
|
68 virtual bool toolbarsVisible() = 0; |
|
69 |
|
70 virtual void setStatusbarVisible(bool) = 0; |
|
71 virtual bool statusbarVisible() = 0; |
|
72 |
|
73 virtual void setScrollbarsVisible(bool) = 0; |
|
74 virtual bool scrollbarsVisible() = 0; |
|
75 |
|
76 virtual void setMenubarVisible(bool) = 0; |
|
77 virtual bool menubarVisible() = 0; |
|
78 |
|
79 virtual void setResizable(bool) = 0; |
|
80 |
|
81 virtual void addMessageToConsole(const String& message, MessageLevel messageLevel, unsigned int lineNumber, const String& sourceID) = 0; |
|
82 |
|
83 virtual bool canRunBeforeUnloadConfirmPanel() = 0; |
|
84 virtual bool runBeforeUnloadConfirmPanel(const String& message, Frame* frame) = 0; |
|
85 |
|
86 virtual void closeWindowSoon() = 0; |
|
87 |
|
88 virtual void runJavaScriptAlert(Frame*, const String&) = 0; |
|
89 virtual bool runJavaScriptConfirm(Frame*, const String&) = 0; |
|
90 virtual bool runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result) = 0; |
|
91 |
|
92 virtual void setStatusbarText(const String&) = 0; |
|
93 virtual bool shouldInterruptJavaScript() = 0; |
|
94 virtual bool tabsToLinks() const = 0; |
|
95 |
|
96 virtual IntRect windowResizerRect() const = 0; |
|
97 virtual void addToDirtyRegion(const IntRect&) = 0; |
|
98 virtual void scrollBackingStore(int dx, int dy, const IntRect& scrollViewRect, const IntRect& clipRect) = 0; |
|
99 virtual void updateBackingStore() = 0; |
|
100 |
|
101 virtual void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags) = 0; |
|
102 |
|
103 virtual void setToolTip(const String&) = 0; |
|
104 |
|
105 virtual void print(Frame*) = 0; |
|
106 #if PLATFORM(SYMBIAN) |
|
107 virtual void setElementVisibilityChanged(bool visibility) = 0; |
|
108 virtual bool elementVisibilityChanged() = 0; |
|
109 #endif |
|
110 }; |
|
111 |
|
112 } |
|
113 |
|
114 #endif // ChromeClient_h |