OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 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_APP_LIST_VIEWS_APP_LIST_DRAG_AND_DROP_HOST_H_ |
| 6 #define UI_APP_LIST_VIEWS_APP_LIST_DRAG_AND_DROP_HOST_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 namespace gfx { |
| 11 class Point; |
| 12 } // namespace gfx |
| 13 |
| 14 namespace app_list { |
| 15 |
| 16 // This class will get used by the AppListView to drag and drop Application |
| 17 // shortcuts onto another host (the launcher). |
| 18 class ApplicationDragAndDropHost { |
| 19 public: |
| 20 // A drag operation could get started. The recipient has to return true if |
| 21 // he wants to take it - e.g. |location_in_screen_poordinates| is over a |
| 22 // target area. The passed |app_id| identifies the application which should |
| 23 // get dropped. |
| 24 virtual bool StartDrag(const std::string& app_id, |
| 25 const gfx::Point& location_in_screen_coordinates) = 0; |
| 26 |
| 27 // This gets only called when the |StartDrag| function returned true and it |
| 28 // dispatches the mouse coordinate change accordingly. When the function |
| 29 // returns false it requests that the operation be aborted since the event |
| 30 // location is out of bounds. |
| 31 virtual bool Drag(const gfx::Point& location_in_screen_coordinates) = 0; |
| 32 |
| 33 // Once |StartDrag| returned true, this function is guaranteed to be called |
| 34 // when the mouse / touch events stop. If |cancel| is set, the drag operation |
| 35 // was aborted, otherwise the change should be kept. |
| 36 virtual void EndDrag(bool cancel) = 0; |
| 37 }; |
| 38 |
| 39 } // namespace app_list |
| 40 |
| 41 #endif // UI_APP_LIST_VIEWS_APP_LIST_DRAG_AND_DROP_HOST_H_ |
OLD | NEW |