OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_COCOA_DOWNLOAD_ITEM_CELL_H_ |
| 6 #define CHROME_BROWSER_COCOA_DOWNLOAD_ITEM_CELL_H_ |
| 7 |
| 8 #import "chrome/browser/cocoa/gradient_button_cell.h" |
| 9 |
| 10 #include "base/file_path.h" |
| 11 |
| 12 class BaseDownloadItemModel; |
| 13 |
| 14 // A button cell that implements the weird button/popup button hybrid that is |
| 15 // used by the download items. |
| 16 |
| 17 // The button represented by this cell consists of a button part on the left |
| 18 // and a dropdown-menu part on the right. This enum describes which part the |
| 19 // mouse cursor is over currently. |
| 20 enum DownloadItemMousePosition { |
| 21 kDownloadItemMouseOutside, |
| 22 kDownloadItemMouseOverButtonPart, |
| 23 kDownloadItemMouseOverDropdownPart |
| 24 }; |
| 25 |
| 26 @interface DownloadItemCell : GradientButtonCell { |
| 27 @private |
| 28 // Track which part of the button the mouse is over |
| 29 DownloadItemMousePosition mousePosition_; |
| 30 int mouseInsideCount_; |
| 31 scoped_nsobject<NSTrackingArea> trackingAreaButton_; |
| 32 scoped_nsobject<NSTrackingArea> trackingAreaDropdown_; |
| 33 |
| 34 FilePath downloadPath_; // stored unelided |
| 35 NSString* secondaryTitle_; |
| 36 NSFont* secondaryFont_; |
| 37 |
| 38 BOOL isStatusTextVisible_; |
| 39 CGFloat titleY_; |
| 40 CGFloat statusAlpha_; |
| 41 scoped_nsobject<NSAnimation> hideStatusAnimation_; |
| 42 } |
| 43 |
| 44 - (void)setStateFromDownload:(BaseDownloadItemModel*)downloadModel; |
| 45 |
| 46 @property (copy) NSString* secondaryTitle; |
| 47 @property (retain) NSFont* secondaryFont; |
| 48 |
| 49 // Valid to call in response to a click of the cell's button. Returns if the |
| 50 // button part of the cell was clicked. |
| 51 - (BOOL)isButtonPartPressed; |
| 52 |
| 53 @end |
| 54 |
| 55 #endif // CHROME_BROWSER_COCOA_DOWNLOAD_ITEM_CELL_H_ |
| 56 |
OLD | NEW |