| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef UI_AURA_CLIENT_WINDOW_DRAG_DROP_DELEGATE_H_ | |
| 6 #define UI_AURA_CLIENT_WINDOW_DRAG_DROP_DELEGATE_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "ui/aura/aura_export.h" | |
| 10 | |
| 11 namespace aura { | |
| 12 | |
| 13 class DropTargetEvent; | |
| 14 | |
| 15 // Delegate interface for drag and drop actions on aura::Window. | |
| 16 class AURA_EXPORT WindowDragDropDelegate { | |
| 17 public: | |
| 18 // OnDragEntered is invoked when the mouse enters this window during a drag & | |
| 19 // drop session. This is immediately followed by an invocation of | |
| 20 // OnDragUpdated, and eventually one of OnDragExited or OnPerformDrop. | |
| 21 virtual void OnDragEntered(const DropTargetEvent& event) = 0; | |
| 22 | |
| 23 // 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 | |
| 25 // based on the location of the event. Return 0 to indicate the drop should | |
| 26 // not be accepted. | |
| 27 virtual int OnDragUpdated(const DropTargetEvent& event) = 0; | |
| 28 | |
| 29 // 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. | |
| 31 virtual void OnDragExited() = 0; | |
| 32 | |
| 33 // Invoked during a drag and drop session when OnDragUpdated returns a valid | |
| 34 // operation and the user release the mouse. | |
| 35 virtual int OnPerformDrop(const DropTargetEvent& event) = 0; | |
| 36 | |
| 37 protected: | |
| 38 virtual ~WindowDragDropDelegate() {} | |
| 39 }; | |
| 40 | |
| 41 } // namespace aura | |
| 42 | |
| 43 #endif // UI_AURA_CLIENT_WINDOW_DRAG_DROP_DELEGATE_H_ | |
| OLD | NEW |