// // MPT_PluginProtocol.h // AUCoderDemo // // Created by Andrew Salamon on 9/25/06. // Copyright (c) 2006 Machine Perception Laboratory, // University of California San Diego. All rights reserved. // #import @class MPT_AUView; extern NSString *MPT_PluginStep_NoStep; extern NSString *MPT_PluginStep_AfterFaces; extern NSString *MPT_PluginStep_SVM; extern NSString *MPT_PluginStep_Features; extern NSString *MPT_PluginStep_Frequencies; extern NSString *MPT_PluginStep_Results; /** The Objective-C half of a CERT plugin protocol. */ @protocol MPT_PluginProtocol - (id)initWithBundle:(NSBundle *)_bundle; - (void)setDelegate:(id)delegate; ///< Don't retain the delegate since it might very well prevent deallocation. - (id)delegate; ///< The delegate needs to be notified whenever the enabled state of the plugin changes. - (NSBundle *)bundle; - (NSString *)pluginID; - (NSString *)localizedName; - (NSString *)internalName; ///< This will initially be used by SVM plugins, for finding weights files - (NSString *)version; /// Each plugin may return multiple results (e.g. AU 1 and AU 2...). Each result will have its own view - (NSArray *)labels; - (MPT_AUView *)viewForLabel:(NSString *)label; - (void)setView:(MPT_AUView *)view forLabel:(NSString *)label; //- (MPT_AUView *)view; ///< If this returns NULL, the plugin controller will create and set a view //- (void)setView:(MPT_AUView *)newView; - (NSView *)prefPane; - (NSString *)step; - (int)stepOrder; ///< Used for sorting plugins, this is handled by MPT_PluginBase and probably shouldn't be over-ridden. - (BOOL)enabled; - (void)setEnabled:(BOOL)value; - (NSString *)desc; ///< Will be used to display a description of the plugin in the pref pane. @end @interface NSObject(MPT_PluginDelegateMethods) - (void)didChangeEnabledStateForPlugin:(id)plugin; - (NSDictionary *)configForPrefs; ///< Currently only used by the distributed processing system. - (NSArray *)setConfig:(NSDictionary *)config; ///< Currently only used by the distributed processing system. - (BOOL)isEvaluation; ///< Plugins can use this method to determine what type of license is being used. For example, plugins shouldn't allow output to be saved under an evaluation license. - (BOOL)isLicensed; ///< Plugins can use this method to determine what type of license is being used. - (BOOL)isInternal; ///< Plugins can use this method to determine what type of license is being used. @end /** A way for plugins to get localized names for other plugins. * Those plugins that need this kind of interaction will be given an object that conforms to this protocol. */ @protocol MPT_PluginControllerProtocol - (NSString *)localizedNameForPluginID:(NSString *)pluginID; @end