2023-04-19 12:14:14 +02:00
|
|
|
using System.Threading.Tasks;
|
2022-08-30 15:42:25 +02:00
|
|
|
using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
|
2021-05-13 20:03:07 +02:00
|
|
|
|
|
|
|
namespace TINK.View
|
|
|
|
{
|
2022-09-06 16:08:19 +02:00
|
|
|
public interface IViewService
|
|
|
|
{
|
|
|
|
/// <summary> Displays alert message. </summary>
|
|
|
|
/// <param name="title">Title of message.</param>
|
|
|
|
/// <param name="message">Message to display.</param>
|
|
|
|
/// <param name="cancel">Text of button.</param>
|
|
|
|
Task DisplayAlert(
|
|
|
|
string title,
|
|
|
|
string message,
|
|
|
|
string cancel);
|
2021-05-13 20:03:07 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
/// <summary> Displays alert message. </summary>
|
|
|
|
/// <param name="title">Title of message.</param>
|
|
|
|
/// <param name="message">Message to display.</param>
|
|
|
|
/// <param name="details">Detailed error description.</param>
|
|
|
|
/// <param name="cancel">Text of button.</param>
|
|
|
|
Task DisplayAdvancedAlert(
|
|
|
|
string title,
|
|
|
|
string message,
|
|
|
|
string details,
|
|
|
|
string cancel);
|
2021-05-13 20:03:07 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
/// <summary> Displays alert message. </summary>
|
|
|
|
/// <param name="title">Title of message.</param>
|
|
|
|
/// <param name="message">Message to display.</param>
|
|
|
|
/// <param name="accept">Text of accept button.</param>
|
|
|
|
/// <param name="cancel">Text of button.</param>
|
|
|
|
/// <returns>True if user pressed accept.</returns>
|
|
|
|
Task<bool> DisplayAlert(string title, string message, string accept, string cancel);
|
2021-06-26 20:57:55 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
/// <summary> Displays alert message. </summary>
|
|
|
|
/// <param name="title">Title of message.</param>
|
|
|
|
/// <param name="message">Message to display.</param>
|
|
|
|
/// <param name="details">Detailed error description.</param>
|
|
|
|
/// <param name="accept">Text of accept button.</param>
|
|
|
|
/// <param name="cancel">Text of button.</param>
|
|
|
|
/// <returns>True if user pressed accept.</returns>
|
|
|
|
Task<bool> DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel);
|
2021-05-13 20:03:07 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
/// <summary> Displays an action sheet. </summary>
|
|
|
|
/// <param name="title">Title of message.</param>
|
|
|
|
/// <param name="message">Message to display.</param>
|
|
|
|
/// <param name="cancel">Text of button.</param>
|
|
|
|
/// <param name="destruction"></param>
|
|
|
|
/// <param name="buttons">Buttons holding options to select.</param>
|
|
|
|
/// <returns>T</returns>
|
|
|
|
Task<string> DisplayActionSheet(string title, string cancel, string destruction, params string[] buttons);
|
2021-05-13 20:03:07 +02:00
|
|
|
|
2021-08-28 10:04:10 +02:00
|
|
|
#if USEFLYOUT
|
2021-06-26 20:57:55 +02:00
|
|
|
/// <summary> Shows a page.</summary>
|
2021-05-13 20:03:07 +02:00
|
|
|
/// <param name="type">Type of page to show.</param>
|
|
|
|
/// <param name="title">Title of page to show.</param>
|
|
|
|
void ShowPage(ViewTypes type, string title = null);
|
2021-06-26 20:57:55 +02:00
|
|
|
#else
|
2022-09-06 16:08:19 +02:00
|
|
|
/// <summary> Shows a page.</summary>
|
|
|
|
/// <param name="route">Route of the page to show.</param>
|
2021-06-26 20:57:55 +02:00
|
|
|
#if USCSHARP9
|
|
|
|
public Task ShowPage(string route);
|
|
|
|
#else
|
2022-09-06 16:08:19 +02:00
|
|
|
Task ShowPage(string route);
|
2021-06-26 20:57:55 +02:00
|
|
|
#endif
|
|
|
|
#endif
|
2021-05-13 20:03:07 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
/// <summary> Pushes a page onto the stack. </summary>
|
|
|
|
/// <param name="typeOfPage">Page to display.</param>
|
|
|
|
Task PushAsync(ViewTypes typeOfPage);
|
2021-05-13 20:03:07 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
/// <summary> Pushes a page onto the modal stack. </summary>
|
|
|
|
/// <param name="typeOfPage">Page to display.</param>
|
|
|
|
Task PushModalAsync(ViewTypes typeOfPage);
|
2021-05-13 20:03:07 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
/// <summary> Pushes a page onto the modal stack. </summary>
|
|
|
|
Task PopModalAsync();
|
2021-05-13 20:03:07 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
/// <summary> Displays user feedback popup.</summary>
|
|
|
|
/// <param name="battery">Object holding info about battery. For some batteries charging level might need to be updated by user.</param>
|
|
|
|
/// <returns>User feedback.</returns>
|
|
|
|
Task<IUserFeedback> DisplayUserFeedbackPopup(
|
2023-09-22 11:38:42 +02:00
|
|
|
IBatteryMutable battery = null);
|
2021-05-13 20:03:07 +02:00
|
|
|
|
2021-06-26 20:57:55 +02:00
|
|
|
#if USCSHARP9
|
2021-05-13 20:03:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Feedback given by user when returning bike.
|
|
|
|
/// </summary>
|
|
|
|
public interface IUserFeedback
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Holds whether bike is broken or not.
|
|
|
|
/// </summary>
|
|
|
|
bool IsBikeBroken { get; set; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Holds either
|
|
|
|
/// - general feedback
|
|
|
|
/// - error description of broken bike
|
|
|
|
/// or both.
|
|
|
|
/// </summary>
|
|
|
|
string Message { get; set; }
|
|
|
|
}
|
2021-06-26 20:57:55 +02:00
|
|
|
#endif
|
2022-09-06 16:08:19 +02:00
|
|
|
}
|
2021-06-26 20:57:55 +02:00
|
|
|
|
|
|
|
#if !USCSHARP9
|
2022-09-06 16:08:19 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Feedback given by user when returning bike.
|
|
|
|
/// </summary>
|
|
|
|
public interface IUserFeedback
|
|
|
|
{
|
|
|
|
/// <summary>
|
2023-04-19 12:14:14 +02:00
|
|
|
/// Holds the current charging level of the battery in bars, null if unknown.
|
2022-09-06 16:08:19 +02:00
|
|
|
/// </summary>
|
|
|
|
int? CurrentChargeBars { get; set; }
|
2021-06-26 20:57:55 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Holds whether bike is broken or not.
|
|
|
|
/// </summary>
|
|
|
|
bool IsBikeBroken { get; set; }
|
2022-08-30 15:42:25 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Holds either
|
|
|
|
/// - general feedback
|
|
|
|
/// - error description of broken bike
|
|
|
|
/// or both.
|
|
|
|
/// </summary>
|
|
|
|
string Message { get; set; }
|
|
|
|
}
|
2021-06-26 20:57:55 +02:00
|
|
|
#endif
|
2021-05-13 20:03:07 +02:00
|
|
|
}
|