Updated documentation on export plugin

This commit is contained in:
Michael Starke
2020-01-10 15:01:53 +01:00
parent 2b2e5ddbea
commit 4cfe54b65c

View File

@@ -147,9 +147,32 @@ FOUNDATION_EXPORT NSString *const MPPluginDescriptionInfoDictionaryKey;
@protocol MPExportPlugin <NSObject>
@required
/**
Called by the host to update a menu item for exporting.
You are supposed to update the title to something meaningfull.
Target and action will get set by host, so do not rely on them
@param item MenuItem that will be used to export via the plugin
*/
- (void)prepareExportMenuItem:(NSMenuItem *)item;
/**
Called by the host when an export is about to happen.
Update the panel to work for all the files and formats you can export
@param panel The panel used to select the export destination
*/
- (void)prepareSavePanel:(NSSavePanel *)panel;
/**
This will get called when the save panel is closed by the user.
You should retrieve any results from the panel and act accordingly.
If you need custom UI in the process, you can show them here.
For example, if a CSV export might need user input to configure its output this is the place to show it.
@param tree The current tree to be exported
@param panel The save panel that was used to specify the export destination
*/
- (void)exportTree:(KPKTree *)tree forRunningSavePanel:(NSSavePanel *)panel;
@end