From 4cfe54b65c43e987f13df097d203f9556fad31a2 Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Fri, 10 Jan 2020 15:01:53 +0100 Subject: [PATCH] Updated documentation on export plugin --- MacPass/MPPlugin.h | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/MacPass/MPPlugin.h b/MacPass/MPPlugin.h index 1801c940..a7cf5029 100644 --- a/MacPass/MPPlugin.h +++ b/MacPass/MPPlugin.h @@ -147,9 +147,32 @@ FOUNDATION_EXPORT NSString *const MPPluginDescriptionInfoDictionaryKey; @protocol MPExportPlugin @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