MVP_View.cs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Shapes;
  9. namespace SketchAssistantWPF
  10. {
  11. public interface MVP_View
  12. {
  13. /// <summary>
  14. /// Updates the colour of a canvas.
  15. /// </summary>
  16. /// <param name="canvasName">The name of the canvas to be updated.</param>
  17. /// <param name="active">Whether or not the canvas is active.</param>
  18. void SetCanvasState(string canvasName, bool active);
  19. /// <summary>
  20. /// Remove the current line.
  21. /// </summary>
  22. void RemoveCurrLine();
  23. /// <summary>
  24. /// Display the current line.
  25. /// </summary>
  26. /// <param name="line">The current line to display</param>
  27. void DisplayCurrLine(Polyline line);
  28. /// <summary>
  29. /// Removes all Lines from the left canvas.
  30. /// </summary>
  31. void RemoveAllLeftLines();
  32. /// <summary>
  33. /// Removes all lines in the right canvas.
  34. /// </summary>
  35. void RemoveAllRightLines();
  36. /// <summary>
  37. /// Adds another Line that will be displayed in the left display.
  38. /// </summary>
  39. /// <param name="newLine">The new Polyline to be added displayed.</param>
  40. void AddNewLineLeft(Polyline newLine);
  41. /// <summary>
  42. /// Adds another Line that will be displayed in the right display.
  43. /// </summary>
  44. /// <param name="newLine">The new Polyline to be added displayed.</param>
  45. void AddNewLineRight(Polyline newLine);
  46. /// <summary>
  47. /// Enables the timer of the View, which will tick the Presenter.
  48. /// </summary>
  49. void EnableTimer();
  50. /// <summary>
  51. /// A function that opens a file dialog and returns the filename.
  52. /// </summary>
  53. /// <param name="Filter">The filter that should be applied to the new Dialog.</param>
  54. /// <returns>Returns the FileName and the SafeFileName if the user correctly selects a file,
  55. /// else returns a tuple with empty strigns</returns>
  56. Tuple<String, String> openNewDialog(String Filter);
  57. /// <summary>
  58. /// Sets the contents of the load status indicator label.
  59. /// </summary>
  60. /// <param name="message">The new contents</param>
  61. void SetToolStripLoadStatus(String message);
  62. /// <summary>
  63. /// Sets the contents of the last action taken indicator label.
  64. /// </summary>
  65. /// <param name="message">The new contents</param>
  66. void SetLastActionTakenText(String message);
  67. /// <summary>
  68. /// Changes the states of a tool strip button.
  69. /// </summary>
  70. /// <param name="buttonName">The name of the button.</param>
  71. /// <param name="state">The new state of the button.</param>
  72. void SetToolStripButtonStatus(String buttonName, MainWindow.ButtonState state);
  73. /// <summary>
  74. /// shows the given info message in a popup and asks the user to aknowledge it
  75. /// </summary>
  76. /// <param name="message">the message to show</param>
  77. void ShowInfoMessage(String message);
  78. /// <summary>
  79. /// Shows a warning box with the given message (Yes/No Buttons)and returns true if the user aknowledges it.
  80. /// </summary>
  81. /// <param name="message">The message of the warning.</param>
  82. /// <returns>True if the user confirms (Yes), negative if he doesn't (No)</returns>
  83. bool ShowWarning(String message);
  84. /// <summary>
  85. /// If the mouse is pressed or not.
  86. /// </summary>
  87. /// <returns>Whether or not the mouse is pressed.</returns>
  88. bool IsMousePressed();
  89. /// <summary>
  90. /// Adds a point to the right canvas
  91. /// </summary>
  92. /// <param name="newPoint">The point</param>
  93. /// <param name="line">The original line object</param>
  94. void AddNewPointRight(Ellipse newPoint, InternalLine line);
  95. /// <summary>
  96. /// Adds a point to the left canvas
  97. /// </summary>
  98. /// <param name="newPoint">The point</param>
  99. void AddNewPointLeft(Ellipse newPoint);
  100. /// <summary>
  101. /// Returns the cursor position.
  102. /// </summary>
  103. /// <returns>The cursor Position</returns>
  104. Point GetCursorPosition();
  105. /// <summary>
  106. /// Sets the contents of the status bar label containing
  107. /// the similarity score of the left and right image.
  108. /// </summary>
  109. /// <param name="message">The message to be set,
  110. /// will be set to the default value if left empty.</param>
  111. void SetImageSimilarityText(string message);
  112. }
  113. }