| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_VIEWS_WIDGET_NATIVE_WIDGET_DELEGATE_H_ | 5 #ifndef UI_VIEWS_WIDGET_NATIVE_WIDGET_DELEGATE_H_ |
| 6 #define UI_VIEWS_WIDGET_NATIVE_WIDGET_DELEGATE_H_ | 6 #define UI_VIEWS_WIDGET_NATIVE_WIDGET_DELEGATE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "ui/base/events.h" | 9 #include "ui/base/events.h" |
| 10 #include "ui/views/views_export.h" | 10 #include "ui/views/views_export.h" |
| 11 | 11 |
| 12 namespace gfx { | 12 namespace gfx { |
| 13 class Canvas; | 13 class CanvasSkia; |
| 14 class Point; | 14 class Point; |
| 15 class Size; | 15 class Size; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace views { | 18 namespace views { |
| 19 class InputMethod; | 19 class InputMethod; |
| 20 class GestureEvent; | 20 class GestureEvent; |
| 21 class KeyEvent; | 21 class KeyEvent; |
| 22 class MouseEvent; | 22 class MouseEvent; |
| 23 class TouchEvent; | 23 class TouchEvent; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 // Returns true if the delegate has a FocusManager. | 82 // Returns true if the delegate has a FocusManager. |
| 83 virtual bool HasFocusManager() const = 0; | 83 virtual bool HasFocusManager() const = 0; |
| 84 | 84 |
| 85 // Paints the widget using acceleration. If the widget is not using | 85 // Paints the widget using acceleration. If the widget is not using |
| 86 // accelerated painting this returns false and does nothing. | 86 // accelerated painting this returns false and does nothing. |
| 87 virtual bool OnNativeWidgetPaintAccelerated( | 87 virtual bool OnNativeWidgetPaintAccelerated( |
| 88 const gfx::Rect& dirty_region) = 0; | 88 const gfx::Rect& dirty_region) = 0; |
| 89 | 89 |
| 90 // Paints the rootview in the canvas. This will also refresh the compositor | 90 // Paints the rootview in the canvas. This will also refresh the compositor |
| 91 // tree if necessary when accelerated painting is enabled. | 91 // tree if necessary when accelerated painting is enabled. |
| 92 virtual void OnNativeWidgetPaint(gfx::Canvas* canvas) = 0; | 92 virtual void OnNativeWidgetPaint(gfx::CanvasSkia* canvas) = 0; |
| 93 | 93 |
| 94 // Returns the non-client component (see ui/base/hit_test.h) containing | 94 // Returns the non-client component (see ui/base/hit_test.h) containing |
| 95 // |point|, in client coordinates. | 95 // |point|, in client coordinates. |
| 96 virtual int GetNonClientComponent(const gfx::Point& point) = 0; | 96 virtual int GetNonClientComponent(const gfx::Point& point) = 0; |
| 97 | 97 |
| 98 // Mouse and key event handlers. | 98 // Mouse and key event handlers. |
| 99 virtual bool OnKeyEvent(const KeyEvent& event) = 0; | 99 virtual bool OnKeyEvent(const KeyEvent& event) = 0; |
| 100 virtual bool OnMouseEvent(const MouseEvent& event) = 0; | 100 virtual bool OnMouseEvent(const MouseEvent& event) = 0; |
| 101 virtual void OnMouseCaptureLost() = 0; | 101 virtual void OnMouseCaptureLost() = 0; |
| 102 virtual ui::TouchStatus OnTouchEvent(const TouchEvent& event) = 0; | 102 virtual ui::TouchStatus OnTouchEvent(const TouchEvent& event) = 0; |
| 103 virtual ui::GestureStatus OnGestureEvent(const GestureEvent& event) = 0; | 103 virtual ui::GestureStatus OnGestureEvent(const GestureEvent& event) = 0; |
| 104 | 104 |
| 105 // Runs the specified native command. Returns true if the command is handled. | 105 // Runs the specified native command. Returns true if the command is handled. |
| 106 virtual bool ExecuteCommand(int command_id) = 0; | 106 virtual bool ExecuteCommand(int command_id) = 0; |
| 107 | 107 |
| 108 // Returns the input method of the widget this delegate is associated with. | 108 // Returns the input method of the widget this delegate is associated with. |
| 109 // Note that this does not use the top level widget, so may return NULL | 109 // Note that this does not use the top level widget, so may return NULL |
| 110 // if the widget doesn't have input method. | 110 // if the widget doesn't have input method. |
| 111 virtual InputMethod* GetInputMethodDirect() = 0; | 111 virtual InputMethod* GetInputMethodDirect() = 0; |
| 112 | 112 |
| 113 // | 113 // |
| 114 virtual Widget* AsWidget() = 0; | 114 virtual Widget* AsWidget() = 0; |
| 115 virtual const Widget* AsWidget() const = 0; | 115 virtual const Widget* AsWidget() const = 0; |
| 116 }; | 116 }; |
| 117 | 117 |
| 118 } // namespace internal | 118 } // namespace internal |
| 119 } // namespace views | 119 } // namespace views |
| 120 | 120 |
| 121 #endif // UI_VIEWS_WIDGET_NATIVE_WIDGET_DELEGATE_H_ | 121 #endif // UI_VIEWS_WIDGET_NATIVE_WIDGET_DELEGATE_H_ |
| OLD | NEW |