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_CLIENT_DRAG_DROP_DELEGATE_H_ | 5 #ifndef UI_AURA_CLIENT_DRAG_DROP_DELEGATE_H_ |
6 #define UI_AURA_CLIENT_DRAG_DROP_DELEGATE_H_ | 6 #define UI_AURA_CLIENT_DRAG_DROP_DELEGATE_H_ |
7 | 7 |
8 #include "ui/aura/aura_export.h" | 8 #include "ui/aura/aura_export.h" |
9 | 9 |
| 10 namespace ui { |
| 11 class DropTargetEvent; |
| 12 } |
| 13 |
10 namespace aura { | 14 namespace aura { |
11 class DropTargetEvent; | |
12 class Window; | 15 class Window; |
13 namespace client { | 16 namespace client { |
14 | 17 |
15 // Delegate interface for drag and drop actions on aura::Window. | 18 // Delegate interface for drag and drop actions on aura::Window. |
16 class AURA_EXPORT DragDropDelegate { | 19 class AURA_EXPORT DragDropDelegate { |
17 public: | 20 public: |
18 // OnDragEntered is invoked when the mouse enters this window during a drag & | 21 // OnDragEntered is invoked when the mouse enters this window during a drag & |
19 // drop session. This is immediately followed by an invocation of | 22 // drop session. This is immediately followed by an invocation of |
20 // OnDragUpdated, and eventually one of OnDragExited or OnPerformDrop. | 23 // OnDragUpdated, and eventually one of OnDragExited or OnPerformDrop. |
21 virtual void OnDragEntered(const DropTargetEvent& event) = 0; | 24 virtual void OnDragEntered(const ui::DropTargetEvent& event) = 0; |
22 | 25 |
23 // Invoked during a drag and drop session while the mouse is over the window. | 26 // Invoked during a drag and drop session while the mouse is over the window. |
24 // This should return a bitmask of the DragDropTypes::DragOperation supported | 27 // This should return a bitmask of the DragDropTypes::DragOperation supported |
25 // based on the location of the event. Return 0 to indicate the drop should | 28 // based on the location of the event. Return 0 to indicate the drop should |
26 // not be accepted. | 29 // not be accepted. |
27 virtual int OnDragUpdated(const DropTargetEvent& event) = 0; | 30 virtual int OnDragUpdated(const ui::DropTargetEvent& event) = 0; |
28 | 31 |
29 // Invoked during a drag and drop session when the mouse exits the window, or | 32 // Invoked during a drag and drop session when the mouse exits the window, or |
30 // when the drag session was canceled and the mouse was over the window. | 33 // when the drag session was canceled and the mouse was over the window. |
31 virtual void OnDragExited() = 0; | 34 virtual void OnDragExited() = 0; |
32 | 35 |
33 // Invoked during a drag and drop session when OnDragUpdated returns a valid | 36 // Invoked during a drag and drop session when OnDragUpdated returns a valid |
34 // operation and the user release the mouse. | 37 // operation and the user release the mouse. |
35 virtual int OnPerformDrop(const DropTargetEvent& event) = 0; | 38 virtual int OnPerformDrop(const ui::DropTargetEvent& event) = 0; |
36 | 39 |
37 protected: | 40 protected: |
38 virtual ~DragDropDelegate() {} | 41 virtual ~DragDropDelegate() {} |
39 }; | 42 }; |
40 | 43 |
41 AURA_EXPORT void SetDragDropDelegate(Window* window, | 44 AURA_EXPORT void SetDragDropDelegate(Window* window, |
42 DragDropDelegate* delegate); | 45 DragDropDelegate* delegate); |
43 AURA_EXPORT DragDropDelegate* GetDragDropDelegate(Window* window); | 46 AURA_EXPORT DragDropDelegate* GetDragDropDelegate(Window* window); |
44 | 47 |
45 } // namespace client | 48 } // namespace client |
46 } // namespace aura | 49 } // namespace aura |
47 | 50 |
48 #endif // UI_AURA_CLIENT_DRAG_DROP_DELEGATE_H_ | 51 #endif // UI_AURA_CLIENT_DRAG_DROP_DELEGATE_H_ |
OLD | NEW |