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