OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WEBKIT_GLUE_WEBWIDGET_H__ | 5 #ifndef WEBKIT_GLUE_WEBWIDGET_H__ |
6 #define WEBKIT_GLUE_WEBWIDGET_H__ | 6 #define WEBKIT_GLUE_WEBWIDGET_H__ |
7 | 7 |
8 #include "base/ref_counted.h" | 8 #include "base/ref_counted.h" |
9 #include "skia/ext/platform_canvas.h" | 9 #include "skia/ext/platform_canvas.h" |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 // Called to layout the WebWidget. This MUST be called before Paint, and it | 39 // Called to layout the WebWidget. This MUST be called before Paint, and it |
40 // may result in calls to WebWidgetDelegate::DidInvalidateRect. | 40 // may result in calls to WebWidgetDelegate::DidInvalidateRect. |
41 virtual void Layout() = 0; | 41 virtual void Layout() = 0; |
42 | 42 |
43 // Called to paint the specified region of the WebWidget onto the given canvas
. | 43 // Called to paint the specified region of the WebWidget onto the given canvas
. |
44 // You MUST call Layout before calling this method. It is okay to call Paint | 44 // You MUST call Layout before calling this method. It is okay to call Paint |
45 // multiple times once Layout has been called, assuming no other changes are | 45 // multiple times once Layout has been called, assuming no other changes are |
46 // made to the WebWidget (e.g., once events are processed, it should be assume
d | 46 // made to the WebWidget (e.g., once events are processed, it should be assume
d |
47 // that another call to Layout is warranted before painting again). | 47 // that another call to Layout is warranted before painting again). |
48 virtual void Paint(gfx::PlatformCanvas* canvas, const gfx::Rect& rect) = 0; | 48 virtual void Paint(skia::PlatformCanvas* canvas, const gfx::Rect& rect) = 0; |
49 | 49 |
50 // Called to inform the WebWidget of an input event. | 50 // Called to inform the WebWidget of an input event. |
51 // Returns true if the event has been processed, false otherwise. | 51 // Returns true if the event has been processed, false otherwise. |
52 virtual bool HandleInputEvent(const WebInputEvent* input_event) = 0; | 52 virtual bool HandleInputEvent(const WebInputEvent* input_event) = 0; |
53 | 53 |
54 // Called to inform the WebWidget that mouse capture was lost. | 54 // Called to inform the WebWidget that mouse capture was lost. |
55 virtual void MouseCaptureLost() = 0; | 55 virtual void MouseCaptureLost() = 0; |
56 | 56 |
57 // Called to inform the WebWidget that it has gained or lost keyboard focus. | 57 // Called to inform the WebWidget that it has gained or lost keyboard focus. |
58 virtual void SetFocus(bool enable) = 0; | 58 virtual void SetFocus(bool enable) = 0; |
59 | 59 |
60 // Called to inform the webwidget of a composition event from IMM | 60 // Called to inform the webwidget of a composition event from IMM |
61 // (Input Method Manager). | 61 // (Input Method Manager). |
62 virtual bool ImeSetComposition(int string_type, int cursor_position, | 62 virtual bool ImeSetComposition(int string_type, int cursor_position, |
63 int target_start, int target_end, | 63 int target_start, int target_end, |
64 const std::wstring& ime_string) = 0; | 64 const std::wstring& ime_string) = 0; |
65 | 65 |
66 // Retrieve the status of this widget required by IME APIs. | 66 // Retrieve the status of this widget required by IME APIs. |
67 virtual bool ImeUpdateStatus(bool* enable_ime, const void** node, | 67 virtual bool ImeUpdateStatus(bool* enable_ime, const void** node, |
68 gfx::Rect* caret_rect) = 0; | 68 gfx::Rect* caret_rect) = 0; |
69 | 69 |
70 private: | 70 private: |
71 DISALLOW_EVIL_CONSTRUCTORS(WebWidget); | 71 DISALLOW_EVIL_CONSTRUCTORS(WebWidget); |
72 }; | 72 }; |
73 | 73 |
74 #endif // #ifndef WEBKIT_GLUE_WEBWIDGET_H__ | 74 #endif // #ifndef WEBKIT_GLUE_WEBWIDGET_H__ |
75 | 75 |
OLD | NEW |