OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 VIEWS_CONTROLS_MENU_MENU_WRAPPER_H_ | 5 #ifndef VIEWS_CONTROLS_MENU_MENU_WRAPPER_H_ |
6 #define VIEWS_CONTROLS_MENU_MENU_WRAPPER_H_ | 6 #define VIEWS_CONTROLS_MENU_MENU_WRAPPER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ui/gfx/native_widget_types.h" | 9 #include "ui/gfx/native_widget_types.h" |
10 #include "views/views_api.h" | 10 #include "views/views_export.h" |
11 | 11 |
12 namespace gfx { | 12 namespace gfx { |
13 class Point; | 13 class Point; |
14 } | 14 } |
15 | 15 |
16 namespace views { | 16 namespace views { |
17 | 17 |
18 class Menu2; | 18 class Menu2; |
19 | 19 |
20 // An interface for clients that want a notification when a menu is opened. | 20 // An interface for clients that want a notification when a menu is opened. |
21 class MenuListener { | 21 class MenuListener { |
22 public: | 22 public: |
23 // This will be called after the menu has actually opened. | 23 // This will be called after the menu has actually opened. |
24 virtual void OnMenuOpened() = 0; | 24 virtual void OnMenuOpened() = 0; |
25 }; | 25 }; |
26 | 26 |
27 // An interface that wraps an object that implements a menu. | 27 // An interface that wraps an object that implements a menu. |
28 class VIEWS_API MenuWrapper { | 28 class VIEWS_EXPORT MenuWrapper { |
29 public: | 29 public: |
30 // All of the possible actions that can result from RunMenuAt. | 30 // All of the possible actions that can result from RunMenuAt. |
31 enum MenuAction { | 31 enum MenuAction { |
32 MENU_ACTION_NONE, // Menu cancelled, or never opened. | 32 MENU_ACTION_NONE, // Menu cancelled, or never opened. |
33 MENU_ACTION_SELECTED, // An item was selected. | 33 MENU_ACTION_SELECTED, // An item was selected. |
34 MENU_ACTION_PREVIOUS, // User wants to navigate to the previous menu. | 34 MENU_ACTION_PREVIOUS, // User wants to navigate to the previous menu. |
35 MENU_ACTION_NEXT, // User wants to navigate to the next menu. | 35 MENU_ACTION_NEXT, // User wants to navigate to the next menu. |
36 }; | 36 }; |
37 | 37 |
38 virtual ~MenuWrapper() {} | 38 virtual ~MenuWrapper() {} |
(...skipping 29 matching lines...) Expand all Loading... |
68 // Sets the minimum width of the menu. | 68 // Sets the minimum width of the menu. |
69 virtual void SetMinimumWidth(int width) = 0; | 69 virtual void SetMinimumWidth(int width) = 0; |
70 | 70 |
71 // Creates the appropriate instance of this wrapper for the current platform. | 71 // Creates the appropriate instance of this wrapper for the current platform. |
72 static MenuWrapper* CreateWrapper(Menu2* menu); | 72 static MenuWrapper* CreateWrapper(Menu2* menu); |
73 }; | 73 }; |
74 | 74 |
75 } // namespace views | 75 } // namespace views |
76 | 76 |
77 #endif // VIEWS_CONTROLS_MENU_MENU_WRAPPER_H_ | 77 #endif // VIEWS_CONTROLS_MENU_MENU_WRAPPER_H_ |
OLD | NEW |