MVP_View.cs 4.7 KB

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