using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using ThreadPilot.Models;
namespace ThreadPilot.Services
{
///
/// Service for managing notifications (balloon tips and toast notifications)
///
public interface INotificationService
{
///
/// Event fired when a notification is shown
///
event EventHandler? NotificationShown;
///
/// Event fired when a notification is dismissed
///
event EventHandler? NotificationDismissed;
///
/// Event fired when a notification action is clicked
///
event EventHandler? NotificationActionClicked;
///
/// Gets the notification history
///
IReadOnlyList NotificationHistory { get; }
///
/// Shows a simple notification
///
Task ShowNotificationAsync(string title, string message, NotificationType type = NotificationType.Information);
///
/// Shows a notification with custom settings
///
Task ShowNotificationAsync(NotificationModel notification);
///
/// Shows a balloon tip notification
///
Task ShowBalloonTipAsync(string title, string message, NotificationType type = NotificationType.Information, int timeoutMs = 3000);
///
/// Shows a Windows toast notification (if available)
///
Task ShowToastNotificationAsync(string title, string message, NotificationType type = NotificationType.Information);
///
/// Shows a notification for power plan changes
///
Task ShowPowerPlanChangeNotificationAsync(string oldPlan, string newPlan, string processName = "");
///
/// Shows a notification for process monitoring events
///
Task ShowProcessMonitoringNotificationAsync(string message, bool isEnabled);
///
/// Shows a notification for CPU affinity changes
///
Task ShowCpuAffinityNotificationAsync(string processName, string affinityInfo);
///
/// Shows an error notification
///
Task ShowErrorNotificationAsync(string title, string message, Exception? exception = null);
///
/// Shows a success notification
///
Task ShowSuccessNotificationAsync(string title, string message);
///
/// Dismisses a specific notification
///
Task DismissNotificationAsync(string notificationId);
///
/// Dismisses all notifications
///
Task DismissAllNotificationsAsync();
///
/// Clears notification history
///
Task ClearNotificationHistoryAsync();
///
/// Gets unread notification count
///
int GetUnreadNotificationCount();
///
/// Marks all notifications as read
///
Task MarkAllNotificationsAsReadAsync();
///
/// Checks if notifications are enabled for the given type
///
bool AreNotificationsEnabled(NotificationType type);
///
/// Updates notification settings
///
void UpdateSettings(ApplicationSettingsModel settings);
///
/// Initializes the notification service
///
Task InitializeAsync();
///
/// Disposes the notification service
///
void Dispose();
}
///
/// Event args for notification events
///
public class NotificationEventArgs : EventArgs
{
public NotificationModel Notification { get; }
public NotificationEventArgs(NotificationModel notification)
{
Notification = notification;
}
}
///
/// Event args for notification action events
///
public class NotificationActionEventArgs : EventArgs
{
public NotificationModel Notification { get; }
public string ActionCommand { get; }
public NotificationActionEventArgs(NotificationModel notification, string actionCommand)
{
Notification = notification;
ActionCommand = actionCommand;
}
}
}