2024-01-09 03:56:04 +00:00
|
|
|
namespace PKHeX.Core;
|
2022-06-18 18:04:24 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Plugin interface used by an editor to notify third-party code providers.
|
|
|
|
/// </summary>
|
|
|
|
public interface IPlugin
|
2018-05-13 19:49:26 +00:00
|
|
|
{
|
2019-07-14 22:06:45 +00:00
|
|
|
/// <summary>
|
2022-06-18 18:04:24 +00:00
|
|
|
/// Plugin Name.
|
2019-07-14 22:06:45 +00:00
|
|
|
/// </summary>
|
2022-06-18 18:04:24 +00:00
|
|
|
string Name { get; }
|
2018-05-15 00:30:56 +00:00
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Plugin Loading Priority (lowest is initialized first).
|
|
|
|
/// </summary>
|
|
|
|
int Priority { get; }
|
2018-06-30 22:02:17 +00:00
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Entry point for the parent to initialize the plugin with provided arguments.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="args">Arguments containing objects useful for initializing the plugin.</param>
|
|
|
|
void Initialize(params object[] args);
|
2018-05-15 00:30:56 +00:00
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Notifies the plugin that a save file was just loaded.
|
|
|
|
/// </summary>
|
|
|
|
void NotifySaveLoaded();
|
2018-05-15 00:30:56 +00:00
|
|
|
|
2024-01-09 03:56:04 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Notifies the plugin that the display language has changed.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="language">Short code for language name</param>
|
|
|
|
/// <remarks>Useful to translate controls if any added.</remarks>
|
|
|
|
void NotifyDisplayLanguageChanged(string language) { }
|
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Attempts to load a file using the plugin.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="filePath">Path to file to be loaded.</param>
|
|
|
|
/// <returns>True if the plugin has handled the file.</returns>
|
|
|
|
bool TryLoadFile(string filePath);
|
2018-05-15 00:30:56 +00:00
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Retrieves the <see cref="ISaveFileProvider"/> object which can provide a <see cref="SaveFile"/>.
|
|
|
|
/// </summary>
|
|
|
|
ISaveFileProvider SaveFileEditor { get; }
|
2018-05-13 19:49:26 +00:00
|
|
|
}
|