OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 CHROME_VIEWS_CHROME_MENU_H__ | 5 #ifndef CHROME_VIEWS_CHROME_MENU_H__ |
6 #define CHROME_VIEWS_CHROME_MENU_H__ | 6 #define CHROME_VIEWS_CHROME_MENU_H__ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 | 9 |
10 #include "base/gfx/point.h" | 10 #include "base/gfx/point.h" |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 // Sets the command id of this menu item. | 351 // Sets the command id of this menu item. |
352 void SetCommand(int command) { command_ = command; } | 352 void SetCommand(int command) { command_ = command; } |
353 | 353 |
354 // Returns the command id of this item. | 354 // Returns the command id of this item. |
355 int GetCommand() const { return command_; } | 355 int GetCommand() const { return command_; } |
356 | 356 |
357 // Paints the menu item. | 357 // Paints the menu item. |
358 virtual void Paint(ChromeCanvas* canvas); | 358 virtual void Paint(ChromeCanvas* canvas); |
359 | 359 |
360 // Returns the preferred size of this item. | 360 // Returns the preferred size of this item. |
361 virtual void GetPreferredSize(CSize* out); | 361 virtual gfx::Size GetPreferredSize(); |
362 | 362 |
363 // Returns the object responsible for controlling showing the menu. | 363 // Returns the object responsible for controlling showing the menu. |
364 MenuController* GetMenuController(); | 364 MenuController* GetMenuController(); |
365 | 365 |
366 // Returns the delegate. This returns the delegate of the root menu item. | 366 // Returns the delegate. This returns the delegate of the root menu item. |
367 MenuDelegate* GetDelegate(); | 367 MenuDelegate* GetDelegate(); |
368 | 368 |
369 // Returns the root parent, or this if this has no parent. | 369 // Returns the root parent, or this if this has no parent. |
370 MenuItemView* GetRootMenuItem(); | 370 MenuItemView* GetRootMenuItem(); |
371 | 371 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 // Returns the number of child views that are MenuItemViews. | 493 // Returns the number of child views that are MenuItemViews. |
494 // MenuItemViews are identified by ID. | 494 // MenuItemViews are identified by ID. |
495 int GetMenuItemCount(); | 495 int GetMenuItemCount(); |
496 | 496 |
497 // Returns the MenuItemView at the specified index. | 497 // Returns the MenuItemView at the specified index. |
498 MenuItemView* GetMenuItemAt(int index); | 498 MenuItemView* GetMenuItemAt(int index); |
499 | 499 |
500 // Positions and sizes the child views. This tiles the views vertically, | 500 // Positions and sizes the child views. This tiles the views vertically, |
501 // giving each child the available width. | 501 // giving each child the available width. |
502 virtual void Layout(); | 502 virtual void Layout(); |
503 virtual void GetPreferredSize(CSize* out); | 503 virtual gfx::Size GetPreferredSize(); |
504 | 504 |
505 // View method. Overriden to schedule a paint. We do this so that when | 505 // View method. Overriden to schedule a paint. We do this so that when |
506 // scrolling occurs, everything is repainted correctly. | 506 // scrolling occurs, everything is repainted correctly. |
507 virtual void DidChangeBounds(const CRect& previous, const CRect& current); | 507 virtual void DidChangeBounds(const CRect& previous, const CRect& current); |
508 | 508 |
509 // Painting. | 509 // Painting. |
510 void PaintChildren(ChromeCanvas* canvas); | 510 void PaintChildren(ChromeCanvas* canvas); |
511 | 511 |
512 // Drag and drop methods. These are forwarded to the MenuController. | 512 // Drag and drop methods. These are forwarded to the MenuController. |
513 virtual bool CanDrop(const OSExchangeData& data); | 513 virtual bool CanDrop(const OSExchangeData& data); |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 // underway. | 935 // underway. |
936 scoped_ptr<MenuScrollTask> scroll_task_; | 936 scoped_ptr<MenuScrollTask> scroll_task_; |
937 | 937 |
938 DISALLOW_EVIL_CONSTRUCTORS(MenuController); | 938 DISALLOW_EVIL_CONSTRUCTORS(MenuController); |
939 }; | 939 }; |
940 | 940 |
941 } // namespace | 941 } // namespace |
942 | 942 |
943 #endif // CHROME_VIEWS_CHROME_MENU_H__ | 943 #endif // CHROME_VIEWS_CHROME_MENU_H__ |
944 | 944 |
OLD | NEW |