Plugin Delegate
A Plugin Delegate is a class which acts somewhat like a subclass of a plugin object ... except that it really responds only to certain methods, and is thus not quite an arbitrary subclass. Thanks to key-value binding, it's not really that limiting; you can have arbitrary setter and getter methods to access properties.
These are methods in a plugin delegate that you can use:
- - (void)awakeFromBundleAsNewlyCreatedObject
- (BOOL)isNewObject;
- Initialization for your component
- - (void)awakeFromDragWithDictionary
- (NSDictionary *)aDictionary;
- For population of your component from a dictionary of properties that may be of use
- - (NSBundle *)bundle;
- Bundle of your component, usually used for fetching resources
- - (KTDocument *)document;
- Reference to the containing document
- - (NSManagedObjectContext *)managedObjectContext;
- For Core Data operations
- - (KTMediaManager *)mediaManager;
- For Media operations
- - (NSUndoManager *)undoManager;
- For undo support
- - (id)delegateOwner;
- The actal component object that this delegate serves. e.g a KTPage object.
A delegate may optionally implement:
- copySelectionToPasteboard:
- - (void) findMinimumDocType:(void *)aDocTypePointer forPage:(KTPage *)aPage
- - (void) addSitewideTextToHead:(NSMutableString *)aString forPage:(KTPage *)aPage
- - (void) addLevelTextToHead:(NSMutableString *)aString forPage:(KTPage *)aPage
- - (void) addPageTextToHead:(NSMutableString *)aString forPage:(KTPage *)aPage
- - (void)addResourcesToSet:(NSMutableSet *)aSet forPage:(KTPage *)aPage
