Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(319)

Side by Side Diff: ui/base/models/menu_model.h

Issue 10437006: Converts ui/views/controls, ui/views/examples, ui/base/models to ImageSkia (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #pragma once 7 #pragma once
8 8
9 #include "base/string16.h" 9 #include "base/string16.h"
10 #include "ui/base/models/menu_model_delegate.h" 10 #include "ui/base/models/menu_model_delegate.h"
11 #include "ui/base/ui_export.h" 11 #include "ui/base/ui_export.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 class SkBitmap;
15 15
16 namespace gfx { 16 namespace gfx {
17 class Font; 17 class Font;
18 class ImageSkia;
18 } 19 }
19 20
20 namespace ui { 21 namespace ui {
21 22
22 class Accelerator; 23 class Accelerator;
23 class ButtonMenuItemModel; 24 class ButtonMenuItemModel;
24 25
25 // An interface implemented by an object that provides the content of a menu. 26 // An interface implemented by an object that provides the content of a menu.
26 class UI_EXPORT MenuModel { 27 class UI_EXPORT MenuModel {
27 public: 28 public:
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 81
81 // Returns the checked state of the item at the specified index. 82 // Returns the checked state of the item at the specified index.
82 virtual bool IsItemCheckedAt(int index) const = 0; 83 virtual bool IsItemCheckedAt(int index) const = 0;
83 84
84 // Returns the id of the group of radio items that the item at the specified 85 // Returns the id of the group of radio items that the item at the specified
85 // index belongs to. 86 // index belongs to.
86 virtual int GetGroupIdAt(int index) const = 0; 87 virtual int GetGroupIdAt(int index) const = 0;
87 88
88 // Gets the icon for the item at the specified index, returning true if there 89 // Gets the icon for the item at the specified index, returning true if there
89 // is an icon, false otherwise. 90 // is an icon, false otherwise.
90 virtual bool GetIconAt(int index, SkBitmap* icon) = 0; 91 virtual bool GetIconAt(int index, gfx::ImageSkia* icon) = 0;
91 92
92 // Returns the model for a menu item with a line of buttons at |index|. 93 // Returns the model for a menu item with a line of buttons at |index|.
93 virtual ButtonMenuItemModel* GetButtonMenuItemAt(int index) const = 0; 94 virtual ButtonMenuItemModel* GetButtonMenuItemAt(int index) const = 0;
94 95
95 // Returns the enabled state of the item at the specified index. 96 // Returns the enabled state of the item at the specified index.
96 virtual bool IsEnabledAt(int index) const = 0; 97 virtual bool IsEnabledAt(int index) const = 0;
97 98
98 // Returns true if the menu item is visible. 99 // Returns true if the menu item is visible.
99 virtual bool IsVisibleAt(int index) const; 100 virtual bool IsVisibleAt(int index) const;
100 101
(...skipping 24 matching lines...) Expand all
125 // Retrieves the model and index that contains a specific command id. Returns 126 // 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, 127 // true if an item with the specified command id is found. |model| is inout,
127 // and specifies the model to start searching from. 128 // and specifies the model to start searching from.
128 static bool GetModelAndIndexForCommandId(int command_id, MenuModel** model, 129 static bool GetModelAndIndexForCommandId(int command_id, MenuModel** model,
129 int* index); 130 int* index);
130 }; 131 };
131 132
132 } // namespace ui 133 } // namespace ui
133 134
134 #endif // UI_BASE_MODELS_MENU_MODEL_H_ 135 #endif // UI_BASE_MODELS_MENU_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698