OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 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 | 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_BROWSER_COCOA_CHROMIUM_BUTTON_CELL_H_ | 5 #ifndef CHROME_BROWSER_COCOA_CHROMIUM_BUTTON_CELL_H_ |
6 #define CHROME_BROWSER_COCOA_CHROMIUM_BUTTON_CELL_H_ | 6 #define CHROME_BROWSER_COCOA_CHROMIUM_BUTTON_CELL_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 #include "base/scoped_nsobject.h" | 10 #include "base/scoped_nsobject.h" |
11 | 11 |
| 12 @class GTMTheme; |
| 13 |
12 // Base class for button cells for toolbar and bookmark bar. | 14 // Base class for button cells for toolbar and bookmark bar. |
13 // | 15 // |
14 // This is a button cell that handles drawing/highlighting of buttons. | 16 // This is a button cell that handles drawing/highlighting of buttons. |
15 // The appearance is determined by setting the cell's tag (not the | 17 // The appearance is determined by setting the cell's tag (not the |
16 // view's) to one of the constants below (ButtonType). | 18 // view's) to one of the constants below (ButtonType). |
17 | 19 |
| 20 // Set this as the cell's tag. |
18 enum { | 21 enum { |
19 kLeftButtonType = -1, | 22 kLeftButtonType = -1, |
20 kLeftButtonWithShadowType = -2, | 23 kLeftButtonWithShadowType = -2, |
21 kStandardButtonType = 0, | 24 kStandardButtonType = 0, |
22 kRightButtonType = 1, | 25 kRightButtonType = 1, |
23 }; | 26 }; |
24 typedef NSInteger ButtonType; | 27 typedef NSInteger ButtonType; |
25 | 28 |
26 @interface GradientButtonCell : NSButtonCell { | 29 @interface GradientButtonCell : NSButtonCell { |
27 @private | 30 @private |
28 // Custom drawing means we need to perform our own mouse tracking if | 31 // Custom drawing means we need to perform our own mouse tracking if |
29 // the cell is setShowsBorderOnlyWhileMouseInside:YES. | 32 // the cell is setShowsBorderOnlyWhileMouseInside:YES. |
30 BOOL isMouseInside_; | 33 BOOL isMouseInside_; |
31 scoped_nsobject<NSTrackingArea> trackingArea_; | 34 scoped_nsobject<NSTrackingArea> trackingArea_; |
32 BOOL shouldTheme_; | 35 BOOL shouldTheme_; |
33 } | 36 } |
34 // Turn off theming. Temporary work-around. | 37 // Turn off theming. Temporary work-around. |
35 - (void)setShouldTheme:(BOOL)shouldTheme; | 38 - (void)setShouldTheme:(BOOL)shouldTheme; |
| 39 |
| 40 - (void)drawBorderAndFillForTheme:(GTMTheme*)theme |
| 41 controlView:(NSView*)controlView |
| 42 outerPath:(NSBezierPath*)outerPath |
| 43 innerPath:(NSBezierPath*)innerPath |
| 44 showHighlightGradient:(BOOL)showHighlightGradient |
| 45 showClickedGradient:(BOOL)showClickedGradient |
| 46 active:(BOOL)active |
| 47 cellFrame:(NSRect)cellFrame; |
36 @end | 48 @end |
37 | 49 |
38 @interface GradientButtonCell(TestingAPI) | 50 @interface GradientButtonCell(TestingAPI) |
39 - (BOOL)isMouseInside; | 51 - (BOOL)isMouseInside; |
40 @end | 52 @end |
41 | 53 |
42 #endif // CHROME_BROWSER_COCOA_CHROMIUM_BUTTON_CELL_H_ | 54 #endif // CHROME_BROWSER_COCOA_CHROMIUM_BUTTON_CELL_H_ |
OLD | NEW |