Intermediary checkin, just to mark my place and back up, in case Panther decides...
[ITKit.git] / ITWindowEffect.h
1 /*
2  *      ITKit
3  *  ITWindowEffect
4  *    Protocal and abstract superclass for performing effects on windows.
5  *
6  *  Original Author : Matt Judy <mjudy@ithinksw.com>
7  *   Responsibility : Matt Judy <mjudy@ithinksw.com>
8  *
9  *  Copyright (c) 2002 - 2003 iThink Software.
10  *  All Rights Reserved
11  *
12  */
13
14
15 #import <Cocoa/Cocoa.h>
16 #import "ITWindowPositioning.h"
17
18 @class ITTransientStatusWindow;
19
20 #define EFFECT_FPS 30.0
21 #define DEFAULT_EFFECT_TIME 0.75
22
23
24 typedef enum {
25     ITWindowHiddenState,
26     ITWindowAppearingState,
27     ITWindowVisibleState,
28     ITWindowVanishingState
29 } ITWindowVisibilityState;
30
31
32 @protocol ITWindowEffect
33 + (NSString *)effectName;
34 + (NSDictionary *)supportedPositions;
35 - (void)performAppear;
36 - (void)performVanish;
37 - (void)cancelAppear;
38 - (void)cancelVanish;
39 @end
40
41
42 @protocol ITWindowMotility
43 - (ITWindowVisibilityState)visibilityState;
44 - (void)setVisibilityState:(ITWindowVisibilityState)newState;
45 - (float)effectProgress;
46 - (void)setEffectProgress:(float)newProgress;
47 @end
48
49
50 @interface ITWindowEffect : NSObject <ITWindowEffect>
51 {
52     ITTransientStatusWindow    *_window;
53     float                       _effectTime;
54     float                       _effectSpeed;
55     ITVerticalWindowPosition    _verticalPosition;
56     ITHorizontalWindowPosition  _horizontalPosition;
57     NSTimer                    *_effectTimer;
58     BOOL                                           __idle;
59     BOOL                       __shouldReleaseWhenIdle;
60 }
61
62 + (NSArray *)effectClasses;
63
64 // Designated initializer
65 - (id)initWithWindow:(NSWindow *)window;
66
67 - (NSWindow *)window;
68
69 - (void)setWindow:(NSWindow *)newWindow;
70
71 - (void)setWindowVisibility:(ITWindowVisibilityState)visibilityState;
72
73 - (float)effectTime;
74 - (void)setEffectTime:(float)newTime;
75
76 - (void)releaseWhenIdle;
77
78 @end