- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / cocoa / styled_text_field_cell.h
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_UI_COCOA_STYLED_TEXT_FIELD_CELL_H_
6 #define CHROME_BROWSER_UI_COCOA_STYLED_TEXT_FIELD_CELL_H_
7
8 #import <Cocoa/Cocoa.h>
9
10 #import "chrome/browser/ui/cocoa/rect_path_utils.h"
11
12 // StyledTextFieldCell customizes the look of the standard Cocoa text field.
13 // The border and focus ring are modified, as is the drawing rect.  Subclasses
14 // can override |drawInteriorWithFrame:inView:| to provide custom drawing for
15 // decorations, but they must make sure to call the superclass' implementation
16 // with a modified frame after performing any custom drawing.
17
18 @interface StyledTextFieldCell : NSTextFieldCell {
19 }
20
21 @end
22
23 // Methods intended to be overridden by subclasses, not part of the public API
24 // and should not be called outside of subclasses.
25 @interface StyledTextFieldCell (ProtectedMethods)
26
27 // Return the portion of the cell to show the text cursor over.  The default
28 // implementation returns the full |cellFrame|.  Subclasses should override this
29 // method if they add any decorations.
30 - (NSRect)textCursorFrameForFrame:(NSRect)cellFrame;
31
32 // Return the portion of the cell to use for text display.  This corresponds to
33 // the frame with our added decorations sliced off.  The default implementation
34 // returns the full |cellFrame|, as by default there are no decorations.
35 // Subclasses should override this method if they add any decorations.
36 - (NSRect)textFrameForFrame:(NSRect)cellFrame;
37
38 // Offset from the top of the cell frame to the text frame. Defaults to 0.
39 // Subclasses should
40 - (CGFloat)topTextFrameOffset;
41
42 // Offset from the bottom of the cell frame to the text frame. Defaults to 0.
43 // Subclasses should
44 - (CGFloat)bottomTextFrameOffset;
45
46 // Radius of the corners of the field.  Defaults to square corners (0.0).
47 - (CGFloat)cornerRadius;
48
49 // Which corners of the field to round.  Defaults to RoundedAll.
50 - (rect_path_utils::RoundedCornerFlags)roundedFlags;
51
52 // Returns YES if a light themed bezel should be drawn under the text field.
53 // Default implementation returns NO.
54 - (BOOL)shouldDrawBezel;
55
56 @end
57
58 #endif  // CHROME_BROWSER_UI_COCOA_STYLED_TEXT_FIELD_CELL_H_