Clean up 'guitabtooltip' patch
[MacVim.git] / src / MacVim / PSMTabBarControl / source / PSMTabBarCell.h
blob5d98eff3f2651c4d1187d99f83fb12fb3f1811a7
1 //
2 // PSMTabBarCell.h
3 // PSMTabBarControl
4 //
5 // Created by John Pannell on 10/13/05.
6 // Copyright 2005 Positive Spin Media. All rights reserved.
7 //
9 #import <Cocoa/Cocoa.h>
10 #import "PSMTabBarControl.h"
12 @class PSMTabBarControl;
13 @class PSMProgressIndicator;
15 @interface PSMTabBarCell : NSActionCell {
16 // sizing
17 NSRect _frame;
18 NSSize _stringSize;
19 int _currentStep;
20 BOOL _isPlaceholder;
22 // state
23 int _tabState;
24 NSTrackingRectTag _closeButtonTrackingTag; // left side tracking, if dragging
25 NSTrackingRectTag _cellTrackingTag; // right side tracking, if dragging
26 BOOL _closeButtonOver;
27 BOOL _closeButtonPressed;
28 PSMProgressIndicator *_indicator;
29 BOOL _isInOverflowMenu;
30 BOOL _hasCloseButton;
31 BOOL _isCloseButtonSuppressed;
32 BOOL _hasIcon;
33 int _count;
34 NSString *_toolTip;
37 // creation/destruction
38 - (id)initWithControlView:(PSMTabBarControl *)controlView;
39 - (id)initPlaceholderWithFrame:(NSRect)frame expanded:(BOOL)value inControlView:(PSMTabBarControl *)controlView;
40 - (void)dealloc;
42 // accessors
43 - (id)controlView;
44 - (void)setControlView:(id)view;
45 - (NSTrackingRectTag)closeButtonTrackingTag;
46 - (void)setCloseButtonTrackingTag:(NSTrackingRectTag)tag;
47 - (NSTrackingRectTag)cellTrackingTag;
48 - (void)setCellTrackingTag:(NSTrackingRectTag)tag;
49 - (float)width;
50 - (NSRect)frame;
51 - (void)setFrame:(NSRect)rect;
52 - (void)setStringValue:(NSString *)aString;
53 - (NSSize)stringSize;
54 - (NSAttributedString *)attributedStringValue;
55 - (int)tabState;
56 - (void)setTabState:(int)state;
57 - (NSProgressIndicator *)indicator;
58 - (BOOL)isInOverflowMenu;
59 - (void)setIsInOverflowMenu:(BOOL)value;
60 - (BOOL)closeButtonPressed;
61 - (void)setCloseButtonPressed:(BOOL)value;
62 - (BOOL)closeButtonOver;
63 - (void)setCloseButtonOver:(BOOL)value;
64 - (BOOL)hasCloseButton;
65 - (void)setHasCloseButton:(BOOL)set;
66 - (void)setCloseButtonSuppressed:(BOOL)suppress;
67 - (BOOL)isCloseButtonSuppressed;
68 - (BOOL)hasIcon;
69 - (void)setHasIcon:(BOOL)value;
70 - (int)count;
71 - (void)setCount:(int)value;
72 - (BOOL)isPlaceholder;
73 - (void)setIsPlaceholder:(BOOL)value;
74 - (int)currentStep;
75 - (void)setCurrentStep:(int)value;
76 - (NSString *)toolTip;
77 - (void)setToolTip:(NSString *)tip;
79 // component attributes
80 - (NSRect)indicatorRectForFrame:(NSRect)cellFrame;
81 - (NSRect)closeButtonRectForFrame:(NSRect)cellFrame;
82 - (float)minimumWidthOfCell;
83 - (float)desiredWidthOfCell;
85 // drawing
86 - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
88 // tracking the mouse
89 - (void)mouseEntered:(NSEvent *)theEvent;
90 - (void)mouseExited:(NSEvent *)theEvent;
92 // drag support
93 - (NSImage*)dragImageForRect:(NSRect)cellFrame;
95 // archiving
96 - (void)encodeWithCoder:(NSCoder *)aCoder;
97 - (id)initWithCoder:(NSCoder *)aDecoder;
99 @end
101 @interface PSMTabBarControl (CellAccessors)
103 - (id<PSMTabStyle>)style;
105 @end