Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / ui / views / drag_controller.h
blobeace6a9839bc8c19c442abdc93c69ed57f9ed5a0
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"
10 namespace gfx {
11 class Point;
14 namespace ui {
15 class OSExchangeData;
18 namespace views {
19 class View;
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
23 // want to subclass.
24 class VIEWS_EXPORT DragController {
25 public:
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;
43 protected:
44 virtual ~DragController() {}
47 } // namespace views
49 #endif // UI_VIEWS_DRAG_CONTROLLER_H_