//
//  MSFilterPlugin.h
//  DrawIt
//
//  Created by Pieter Omvlee on 12/8/07.
//  Copyright 2007 GetDrawIt. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import <QuartzCore/QuartzCore.h>

@interface MSFilterPlugin : NSObject <NSCoding>
{
  NSMutableDictionary *options;
}

//for example @"Inner Shadow"
+ (NSString *)displayName;
- (NSString *)displayName;

//render your image (a CIImage) and return a CIImage
- (id)render:(id)image inFrame:(NSRect)rect effectOnly:(BOOL)effectOnly originalImage:(id)original;

//return an array of keys which you are using. example { inputRadius, inputImage, inputColor }
- (NSArray *)attributeKeys;

//return the displayname for the given key. for example: inputRadius returns Radius;
- (NSString *)displayNameForKey:(NSString *)key;

// return @"CIImage", @"CIColor", @"NSNumber" or @"CIVector" for the given key.
// when you return @"CIVector" here, DrawIt will assume it is a point and assumes it was x and y values.
- (NSString *)typeForKey:(NSString *)key;

// return the default value for the 'key'
// in case of an image, return an CIImage or nil,
// in case of a number: NSNumber
// in case of a color: a CIColor instance.
// in case of a point: a CIVector instance with X and Y. Important: points are relative to their frame: (1.0,1.0) is the topRight of a layer
- (id)defaultValueForKey:(NSString *)key;

- (NSArray *)defaultValuesForOptionKey:(NSString *)key;

// return the minimum and maximum NSNumber instances for a give key. You can assume this method only gets called in case of a number-key.
- (id)minValueForKey:(NSString *)key;
- (id)maxValueForKey:(NSString *)key;

// some filters might want to do something when they are selected, for example a filter with points will display them.
// you can overwrite this method do other custom behaviour
// if your filter contains points, those are automatically displayed for you.
- (void)gotFocus:(id)img rect:(NSRect)layerFrame;
- (void)lostFocus:(id)img rect:(NSRect)layerFrame;

//refeshes the entire document.
//If you are sure your filter stays within the boundaries of the layer, overwrite this method and return NO increased performace
- (BOOL)requiresFullUpdate;

- (BOOL)usesDefaultMaskOption;

- (BOOL)ignoresSpecialOption;

@end
