ISukiToastManager.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System;
  2. namespace SukiUI.Toasts
  3. {
  4. public interface ISukiToastManager
  5. {
  6. /// <summary>
  7. /// Raised whenever a toast is queued.
  8. /// </summary>
  9. event SukiToastManagerEventHandler OnToastQueued;
  10. /// <summary>
  11. /// Raised whenever a toast is dismissed.
  12. /// </summary>
  13. event SukiToastManagerEventHandler OnToastDismissed;
  14. /// <summary>
  15. /// Raised whenever all toasts are dismissed at once.
  16. /// </summary>
  17. event EventHandler OnAllToastsDismissed;
  18. /// <summary>
  19. /// Queues a given toast for display.
  20. /// </summary>
  21. void Queue(ISukiToast toast);
  22. /// <summary>
  23. /// Dismisses a given toast from the stack, if it is still present.
  24. /// </summary>
  25. void Dismiss(ISukiToast toast);
  26. /// <summary>
  27. /// Dismisses a specific number of toasts from the stack.
  28. /// </summary>
  29. void Dismiss(int count);
  30. /// <summary>
  31. /// Ensures that the toast stack doesn't exceed the specified maximum.
  32. /// If it does, it will dismiss the oldest toasts down to the maximum.
  33. /// </summary>
  34. /// <param name="maxAllowed"></param>
  35. void EnsureMaximum(int maxAllowed);
  36. /// <summary>
  37. /// Dismisses all toasts from the stack immediately.
  38. /// </summary>
  39. void DismissAll();
  40. /// <summary>
  41. /// Checks to see if a <see cref="ISukiToast"/> has already been dismissed from the stack.
  42. /// </summary>
  43. bool IsDismissed(ISukiToast toast);
  44. }
  45. }