OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
3 // LICENSE file. | 3 // LICENSE file. |
4 | 4 |
5 #ifndef CONTROLS_MENU_VIEWS_MENU_2_H_ | 5 #ifndef CONTROLS_MENU_VIEWS_MENU_2_H_ |
6 #define CONTROLS_MENU_VIEWS_MENU_2_H_ | 6 #define CONTROLS_MENU_VIEWS_MENU_2_H_ |
7 | 7 |
8 #include <string> | |
9 | |
10 #include "base/gfx/native_widget_types.h" | 8 #include "base/gfx/native_widget_types.h" |
| 9 #include "base/string16.h" |
11 | 10 |
12 namespace gfx { | 11 namespace gfx { |
13 class Point; | 12 class Point; |
14 } | 13 } |
15 class SkBitmap; | 14 class SkBitmap; |
16 | 15 |
17 namespace views { | 16 namespace views { |
18 | 17 |
19 class Accelerator; | 18 class Accelerator; |
20 class Menu2; | 19 class Menu2; |
(...skipping 30 matching lines...) Expand all Loading... |
51 // Returns the number of items in the menu. | 50 // Returns the number of items in the menu. |
52 virtual int GetItemCount() const = 0; | 51 virtual int GetItemCount() const = 0; |
53 | 52 |
54 // Returns the type of item at the specified index. | 53 // Returns the type of item at the specified index. |
55 virtual ItemType GetTypeAt(int index) const = 0; | 54 virtual ItemType GetTypeAt(int index) const = 0; |
56 | 55 |
57 // Returns the command id of the item at the specified index. | 56 // Returns the command id of the item at the specified index. |
58 virtual int GetCommandIdAt(int index) const = 0; | 57 virtual int GetCommandIdAt(int index) const = 0; |
59 | 58 |
60 // Returns the label of the item at the specified index. | 59 // Returns the label of the item at the specified index. |
61 virtual std::wstring GetLabelAt(int index) const = 0; | 60 virtual string16 GetLabelAt(int index) const = 0; |
62 | 61 |
63 // Returns true if the label at the specified index can change over the course | 62 // Returns true if the label at the specified index can change over the course |
64 // of the menu's lifetime. If this function returns true, the label of the | 63 // of the menu's lifetime. If this function returns true, the label of the |
65 // menu item will be updated each time the menu is shown. | 64 // menu item will be updated each time the menu is shown. |
66 virtual bool IsLabelDynamicAt(int index) const = 0; | 65 virtual bool IsLabelDynamicAt(int index) const = 0; |
67 | 66 |
68 // Gets the acclerator information for the specified index, returning true if | 67 // Gets the acclerator information for the specified index, returning true if |
69 // there is a shortcut accelerator for the item, false otherwise. | 68 // there is a shortcut accelerator for the item, false otherwise. |
70 virtual bool GetAcceleratorAt(int index, | 69 virtual bool GetAcceleratorAt(int index, |
71 views::Accelerator* accelerator) const = 0; | 70 views::Accelerator* accelerator) const = 0; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 | 143 |
145 // The object that actually implements the menu. | 144 // The object that actually implements the menu. |
146 MenuWrapper* wrapper_; | 145 MenuWrapper* wrapper_; |
147 | 146 |
148 DISALLOW_COPY_AND_ASSIGN(Menu2); | 147 DISALLOW_COPY_AND_ASSIGN(Menu2); |
149 }; | 148 }; |
150 | 149 |
151 } // namespace views | 150 } // namespace views |
152 | 151 |
153 #endif // CONTROLS_MENU_VIEWS_MENU_2_H_ | 152 #endif // CONTROLS_MENU_VIEWS_MENU_2_H_ |
OLD | NEW |