Fixed a bunch of unit tests to restore state after they complete.
[adiumx.git] / Source / KNShelfSplitView.h
blob3dac3190213aaec24eee7e5867663d61daa06797
1 /*
3 BSD License
5 Copyright (c) 2006, Keith Anderson
6 All rights reserved.
8 Redistribution and use in source and binary forms, with or without modification,
9 are permitted provided that the following conditions are met:
11 * Redistributions of source code must retain the above copyright notice,
12 this list of conditions and the following disclaimer.
13 * Redistributions in binary form must reproduce the above copyright notice,
14 this list of conditions and the following disclaimer in the documentation
15 and/or other materials provided with the distribution.
16 * Neither the name of keeto.net or Keith Anderson nor the names of its
17 contributors may be used to endorse or promote products derived
18 from this software without specific prior written permission.
20 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
24 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
25 OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
26 OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28 STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 #import <Cocoa/Cocoa.h>
37 @interface KNShelfSplitView : NSView {
38 IBOutlet NSView * shelfView;
39 IBOutlet NSView * contentView;
40 IBOutlet id delegate;
41 IBOutlet id target;
42 SEL action;
44 NSString * autosaveName;
45 NSImage * actionButtonImage;
46 NSImage * contextButtonImage;
47 NSColor * shelfBackgroundColor;
48 float currentShelfWidth;
49 BOOL isShelfVisible;
50 NSMenu * contextButtonMenu;
52 NSRect controlRect;
53 BOOL shouldDrawActionButton;
54 NSRect actionButtonRect;
55 BOOL shouldDrawContextButton;
56 NSRect contextButtonRect;
57 NSRect resizeThumbRect;
58 NSRect resizeBarRect;
59 int activeControlPart;
60 BOOL shouldHilite;
62 BOOL delegateHasValidateWidth;
64 NSString *stringValue;
65 NSAttributedString *attributedStringValue;
66 float stringHeight;
68 NSImage *background;
69 NSSize backgroundSize;
72 -(IBAction)toggleShelf:(id)sender;
74 -(id)initWithFrame:(NSRect)aFrame shelfView:(NSView *)aShelfView contentView:(NSView *)aContentView;
76 -(void)setDelegate:(id)aDelegate;
77 -(id)delegate;
78 -(void)setTarget:(id)aTarget;
79 -(id)target;
80 -(void)setAction:(SEL)aSelector;
81 -(SEL)action;
82 -(void)setContextButtonMenu:(NSMenu *)aMenu;
83 -(NSMenu *)contextButtonMenu;
85 -(void)setShelfView:(NSView *)aView;
86 -(NSView *)shelfView;
87 -(void)setContentView:(NSView *)aView;
88 -(NSView *)contentView;
90 -(void)setShelfWidth:(float)aWidth;
91 -(float)shelfWidth;
93 -(BOOL)isShelfVisible;
94 -(void)setShelfIsVisible:(BOOL)visible;
96 -(void)setAutosaveName:(NSString *)aName;
97 -(NSString *)autosaveName;
100 -(void)setActionButtonImage:(NSImage *)anImage;
101 -(NSImage *)actionButtonImage;
102 -(void)setContextButtonImage:(NSImage *)anImage;
103 -(NSImage *)contextButtonImage;
104 -(void)setShelfBackgroundColor:(NSColor *)aColor;
105 -(NSColor *)shelfBackgroundColor;
108 -(void)recalculateSizes;
109 -(void)drawControlBackgroundInRect:(NSRect)aRect active:(BOOL)isActive;
111 - (void)setResizeThumbStringValue:(NSString *)inString;
114 @end
116 @interface NSObject (KNShelfSplitViewDelegate)
117 -(float)shelfSplitView:(KNShelfSplitView *)shelfSplitView validateWidth:(float)proposedWidth;
118 @end