| 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 UI_BASE_MODELS_MENU_MODEL_H_ | 5 #ifndef UI_BASE_MODELS_MENU_MODEL_H_ |
| 6 #define UI_BASE_MODELS_MENU_MODEL_H_ | 6 #define UI_BASE_MODELS_MENU_MODEL_H_ |
| 7 | 7 |
| 8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "ui/base/models/menu_model_delegate.h" | 9 #include "ui/base/models/menu_model_delegate.h" |
| 10 #include "ui/base/models/menu_separator_types.h" | 10 #include "ui/base/models/menu_separator_types.h" |
| 11 #include "ui/base/ui_base_export.h" | 11 #include "ui/base/ui_base_export.h" |
| 12 #include "ui/gfx/image/image_skia.h" | 12 #include "ui/gfx/image/image_skia.h" |
| 13 #include "ui/gfx/native_widget_types.h" | 13 #include "ui/gfx/native_widget_types.h" |
| 14 | 14 |
| 15 namespace gfx { | 15 namespace gfx { |
| 16 class Font; | 16 class FontList; |
| 17 class Image; | 17 class Image; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace ui { | 20 namespace ui { |
| 21 | 21 |
| 22 class Accelerator; | 22 class Accelerator; |
| 23 class ButtonMenuItemModel; | 23 class ButtonMenuItemModel; |
| 24 | 24 |
| 25 // An interface implemented by an object that provides the content of a menu. | 25 // An interface implemented by an object that provides the content of a menu. |
| 26 class UI_BASE_EXPORT MenuModel { | 26 class UI_BASE_EXPORT MenuModel { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // Returns the minor text of the item at the specified index. The minor text | 64 // Returns the minor text of the item at the specified index. The minor text |
| 65 // is rendered to the right of the label and using the font GetLabelFontAt(). | 65 // is rendered to the right of the label and using the font GetLabelFontAt(). |
| 66 virtual base::string16 GetMinorTextAt(int index) const; | 66 virtual base::string16 GetMinorTextAt(int index) const; |
| 67 | 67 |
| 68 // Returns true if the menu item (label/sublabel/icon) at the specified | 68 // Returns true if the menu item (label/sublabel/icon) at the specified |
| 69 // index can change over the course of the menu's lifetime. If this function | 69 // index can change over the course of the menu's lifetime. If this function |
| 70 // returns true, the label, sublabel and icon of the menu item will be | 70 // returns true, the label, sublabel and icon of the menu item will be |
| 71 // updated each time the menu is shown. | 71 // updated each time the menu is shown. |
| 72 virtual bool IsItemDynamicAt(int index) const = 0; | 72 virtual bool IsItemDynamicAt(int index) const = 0; |
| 73 | 73 |
| 74 // Returns the font used for the label at the specified index. | 74 // Returns the font list used for the label at the specified index. |
| 75 // If NULL, then the default font should be used. | 75 // If NULL, then the default font list should be used. |
| 76 virtual const gfx::Font* GetLabelFontAt(int index) const; | 76 virtual const gfx::FontList* GetLabelFontListAt(int index) const; |
| 77 | 77 |
| 78 // Gets the acclerator information for the specified index, returning true if | 78 // Gets the acclerator information for the specified index, returning true if |
| 79 // there is a shortcut accelerator for the item, false otherwise. | 79 // there is a shortcut accelerator for the item, false otherwise. |
| 80 virtual bool GetAcceleratorAt(int index, | 80 virtual bool GetAcceleratorAt(int index, |
| 81 ui::Accelerator* accelerator) const = 0; | 81 ui::Accelerator* accelerator) const = 0; |
| 82 | 82 |
| 83 // Returns the checked state of the item at the specified index. | 83 // Returns the checked state of the item at the specified index. |
| 84 virtual bool IsItemCheckedAt(int index) const = 0; | 84 virtual bool IsItemCheckedAt(int index) const = 0; |
| 85 | 85 |
| 86 // Returns the id of the group of radio items that the item at the specified | 86 // Returns the id of the group of radio items that the item at the specified |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 // true if an item with the specified command id is found. |model| is inout, | 131 // true if an item with the specified command id is found. |model| is inout, |
| 132 // and specifies the model to start searching from. | 132 // and specifies the model to start searching from. |
| 133 static bool GetModelAndIndexForCommandId(int command_id, | 133 static bool GetModelAndIndexForCommandId(int command_id, |
| 134 MenuModel** model, | 134 MenuModel** model, |
| 135 int* index); | 135 int* index); |
| 136 }; | 136 }; |
| 137 | 137 |
| 138 } // namespace ui | 138 } // namespace ui |
| 139 | 139 |
| 140 #endif // UI_BASE_MODELS_MENU_MODEL_H_ | 140 #endif // UI_BASE_MODELS_MENU_MODEL_H_ |
| OLD | NEW |