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.
5 #ifndef UI_VIEWS_DRAG_CONTROLLER_H_
6 #define UI_VIEWS_DRAG_CONTROLLER_H_
8 #include "ui/views/views_export.h"
21 // DragController is responsible for writing drag data for a view, as well as
22 // supplying the supported drag operations. Use DragController if you don't
24 class VIEWS_EXPORT DragController
{
26 // Writes the data for the drag.
27 virtual void WriteDragDataForView(View
* sender
,
28 const gfx::Point
& press_pt
,
29 ui::OSExchangeData
* data
) = 0;
31 // Returns the supported drag operations (see DragDropTypes for possible
32 // values). A drag is only started if this returns a non-zero value.
33 virtual int GetDragOperationsForView(View
* sender
,
34 const gfx::Point
& p
) = 0;
36 // Returns true if a drag operation can be started.
37 // |press_pt| represents the coordinates where the mouse was initially
38 // pressed down. |p| is the current mouse coordinates.
39 virtual bool CanStartDragForView(View
* sender
,
40 const gfx::Point
& press_pt
,
41 const gfx::Point
& p
) = 0;
44 virtual ~DragController() {}
49 #endif // UI_VIEWS_DRAG_CONTROLLER_H_