mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-12-22 23:26:31 +01:00
135 lines
4.5 KiB
C#
135 lines
4.5 KiB
C#
using System.Threading.Tasks;
|
|
using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
|
|
|
|
namespace TINK.View
|
|
{
|
|
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);
|
|
|
|
/// <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);
|
|
|
|
/// <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);
|
|
|
|
/// <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);
|
|
|
|
/// <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);
|
|
|
|
#if USEFLYOUT
|
|
/// <summary> Shows a page.</summary>
|
|
/// <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);
|
|
#else
|
|
/// <summary> Shows a page.</summary>
|
|
/// <param name="route">Route of the page to show.</param>
|
|
#if USCSHARP9
|
|
public Task ShowPage(string route);
|
|
#else
|
|
Task ShowPage(string route);
|
|
#endif
|
|
#endif
|
|
|
|
/// <summary> Pushes a page onto the stack. </summary>
|
|
/// <param name="typeOfPage">Page to display.</param>
|
|
Task PushAsync(ViewTypes typeOfPage);
|
|
|
|
/// <summary> Pushes a page onto the modal stack. </summary>
|
|
/// <param name="typeOfPage">Page to display.</param>
|
|
Task PushModalAsync(ViewTypes typeOfPage);
|
|
|
|
/// <summary> Pushes a page onto the modal stack. </summary>
|
|
Task PopModalAsync();
|
|
|
|
/// <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>
|
|
/// <param name="co2Saving"> Co2 saving information.</param>
|
|
/// <returns>User feedback.</returns>
|
|
Task<IUserFeedback> DisplayUserFeedbackPopup(
|
|
IBattery battery = null,
|
|
string co2Saving = null);
|
|
|
|
#if USCSHARP9
|
|
/// <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; }
|
|
}
|
|
#endif
|
|
}
|
|
|
|
#if !USCSHARP9
|
|
/// <summary>
|
|
/// Feedback given by user when returning bike.
|
|
/// </summary>
|
|
public interface IUserFeedback
|
|
{
|
|
/// <summary>
|
|
/// Holds the current charging level of the battery in bars, null if unknown.
|
|
/// </summary>
|
|
int? CurrentChargeBars { get; set; }
|
|
|
|
/// <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; }
|
|
}
|
|
#endif
|
|
}
|