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 ASH_SHELF_SHELF_BUTTON_HOST_H_ 6 #define ASH_SHELF_SHELF_BUTTON_HOST_H_ 7 8 #include "ash/ash_export.h" 9 #include "base/strings/string16.h" 10 11 namespace ui { 12 class LocatedEvent; 13 } 14 15 namespace views { 16 class View; 17 } 18 19 namespace ash { 20 namespace internal { 21 22 // The shelf buttons communicate back to the host by way of this interface. 23 // This interface is used to enable reordering the items on the shelf. 24 class ASH_EXPORT ShelfButtonHost { 25 public: 26 enum Pointer { 27 NONE, 28 DRAG_AND_DROP, 29 MOUSE, 30 TOUCH, 31 }; 32 33 // Invoked when a pointer device is pressed on a view. 34 virtual void PointerPressedOnButton(views::View* view, 35 Pointer pointer, 36 const ui::LocatedEvent& event) = 0; 37 38 // Invoked when a pointer device is dragged over a view. 39 virtual void PointerDraggedOnButton(views::View* view, 40 Pointer pointer, 41 const ui::LocatedEvent& event) = 0; 42 43 // Invoked either if a pointer device is released or mouse capture canceled. 44 virtual void PointerReleasedOnButton(views::View* view, 45 Pointer pointer, 46 bool canceled) = 0; 47 48 // Invoked when the mouse moves on the item. 49 virtual void MouseMovedOverButton(views::View* view) = 0; 50 51 // Invoked when the mouse enters the item. 52 virtual void MouseEnteredButton(views::View* view) = 0; 53 54 // Invoked when the mouse exits the item. 55 virtual void MouseExitedButton(views::View* view) = 0; 56 57 // Invoked to get the accessible name of the item. 58 virtual base::string16 GetAccessibleName(const views::View* view) = 0; 59 60 protected: 61 virtual ~ShelfButtonHost() {} 62 }; 63 64 } // namespace internal 65 } // namespace ash 66 67 #endif // ASH_SHELF_SHELF_BUTTON_HOST_H_ 68