| 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 | |
| 18 class Window; | 17 class Window; |
| 18 namespace client { |
| 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. Returns the drag operation that was | 25 // Initiates a drag and drop session. Returns the drag operation that was |
| 26 // applied at the end of the drag drop session. | 26 // applied at the end of the drag drop session. |
| 27 virtual int StartDragAndDrop(const ui::OSExchangeData& data, | 27 virtual int StartDragAndDrop(const ui::OSExchangeData& data, |
| 28 int operation) = 0; | 28 int operation) = 0; |
| 29 | 29 |
| 30 // Called when mouse is dragged during a drag and drop. | 30 // Called when mouse is dragged during a drag and drop. |
| 31 virtual void DragUpdate(aura::Window* target, const MouseEvent& event) = 0; | 31 virtual void DragUpdate(aura::Window* target, const MouseEvent& event) = 0; |
| 32 | 32 |
| 33 // Called when mouse is released during a drag and drop. | 33 // Called when mouse is released during a drag and drop. |
| 34 virtual void Drop(aura::Window* target, const MouseEvent& event) = 0; | 34 virtual void Drop(aura::Window* target, const MouseEvent& event) = 0; |
| 35 | 35 |
| 36 // Called when a drag and drop session is cancelled. | 36 // Called when a drag and drop session is cancelled. |
| 37 virtual void DragCancel() = 0; | 37 virtual void DragCancel() = 0; |
| 38 | 38 |
| 39 // Returns true if a drag and drop session is in progress. | 39 // Returns true if a drag and drop session is in progress. |
| 40 virtual bool IsDragDropInProgress() = 0; | 40 virtual bool IsDragDropInProgress() = 0; |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 AURA_EXPORT void SetDragDropClient(DragDropClient* client); |
| 44 AURA_EXPORT DragDropClient* GetDragDropClient(); |
| 45 |
| 46 } // namespace client |
| 43 } // namespace aura | 47 } // namespace aura |
| 44 | 48 |
| 45 #endif // UI_AURA_CLIENT_DRAG_DROP_CLIENT_H_ | 49 #endif // UI_AURA_CLIENT_DRAG_DROP_CLIENT_H_ |
| OLD | NEW |