OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 15 matching lines...) Expand all Loading... |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef WebWidgetClient_h | 31 #ifndef WebWidgetClient_h |
32 #define WebWidgetClient_h | 32 #define WebWidgetClient_h |
33 | 33 |
34 #include "WebCommon.h" | 34 #include "WebCommon.h" |
35 #include "WebNavigationPolicy.h" | 35 #include "WebNavigationPolicy.h" |
| 36 #include "WebRect.h" |
| 37 #include "WebScreenInfo.h" |
36 | 38 |
37 namespace WebKit { | 39 namespace WebKit { |
38 class WebWidget; | 40 class WebWidget; |
39 struct WebCursorInfo; | 41 struct WebCursorInfo; |
40 struct WebRect; | |
41 struct WebScreenInfo; | |
42 | 42 |
43 class WebWidgetClient { | 43 class WebWidgetClient { |
44 public: | 44 public: |
45 // Called when a region of the WebWidget needs to be re-painted. | 45 // Called when a region of the WebWidget needs to be re-painted. |
46 virtual void didInvalidateRect(const WebRect&) = 0; | 46 virtual void didInvalidateRect(const WebRect&) { } |
47 | 47 |
48 // Called when a region of the WebWidget, given by clipRect, should be | 48 // Called when a region of the WebWidget, given by clipRect, should be |
49 // scrolled by the specified dx and dy amounts. | 49 // scrolled by the specified dx and dy amounts. |
50 virtual void didScrollRect(int dx, int dy, const WebRect& clipRect) = 0; | 50 virtual void didScrollRect(int dx, int dy, const WebRect& clipRect) { } |
51 | 51 |
52 // Called when the widget acquires or loses focus, respectively. | 52 // Called when the widget acquires or loses focus, respectively. |
53 virtual void didFocus() = 0; | 53 virtual void didFocus() { } |
54 virtual void didBlur() = 0; | 54 virtual void didBlur() { } |
55 | 55 |
56 // Called when the cursor for the widget changes. | 56 // Called when the cursor for the widget changes. |
57 virtual void didChangeCursor(const WebCursorInfo&) = 0; | 57 virtual void didChangeCursor(const WebCursorInfo&) { } |
58 | 58 |
59 // Called when the widget should be closed. WebWidget::close() should | 59 // Called when the widget should be closed. WebWidget::close() should |
60 // be called asynchronously as a result of this notification. | 60 // be called asynchronously as a result of this notification. |
61 virtual void closeWidgetSoon() = 0; | 61 virtual void closeWidgetSoon() { } |
62 | 62 |
63 // Called to show the widget according to the given policy. | 63 // Called to show the widget according to the given policy. |
64 virtual void show(WebNavigationPolicy) = 0; | 64 virtual void show(WebNavigationPolicy) { } |
65 | 65 |
66 // Called to block execution of the current thread until the widget is | 66 // Called to block execution of the current thread until the widget is |
67 // closed. | 67 // closed. |
68 virtual void runModal() = 0; | 68 virtual void runModal() { } |
69 | 69 |
70 // Called to get/set the position of the widget in screen coordinates. | 70 // Called to get/set the position of the widget in screen coordinates. |
71 virtual WebRect windowRect() = 0; | 71 virtual WebRect windowRect() { return WebRect(); } |
72 virtual void setWindowRect(const WebRect&) = 0; | 72 virtual void setWindowRect(const WebRect&) { } |
73 | 73 |
74 // Called to get the position of the resizer rect in window coordinates. | 74 // Called to get the position of the resizer rect in window coordinates. |
75 virtual WebRect windowResizerRect() = 0; | 75 virtual WebRect windowResizerRect() { return WebRect(); } |
76 | 76 |
77 // Called to get the position of the root window containing the widget | 77 // Called to get the position of the root window containing the widget |
78 // in screen coordinates. | 78 // in screen coordinates. |
79 virtual WebRect rootWindowRect() = 0; | 79 virtual WebRect rootWindowRect() { return WebRect(); } |
80 | 80 |
81 // Called to query information about the screen where this widget is | 81 // Called to query information about the screen where this widget is |
82 // displayed. | 82 // displayed. |
83 virtual WebScreenInfo screenInfo() = 0; | 83 virtual WebScreenInfo screenInfo() { return WebScreenInfo(); } |
84 | 84 |
85 protected: | 85 protected: |
86 ~WebWidgetClient() { } | 86 ~WebWidgetClient() { } |
87 }; | 87 }; |
88 | 88 |
89 } // namespace WebKit | 89 } // namespace WebKit |
90 | 90 |
91 #endif | 91 #endif |
OLD | NEW |