| 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/string16.h" | 8 #include "base/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/ui_export.h" | 11 #include "ui/base/ui_export.h" |
| 11 #include "ui/gfx/image/image_skia.h" | 12 #include "ui/gfx/image/image_skia.h" |
| 12 #include "ui/gfx/native_widget_types.h" | 13 #include "ui/gfx/native_widget_types.h" |
| 13 | 14 |
| 14 | 15 |
| 15 namespace gfx { | 16 namespace gfx { |
| 16 class Font; | 17 class Font; |
| 17 class Image; | 18 class Image; |
| 18 } | 19 } |
| 19 | 20 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 50 // here, it must offset the values for |index| it passes to the | 51 // here, it must offset the values for |index| it passes to the |
| 51 // methods below by this number - this is NOT done automatically! | 52 // methods below by this number - this is NOT done automatically! |
| 52 virtual int GetFirstItemIndex(gfx::NativeMenu native_menu) const; | 53 virtual int GetFirstItemIndex(gfx::NativeMenu native_menu) const; |
| 53 | 54 |
| 54 // Returns the number of items in the menu. | 55 // Returns the number of items in the menu. |
| 55 virtual int GetItemCount() const = 0; | 56 virtual int GetItemCount() const = 0; |
| 56 | 57 |
| 57 // Returns the type of item at the specified index. | 58 // Returns the type of item at the specified index. |
| 58 virtual ItemType GetTypeAt(int index) const = 0; | 59 virtual ItemType GetTypeAt(int index) const = 0; |
| 59 | 60 |
| 61 // Returns the separator type at the specified index. |
| 62 virtual ui::MenuSeparatorType GetSeparatorTypeAt(int index) const = 0; |
| 63 |
| 60 // Returns the command id of the item at the specified index. | 64 // Returns the command id of the item at the specified index. |
| 61 virtual int GetCommandIdAt(int index) const = 0; | 65 virtual int GetCommandIdAt(int index) const = 0; |
| 62 | 66 |
| 63 // Returns the label of the item at the specified index. | 67 // Returns the label of the item at the specified index. |
| 64 virtual string16 GetLabelAt(int index) const = 0; | 68 virtual string16 GetLabelAt(int index) const = 0; |
| 65 | 69 |
| 66 // Returns true if the menu item (label/icon) at the specified index can | 70 // Returns true if the menu item (label/icon) at the specified index can |
| 67 // change over the course of the menu's lifetime. If this function returns | 71 // change over the course of the menu's lifetime. If this function returns |
| 68 // true, the label and icon of the menu item will be updated each time the | 72 // true, the label and icon of the menu item will be updated each time the |
| 69 // menu is shown. | 73 // menu is shown. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 // Retrieves the model and index that contains a specific command id. Returns | 129 // Retrieves the model and index that contains a specific command id. Returns |
| 126 // true if an item with the specified command id is found. |model| is inout, | 130 // true if an item with the specified command id is found. |model| is inout, |
| 127 // and specifies the model to start searching from. | 131 // and specifies the model to start searching from. |
| 128 static bool GetModelAndIndexForCommandId(int command_id, MenuModel** model, | 132 static bool GetModelAndIndexForCommandId(int command_id, MenuModel** model, |
| 129 int* index); | 133 int* index); |
| 130 }; | 134 }; |
| 131 | 135 |
| 132 } // namespace ui | 136 } // namespace ui |
| 133 | 137 |
| 134 #endif // UI_BASE_MODELS_MENU_MODEL_H_ | 138 #endif // UI_BASE_MODELS_MENU_MODEL_H_ |
| OLD | NEW |