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.
5 #import <Cocoa/Cocoa.h>
7 @
class StyledTextFieldCell
;
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
{
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
;
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
23 - (CGFloat
)availableDecorationWidth
;
27 @interface
StyledTextField (ExposedForTesting
)
28 - (StyledTextFieldCell
*)styledTextFieldCell
;