IMainView.cs 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using System;
  2. using JetBrains.Annotations;
  3. using Unity.Cloud.Collaborate.Components;
  4. using Unity.Cloud.Collaborate.Presenters;
  5. namespace Unity.Cloud.Collaborate.Views
  6. {
  7. internal interface IMainView : IView<IMainPresenter>
  8. {
  9. /// <summary>
  10. /// Add or update an alert with the provided id.
  11. /// </summary>
  12. /// <param name="id">Id of the alert to add or update.</param>
  13. /// <param name="level">Level of severity.</param>
  14. /// <param name="message">Message for the alert.</param>
  15. /// <param name="button">Optional button with text and a callback.</param>
  16. void AddAlert([NotNull] string id, AlertBox.AlertLevel level, [NotNull] string message, (string text, Action action)? button = null);
  17. /// <summary>
  18. /// Remove alert with the provided id.
  19. /// </summary>
  20. /// <param name="id">Id of the alert to remove.</param>
  21. void RemoveAlert([NotNull] string id);
  22. /// <summary>
  23. /// Switch to the given tab index.
  24. /// </summary>
  25. /// <param name="index">Index of tab to switch to.</param>
  26. void SetTab(int index);
  27. /// <summary>
  28. /// Display progress view. Should only be called once, so only call when progress starts.
  29. /// </summary>
  30. void AddOperationProgress();
  31. /// <summary>
  32. /// Hide progress view. Should only be called once, so only call when progress finishes.
  33. /// </summary>
  34. void RemoveOperationProgress();
  35. /// <summary>
  36. /// Update the progress value displayed in the progress view.
  37. /// </summary>
  38. /// <param name="title">Title of the job in progress.</param>
  39. /// <param name="details">Description/details/status of the job in progress.</param>
  40. /// <param name="percentage">Current percentage completion of the job in progress. Used for percentage display.</param>
  41. /// <param name="completed">Current number of job items completed. Used for discrete display.</param>
  42. /// <param name="total">Total number of job items completed. Used for discrete display.</param>
  43. /// <param name="isPercentage">True if the progress bar uses percentage, false if its discrete completed-of-total.</param>
  44. /// <param name="canCancel">True if the job in progress can be cancelled.</param>
  45. void SetOperationProgress(string title, string details, int percentage, int completed, int total, bool isPercentage, bool canCancel);
  46. /// <summary>
  47. /// Clear the current back navigation.
  48. /// </summary>
  49. void ClearBackNavigation();
  50. /// <summary>
  51. /// Set back navigation to be displayed with the provided text.
  52. /// </summary>
  53. /// <param name="text">Destination of the back navigation</param>
  54. void DisplayBackNavigation([NotNull] string text);
  55. }
  56. }