2022-10-17 18:45:38 +02:00
using System ;
2022-08-30 15:42:25 +02:00
using System.Collections.Generic ;
using System.ComponentModel.DataAnnotations ;
2021-05-13 20:03:07 +02:00
using System.Threading ;
2022-08-30 15:42:25 +02:00
using Serilog.Events ;
2021-05-13 20:03:07 +02:00
using TINK.Model.Connector ;
using TINK.Model.Device ;
using TINK.Model.Services.CopriApi.ServerUris ;
2022-10-17 18:45:38 +02:00
using TINK.Model.Settings ;
2023-04-19 12:14:14 +02:00
using TINK.Model.Stations.StationNS ;
2022-08-30 15:42:25 +02:00
using TINK.Services ;
using TINK.Services.BluetoothLock ;
2021-05-13 20:03:07 +02:00
using TINK.Settings ;
using TINK.ViewModel.Map ;
using TINK.ViewModel.Settings ;
namespace TINK.Model
{
2022-09-06 16:08:19 +02:00
public enum AppFlavor
{
[Display(Name = "sharee.bike")]
ShareeBike ,
[Display(Name = "Lastenrad Bayern")]
LastenradBayern ,
[Display(Name = "Mein konrad")]
MeinKonrad ,
}
2022-08-30 15:42:25 +02:00
2022-09-06 16:08:19 +02:00
public interface ITinkApp
{
/// <summary> Update connector from depending on whether user is logged in or not.</summary>
void UpdateConnector ( ) ;
2021-05-13 20:03:07 +02:00
2022-09-06 16:08:19 +02:00
/// <summary> Saves object to file. </summary>
void Save ( ) ;
2021-05-13 20:03:07 +02:00
2022-09-06 16:08:19 +02:00
/// <summary> Holds the filter which is applied on the map view. Either TINK or Konrad stations are displayed. </summary>
IGroupFilterMapPage GroupFilterMapPage { get ; set ; }
2021-05-13 20:03:07 +02:00
2022-09-06 16:08:19 +02:00
/// <summary> Holds the user of the app. </summary>
User . User ActiveUser { get ; }
2021-05-13 20:03:07 +02:00
2022-09-06 16:08:19 +02:00
/// <summary> Holds the system to copri.</summary>
IFilteredConnector GetConnector ( bool isConnected ) ;
2021-05-13 20:03:07 +02:00
2022-09-06 16:08:19 +02:00
/// <summary> Name of the station which is selected. </summary>
IStation SelectedStation { get ; set ; }
2021-05-13 20:03:07 +02:00
2023-04-19 12:14:14 +02:00
/// <summary>Polling period.</summary>
2022-09-06 16:08:19 +02:00
PollingParameters Polling { get ; set ; }
2021-05-13 20:03:07 +02:00
2022-09-06 16:08:19 +02:00
TimeSpan ExpiresAfter { get ; set ; }
2021-05-13 20:03:07 +02:00
2023-04-19 12:14:14 +02:00
/// <summary> Holds status about whats new page. </summary>
2022-09-06 16:08:19 +02:00
WhatsNew WhatsNew { get ; }
2021-05-13 20:03:07 +02:00
2023-04-19 12:14:14 +02:00
/// <summary> Gets whether device is connected to Internet or not. </summary>
2022-09-06 16:08:19 +02:00
bool GetIsConnected ( ) ;
2021-05-13 20:03:07 +02:00
2022-09-06 16:08:19 +02:00
/// <summary> Action to post to GUI thread.</summary>
Action < SendOrPostCallback , object > PostAction { get ; }
2021-05-13 20:03:07 +02:00
2022-09-06 16:08:19 +02:00
/// <summary> Holds the uri which is applied after restart. </summary>
Uri NextActiveUri { get ; set ; }
2021-05-13 20:03:07 +02:00
2022-09-06 16:08:19 +02:00
/// <summary> Holds the filters loaded from settings. </summary>
IGroupFilterSettings FilterGroupSetting { get ; set ; }
2021-05-13 20:03:07 +02:00
2022-10-17 18:45:38 +02:00
/// <summary>Settings determining the startup behavior of the app.</summary>
IStartupSettings StartupSettings { get ; }
2023-04-19 12:14:14 +02:00
/// <summary> Value indicating whether map is centered to current position or not. </summary>
2022-09-06 16:08:19 +02:00
bool CenterMapToCurrentLocation { get ; set ; }
2021-05-13 20:03:07 +02:00
2022-09-06 16:08:19 +02:00
/// <summary> Holds the map area where user is or was located or null if position is unknown. </summary>
Xamarin . Forms . GoogleMaps . MapSpan UserMapSpan { get ; set ; }
2021-12-08 20:03:50 +01:00
2022-09-06 16:08:19 +02:00
/// <summary> Holds the map span to display either default span or span centered to current position depending on option <see cref="CenterMapToCurrentLocation"/>.</summary>
Xamarin . Forms . GoogleMaps . MapSpan ActiveMapSpan { get ; }
2021-11-14 23:27:29 +01:00
2022-09-06 16:08:19 +02:00
bool LogToExternalFolder { get ; set ; }
2021-05-13 20:03:07 +02:00
2022-09-06 16:08:19 +02:00
bool IsSiteCachingOn { get ; set ; }
2021-05-13 20:03:07 +02:00
2022-09-06 16:08:19 +02:00
/// <summary> Gets the minimum logging level. </summary>
LogEventLevel MinimumLogEventLevel { get ; set ; }
2021-05-13 20:03:07 +02:00
2022-09-06 16:08:19 +02:00
/// <summary> Gets a value indicating whether reporting level is verbose or not.</summary>
bool IsReportLevelVerbose { get ; set ; }
2021-06-26 20:57:55 +02:00
2022-09-06 16:08:19 +02:00
/// <summary> Updates logging level. </summary>
2022-10-17 18:45:38 +02:00
/// <param name="newLogLevel">New level to set.</param>
void UpdateLoggingLevel ( LogEventLevel newLogLevel ) ;
2021-05-13 20:03:07 +02:00
2022-09-06 16:08:19 +02:00
/// <summary>Holds uris of copri servers. </summary>
CopriServerUriList Uris { get ; }
2021-05-13 20:03:07 +02:00
2022-09-06 16:08:19 +02:00
/// <summary> Holds the different lock service implementations.</summary>
LocksServicesContainerMutable LocksServices { get ; }
2021-05-13 20:03:07 +02:00
2023-04-19 12:14:14 +02:00
/// <summary> Holds the flavor of the app, i.e. specifies if app is sharee.bike, Mein konrad or LastenRad Bayern.</summary>
2022-09-06 16:08:19 +02:00
AppFlavor Flavor { get ; }
2021-05-13 20:03:07 +02:00
2022-09-06 16:08:19 +02:00
/// <summary> Holds available app themes.</summary>
ServicesContainerMutable Themes { get ; }
2021-05-13 20:03:07 +02:00
2022-09-06 16:08:19 +02:00
/// <summary> Reference of object which provides device information. </summary>
ISmartDevice SmartDevice { get ; }
2021-05-13 20:03:07 +02:00
2022-09-06 16:08:19 +02:00
/// <summary> Holds the folder where settings files are stored. </summary>
string SettingsFileFolder { get ; }
2021-06-26 20:57:55 +02:00
2022-09-06 16:08:19 +02:00
/// <summary> Holds the external path. </summary>
string ExternalFolder { get ; }
2022-01-22 18:28:01 +01:00
2023-04-19 12:14:14 +02:00
/// <summary> Holds the stations centered. </summary>
2022-09-06 16:08:19 +02:00
IEnumerable < IStation > Stations { get ; set ; }
2022-01-22 18:28:01 +01:00
2022-10-17 18:45:38 +02:00
/// <summary> Holds the Urs to query resources from. </summary>
2022-09-06 16:08:19 +02:00
IResourceUrls ResourceUrls { get ; set ; }
}
2022-01-22 18:28:01 +01:00
2022-09-06 16:08:19 +02:00
public interface IResourceUrls
{
string FeesResourcePath { get ; }
2022-01-22 18:28:01 +01:00
2022-09-06 16:08:19 +02:00
string BikesResourcePath { get ; }
2022-01-22 18:28:01 +01:00
2022-09-06 16:08:19 +02:00
string AgbResourcePath { get ; }
2022-01-22 18:28:01 +01:00
2022-09-06 16:08:19 +02:00
string PrivacyResourcePath { get ; }
string ImpressResourcePath { get ; }
}
2021-05-13 20:03:07 +02:00
}