/* * LBFileProtocol.h * Lightbox * * Plug-ins for various file formats must conform to this protocol * Copyright (c) 2002 Josh Anon. All rights reserved. * */ #import @protocol LBFileProtocol < NSObject > +(NSString*)name; //if you match to a camera that uses a standard file type to hold //non-standard contents (e.g. Canon calls their RAW files from the 1D .tif), //match to the camera but don't register the type in SupportedTypes //unless you can handle all versions of that type (e.g. standard tif types, too) //type match = 1 point +(NSArray*)supportedTypes; //brand match = 2 points //return YES if you support a given brand for a given type +(BOOL)supportsBrand:(NSString*)brand forType:(NSString*)ext ; //camera match = 4 points //return YES if you support a given camera for a given type +(BOOL)supportsCamera:(NSString*)cameraName forType:(NSString*)ext; +(BOOL)initializeClass:(NSBundle*)theBundle; //for when Cocoa gets unloading bundle support +(void)terminateClass; //current protocol version is 1 +(int)version; //Lightbox will call this init method -(id)init; //in case you need the extension (always called before setFile/setData) -(void)setFileExtension:(NSString*)ext; //don't do conversion on setData as it'll be called even if not converting -(void)setData:(NSData*)data; -(void)setFile:(NSString*)path; //for things like Canon .thm files -(void)setAlternateData:(NSData*)date; //from your conversion prefs--does the user want a low dynamic range //image? -(BOOL)is8BitPerComponent; //expect this to undergo revision in the next version //can you provide EXIF data? (note setAlternateData: will be called before this) -(BOOL)providesEXIFDataForType:(NSString*)type; //Format: key = LB key for exif //return value = NSCalendarDate or NSString //In 1.0, if it's exif data, use the standard key (e.g. date is 9003). Key is a string //exposure, flash (@"Yes" or @"No"), and fnumber should be a string //date should be a calendardate //date format = @"%Y:%m:%d %H:%M:%S" -(id)exifPropertyForKey:(NSString*)key; //provide EXIF in one lump -(NSDictionary*)exifProperties; //you can provide a view with conversion options for all images //note that the instance providing the view may be different than the //one(s) doing the conversion--make sure you plan accordingly! -(NSView*)conversionView; //don't count on this method being called right after -setData, but you'll prob want to do your conversion here: -(NSBitmapImageRep*)bitmapImageRep; //called when importing from disk and not camera, should be > 128 px x 128 -(NSBitmapImageRep*)smallThumbnail; @end