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_AURA_WINDOW_DELEGATE_H_ | 5 #ifndef UI_AURA_WINDOW_DELEGATE_H_ |
6 #define UI_AURA_WINDOW_DELEGATE_H_ | 6 #define UI_AURA_WINDOW_DELEGATE_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "ui/aura/aura_export.h" | 10 #include "ui/aura/aura_export.h" |
11 #include "ui/events/event_constants.h" | 11 #include "ui/events/event_constants.h" |
12 #include "ui/events/event_handler.h" | 12 #include "ui/events/event_handler.h" |
13 #include "ui/gfx/native_widget_types.h" | 13 #include "ui/gfx/native_widget_types.h" |
14 | 14 |
15 namespace gfx { | 15 namespace gfx { |
16 class Canvas; | 16 class Canvas; |
17 class Path; | 17 class Path; |
18 class Point; | 18 class Point; |
19 class Rect; | 19 class Rect; |
20 class Size; | 20 class Size; |
21 } | 21 } |
22 | 22 |
23 namespace ui { | 23 namespace ui { |
24 class GestureEvent; | 24 class GestureEvent; |
25 class KeyEvent; | 25 class KeyEvent; |
26 class Layer; | 26 class Layer; |
27 class MouseEvent; | 27 class MouseEvent; |
| 28 class TextInputClient; |
28 class Texture; | 29 class Texture; |
29 class TouchEvent; | 30 class TouchEvent; |
30 } | 31 } |
31 | 32 |
32 namespace aura { | 33 namespace aura { |
33 | 34 |
34 // Delegate interface for aura::Window. | 35 // Delegate interface for aura::Window. |
35 class AURA_EXPORT WindowDelegate : public ui::EventHandler { | 36 class AURA_EXPORT WindowDelegate : public ui::EventHandler { |
36 public: | 37 public: |
37 // Returns the window's minimum size, or size 0,0 if there is no limit. | 38 // Returns the window's minimum size, or size 0,0 if there is no limit. |
38 virtual gfx::Size GetMinimumSize() const = 0; | 39 virtual gfx::Size GetMinimumSize() const = 0; |
39 | 40 |
40 // Returns the window's maximum size, or size 0,0 if there is no limit. | 41 // Returns the window's maximum size, or size 0,0 if there is no limit. |
41 virtual gfx::Size GetMaximumSize() const = 0; | 42 virtual gfx::Size GetMaximumSize() const = 0; |
42 | 43 |
43 // Called when the Window's position and/or size changes. | 44 // Called when the Window's position and/or size changes. |
44 virtual void OnBoundsChanged(const gfx::Rect& old_bounds, | 45 virtual void OnBoundsChanged(const gfx::Rect& old_bounds, |
45 const gfx::Rect& new_bounds) = 0; | 46 const gfx::Rect& new_bounds) = 0; |
46 | 47 |
| 48 // Returns the focused text input client within this window. |
| 49 // This function does not look at child windows. |
| 50 virtual ui::TextInputClient* GetFocusedTextInputClient() = 0; |
| 51 |
47 // Returns the native cursor for the specified point, in window coordinates, | 52 // Returns the native cursor for the specified point, in window coordinates, |
48 // or NULL for the default cursor. | 53 // or NULL for the default cursor. |
49 virtual gfx::NativeCursor GetCursor(const gfx::Point& point) = 0; | 54 virtual gfx::NativeCursor GetCursor(const gfx::Point& point) = 0; |
50 | 55 |
51 // Returns the non-client component (see hit_test.h) containing |point|, in | 56 // Returns the non-client component (see hit_test.h) containing |point|, in |
52 // window coordinates. | 57 // window coordinates. |
53 virtual int GetNonClientComponent(const gfx::Point& point) const = 0; | 58 virtual int GetNonClientComponent(const gfx::Point& point) const = 0; |
54 | 59 |
55 // Returns true if event handling should descend into |child|. |location| is | 60 // Returns true if event handling should descend into |child|. |location| is |
56 // in terms of the Window. | 61 // in terms of the Window. |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // above returns true. | 105 // above returns true. |
101 virtual void GetHitTestMask(gfx::Path* mask) const = 0; | 106 virtual void GetHitTestMask(gfx::Path* mask) const = 0; |
102 | 107 |
103 protected: | 108 protected: |
104 ~WindowDelegate() override {} | 109 ~WindowDelegate() override {} |
105 }; | 110 }; |
106 | 111 |
107 } // namespace aura | 112 } // namespace aura |
108 | 113 |
109 #endif // UI_AURA_WINDOW_DELEGATE_H_ | 114 #endif // UI_AURA_WINDOW_DELEGATE_H_ |
OLD | NEW |