2002-02-02 11:48:54 +00:00
|
|
|
#import <Foundation/Foundation.h>
|
2002-04-04 16:57:07 +00:00
|
|
|
#import "ResKnifeResourceProtocol.h"
|
2002-02-02 11:48:54 +00:00
|
|
|
|
2009-11-08 14:07:22 +00:00
|
|
|
/*!
|
|
|
|
@protocol ResKnifePluginProtocol
|
|
|
|
@abstract Your plug-in's principal class must implement initWithResource: or initWithResources:, all other methods are optional, and thus declared in ResKnifeInformalPluginProtocol.
|
|
|
|
*/
|
2002-02-02 11:48:54 +00:00
|
|
|
@protocol ResKnifePluginProtocol
|
|
|
|
|
2009-11-08 14:07:22 +00:00
|
|
|
/*!
|
|
|
|
@method initWithResource:
|
|
|
|
@abstract Your plug-in is inited with this call. This allows immediate access to the resource you are about to edit, and with this information you can set up different windows, etc.
|
|
|
|
*/
|
|
|
|
- (id)initWithResource:(id <ResKnifeResourceProtocol>)inResource;
|
2003-08-01 22:23:50 +00:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
2009-11-08 14:07:22 +00:00
|
|
|
/*!
|
|
|
|
@protocol ResKnifeTemplatePluginProtocol
|
|
|
|
@abstract If you're implementing a template editor, you should implement this extended protocol instead of the regular plugin protocol.
|
|
|
|
*/
|
|
|
|
@protocol ResKnifeTemplatePluginProtocol <ResKnifePluginProtocol>
|
|
|
|
|
|
|
|
/*!
|
|
|
|
@method initWithResource:
|
|
|
|
@abstract Your template editor is inited with this call. The first argument is the resource to edit, the second is the TMPL resource that defines the data structure.
|
|
|
|
*/
|
|
|
|
- (id)initWithResources:(id <ResKnifeResourceProtocol>)inResource, ...;
|
2003-08-01 22:23:50 +00:00
|
|
|
|
2009-11-08 14:07:22 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
@protocol ResKnifeInformalPluginProtocol
|
|
|
|
@abstract Optional methods your plugin may implement to provide additional functionality.
|
|
|
|
@author Uli Kusterer
|
2010-08-31 10:28:19 +00:00
|
|
|
@updated 2005-10-03 NGS: Added UTI, MIME Type and OSType methods, renamed extensionForFileExport: to filenameExtensionForFileExport:
|
2009-11-08 14:07:22 +00:00
|
|
|
*/
|
2003-08-01 22:23:50 +00:00
|
|
|
@interface ResKnifeInformalPluginProtocol
|
|
|
|
|
2009-11-08 14:07:22 +00:00
|
|
|
/*!
|
|
|
|
@method dataForFileExport:
|
|
|
|
@abstract Return the data to be saved to disk when your resource is exported to a flat file. By default the host application uses the raw resource data if you don't implement this. The idea is that this export function is non-lossy, i.e. only override this if there is a format that is a 100% equivalent to your data.
|
|
|
|
*/
|
|
|
|
+ (NSData *)dataForFileExport:(id <ResKnifeResourceProtocol>)resource;
|
2003-08-01 22:23:50 +00:00
|
|
|
|
2009-11-08 14:07:22 +00:00
|
|
|
/* Your plug should implement one of the following four methods.
|
|
|
|
* They are looked for in the order shown below. Only implement one.
|
|
|
|
*/
|
2003-08-01 22:23:50 +00:00
|
|
|
|
2009-11-08 14:07:22 +00:00
|
|
|
/*!
|
|
|
|
@method UTIForFileExport:
|
|
|
|
@abstract Regardless of whether you implement dataForFileExport, you should implement this and return the proper Uniform Type Identifier for your file.
|
|
|
|
*/
|
2003-08-01 22:23:50 +00:00
|
|
|
|
2009-11-08 14:07:22 +00:00
|
|
|
+ (NSString *)UTIForFileExport:(id <ResKnifeResourceProtocol>)resource;
|
2003-08-01 22:23:50 +00:00
|
|
|
|
2009-11-08 14:07:22 +00:00
|
|
|
/*!
|
|
|
|
@method MIMETypeForFileExport:
|
|
|
|
@abstract If you do not know the UTI for your file type, but it has a known MIME Type (e.g. image/svg), you can return that here.
|
|
|
|
*/
|
|
|
|
|
|
|
|
+ (NSString *)MIMETypeForFileExport:(id <ResKnifeResourceProtocol>)resource;
|
|
|
|
|
|
|
|
/*!
|
|
|
|
@method OSTypeForFileExport:
|
|
|
|
@abstract If your data has a classical Macintosh OSType code, you can return that here.
|
|
|
|
*/
|
2003-08-01 22:23:50 +00:00
|
|
|
|
2009-11-08 14:07:22 +00:00
|
|
|
+ (NSString *)OSTypeForFileExport:(id <ResKnifeResourceProtocol>)resource;
|
2002-02-02 11:48:54 +00:00
|
|
|
|
2009-11-08 14:07:22 +00:00
|
|
|
/*!
|
|
|
|
@method filenameExtensionForFileExport:
|
|
|
|
@abstract As a last resort, you can return here the filename extension for your resource type.
|
|
|
|
By default the host application substitutes the resource type if you do not implement this.
|
|
|
|
*/
|
|
|
|
|
|
|
|
+ (NSString *)filenameExtensionForFileExport:(id <ResKnifeResourceProtocol>)resource;
|
|
|
|
|
2010-08-30 23:38:46 +00:00
|
|
|
/*!
|
|
|
|
@@method iconForResourceType:
|
|
|
|
@abstract Returns the icon to be used throughout the UI for any given resource type.
|
|
|
|
*/
|
|
|
|
- (NSImage *)iconForResourceType:(NSString *)resourceType;
|
|
|
|
|
2009-11-08 14:07:22 +00:00
|
|
|
@end
|