| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_UI_COCOA_GRADIENT_BUTTON_CELL_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_GRADIENT_BUTTON_CELL_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_GRADIENT_BUTTON_CELL_H_ | 6 #define CHROME_BROWSER_UI_COCOA_GRADIENT_BUTTON_CELL_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 - (BOOL)isPulseStuckOn; | 99 - (BOOL)isPulseStuckOn; |
| 100 | 100 |
| 101 // Safely stop continuous pulsing by turning off all timers. | 101 // Safely stop continuous pulsing by turning off all timers. |
| 102 // May leave the cell in an odd state. | 102 // May leave the cell in an odd state. |
| 103 // Needed by an owning control's dealloc routine. | 103 // Needed by an owning control's dealloc routine. |
| 104 - (void)safelyStopPulsing; | 104 - (void)safelyStopPulsing; |
| 105 | 105 |
| 106 // Actually fetches current mouse position and does a hit test. | 106 // Actually fetches current mouse position and does a hit test. |
| 107 - (BOOL)isMouseReallyInside; | 107 - (BOOL)isMouseReallyInside; |
| 108 | 108 |
| 109 // Returns the offset of the start of the text in the cell. | |
| 110 - (CGFloat)textStartXOffset; | |
| 111 | |
| 112 // Defines the top offset of text within the cell. Used by drawTitle and can | 109 // Defines the top offset of text within the cell. Used by drawTitle and can |
| 113 // be overriden by objects that inherit this class for placement of text. | 110 // be overriden by objects that inherit this class for placement of text. |
| 114 - (int)verticalTextOffset; | 111 - (int)verticalTextOffset; |
| 115 | 112 |
| 116 // The amount by which the gradient button cell should nudge the path used to | 113 // The amount by which the gradient button cell should nudge the path used to |
| 117 // draw the hover (and pressed) state background path. | 114 // draw the hover (and pressed) state background path. |
| 118 - (CGFloat)hoverBackgroundVerticalOffsetInControlView:(NSView*)controlView; | 115 - (CGFloat)hoverBackgroundVerticalOffsetInControlView:(NSView*)controlView; |
| 119 | 116 |
| 120 // Returns YES if the cell's tag indicates a Material Design button type. | 117 // Returns YES if the cell's tag indicates a Material Design button type. |
| 121 - (BOOL)isMaterialDesignButtonType; | 118 - (BOOL)isMaterialDesignButtonType; |
| 122 | 119 |
| 123 @property(assign, nonatomic) CGFloat hoverAlpha; | 120 @property(assign, nonatomic) CGFloat hoverAlpha; |
| 124 | 121 |
| 125 // An image that will be drawn after the normal content of the button cell, | 122 // An image that will be drawn after the normal content of the button cell, |
| 126 // overlaying it. Never themed. | 123 // overlaying it. Never themed. |
| 127 @property(retain, nonatomic) NSImage* overlayImage; | 124 @property(retain, nonatomic) NSImage* overlayImage; |
| 128 | 125 |
| 129 @end | 126 @end |
| 130 | 127 |
| 131 @interface GradientButtonCell(TestingAPI) | 128 @interface GradientButtonCell(TestingAPI) |
| 132 - (BOOL)isMouseInside; | 129 - (BOOL)isMouseInside; |
| 133 - (BOOL)pulsing; | 130 - (BOOL)pulsing; |
| 134 - (gradient_button_cell::PulseState)pulseState; | 131 - (gradient_button_cell::PulseState)pulseState; |
| 135 - (void)setPulseState:(gradient_button_cell::PulseState)pstate; | 132 - (void)setPulseState:(gradient_button_cell::PulseState)pstate; |
| 136 @end | 133 @end |
| 137 | 134 |
| 138 #endif // CHROME_BROWSER_UI_COCOA_GRADIENT_BUTTON_CELL_H_ | 135 #endif // CHROME_BROWSER_UI_COCOA_GRADIENT_BUTTON_CELL_H_ |
| OLD | NEW |