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_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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ui/aura/aura_export.h" | 9 #include "ui/aura/aura_export.h" |
10 #include "ui/aura/event.h" | 10 #include "ui/aura/event.h" |
11 | 11 |
12 namespace ui { | 12 namespace ui { |
13 class OSExchangeData; | 13 class OSExchangeData; |
14 } | 14 } |
15 | 15 |
16 namespace aura { | 16 namespace aura { |
17 | 17 |
18 class Window; | 18 class Window; |
19 | 19 |
20 // An interface implemented by an object that controls a drag and drop session. | 20 // An interface implemented by an object that controls a drag and drop session. |
21 class AURA_EXPORT DragDropClient { | 21 class AURA_EXPORT DragDropClient { |
22 public: | 22 public: |
23 virtual ~DragDropClient() {} | 23 virtual ~DragDropClient() {} |
24 | 24 |
25 // Initiates a drag and drop session | 25 // Initiates a drag and drop session. Returns the drag operation that was |
26 virtual void StartDragAndDrop(const ui::OSExchangeData& data, | 26 // applied at the end of the drag drop session. |
| 27 virtual int StartDragAndDrop(const ui::OSExchangeData& data, |
27 int operation) = 0; | 28 int operation) = 0; |
28 | 29 |
29 // Called when mouse is dragged during a drag and drop. | 30 // Called when mouse is dragged during a drag and drop. |
30 virtual void DragUpdate(aura::Window* target, const MouseEvent& event) = 0; | 31 virtual void DragUpdate(aura::Window* target, const MouseEvent& event) = 0; |
31 | 32 |
32 // Called when mouse is released during a drag and drop. | 33 // Called when mouse is released during a drag and drop. |
33 virtual void Drop(aura::Window* target, const MouseEvent& event) = 0; | 34 virtual void Drop(aura::Window* target, const MouseEvent& event) = 0; |
34 | 35 |
35 // Called when a drag and drop session is cancelled. | 36 // Called when a drag and drop session is cancelled. |
36 virtual void DragCancel() = 0; | 37 virtual void DragCancel() = 0; |
| 38 |
| 39 // Returns true if a drag and drop session is in progress. |
| 40 virtual bool IsDragDropInProgress() = 0; |
37 }; | 41 }; |
38 | 42 |
39 } // namespace aura | 43 } // namespace aura |
40 | 44 |
41 #endif // UI_AURA_CLIENT_DRAG_DROP_CLIENT_H_ | 45 #endif // UI_AURA_CLIENT_DRAG_DROP_CLIENT_H_ |
OLD | NEW |