//
//  DTCStatusItemController.h
//  MainMenu
//
//  Created by Philipp on 02/07/2009.
//  Copyright 2015 Incredible Bee Ltd. All rights reserved.
//

#import <Cocoa/Cocoa.h>

/*
 * To use `BEStatusItemAnimator` first setup a status item in the usual way:
 *
 *      NSStatusItem *statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength];
 *      NSImage *plainIcon = [self statusItemImageNamed:@"menuicon-N"];
 *N SImage *plainHighlightedIcon = [self statusItemImageNamed:@"menuicon-P"];
 *     [statusItem setImage:plainIcon];
 *     [statusItem setAlternateImage:plainHighlightedIcon];
 *     [statusItem setToolTip:@"MainMenu"];
 *     [statusItem setHighlightMode:YES];
 *
 * Then create a `BEStatusItemAnimator` and configure it with the status item:
 *
 *     BEStatusItemAnimator *statusItemController = [[BEStatusItemAnimator alloc] initWithStatusItem:statusItem];
 *
 * The animation consists of a sequence of images that you set on the status
 * item animator:
 *
 *     [statusItemController setAnimationFrames:[NSArray arrayWithObjects:[self statusItemImageNamed:@"menuiconanim1-N"], [self statusItemImageNamed:@"menuiconanim2-N"], [self statusItemImageNamed:@"menuiconanim3-N"], [self statusItemImageNamed:@"menuiconanim2-N"], nil]];
 *
 * Optionally set an interval between frames to pace the animation:
 *
 *     [statusItemController setAnimationFrameInterval:5.0];
 *
 * Starting and stopping animations also involves two method calls:
 *
 *     [statusItemController startAnimation];
 *     [statusItemController stopAnimation];
 */
@interface BEStatusItemAnimator : NSObject {
	// the status item we're controlling
	NSStatusItem *statusItem;
	
	// animation properties
	BOOL isAnimating;                 // whether we're currently animating
	NSArray *animationFrames;         // the images to use in the animation
	float animationFrameInterval;     // how many seconds between frames
}

-(id)initWithStatusItem:(NSStatusItem *)aStatusItem;


#pragma mark Properties

-(NSStatusItem *)statusItem;


#pragma mark Animation methods

-(void)startAnimation;

-(void)stopAnimation;

-(BOOL)isAnimating;

-(NSArray *)animationFrames;
-(void)setAnimationFrames:(NSArray *)anImageList;

-(float)animationFrameInterval;
-(void)setAnimationFrameInterval:(float)aFrameInterval;

@end
