using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using ThreadPilot.Models;
namespace ThreadPilot.Services
{
///
/// Interface for managing process-power plan associations
///
public interface IProcessPowerPlanAssociationService
{
///
/// Event fired when configuration changes
///
event EventHandler? ConfigurationChanged;
///
/// Gets the current configuration
///
ProcessMonitorConfiguration Configuration { get; }
///
/// Loads configuration from persistent storage
///
Task LoadConfigurationAsync();
///
/// Saves configuration to persistent storage
///
Task SaveConfigurationAsync();
///
/// Gets all associations
///
Task> GetAssociationsAsync();
///
/// Gets enabled associations only
///
Task> GetEnabledAssociationsAsync();
///
/// Adds a new association
///
Task AddAssociationAsync(ProcessPowerPlanAssociation association);
///
/// Updates an existing association
///
Task UpdateAssociationAsync(ProcessPowerPlanAssociation association);
///
/// Removes an association
///
Task RemoveAssociationAsync(string associationId);
///
/// Finds the best matching association for a process
///
Task FindMatchingAssociationAsync(ProcessModel process);
///
/// Finds association by executable name
///
Task FindAssociationByExecutableAsync(string executableName);
///
/// Sets the default power plan
///
Task SetDefaultPowerPlanAsync(string powerPlanGuid, string powerPlanName);
///
/// Gets the default power plan
///
Task<(string Guid, string Name)> GetDefaultPowerPlanAsync();
///
/// Validates the current configuration
///
Task> ValidateConfigurationAsync();
///
/// Resets configuration to defaults
///
Task ResetConfigurationAsync();
///
/// Exports configuration to a file
///
Task ExportConfigurationAsync(string filePath);
///
/// Imports configuration from a file
///
Task ImportConfigurationAsync(string filePath);
}
///
/// Event arguments for configuration changes
///
public class ConfigurationChangedEventArgs : EventArgs
{
public string ChangeType { get; }
public ProcessPowerPlanAssociation? Association { get; }
public string? Details { get; }
public ConfigurationChangedEventArgs(string changeType, ProcessPowerPlanAssociation? association = null, string? details = null)
{
ChangeType = changeType;
Association = association;
Details = details;
}
}
}