OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 APP_MENUS_MENU_MODEL_H_ | 5 #ifndef APP_MENUS_MENU_MODEL_H_ |
6 #define APP_MENUS_MENU_MODEL_H_ | 6 #define APP_MENUS_MENU_MODEL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 // Returns the type of item at the specified index. | 57 // Returns the type of item at the specified index. |
58 virtual ItemType GetTypeAt(int index) const = 0; | 58 virtual ItemType GetTypeAt(int index) const = 0; |
59 | 59 |
60 // Returns the command id of the item at the specified index. | 60 // Returns the command id of the item at the specified index. |
61 virtual int GetCommandIdAt(int index) const = 0; | 61 virtual int GetCommandIdAt(int index) const = 0; |
62 | 62 |
63 // Returns the label of the item at the specified index. | 63 // Returns the label of the item at the specified index. |
64 virtual string16 GetLabelAt(int index) const = 0; | 64 virtual string16 GetLabelAt(int index) const = 0; |
65 | 65 |
66 // Returns true if the label at the specified index can change over the course | 66 // Returns true if the menu item (label/icon) at the specified index can |
67 // of the menu's lifetime. If this function returns true, the label of the | 67 // change over the course of the menu's lifetime. If this function returns |
68 // menu item will be updated each time the menu is shown. | 68 // true, the label and icon of the menu item will be updated each time the |
69 virtual bool IsLabelDynamicAt(int index) const = 0; | 69 // menu is shown. |
| 70 virtual bool IsItemDynamicAt(int index) const = 0; |
70 | 71 |
71 // Returns the font use for the label at the specified index. | 72 // Returns the font use for the label at the specified index. |
72 // If NULL, then use default font. | 73 // If NULL, then use default font. |
73 virtual const gfx::Font* GetLabelFontAt(int index) const; | 74 virtual const gfx::Font* GetLabelFontAt(int index) const; |
74 | 75 |
75 // Gets the acclerator information for the specified index, returning true if | 76 // Gets the acclerator information for the specified index, returning true if |
76 // there is a shortcut accelerator for the item, false otherwise. | 77 // there is a shortcut accelerator for the item, false otherwise. |
77 virtual bool GetAcceleratorAt(int index, | 78 virtual bool GetAcceleratorAt(int index, |
78 menus::Accelerator* accelerator) const = 0; | 79 menus::Accelerator* accelerator) const = 0; |
79 | 80 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 // Retrieves the model and index that contains a specific command id. Returns | 118 // Retrieves the model and index that contains a specific command id. Returns |
118 // true if an item with the specified command id is found. |model| is inout, | 119 // true if an item with the specified command id is found. |model| is inout, |
119 // and specifies the model to start searching from. | 120 // and specifies the model to start searching from. |
120 static bool GetModelAndIndexForCommandId(int command_id, MenuModel** model, | 121 static bool GetModelAndIndexForCommandId(int command_id, MenuModel** model, |
121 int* index); | 122 int* index); |
122 }; | 123 }; |
123 | 124 |
124 } // namespace | 125 } // namespace |
125 | 126 |
126 #endif // APP_MENUS_MENU_MODEL_H_ | 127 #endif // APP_MENUS_MENU_MODEL_H_ |
OLD | NEW |