OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ASH_LAUNCHER_LAUNCHER_BUTTON_HOST_H_ | 5 #ifndef ASH_LAUNCHER_LAUNCHER_BUTTON_HOST_H_ |
6 #define ASH_LAUNCHER_LAUNCHER_BUTTON_HOST_H_ | 6 #define ASH_LAUNCHER_LAUNCHER_BUTTON_HOST_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/wm/shelf_types.h" | 9 #include "ash/wm/shelf_types.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
11 | 11 |
| 12 namespace ui { |
| 13 class LocatedEvent; |
| 14 } |
| 15 |
12 namespace views { | 16 namespace views { |
13 class LocatedEvent; | |
14 class View; | 17 class View; |
15 } | 18 } |
16 | 19 |
17 namespace ash { | 20 namespace ash { |
18 namespace internal { | 21 namespace internal { |
19 | 22 |
20 // The launcher buttons communicate back to the host by way of this interface. | 23 // The launcher buttons communicate back to the host by way of this interface. |
21 // This interface is used to enable reordering the items on the launcher. | 24 // This interface is used to enable reordering the items on the launcher. |
22 class ASH_EXPORT LauncherButtonHost { | 25 class ASH_EXPORT LauncherButtonHost { |
23 public: | 26 public: |
24 enum Pointer { | 27 enum Pointer { |
25 NONE, | 28 NONE, |
26 MOUSE, | 29 MOUSE, |
27 TOUCH, | 30 TOUCH, |
28 }; | 31 }; |
29 | 32 |
30 // Invoked when a pointer device is pressed on a view. | 33 // Invoked when a pointer device is pressed on a view. |
31 virtual void PointerPressedOnButton(views::View* view, | 34 virtual void PointerPressedOnButton(views::View* view, |
32 Pointer pointer, | 35 Pointer pointer, |
33 const views::LocatedEvent& event) = 0; | 36 const ui::LocatedEvent& event) = 0; |
34 | 37 |
35 // Invoked when a pointer device is dragged over a view. | 38 // Invoked when a pointer device is dragged over a view. |
36 virtual void PointerDraggedOnButton(views::View* view, | 39 virtual void PointerDraggedOnButton(views::View* view, |
37 Pointer pointer, | 40 Pointer pointer, |
38 const views::LocatedEvent& event) = 0; | 41 const ui::LocatedEvent& event) = 0; |
39 | 42 |
40 // Invoked either if a pointer device is released or mouse capture canceled. | 43 // Invoked either if a pointer device is released or mouse capture canceled. |
41 virtual void PointerReleasedOnButton(views::View* view, | 44 virtual void PointerReleasedOnButton(views::View* view, |
42 Pointer pointer, | 45 Pointer pointer, |
43 bool canceled) = 0; | 46 bool canceled) = 0; |
44 | 47 |
45 // Invoked when the mouse moves on the item. | 48 // Invoked when the mouse moves on the item. |
46 virtual void MouseMovedOverButton(views::View* view) = 0; | 49 virtual void MouseMovedOverButton(views::View* view) = 0; |
47 | 50 |
48 // Invoked when the mouse enters the item. | 51 // Invoked when the mouse enters the item. |
49 virtual void MouseEnteredButton(views::View* view) = 0; | 52 virtual void MouseEnteredButton(views::View* view) = 0; |
50 | 53 |
51 // Invoked when the mouse exits the item. | 54 // Invoked when the mouse exits the item. |
52 virtual void MouseExitedButton(views::View* view) = 0; | 55 virtual void MouseExitedButton(views::View* view) = 0; |
53 | 56 |
54 virtual ShelfAlignment GetShelfAlignment() const = 0; | 57 virtual ShelfAlignment GetShelfAlignment() const = 0; |
55 | 58 |
56 // Invoked to get the accessible name of the item. | 59 // Invoked to get the accessible name of the item. |
57 virtual string16 GetAccessibleName(const views::View* view) = 0; | 60 virtual string16 GetAccessibleName(const views::View* view) = 0; |
58 | 61 |
59 protected: | 62 protected: |
60 virtual ~LauncherButtonHost() {} | 63 virtual ~LauncherButtonHost() {} |
61 }; | 64 }; |
62 | 65 |
63 } // namespace internal | 66 } // namespace internal |
64 } // namespace ash | 67 } // namespace ash |
65 | 68 |
66 #endif // ASH_LAUNCHER_LAUNCHER_BUTTON_HOST_H_ | 69 #endif // ASH_LAUNCHER_LAUNCHER_BUTTON_HOST_H_ |
OLD | NEW |