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 #import <Cocoa/Cocoa.h> 6 7 @class StyledTextFieldCell; 8 9 // An implementation of NSTextField that is designed to work with 10 // StyledTextFieldCell. Provides methods to redraw the field when cell 11 // decorations have changed and overrides |mouseDown:| to properly handle clicks 12 // in sections of the cell with decorations. 13 @interface StyledTextField : NSTextField { 14 } 15 16 // Repositions and redraws the field editor. Call this method when the cell's 17 // text frame has changed (whenever changing cell decorations). 18 - (void)resetFieldEditorFrameIfNeeded; 19 20 // Returns the amount of the field's width which is not being taken up 21 // by the text contents. May be negative if the contents are large 22 // enough to scroll. 23 - (CGFloat)availableDecorationWidth; 24 25 @end 26 27 @interface StyledTextField (ExposedForTesting) 28 - (StyledTextFieldCell*)styledTextFieldCell; 29 @end 30