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_VIEWS_EVENTS_DRAG_CONTROLLER_H_ |
| 6 #define UI_VIEWS_EVENTS_DRAG_CONTROLLER_H_ |
| 7 #pragma once |
| 8 |
| 9 namespace ui { |
| 10 |
| 11 // DragController is responsible for writing drag data for a View, as well as |
| 12 // supplying the supported drag operations without having to subclass View. |
| 13 class DragController { |
| 14 public: |
| 15 // Writes the data for the drag. |
| 16 virtual void WriteDragData(View* sender, |
| 17 const gfx::Point& press_pt, |
| 18 OSExchangeData* data) = 0; |
| 19 |
| 20 // Returns the supported drag operations (see DragDropTypes for possible |
| 21 // values). A drag is only started if this returns a non-zero value. |
| 22 virtual int GetDragOperations(View* sender, const gfx::Point& p) = 0; |
| 23 |
| 24 // Returns true if a drag operation can be started. |
| 25 // |press_pt| represents the coordinates where the mouse was initially |
| 26 // pressed down. |p| is the current mouse coordinates. |
| 27 virtual bool CanStartDrag(View* sender, |
| 28 const gfx::Point& press_pt, |
| 29 const gfx::Point& p) = 0; |
| 30 |
| 31 protected: |
| 32 virtual ~DragController() {} |
| 33 }; |
| 34 |
| 35 } // namespace ui |
| 36 |
| 37 #endif // UI_VIEWS_EVENTS_DRAG_CONTROLLER_H_ |
OLD | NEW |