Files
UnrealEngineUWP/Engine/Source/Programs/UnrealToolbox/IToolboxPlugin.cs
ben marsh 2af764e351 Merging latest Horde changes from Main.
[CL 36756615 by ben marsh in 5.5 branch]
2024-10-01 19:23:06 -04:00

66 lines
1.5 KiB
C#

// Copyright Epic Games, Inc. All Rights Reserved.
using Avalonia.Controls;
using FluentAvalonia.UI.Controls;
namespace UnrealToolbox
{
enum TrayAppPluginState
{
Undefined,
Ok,
Busy,
Paused,
Error
}
/// <summary>
/// Reported status of a plugin
/// </summary>
record class TrayAppPluginStatus(TrayAppPluginState State, string? Message = null, string? NotificationMessage = null)
{
public static TrayAppPluginStatus Default { get; } = new TrayAppPluginStatus(TrayAppPluginState.Undefined);
}
/// <summary>
/// Plugin for the tray app
/// </summary>
interface ITrayAppPlugin : IAsyncDisposable
{
/// <summary>
/// Name of the plugin to show in the settings page
/// </summary>
string Name { get; }
/// <summary>
/// Icon to show on the settings page
/// </summary>
IconSource Icon { get; }
/// <summary>
/// Refresh the state of this plugin. Called when the application is activated or focussed.
/// </summary>
void Refresh();
/// <summary>
/// Get the current status of this plugin
/// </summary>
TrayAppPluginStatus GetStatus();
/// <summary>
/// Determines if the plugin should be shown in the settings page
/// </summary>
bool HasSettingsPage();
/// <summary>
/// Create a settings page for this plugin
/// </summary>
Control CreateSettingsPage(SettingsContext context);
/// <summary>
/// Allow the plugin to customize the tray icon context menu
/// </summary>
void PopulateContextMenu(NativeMenu contextMenu);
}
}