//
//  NSArray_Extensions.h
//
//  Copyright (c) 2001-2002, Apple. All rights reserved.
//

#import <Cocoa/Cocoa.h>

#define MSLocalized(key) NSLocalizedString((key),(key))

@interface NSArray (NSArrayAdditions)
- (NSIndexSet *)indexesOfObjects:(NSArray *)array;
@end

@interface NSBezierPath (NSBezierPathAdditions)
+ (NSBezierPath *)bezierPathAroundRect:(NSRect)r1 parentRect:(NSRect)r2;
+ (NSBezierPath*)bezierPathWithRoundedRectInRect:(NSRect)r
                                          radius:(int)radius
                                          drawArrow:(BOOL)b
                                      arrowWidth:(float)w
                                     arrowHeight:(float)h;
@end

@interface NSImage (NSImageAdditions)
+ (id)imageFromPath:(NSString *)path;
+ (id)imageFromData:(NSData *)data type:(NSString *)type;
+ (id)imageFromCGImageRef:(CGImageRef)image; //do not use
- (void)drawProportionallyInRect:(NSRect)rect operation:(NSCompositingOperation)op fraction:(float)frac;
- (id)scaledImageToSize:(NSSize)aSize;
@end

@interface NSToolbarItem (NSToolbarItemAdditions)
- (NSString *)title;
- (void)setTitle:(NSString *)aValue;
@end

@interface NSWindow (NSWindowAdditions)
- (float)toolbarHeight;
@end

@interface NSCursor (NSCursorAdditions)
+ (NSCursor *)brushCursorWithSize:(int)size;
@end

@interface NSString (NSStringAdditions)
- (BOOL)endsWith:(NSString *)end;
@end

@interface NSColor (Saving)
- (BOOL)writeToFile:(NSString *)path atomically:(BOOL)useAuxiliaryFile;
+ (NSColor *)colorFromFile:(NSString *)path;
@end

@interface NSString (FolderCreation)
- (void)createAsFolder;
- (BOOL)containsSubstring:(NSString *)sub;
@end

@interface NSFileWrapper (PackageSaving)
+ (NSFileWrapper *)wrapperWithData:(NSData *)regularData preview:(NSImage *)imgPreview;
@end