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_CLIENT_H_ | 5 #ifndef UI_AURA_CLIENT_DRAG_DROP_CLIENT_H_ |
6 #define UI_AURA_CLIENT_DRAG_DROP_CLIENT_H_ | 6 #define UI_AURA_CLIENT_DRAG_DROP_CLIENT_H_ |
7 | 7 |
8 #include "ui/aura/aura_export.h" | 8 #include "ui/aura/aura_export.h" |
9 #include "ui/aura/event.h" | 9 #include "ui/gfx/native_widget_types.h" |
| 10 |
| 11 namespace gfx { |
| 12 class Point; |
| 13 } |
10 | 14 |
11 namespace ui { | 15 namespace ui { |
| 16 class LocatedEvent; |
12 class OSExchangeData; | 17 class OSExchangeData; |
13 } | 18 } |
14 | 19 |
15 namespace aura { | 20 namespace aura { |
16 class RootWindow; | 21 class RootWindow; |
17 class Window; | 22 class Window; |
18 namespace client { | 23 namespace client { |
19 | 24 |
20 // An interface implemented by an object that controls a drag and drop session. | 25 // An interface implemented by an object that controls a drag and drop session. |
21 class AURA_EXPORT DragDropClient { | 26 class AURA_EXPORT DragDropClient { |
22 public: | 27 public: |
23 virtual ~DragDropClient() {} | 28 virtual ~DragDropClient() {} |
24 | 29 |
25 // Initiates a drag and drop session. Returns the drag operation that was | 30 // Initiates a drag and drop session. Returns the drag operation that was |
26 // applied at the end of the drag drop session. |root_location| is in the | 31 // applied at the end of the drag drop session. |root_location| is in the |
27 // RootWindow's coordinate system. | 32 // RootWindow's coordinate system. |
28 virtual int StartDragAndDrop(const ui::OSExchangeData& data, | 33 virtual int StartDragAndDrop(const ui::OSExchangeData& data, |
29 const gfx::Point& root_location, | 34 const gfx::Point& root_location, |
30 int operation) = 0; | 35 int operation) = 0; |
31 | 36 |
32 // Called when mouse is dragged during a drag and drop. | 37 // Called when mouse is dragged during a drag and drop. |
33 virtual void DragUpdate(aura::Window* target, const LocatedEvent& event) = 0; | 38 virtual void DragUpdate(aura::Window* target, |
| 39 const ui::LocatedEvent& event) = 0; |
34 | 40 |
35 // Called when mouse is released during a drag and drop. | 41 // Called when mouse is released during a drag and drop. |
36 virtual void Drop(aura::Window* target, const LocatedEvent& event) = 0; | 42 virtual void Drop(aura::Window* target, |
| 43 const ui::LocatedEvent& event) = 0; |
37 | 44 |
38 // Called when a drag and drop session is cancelled. | 45 // Called when a drag and drop session is cancelled. |
39 virtual void DragCancel() = 0; | 46 virtual void DragCancel() = 0; |
40 | 47 |
41 // Returns true if a drag and drop session is in progress. | 48 // Returns true if a drag and drop session is in progress. |
42 virtual bool IsDragDropInProgress() = 0; | 49 virtual bool IsDragDropInProgress() = 0; |
43 | 50 |
44 // Returns the current cursor according to the appropriate drag effect. This | 51 // Returns the current cursor according to the appropriate drag effect. This |
45 // should only be called if IsDragDropInProgress() returns true. If it is | 52 // should only be called if IsDragDropInProgress() returns true. If it is |
46 // called otherwise, the returned cursor is arbitrary. | 53 // called otherwise, the returned cursor is arbitrary. |
47 virtual gfx::NativeCursor GetDragCursor() = 0; | 54 virtual gfx::NativeCursor GetDragCursor() = 0; |
48 }; | 55 }; |
49 | 56 |
50 AURA_EXPORT void SetDragDropClient(RootWindow* root_window, | 57 AURA_EXPORT void SetDragDropClient(RootWindow* root_window, |
51 DragDropClient* client); | 58 DragDropClient* client); |
52 AURA_EXPORT DragDropClient* GetDragDropClient(RootWindow* root_window); | 59 AURA_EXPORT DragDropClient* GetDragDropClient(RootWindow* root_window); |
53 | 60 |
54 } // namespace client | 61 } // namespace client |
55 } // namespace aura | 62 } // namespace aura |
56 | 63 |
57 #endif // UI_AURA_CLIENT_DRAG_DROP_CLIENT_H_ | 64 #endif // UI_AURA_CLIENT_DRAG_DROP_CLIENT_H_ |
OLD | NEW |