OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ui/aura/aura_export.h" | 9 #include "ui/aura/aura_export.h" |
10 #include "ui/base/events.h" | 10 #include "ui/base/events.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 // window coordinates. | 48 // window coordinates. |
49 virtual int GetNonClientComponent(const gfx::Point& point) const = 0; | 49 virtual int GetNonClientComponent(const gfx::Point& point) const = 0; |
50 | 50 |
51 virtual bool OnMouseEvent(MouseEvent* event) = 0; | 51 virtual bool OnMouseEvent(MouseEvent* event) = 0; |
52 | 52 |
53 virtual ui::TouchStatus OnTouchEvent(TouchEvent* event) = 0; | 53 virtual ui::TouchStatus OnTouchEvent(TouchEvent* event) = 0; |
54 | 54 |
55 // Returns true of the window can be focused. | 55 // Returns true of the window can be focused. |
56 virtual bool CanFocus() = 0; | 56 virtual bool CanFocus() = 0; |
57 | 57 |
58 // Returns true if the window should be activated. |event| is either the mouse | |
59 // event supplied if the activation is the result of a mouse, or the touch | |
60 // event if the activation is the result of a touch, or NULL if activation is | |
61 // attempted for another reason. | |
62 virtual bool ShouldActivate(Event* event) = 0; | |
63 | |
64 // Sent when the window is activated. | |
65 virtual void OnActivated() = 0; | |
66 | |
67 // Sent when the window loses active status. | |
68 virtual void OnLostActive() = 0; | |
69 | |
70 // Invoked when mouse capture is lost on the window. | 58 // Invoked when mouse capture is lost on the window. |
71 virtual void OnCaptureLost() = 0; | 59 virtual void OnCaptureLost() = 0; |
72 | 60 |
73 // Asks the delegate to paint window contents into the supplied canvas. | 61 // Asks the delegate to paint window contents into the supplied canvas. |
74 virtual void OnPaint(gfx::Canvas* canvas) = 0; | 62 virtual void OnPaint(gfx::Canvas* canvas) = 0; |
75 | 63 |
76 // Called from Window's destructor before OnWindowDestroyed and before the | 64 // Called from Window's destructor before OnWindowDestroyed and before the |
77 // children have been destroyed. | 65 // children have been destroyed. |
78 virtual void OnWindowDestroying() = 0; | 66 virtual void OnWindowDestroying() = 0; |
79 | 67 |
80 // Called when the Window has been destroyed (i.e. from its destructor). This | 68 // Called when the Window has been destroyed (i.e. from its destructor). This |
81 // is called after OnWindowDestroying and after the children have been | 69 // is called after OnWindowDestroying and after the children have been |
82 // deleted. | 70 // deleted. |
83 // The delegate can use this as an opportunity to delete itself if necessary. | 71 // The delegate can use this as an opportunity to delete itself if necessary. |
84 virtual void OnWindowDestroyed() = 0; | 72 virtual void OnWindowDestroyed() = 0; |
85 | 73 |
86 // Called when the visibility of a Window changed. | 74 // Called when the visibility of a Window changed. |
87 virtual void OnWindowVisibilityChanged(bool visible) = 0; | 75 virtual void OnWindowVisibilityChanged(bool visible) = 0; |
88 | 76 |
89 protected: | 77 protected: |
90 virtual ~WindowDelegate() {} | 78 virtual ~WindowDelegate() {} |
91 }; | 79 }; |
92 | 80 |
93 } // namespace aura | 81 } // namespace aura |
94 | 82 |
95 #endif // UI_AURA_WINDOW_DELEGATE_H_ | 83 #endif // UI_AURA_WINDOW_DELEGATE_H_ |
OLD | NEW |