Performed [21405] and [21406], moving the contact list to Source, on adium-1.1
[adiumx.git] / Source / AIOutlineViewAnimation.m
blobdffdbc3cd7743b889361c4943b74c657a21c82be
1 //
2 //  AIOutlineViewAnimation.m
3 //  Adium
4 //
5 //  Created by Evan Schoenberg on 6/9/07.
6 //
8 #import "AIOutlineViewAnimation.h"
9 #import "AIAnimatingListOutlineView.h"
11 @interface AIAnimatingListOutlineView (AIOutlineViewAnimationDelegate)
12 - (void)animation:(AIOutlineViewAnimation *)animation didSetCurrentValue:(float)currentValue forDict:(NSDictionary *)animatingRowsDict;
13 @end
15 @interface AIOutlineViewAnimation (PRIVATE)
16 - (id)initWithDictionary:(NSDictionary *)inDict outlineView:(AIAnimatingListOutlineView *)inOutlineView;
17 @end
19 /*!
20  * @class AIOutlineViewAnimation
21  * @brief NSAnimation subclass for AIOutlineView's animations
22  *
23  * This NSAnimation subclass is a simple subclass to let the outline view handle changes in progress
24  * along a non-blocking ease-in/ease-out animation.
25  * AIOutlineView should release the AIOutlineViewAnimation when the animation is complete.
26  */
27 @implementation AIOutlineViewAnimation
28 + (AIOutlineViewAnimation *)listObjectAnimationWithDictionary:(NSDictionary *)inDict outlineView:(AIAnimatingListOutlineView *)inOutlineView
30         return [[[self alloc] initWithDictionary:inDict outlineView:inOutlineView] autorelease];
33 - (id)initWithDictionary:(NSDictionary *)inDict outlineView:(AIAnimatingListOutlineView *)inOutlineView
35         if ((self = [super initWithDuration:LIST_OBJECT_ANIMATION_DURATION animationCurve:NSAnimationEaseInOut])) {
36                 dict = [inDict retain];
37                 outlineView = [inOutlineView retain];
39                 [self setAnimationBlockingMode:NSAnimationNonblocking];
40         }
41         
42         return self;
45 - (void)dealloc
47         [dict release];
48         [outlineView release];
50         [super dealloc];
53 /*!
54  * @brief We want to run our animation no matter what's going on
55  */
56 - (NSArray *)runLoopModesForAnimating
58     return [NSArray arrayWithObjects:NSDefaultRunLoopMode, NSModalPanelRunLoopMode, NSEventTrackingRunLoopMode, nil];
61 /*!
62  * @brief When progress updates, inform the delegate
63  */
64 - (void)setCurrentProgress:(NSAnimationProgress)progress
66         [super setCurrentProgress:progress];
68         [outlineView animation:self didSetCurrentValue:[self currentValue] forDict:dict];
71 @end