Chromium Code Reviews| 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/ui_export.h" | 10 #include "ui/base/ui_export.h" |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 28 // The type of item. | 28 // The type of item. |
| 29 enum ItemType { | 29 enum ItemType { |
| 30 TYPE_COMMAND, | 30 TYPE_COMMAND, |
| 31 TYPE_CHECK, | 31 TYPE_CHECK, |
| 32 TYPE_RADIO, | 32 TYPE_RADIO, |
| 33 TYPE_SEPARATOR, | 33 TYPE_SEPARATOR, |
| 34 TYPE_BUTTON_ITEM, | 34 TYPE_BUTTON_ITEM, |
| 35 TYPE_SUBMENU | 35 TYPE_SUBMENU |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 // For a separator we have the following types. | |
| 39 // Normal - top to bottom: Spacing, line, spacing | |
| 40 static const string16 NORMAL_SEPARATOR; | |
|
sky
2012/08/20 15:58:17
This should be an enum.
| |
| 41 // Upper - top to bottom: Line, spacing | |
| 42 static const string16 UPPER_SEPARATOR; | |
| 43 // Lower - top to bottom: Spacing, line | |
| 44 static const string16 LOWER_SEPARATOR; | |
| 45 // Spacing - top to bottom: Spacing only. | |
| 46 static const string16 SPACING_SEPARATOR; | |
| 47 | |
| 38 virtual ~MenuModel() {} | 48 virtual ~MenuModel() {} |
| 39 | 49 |
| 40 // Returns true if any of the items within the model have icons. Not all | 50 // Returns true if any of the items within the model have icons. Not all |
| 41 // platforms support icons in menus natively and so this is a hint for | 51 // platforms support icons in menus natively and so this is a hint for |
| 42 // triggering a custom rendering mode. | 52 // triggering a custom rendering mode. |
| 43 virtual bool HasIcons() const = 0; | 53 virtual bool HasIcons() const = 0; |
| 44 | 54 |
| 45 // Returns the index of the first item. This is 0 for most menus except the | 55 // Returns the index of the first item. This is 0 for most menus except the |
| 46 // system menu on Windows. |native_menu| is the menu to locate the start index | 56 // system menu on Windows. |native_menu| is the menu to locate the start index |
| 47 // within. It is guaranteed to be reset to a clean default state. Some | 57 // within. It is guaranteed to be reset to a clean default state. Some |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 125 // Retrieves the model and index that contains a specific command id. Returns | 135 // 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, | 136 // true if an item with the specified command id is found. |model| is inout, |
| 127 // and specifies the model to start searching from. | 137 // and specifies the model to start searching from. |
| 128 static bool GetModelAndIndexForCommandId(int command_id, MenuModel** model, | 138 static bool GetModelAndIndexForCommandId(int command_id, MenuModel** model, |
| 129 int* index); | 139 int* index); |
| 130 }; | 140 }; |
| 131 | 141 |
| 132 } // namespace ui | 142 } // namespace ui |
| 133 | 143 |
| 134 #endif // UI_BASE_MODELS_MENU_MODEL_H_ | 144 #endif // UI_BASE_MODELS_MENU_MODEL_H_ |
| OLD | NEW |