/* Copyright (c) 2004, Noah Sorscher
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 * 	• 	Redistributions of source code must retain the above copyright
 * 	notice, this list of conditions and the following disclaimer.
 * 	• 	Redistributions in binary form must reproduce the above copyright
 * 	notice, this list of conditions and the following disclaimer in the
 * 	documentation and/or other materials provided with the distribution.
 * 	• 	Neither the name of the Noah Sorscher nor the names of its
 * 	contributors may be used to endorse or promote products derived from
 * 	this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 * THE POSSIBILITY OF SUCH DAMAGE.
 */
//
//  MHUtil.h
//  Hootenanny
//
//  Created by Noah Sorscher on Tue Mar 25 2003.
//  Copyright (c) 2003 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <Cocoa/Cocoa.h>
#import <QuickTime/Movies.h>
#import "tScanner.h"

@protocol ImageHelperProto

- (BOOL)openMovie:(NSURL *)url;
- (void)setHeight:(int)height;
- (void)debug;
- (NSData *)getImage:(TimeValue)time;
- (NSData *)getImage:(TimeValue)time sender:(NSString *)senderID;
- (NSData *)getImage:(TimeValue)time sender:(NSString *)senderID transparency:(NSColor *)keyColor;
- (void)quit;


@end

@interface MHUtil : NSObject {

}

+ (id)imageHelper;
+ (id)spriteHelper;

+ (void)saveArgs:(NSArray *)args;
+ (NSArray *)args;

+ (NSString *)supportDir;
+ (void)clearSupportDir;
+ (NSString *)uniquePath:(NSString *)path;
//+ (void)killSupportDir;
+ (NSArray *)showOpenPanel;

+ (NSString *)handleToString:(Handle)h;
+ (NSImage *)picHandleToImage:(PicHandle)picHandle;

+ (NSString *)trackFormatForMovie:(Movie)movie ofType:(OSType)theType;

+ (NSString *)displayTime:(double)nSeconds;
+ (NSString *)displaySize:(double)megaBytes;
+ (double)stringToNSeconds:(NSString *)input;
+ (double)stringToNSeconds:(NSString *)input timebase:(int)base;
+ (NSString *)nSecondsToString:(double)nSeconds;
+ (NSString *)nSecondsToShortString:(int)seconds;

+ (NSString *)spaceToPlus:(NSString *)input;
+ (BOOL)isNum:(char)ch;
+ (int)expon:(int)a toThe:(int)b;

+ (NSURL *)stringToURL:(NSString *)string;

+ (NSString *)fixIMDB:(NSString *)input;
+ (BOOL)parenGood:(NSString *)input;
+ (NSString *)getEscapeChar:(NSString *)input;
+ (NSString *)interpretTag:(NSString *)input;

+ (NSString *)cleanHTML:(NSString *)input;
+ (NSString *)newLines:(NSString *)input;

+ (int)framesBetweenStart:(TimeValue)start end:(TimeValue)end movie:(Movie)movie;


+ (NSMutableDictionary *)spritesFromPlist:(NSDictionary *)plist;
+ (NSDictionary *)plist:(NSDictionary *)input;
+ (NSString *)stringClass:(id)input;

@end
