Interface function descriptions are given in Delphi. But it is easy to convert them in C/C++ or another programming language.
Below there is a table with all available functions described. Not all functions have to exist in your plugin. Those ones which are necessary have the plus sign (+) opposite to plugin type. If the minus sign () is written, the function is not used in the plugin of such a type.
| Plugin Type | Function | Description |
| Comparer | Viewer |
| + | + | function DupKillerPlugin:boolean | This function must return true (always!). It is for DupKiller to find its native plugins. If this function is absent or returns false then plugin will not be connected to DupKiller. |
| + | + | function GetPluginInfo(value:PChar):PChar | Returns information about plugin depending on value. For example: GetPluginInfo('name') returns plugin name (e.g., 'ApproCom'). GetPluginInfo('author') returns plugin author name (e.g., 'Oleksandr Roslov'). GetPluginInfo('version') returns plugin version (e.g., '0.1'). GetPluginInfo('comparer') returns '1' if plugin is for file comparison, or '0' if not. GetPluginInfo('viewer') returns '1' if plugin is for file viewing, or '0' if not. GetPluginInfo('tbc') returns '1' if plugin uses true byte comparison during scan process, or '0' if not. GetPluginInfo('description') returns plugin description (e.g., 'Compares files using not whole contents but random samples.'). All other values must return an empty string (''). |
| + | | function PluginCompare(f1,f2:PChar):boolean | Compares files and returns true if the files are duplicate, or false in other case. f1 and f2 are full paths (with filenames) to files to compare. |
| | | procedure ShowPluginProperties | Shows plugin properties window. |
| | | procedure LoadSettings(FullPath:PChar) | Loads plugin settings from the Registry. FullPath is a Registry key of the HKCU branch where plugins store their settings. E.g., Software\TR\DupKiller\Settings\Plugins. Each plugin has to have its own key (for example, ApproCom) to store its settings. |
| | | procedure SaveSettings(FullPath:PChar) | Saves plugin settings in the Registry. FullPath is a Registry key of the HKCU branch where plugins store their settings. E.g., Software\TR\DupKiller\Settings\Plugins. Each plugin has to have its own key (for example, ApproCom) to store its settings. |
| | | procedure LoadDefaultSettings | Loads plugin default settings. |
| | | procedure Terminate | Stops plugin execution. This function is called when a user breaks scan process. |
| | | procedure Prepare | Prepares plugin for work. This function is called before scanning. |
| | + | function ViewFile(h:THandle; fn:PChar):boolean | Displays file in the viewer window. The first parameter is a window panel handle where plugin has to place its visual components to view file. The second parameter is a full path to file to show. The function returns true if the file was displayed successfully, or false if any error occured. This function is called when a cursor in the dupe list enters a row of file with extension supported with this plugin. |
| | | procedure StopView | Forces plugin to stop file viewing. This function is called when a cursor leaves a file row or a viewer window is closed. |
| | + | function GetPluginExtensions:PChar | Returns string of file extensions supported by plugin. Extensions must be separated with a whiteblank and not include delimiter character (e.g., 'wav wma mp3'). |
| | | procedure Resize | This function is called on a viewer window resizing for plugin to update its components correctly according to new sizes of the window. |
| + | + | function GetDKVersion:PChar | Returns DupKiller version able to support this plugin (e.g., '0.8.2'). It is recommended to set the smallest version of DupKiller fully supporting this plugin. |