Revert "File scoped namespaces"

This reverts commit d31d8f574e.
This commit is contained in:
Burak Kaan Köse
2025-02-16 11:43:30 +01:00
parent d31d8f574e
commit cf9869b71e
617 changed files with 32097 additions and 31478 deletions
+12 -11
View File
@@ -1,15 +1,16 @@
using System;
namespace Wino.Core.Domain.Interfaces;
public interface IAccountCalendar
namespace Wino.Core.Domain.Interfaces
{
string Name { get; set; }
string TextColorHex { get; set; }
string BackgroundColorHex { get; set; }
bool IsPrimary { get; set; }
Guid AccountId { get; set; }
string RemoteCalendarId { get; set; }
bool IsExtended { get; set; }
Guid Id { get; set; }
public interface IAccountCalendar
{
string Name { get; set; }
string TextColorHex { get; set; }
string BackgroundColorHex { get; set; }
bool IsPrimary { get; set; }
Guid AccountId { get; set; }
string RemoteCalendarId { get; set; }
bool IsExtended { get; set; }
Guid Id { get; set; }
}
}
@@ -2,11 +2,12 @@
using System.Threading.Tasks;
using Wino.Core.Domain.Enums;
namespace Wino.Core.Domain.Interfaces;
public interface IAccountCreationDialog
namespace Wino.Core.Domain.Interfaces
{
Task ShowDialogAsync(CancellationTokenSource cancellationTokenSource);
void Complete(bool cancel);
AccountCreationDialogState State { get; set; }
public interface IAccountCreationDialog
{
Task ShowDialogAsync(CancellationTokenSource cancellationTokenSource);
void Complete(bool cancel);
AccountCreationDialogState State { get; set; }
}
}
+14 -13
View File
@@ -2,20 +2,21 @@
using Wino.Core.Domain.Entities.Mail;
using Wino.Core.Domain.Entities.Shared;
namespace Wino.Core.Domain.Interfaces;
public interface IAccountMenuItem : IMenuItem
namespace Wino.Core.Domain.Interfaces
{
bool IsEnabled { get; set; }
double SynchronizationProgress { get; set; }
int UnreadItemCount { get; set; }
IEnumerable<MailAccount> HoldingAccounts { get; }
void UpdateAccount(MailAccount account);
}
public interface IAccountMenuItem : IMenuItem
{
bool IsEnabled { get; set; }
double SynchronizationProgress { get; set; }
int UnreadItemCount { get; set; }
IEnumerable<MailAccount> HoldingAccounts { get; }
void UpdateAccount(MailAccount account);
}
public interface IMergedAccountMenuItem : IAccountMenuItem
{
int MergedAccountCount { get; }
public interface IMergedAccountMenuItem : IAccountMenuItem
{
int MergedAccountCount { get; }
MergedInbox Parameter { get; }
MergedInbox Parameter { get; }
}
}
@@ -1,5 +1,6 @@
namespace Wino.Core.Domain.Interfaces;
public interface IAccountPickerDialog
namespace Wino.Core.Domain.Interfaces
{
public interface IAccountPickerDialog
{
}
}
@@ -1,37 +1,38 @@
using System;
namespace Wino.Core.Domain.Interfaces;
public interface IAccountProviderDetailViewModel
namespace Wino.Core.Domain.Interfaces
{
/// <summary>
/// Entity id that will help to identify the startup entity on launch.
/// </summary>
Guid StartupEntityId { get; }
public interface IAccountProviderDetailViewModel
{
/// <summary>
/// Entity id that will help to identify the startup entity on launch.
/// </summary>
Guid StartupEntityId { get; }
/// <summary>
/// Name representation of the view model that will be used to identify the startup entity on launch.
/// </summary>
string StartupEntityTitle { get; }
/// <summary>
/// Name representation of the view model that will be used to identify the startup entity on launch.
/// </summary>
string StartupEntityTitle { get; }
/// <summary>
/// E-mail addresses that this account holds.
/// </summary>
/// <summary>
/// E-mail addresses that this account holds.
/// </summary>
string StartupEntityAddresses { get; }
string StartupEntityAddresses { get; }
/// <summary>
/// Represents the account order in the accounts list.
/// </summary>
int Order { get; }
/// <summary>
/// Represents the account order in the accounts list.
/// </summary>
int Order { get; }
/// <summary>
/// Provider details of the account.
/// </summary>
IProviderDetail ProviderDetail { get; set; }
/// <summary>
/// Provider details of the account.
/// </summary>
IProviderDetail ProviderDetail { get; set; }
/// <summary>
/// How many accounts this provider has.
/// </summary>
int HoldingAccountCount { get; }
/// <summary>
/// How many accounts this provider has.
/// </summary>
int HoldingAccountCount { get; }
}
}
@@ -1,10 +1,11 @@
using Wino.Core.Domain.Entities.Shared;
namespace Wino.Core.Domain.Interfaces;
public interface IAccountProviderDetails
namespace Wino.Core.Domain.Interfaces
{
MailAccount Account { get; set; }
bool AutoExtend { get; set; }
IProviderDetail ProviderDetail { get; set; }
public interface IAccountProviderDetails
{
MailAccount Account { get; set; }
bool AutoExtend { get; set; }
IProviderDetail ProviderDetail { get; set; }
}
}
+129 -128
View File
@@ -5,155 +5,156 @@ using Wino.Core.Domain.Entities.Mail;
using Wino.Core.Domain.Entities.Shared;
using Wino.Core.Domain.Models.Accounts;
namespace Wino.Core.Domain.Interfaces;
public interface IAccountService
namespace Wino.Core.Domain.Interfaces
{
/// <summary>
/// Current IAuthenticator that should receive external authentication process to continue with.
/// For example: Google auth will launch a browser authentication. After it completes, this is the IAuthenticator
/// to continue process for token exchange.
/// </summary>
IAuthenticator ExternalAuthenticationAuthenticator { get; set; }
public interface IAccountService
{
/// <summary>
/// Current IAuthenticator that should receive external authentication process to continue with.
/// For example: Google auth will launch a browser authentication. After it completes, this is the IAuthenticator
/// to continue process for token exchange.
/// </summary>
IAuthenticator ExternalAuthenticationAuthenticator { get; set; }
/// <summary>
/// Returns all local accounts.
/// </summary>
/// <returns>All local accounts</returns>
Task<List<MailAccount>> GetAccountsAsync();
/// <summary>
/// Returns all local accounts.
/// </summary>
/// <returns>All local accounts</returns>
Task<List<MailAccount>> GetAccountsAsync();
/// <summary>
/// Returns single MailAccount
/// </summary>
/// <param name="accountId">AccountId.</param>
Task<MailAccount> GetAccountAsync(Guid accountId);
/// <summary>
/// Returns single MailAccount
/// </summary>
/// <param name="accountId">AccountId.</param>
Task<MailAccount> GetAccountAsync(Guid accountId);
/// <summary>
/// Deletes all information about the account, including token information.
/// </summary>
/// <param name="account">MailAccount to be removed</param>
Task DeleteAccountAsync(MailAccount account);
/// <summary>
/// Deletes all information about the account, including token information.
/// </summary>
/// <param name="account">MailAccount to be removed</param>
Task DeleteAccountAsync(MailAccount account);
/// <summary>
/// Returns the custom server information for the given account id.
/// </summary>
Task<CustomServerInformation> GetAccountCustomServerInformationAsync(Guid accountId);
/// <summary>
/// Returns the custom server information for the given account id.
/// </summary>
Task<CustomServerInformation> GetAccountCustomServerInformationAsync(Guid accountId);
/// <summary>
/// Updates the given account properties.
/// </summary>
Task UpdateAccountAsync(MailAccount account);
/// <summary>
/// Updates the given account properties.
/// </summary>
Task UpdateAccountAsync(MailAccount account);
/// <summary>
/// Creates new account with the given server information if any.
/// Also sets the account as Startup account if there are no accounts.
/// </summary>
Task CreateAccountAsync(MailAccount account, CustomServerInformation customServerInformation);
/// <summary>
/// Creates new account with the given server information if any.
/// Also sets the account as Startup account if there are no accounts.
/// </summary>
Task CreateAccountAsync(MailAccount account, CustomServerInformation customServerInformation);
/// <summary>
/// Fixed authentication errors for account by forcing interactive login.
/// </summary>
Task FixTokenIssuesAsync(Guid accountId);
/// <summary>
/// Fixed authentication errors for account by forcing interactive login.
/// </summary>
Task FixTokenIssuesAsync(Guid accountId);
/// <summary>
/// Removed the attention from an account.
/// </summary>
/// <param name="accountId">Account id to remove from</param>
Task ClearAccountAttentionAsync(Guid accountId);
/// <summary>
/// Removed the attention from an account.
/// </summary>
/// <param name="accountId">Account id to remove from</param>
Task ClearAccountAttentionAsync(Guid accountId);
/// <summary>
/// Updates the account synchronization identifier.
/// For example: Gmail uses this identifier to keep track of the last synchronization.
/// Update is ignored for Gmail if the new identifier is older than the current one.
/// </summary>
/// <param name="newIdentifier">Identifier to update</param>
/// <returns>Current account synchronization modifier.</returns>
Task<string> UpdateSynchronizationIdentifierAsync(Guid accountId, string newIdentifier);
/// <summary>
/// Updates the account synchronization identifier.
/// For example: Gmail uses this identifier to keep track of the last synchronization.
/// Update is ignored for Gmail if the new identifier is older than the current one.
/// </summary>
/// <param name="newIdentifier">Identifier to update</param>
/// <returns>Current account synchronization modifier.</returns>
Task<string> UpdateSynchronizationIdentifierAsync(Guid accountId, string newIdentifier);
/// <summary>
/// Renames the merged inbox with the given id.
/// </summary>
/// <param name="mergedInboxId">Merged Inbox id</param>
/// <param name="newName">New name for the merged/linked inbox.</param>
Task RenameMergedAccountAsync(Guid mergedInboxId, string newName);
/// <summary>
/// Renames the merged inbox with the given id.
/// </summary>
/// <param name="mergedInboxId">Merged Inbox id</param>
/// <param name="newName">New name for the merged/linked inbox.</param>
Task RenameMergedAccountAsync(Guid mergedInboxId, string newName);
/// <summary>
/// Creates a new merged inbox with the given accounts.
/// </summary>
/// <param name="mergedInbox">Merged inbox properties.</param>
/// <param name="accountsToMerge">List of accounts to merge together.</param>
Task CreateMergeAccountsAsync(MergedInbox mergedInbox, IEnumerable<MailAccount> accountsToMerge);
/// <summary>
/// Creates a new merged inbox with the given accounts.
/// </summary>
/// <param name="mergedInbox">Merged inbox properties.</param>
/// <param name="accountsToMerge">List of accounts to merge together.</param>
Task CreateMergeAccountsAsync(MergedInbox mergedInbox, IEnumerable<MailAccount> accountsToMerge);
/// <summary>
/// Updates the merged inbox with the given id with the new linked accounts.
/// </summary>
/// <param name="mergedInboxId">Updating merged inbox id.</param>
/// <param name="linkedAccountIds">List of linked account ids.</param>
Task UpdateMergedInboxAsync(Guid mergedInboxId, IEnumerable<Guid> linkedAccountIds);
/// <summary>
/// Updates the merged inbox with the given id with the new linked accounts.
/// </summary>
/// <param name="mergedInboxId">Updating merged inbox id.</param>
/// <param name="linkedAccountIds">List of linked account ids.</param>
Task UpdateMergedInboxAsync(Guid mergedInboxId, IEnumerable<Guid> linkedAccountIds);
/// <summary>
/// Destroys the merged inbox with the given id.
/// </summary>
/// <param name="mergedInboxId">Merged inbox id to destroy.</param>
Task UnlinkMergedInboxAsync(Guid mergedInboxId);
/// <summary>
/// Destroys the merged inbox with the given id.
/// </summary>
/// <param name="mergedInboxId">Merged inbox id to destroy.</param>
Task UnlinkMergedInboxAsync(Guid mergedInboxId);
/// <summary>
/// Updates the account listing orders.
/// </summary>
/// <param name="accountIdOrderPair">AccountId-OrderNumber pair for all accounts.</param>
Task UpdateAccountOrdersAsync(Dictionary<Guid, int> accountIdOrderPair);
/// <summary>
/// Updates the account listing orders.
/// </summary>
/// <param name="accountIdOrderPair">AccountId-OrderNumber pair for all accounts.</param>
Task UpdateAccountOrdersAsync(Dictionary<Guid, int> accountIdOrderPair);
/// <summary>
/// Returns the account aliases.
/// </summary>
/// <param name="accountId">Account id.</param>
/// <returns>A list of MailAccountAlias that has e-mail aliases.</returns>
Task<List<MailAccountAlias>> GetAccountAliasesAsync(Guid accountId);
/// <summary>
/// Returns the account aliases.
/// </summary>
/// <param name="accountId">Account id.</param>
/// <returns>A list of MailAccountAlias that has e-mail aliases.</returns>
Task<List<MailAccountAlias>> GetAccountAliasesAsync(Guid accountId);
/// <summary>
/// Updated account's aliases.
/// </summary>
/// <param name="accountId">Account id to update aliases for.</param>
/// <param name="aliases">Full list of updated aliases.</param>
/// <returns></returns>
Task UpdateAccountAliasesAsync(Guid accountId, List<MailAccountAlias> aliases);
/// <summary>
/// Updated account's aliases.
/// </summary>
/// <param name="accountId">Account id to update aliases for.</param>
/// <param name="aliases">Full list of updated aliases.</param>
/// <returns></returns>
Task UpdateAccountAliasesAsync(Guid accountId, List<MailAccountAlias> aliases);
/// <summary>
/// Delete account alias.
/// </summary>
/// <param name="aliasId">Alias to remove.</param>
Task DeleteAccountAliasAsync(Guid aliasId);
/// <summary>
/// Delete account alias.
/// </summary>
/// <param name="aliasId">Alias to remove.</param>
Task DeleteAccountAliasAsync(Guid aliasId);
/// <summary>
/// Updated profile information of the account.
/// </summary>
/// <param name="accountId">Account id to update info for.</param>
/// <param name="profileInformation">Info data.</param>
/// <returns></returns>
Task UpdateProfileInformationAsync(Guid accountId, ProfileInformation profileInformation);
/// <summary>
/// Updated profile information of the account.
/// </summary>
/// <param name="accountId">Account id to update info for.</param>
/// <param name="profileInformation">Info data.</param>
/// <returns></returns>
Task UpdateProfileInformationAsync(Guid accountId, ProfileInformation profileInformation);
/// <summary>
/// Creates a root + primary alias for the account.
/// This is only called when the account is created.
/// </summary>
/// <param name="accountId">Account id.</param>
/// <param name="address">Address to create root primary alias from.</param>
Task CreateRootAliasAsync(Guid accountId, string address);
/// <summary>
/// Creates a root + primary alias for the account.
/// This is only called when the account is created.
/// </summary>
/// <param name="accountId">Account id.</param>
/// <param name="address">Address to create root primary alias from.</param>
Task CreateRootAliasAsync(Guid accountId, string address);
/// <summary>
/// Will compare local-remote aliases and update the local ones or add/delete new ones.
/// </summary>
/// <param name="remoteAccountAliases">Remotely fetched basic alias info from synchronizer.</param>
/// <param name="account">Account to update remote aliases for..</param>
Task UpdateRemoteAliasInformationAsync(MailAccount account, List<RemoteAccountAlias> remoteAccountAliases);
/// <summary>
/// Will compare local-remote aliases and update the local ones or add/delete new ones.
/// </summary>
/// <param name="remoteAccountAliases">Remotely fetched basic alias info from synchronizer.</param>
/// <param name="account">Account to update remote aliases for..</param>
Task UpdateRemoteAliasInformationAsync(MailAccount account, List<RemoteAccountAlias> remoteAccountAliases);
/// <summary>
/// Gets the primary account alias for the given account id.
/// Used when creating draft messages.
/// </summary>
/// <param name="accountId">Account id.</param>
/// <returns>Primary alias for the account.</returns>
Task<MailAccountAlias> GetPrimaryAccountAliasAsync(Guid accountId);
Task<bool> IsAccountFocusedEnabledAsync(Guid accountId);
/// <summary>
/// Gets the primary account alias for the given account id.
/// Used when creating draft messages.
/// </summary>
/// <param name="accountId">Account id.</param>
/// <returns>Primary alias for the account.</returns>
Task<MailAccountAlias> GetPrimaryAccountAliasAsync(Guid accountId);
Task<bool> IsAccountFocusedEnabledAsync(Guid accountId);
}
}
@@ -1,26 +1,32 @@
namespace Wino.Core.Domain.Interfaces;
/// <summary>
/// Singleton object that holds the application data folder path and the publisher shared folder path.
/// Load the values before calling any service.
/// App data folder is used for storing files.
/// Pubhlisher cache folder is only used for database file so other apps can access it in the same package by same publisher.
/// </summary>
public interface IApplicationConfiguration
namespace Wino.Core.Domain.Interfaces
{
/// <summary>
/// Application data folder.
/// Singleton object that holds the application data folder path and the publisher shared folder path.
/// Load the values before calling any service.
/// App data folder is used for storing files.
/// Pubhlisher cache folder is only used for database file so other apps can access it in the same package by same publisher.
/// </summary>
string ApplicationDataFolderPath { get; set; }
public interface IApplicationConfiguration
{
/// <summary>
/// Application data folder.
/// </summary>
string ApplicationDataFolderPath { get; set; }
/// <summary>
/// Publisher shared folder path.
/// </summary>
string PublisherSharedFolderPath { get; set; }
/// <summary>
/// Publisher shared folder path.
/// </summary>
string PublisherSharedFolderPath { get; set; }
/// <summary>
/// Temp folder path of the application.
/// Files here are short-lived and can be deleted by system.
/// </summary>
string ApplicationTempFolderPath { get; set; }
/// <summary>
/// Temp folder path of the application.
/// Files here are short-lived and can be deleted by system.
/// </summary>
string ApplicationTempFolderPath { get; set; }
/// <summary>
/// Application insights instrumentation key.
/// </summary>
string ApplicationInsightsInstrumentationKey { get; }
}
}
@@ -1,11 +1,12 @@
namespace Wino.Core.Domain.Interfaces;
public interface IApplicationResourceManager<T>
namespace Wino.Core.Domain.Interfaces
{
void RemoveResource(T resource);
void AddResource(T resource);
bool ContainsResourceKey(string resourceKey);
void ReplaceResource(string resourceKey, object resource);
T GetLastResource();
TReturnType GetResource<TReturnType>(string resourceKey);
public interface IApplicationResourceManager<T>
{
void RemoveResource(T resource);
void AddResource(T resource);
bool ContainsResourceKey(string resourceKey);
void ReplaceResource(string resourceKey, object resource);
T GetLastResource();
TReturnType GetResource<TReturnType>(string resourceKey);
}
}
@@ -1,8 +1,9 @@
using Wino.Core.Domain.Enums;
namespace Wino.Core.Domain.Interfaces;
public interface IAuthenticationProvider
namespace Wino.Core.Domain.Interfaces
{
IAuthenticator GetAuthenticator(MailProviderType providerType);
public interface IAuthenticationProvider
{
IAuthenticator GetAuthenticator(MailProviderType providerType);
}
}
+27 -26
View File
@@ -3,36 +3,37 @@ using Wino.Core.Domain.Entities.Shared;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.Authentication;
namespace Wino.Core.Domain.Interfaces;
public interface IAuthenticator
namespace Wino.Core.Domain.Interfaces
{
/// <summary>
/// Type of the provider.
/// </summary>
MailProviderType ProviderType { get; }
public interface IAuthenticator
{
/// <summary>
/// Type of the provider.
/// </summary>
MailProviderType ProviderType { get; }
Task<TokenInformationEx> GetTokenInformationAsync(MailAccount account);
Task<TokenInformationEx> GetTokenInformationAsync(MailAccount account);
Task<TokenInformationEx> GenerateTokenInformationAsync(MailAccount account);
Task<TokenInformationEx> GenerateTokenInformationAsync(MailAccount account);
///// <summary>
///// Gets the token for the given account from the cache.
///// Forces interactive login if the token is not found.
///// </summary>
///// <param name="account">Account to get access token for.</param>
///// <returns>Access token</returns>
//Task<string> GetTokenAsync(MailAccount account);
///// <summary>
///// Gets the token for the given account from the cache.
///// Forces interactive login if the token is not found.
///// </summary>
///// <param name="account">Account to get access token for.</param>
///// <returns>Access token</returns>
//Task<string> GetTokenAsync(MailAccount account);
///// <summary>
///// Forces an interactive login to get the token for the given account.
///// </summary>
///// <param name="account">Account to get access token for.</param>
///// <returns>Access token</returns>
//// Task<string> GenerateTokenAsync(MailAccount account);
///// <summary>
///// Forces an interactive login to get the token for the given account.
///// </summary>
///// <param name="account">Account to get access token for.</param>
///// <returns>Access token</returns>
//// Task<string> GenerateTokenAsync(MailAccount account);
///// <summary>
///// ClientId in case of needed for authorization/authentication.
///// </summary>
//string ClientId { get; }
///// <summary>
///// ClientId in case of needed for authorization/authentication.
///// </summary>
//string ClientId { get; }
}
}
@@ -1,10 +1,11 @@
namespace Wino.Core.Domain.Interfaces;
public interface IAuthenticatorConfig
namespace Wino.Core.Domain.Interfaces
{
string OutlookAuthenticatorClientId { get; }
string[] OutlookScope { get; }
string GmailAuthenticatorClientId { get; }
string[] GmailScope { get; }
string GmailTokenStoreIdentifier { get; }
public interface IAuthenticatorConfig
{
string OutlookAuthenticatorClientId { get; }
string[] OutlookScope { get; }
string GmailAuthenticatorClientId { get; }
string[] GmailScope { get; }
string GmailTokenStoreIdentifier { get; }
}
}
@@ -1,9 +1,10 @@
namespace Wino.Core.Domain.Interfaces;
public interface IOutlookAuthenticator : IAuthenticator { }
public interface IGmailAuthenticator : IAuthenticator
namespace Wino.Core.Domain.Interfaces
{
bool ProposeCopyAuthURL { get; set; }
}
public interface IOutlookAuthenticator : IAuthenticator { }
public interface IGmailAuthenticator : IAuthenticator
{
bool ProposeCopyAuthURL { get; set; }
}
public interface IImapAuthenticator : IAuthenticator { }
public interface IImapAuthenticator : IAuthenticator { }
}
@@ -1,17 +1,18 @@
using System.Threading.Tasks;
using Wino.Core.Domain.Models.AutoDiscovery;
namespace Wino.Core.Domain.Interfaces;
/// <summary>
/// Searches for Auto Discovery settings for custom mail accounts.
/// </summary>
public interface IAutoDiscoveryService
namespace Wino.Core.Domain.Interfaces
{
/// <summary>
/// Tries to return the best mail server settings using different techniques.
/// Searches for Auto Discovery settings for custom mail accounts.
/// </summary>
/// <param name="mailAddress">Address to search settings for.</param>
/// <returns>CustomServerInformation with only settings applied.</returns>
Task<AutoDiscoverySettings> GetAutoDiscoverySettings(AutoDiscoveryMinimalSettings autoDiscoveryMinimalSettings);
public interface IAutoDiscoveryService
{
/// <summary>
/// Tries to return the best mail server settings using different techniques.
/// </summary>
/// <param name="mailAddress">Address to search settings for.</param>
/// <returns>CustomServerInformation with only settings applied.</returns>
Task<AutoDiscoverySettings> GetAutoDiscoverySettings(AutoDiscoveryMinimalSettings autoDiscoveryMinimalSettings);
}
}
@@ -1,17 +1,18 @@
using System.Threading.Tasks;
namespace Wino.Core.Domain.Interfaces;
public interface IBackgroundTaskService
namespace Wino.Core.Domain.Interfaces
{
/// <summary>
/// Unregisters all background tasks once.
/// This is used to clean up the background tasks when the app is updated.
/// </summary>
void UnregisterAllBackgroundTask();
public interface IBackgroundTaskService
{
/// <summary>
/// Unregisters all background tasks once.
/// This is used to clean up the background tasks when the app is updated.
/// </summary>
void UnregisterAllBackgroundTask();
/// <summary>
/// Registers required background tasks.
/// </summary>
Task RegisterBackgroundTasksAsync();
/// <summary>
/// Registers required background tasks.
/// </summary>
Task RegisterBackgroundTasksAsync();
}
}
@@ -3,30 +3,31 @@ using Wino.Core.Domain.Entities.Shared;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.Accounts;
namespace Wino.Core.Domain.Interfaces;
public interface IBaseSynchronizer
namespace Wino.Core.Domain.Interfaces
{
/// <summary>
/// Account that is assigned for this synchronizer.
/// </summary>
MailAccount Account { get; }
public interface IBaseSynchronizer
{
/// <summary>
/// Account that is assigned for this synchronizer.
/// </summary>
MailAccount Account { get; }
/// <summary>
/// Synchronizer state.
/// </summary>
AccountSynchronizerState State { get; }
/// <summary>
/// Synchronizer state.
/// </summary>
AccountSynchronizerState State { get; }
/// <summary>
/// Queues a single request to be executed in the next synchronization.
/// </summary>
/// <param name="request">Request to queue.</param>
void QueueRequest(IRequestBase request);
/// <summary>
/// Queues a single request to be executed in the next synchronization.
/// </summary>
/// <param name="request">Request to queue.</param>
void QueueRequest(IRequestBase request);
/// <summary>
/// Synchronizes profile information with the server.
/// Sender name and Profile picture are updated.
/// </summary>
/// <returns>Profile information model that holds the values.</returns>
Task<ProfileInformation> GetProfileInformationAsync();
/// <summary>
/// Synchronizes profile information with the server.
/// Sender name and Profile picture are updated.
/// </summary>
/// <returns>Profile information model that holds the values.</returns>
Task<ProfileInformation> GetProfileInformationAsync();
}
}
@@ -1,5 +1,6 @@
namespace Wino.Core.Domain.Interfaces;
public interface ICalendarDialogService : IDialogServiceBase
namespace Wino.Core.Domain.Interfaces
{
public interface ICalendarDialogService : IDialogServiceBase
{
}
}
+16 -15
View File
@@ -1,22 +1,23 @@
using System;
using Itenso.TimePeriod;
namespace Wino.Core.Domain.Interfaces;
public interface ICalendarItem
namespace Wino.Core.Domain.Interfaces
{
string Title { get; }
Guid Id { get; }
IAccountCalendar AssignedCalendar { get; }
DateTime StartDate { get; set; }
DateTime EndDate { get; }
double DurationInSeconds { get; set; }
ITimePeriod Period { get; }
public interface ICalendarItem
{
string Title { get; }
Guid Id { get; }
IAccountCalendar AssignedCalendar { get; }
DateTime StartDate { get; set; }
DateTime EndDate { get; }
double DurationInSeconds { get; set; }
ITimePeriod Period { get; }
bool IsAllDayEvent { get; }
bool IsMultiDayEvent { get; }
bool IsAllDayEvent { get; }
bool IsMultiDayEvent { get; }
bool IsRecurringChild { get; }
bool IsRecurringParent { get; }
bool IsRecurringEvent { get; }
bool IsRecurringChild { get; }
bool IsRecurringParent { get; }
bool IsRecurringEvent { get; }
}
}
@@ -1,9 +1,10 @@
namespace Wino.Core.Domain.Interfaces;
/// <summary>
/// Temporarily to enforce CalendarItemViewModel. Used in CalendarEventCollection.
/// </summary>
public interface ICalendarItemViewModel
namespace Wino.Core.Domain.Interfaces
{
bool IsSelected { get; set; }
/// <summary>
/// Temporarily to enforce CalendarItemViewModel. Used in CalendarEventCollection.
/// </summary>
public interface ICalendarItemViewModel
{
bool IsSelected { get; set; }
}
}
+22 -21
View File
@@ -4,28 +4,29 @@ using System.Threading.Tasks;
using Wino.Core.Domain.Entities.Calendar;
using Wino.Core.Domain.Models.Calendar;
namespace Wino.Core.Domain.Interfaces;
public interface ICalendarService
namespace Wino.Core.Domain.Interfaces
{
Task<List<AccountCalendar>> GetAccountCalendarsAsync(Guid accountId);
Task<AccountCalendar> GetAccountCalendarAsync(Guid accountCalendarId);
Task DeleteCalendarItemAsync(Guid calendarItemId);
public interface ICalendarService
{
Task<List<AccountCalendar>> GetAccountCalendarsAsync(Guid accountId);
Task<AccountCalendar> GetAccountCalendarAsync(Guid accountCalendarId);
Task DeleteCalendarItemAsync(Guid calendarItemId);
Task DeleteAccountCalendarAsync(AccountCalendar accountCalendar);
Task InsertAccountCalendarAsync(AccountCalendar accountCalendar);
Task UpdateAccountCalendarAsync(AccountCalendar accountCalendar);
Task CreateNewCalendarItemAsync(CalendarItem calendarItem, List<CalendarEventAttendee> attendees);
Task<List<CalendarItem>> GetCalendarEventsAsync(IAccountCalendar calendar, DayRangeRenderModel dayRangeRenderModel);
Task<CalendarItem> GetCalendarItemAsync(Guid accountCalendarId, string remoteEventId);
Task UpdateCalendarDeltaSynchronizationToken(Guid calendarId, string deltaToken);
Task DeleteAccountCalendarAsync(AccountCalendar accountCalendar);
Task InsertAccountCalendarAsync(AccountCalendar accountCalendar);
Task UpdateAccountCalendarAsync(AccountCalendar accountCalendar);
Task CreateNewCalendarItemAsync(CalendarItem calendarItem, List<CalendarEventAttendee> attendees);
Task<List<CalendarItem>> GetCalendarEventsAsync(IAccountCalendar calendar, DayRangeRenderModel dayRangeRenderModel);
Task<CalendarItem> GetCalendarItemAsync(Guid accountCalendarId, string remoteEventId);
Task UpdateCalendarDeltaSynchronizationToken(Guid calendarId, string deltaToken);
/// <summary>
/// Returns the correct calendar item based on the target details.
/// </summary>
/// <param name="targetDetails">Target details.</param>
Task<CalendarItem> GetCalendarItemTargetAsync(CalendarItemTarget targetDetails);
Task<CalendarItem> GetCalendarItemAsync(Guid id);
Task<List<CalendarEventAttendee>> GetAttendeesAsync(Guid calendarEventTrackingId);
Task<List<CalendarEventAttendee>> ManageEventAttendeesAsync(Guid calendarItemId, List<CalendarEventAttendee> allAttendees);
/// <summary>
/// Returns the correct calendar item based on the target details.
/// </summary>
/// <param name="targetDetails">Target details.</param>
Task<CalendarItem> GetCalendarItemTargetAsync(CalendarItemTarget targetDetails);
Task<CalendarItem> GetCalendarItemAsync(Guid id);
Task<List<CalendarEventAttendee>> GetAttendeesAsync(Guid calendarEventTrackingId);
Task<List<CalendarEventAttendee>> ManageEventAttendeesAsync(Guid calendarItemId, List<CalendarEventAttendee> allAttendees);
}
}
@@ -1,7 +1,8 @@
namespace Wino.Core.Domain.Interfaces;
/// <summary>
/// All messages that Client sends to Server and awaits a response in return.
/// For example; triggering a new synchronization request.
/// </summary>
public interface IClientMessage;
namespace Wino.Core.Domain.Interfaces
{
/// <summary>
/// All messages that Client sends to Server and awaits a response in return.
/// For example; triggering a new synchronization request.
/// </summary>
public interface IClientMessage;
}
@@ -1,8 +1,9 @@
using System.Threading.Tasks;
namespace Wino.Core.Domain.Interfaces;
public interface IClipboardService
namespace Wino.Core.Domain.Interfaces
{
Task CopyClipboardAsync(string text);
public interface IClipboardService
{
Task CopyClipboardAsync(string text);
}
}
@@ -1,10 +1,11 @@
namespace Wino.Core.Domain.Interfaces;
public interface IConfigurationService
namespace Wino.Core.Domain.Interfaces
{
void Set(string key, object value);
T Get<T>(string key, T defaultValue = default);
public interface IConfigurationService
{
void Set(string key, object value);
T Get<T>(string key, T defaultValue = default);
void SetRoaming(string key, object value);
T GetRoaming<T>(string key, T defaultValue = default);
void SetRoaming(string key, object value);
T GetRoaming<T>(string key, T defaultValue = default);
}
}
@@ -3,12 +3,13 @@ using System.Threading.Tasks;
using MimeKit;
using Wino.Core.Domain.Entities.Shared;
namespace Wino.Core.Domain.Interfaces;
public interface IContactService
namespace Wino.Core.Domain.Interfaces
{
Task<List<AccountContact>> GetAddressInformationAsync(string queryText);
Task<AccountContact> GetAddressInformationByAddressAsync(string address);
Task SaveAddressInformationAsync(MimeMessage message);
Task<AccountContact> CreateNewContactAsync(string address, string displayName);
public interface IContactService
{
Task<List<AccountContact>> GetAddressInformationAsync(string queryText);
Task<AccountContact> GetAddressInformationByAddressAsync(string address);
Task SaveAddressInformationAsync(MimeMessage message);
Task<AccountContact> CreateNewContactAsync(string address, string displayName);
}
}
@@ -3,11 +3,12 @@ using Wino.Core.Domain.Models.Folders;
using Wino.Core.Domain.Models.MailItem;
using Wino.Core.Domain.Models.Menus;
namespace Wino.Core.Domain.Interfaces;
public interface IContextMenuItemService
namespace Wino.Core.Domain.Interfaces
{
IEnumerable<FolderOperationMenuItem> GetFolderContextMenuActions(IBaseFolderMenuItem folderInformation);
IEnumerable<MailOperationMenuItem> GetMailItemContextMenuActions(IEnumerable<IMailItem> selectedMailItems);
IEnumerable<MailOperationMenuItem> GetMailItemRenderMenuActions(IMailItem mailItem, bool isDarkEditor);
public interface IContextMenuItemService
{
IEnumerable<FolderOperationMenuItem> GetFolderContextMenuActions(IBaseFolderMenuItem folderInformation);
IEnumerable<MailOperationMenuItem> GetMailItemContextMenuActions(IEnumerable<IMailItem> selectedMailItems);
IEnumerable<MailOperationMenuItem> GetMailItemRenderMenuActions(IMailItem mailItem, bool isDarkEditor);
}
}
@@ -3,27 +3,28 @@ using Wino.Core.Domain.Models.Folders;
using Wino.Core.Domain.Models.MailItem;
using Wino.Core.Domain.Models.Menus;
namespace Wino.Core.Domain.Interfaces;
public interface IContextMenuProvider
namespace Wino.Core.Domain.Interfaces
{
/// <summary>
/// Calculates and returns available folder operations for the given folder.
/// </summary>
/// <param name="folderInformation">Folder to get actions for.</param>
IEnumerable<FolderOperationMenuItem> GetFolderContextMenuActions(IMailItemFolder folderInformation);
public interface IContextMenuProvider
{
/// <summary>
/// Calculates and returns available folder operations for the given folder.
/// </summary>
/// <param name="folderInformation">Folder to get actions for.</param>
IEnumerable<FolderOperationMenuItem> GetFolderContextMenuActions(IMailItemFolder folderInformation);
/// <summary>
/// Calculates and returns available context menu items for selected mail items.
/// </summary>
/// <param name="folderInformation">Current folder that asks for the menu items.</param>
/// <param name="selectedMailItems">Selected menu items in the given folder.</param>
IEnumerable<MailOperationMenuItem> GetMailItemContextMenuActions(IMailItemFolder folderInformation, IEnumerable<IMailItem> selectedMailItems);
/// <summary>
/// Calculates and returns available context menu items for selected mail items.
/// </summary>
/// <param name="folderInformation">Current folder that asks for the menu items.</param>
/// <param name="selectedMailItems">Selected menu items in the given folder.</param>
IEnumerable<MailOperationMenuItem> GetMailItemContextMenuActions(IMailItemFolder folderInformation, IEnumerable<IMailItem> selectedMailItems);
/// <summary>
/// Calculates and returns available mail operations for mail rendering CommandBar.
/// </summary>
/// <param name="mailItem">Rendered mail item.</param>
/// <param name="activeFolder">Folder that mail item belongs to.</param>
IEnumerable<MailOperationMenuItem> GetMailItemRenderMenuActions(IMailItem mailItem, IMailItemFolder activeFolder, bool isDarkEditor);
/// <summary>
/// Calculates and returns available mail operations for mail rendering CommandBar.
/// </summary>
/// <param name="mailItem">Rendered mail item.</param>
/// <param name="activeFolder">Folder that mail item belongs to.</param>
IEnumerable<MailOperationMenuItem> GetMailItemRenderMenuActions(IMailItem mailItem, IMailItemFolder activeFolder, bool isDarkEditor);
}
}
@@ -1,8 +1,9 @@
using Wino.Core.Domain.Entities.Mail;
namespace Wino.Core.Domain.Interfaces;
public interface ICreateAccountAliasDialog
namespace Wino.Core.Domain.Interfaces
{
public MailAccountAlias CreatedAccountAlias { get; set; }
public interface ICreateAccountAliasDialog
{
public MailAccountAlias CreatedAccountAlias { get; set; }
}
}
@@ -1,21 +1,22 @@
using System;
using System.Collections.Generic;
namespace Wino.Core.Domain.Interfaces;
/// <summary>
/// An interface that should force synchronizer to do synchronization for only given folder ids
/// after the execution is completed.
/// </summary>
public interface ICustomFolderSynchronizationRequest
namespace Wino.Core.Domain.Interfaces
{
/// <summary>
/// Which folders to sync after this operation?
/// An interface that should force synchronizer to do synchronization for only given folder ids
/// after the execution is completed.
/// </summary>
List<Guid> SynchronizationFolderIds { get; }
public interface ICustomFolderSynchronizationRequest
{
/// <summary>
/// Which folders to sync after this operation?
/// </summary>
List<Guid> SynchronizationFolderIds { get; }
/// <summary>
/// If true, additional folders like Sent, Drafts and Deleted will not be synchronized
/// </summary>
bool ExcludeMustHaveFolders { get; }
/// <summary>
/// If true, additional folders like Sent, Drafts and Deleted will not be synchronized
/// </summary>
bool ExcludeMustHaveFolders { get; }
}
}
@@ -6,28 +6,29 @@ using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.Accounts;
using Wino.Core.Domain.Models.Common;
namespace Wino.Core.Domain.Interfaces;
public interface IDialogServiceBase
namespace Wino.Core.Domain.Interfaces
{
Task<string> PickWindowsFolderAsync();
Task<byte[]> PickWindowsFileContentAsync(params object[] typeFilters);
Task<bool> ShowConfirmationDialogAsync(string question, string title, string confirmationButtonTitle);
Task ShowMessageAsync(string message, string title, WinoCustomMessageDialogIcon icon);
void InfoBarMessage(string title, string message, InfoBarMessageType messageType);
void InfoBarMessage(string title, string message, InfoBarMessageType messageType, string actionButtonText, Action action);
void ShowNotSupportedMessage();
Task<MailAccount> ShowEditAccountDialogAsync(MailAccount account);
Task<string> ShowTextInputDialogAsync(string currentInput, string dialogTitle, string dialogDescription, string primaryButtonText);
Task<bool> ShowWinoCustomMessageDialogAsync(string title,
string description,
string approveButtonText,
WinoCustomMessageDialogIcon? icon,
string cancelButtonText = "",
string dontAskAgainConfigurationKey = "");
Task<bool> ShowCustomThemeBuilderDialogAsync();
Task<AccountCreationDialogResult> ShowAccountProviderSelectionDialogAsync(List<IProviderDetail> availableProviders);
IAccountCreationDialog GetAccountCreationDialog(AccountCreationDialogResult accountCreationDialogResult);
Task<List<SharedFile>> PickFilesAsync(params object[] typeFilters);
Task<string> PickFilePathAsync(string saveFileName);
public interface IDialogServiceBase
{
Task<string> PickWindowsFolderAsync();
Task<byte[]> PickWindowsFileContentAsync(params object[] typeFilters);
Task<bool> ShowConfirmationDialogAsync(string question, string title, string confirmationButtonTitle);
Task ShowMessageAsync(string message, string title, WinoCustomMessageDialogIcon icon);
void InfoBarMessage(string title, string message, InfoBarMessageType messageType);
void InfoBarMessage(string title, string message, InfoBarMessageType messageType, string actionButtonText, Action action);
void ShowNotSupportedMessage();
Task<MailAccount> ShowEditAccountDialogAsync(MailAccount account);
Task<string> ShowTextInputDialogAsync(string currentInput, string dialogTitle, string dialogDescription, string primaryButtonText);
Task<bool> ShowWinoCustomMessageDialogAsync(string title,
string description,
string approveButtonText,
WinoCustomMessageDialogIcon? icon,
string cancelButtonText = "",
string dontAskAgainConfigurationKey = "");
Task<bool> ShowCustomThemeBuilderDialogAsync();
Task<AccountCreationDialogResult> ShowAccountProviderSelectionDialogAsync(List<IProviderDetail> availableProviders);
IAccountCreationDialog GetAccountCreationDialog(AccountCreationDialogResult accountCreationDialogResult);
Task<List<SharedFile>> PickFilesAsync(params object[] typeFilters);
Task<string> PickFilePathAsync(string saveFileName);
}
}
+5 -4
View File
@@ -1,9 +1,10 @@
using System;
using System.Threading.Tasks;
namespace Wino.Core.Domain.Interfaces;
public interface IDispatcher
namespace Wino.Core.Domain.Interfaces
{
Task ExecuteOnUIThread(Action action);
public interface IDispatcher
{
Task ExecuteOnUIThread(Action action);
}
}
+14 -13
View File
@@ -1,19 +1,20 @@
using System.IO;
using System.Threading.Tasks;
namespace Wino.Core.Domain.Interfaces;
public interface IFileService
namespace Wino.Core.Domain.Interfaces
{
Task<string> CopyFileAsync(string sourceFilePath, string destinationFolderPath);
Task<Stream> GetFileStreamAsync(string folderPath, string fileName);
Task<string> GetFileContentByApplicationUriAsync(string resourcePath);
public interface IFileService
{
Task<string> CopyFileAsync(string sourceFilePath, string destinationFolderPath);
Task<Stream> GetFileStreamAsync(string folderPath, string fileName);
Task<string> GetFileContentByApplicationUriAsync(string resourcePath);
/// <summary>
/// Zips all existing logs and saves to picked destination folder.
/// </summary>
/// <param name="logsFolder">Folder path where logs are stored.</param>
/// <param name="destinationFolder">Target path to save the archive file.</param>
/// <returns>True if zip is created with at least one item, false if logs are not found.</returns>
Task<bool> SaveLogsToFolderAsync(string logsFolder, string destinationFolder);
/// <summary>
/// Zips all existing logs and saves to picked destination folder.
/// </summary>
/// <param name="logsFolder">Folder path where logs are stored.</param>
/// <param name="destinationFolder">Target path to save the archive file.</param>
/// <returns>True if zip is created with at least one item, false if logs are not found.</returns>
Task<bool> SaveLogsToFolderAsync(string logsFolder, string destinationFolder);
}
}
+25 -24
View File
@@ -3,29 +3,30 @@ using Wino.Core.Domain.Entities.Shared;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.Folders;
namespace Wino.Core.Domain.Interfaces;
public interface IFolderMenuItem : IBaseFolderMenuItem
namespace Wino.Core.Domain.Interfaces
{
MailAccount ParentAccount { get; }
void UpdateParentAccounnt(MailAccount account);
}
public interface IMergedAccountFolderMenuItem : IBaseFolderMenuItem { }
public interface IBaseFolderMenuItem : IMenuItem
{
string FolderName { get; }
bool IsSynchronizationEnabled { get; }
int UnreadItemCount { get; set; }
SpecialFolderType SpecialFolderType { get; }
IEnumerable<IMailItemFolder> HandlingFolders { get; }
IEnumerable<IMenuItem> SubMenuItems { get; }
bool IsMoveTarget { get; }
bool IsSticky { get; }
bool IsSystemFolder { get; }
bool ShowUnreadCount { get; }
string AssignedAccountName { get; }
void UpdateFolder(IMailItemFolder folder);
public interface IFolderMenuItem : IBaseFolderMenuItem
{
MailAccount ParentAccount { get; }
void UpdateParentAccounnt(MailAccount account);
}
public interface IMergedAccountFolderMenuItem : IBaseFolderMenuItem { }
public interface IBaseFolderMenuItem : IMenuItem
{
string FolderName { get; }
bool IsSynchronizationEnabled { get; }
int UnreadItemCount { get; set; }
SpecialFolderType SpecialFolderType { get; }
IEnumerable<IMailItemFolder> HandlingFolders { get; }
IEnumerable<IMenuItem> SubMenuItems { get; }
bool IsMoveTarget { get; }
bool IsSticky { get; }
bool IsSystemFolder { get; }
bool ShowUnreadCount { get; }
string AssignedAccountName { get; }
void UpdateFolder(IMailItemFolder folder);
}
}
+69 -68
View File
@@ -9,86 +9,87 @@ using Wino.Core.Domain.Models.Folders;
using Wino.Core.Domain.Models.MailItem;
using Wino.Core.Domain.Models.Synchronization;
namespace Wino.Core.Domain.Interfaces;
public interface IFolderService
namespace Wino.Core.Domain.Interfaces
{
Task<AccountFolderTree> GetFolderStructureForAccountAsync(Guid accountId, bool includeHiddenFolders);
Task<MailItemFolder> GetFolderAsync(Guid folderId);
Task<MailItemFolder> GetFolderAsync(Guid accountId, string remoteFolderId);
Task<List<MailItemFolder>> GetFoldersAsync(Guid accountId);
Task<MailItemFolder> GetSpecialFolderByAccountIdAsync(Guid accountId, SpecialFolderType type);
Task<int> GetCurrentItemCountForFolder(Guid folderId);
Task<int> GetFolderNotificationBadgeAsync(Guid folderId);
Task ChangeStickyStatusAsync(Guid folderId, bool isSticky);
public interface IFolderService
{
Task<AccountFolderTree> GetFolderStructureForAccountAsync(Guid accountId, bool includeHiddenFolders);
Task<MailItemFolder> GetFolderAsync(Guid folderId);
Task<MailItemFolder> GetFolderAsync(Guid accountId, string remoteFolderId);
Task<List<MailItemFolder>> GetFoldersAsync(Guid accountId);
Task<MailItemFolder> GetSpecialFolderByAccountIdAsync(Guid accountId, SpecialFolderType type);
Task<int> GetCurrentItemCountForFolder(Guid folderId);
Task<int> GetFolderNotificationBadgeAsync(Guid folderId);
Task ChangeStickyStatusAsync(Guid folderId, bool isSticky);
Task<MailAccount> UpdateSystemFolderConfigurationAsync(Guid accountId, SystemFolderConfiguration configuration);
Task ChangeFolderSynchronizationStateAsync(Guid folderId, bool isSynchronizationEnabled);
Task ChangeFolderShowUnreadCountStateAsync(Guid folderId, bool showUnreadCount);
Task<MailAccount> UpdateSystemFolderConfigurationAsync(Guid accountId, SystemFolderConfiguration configuration);
Task ChangeFolderSynchronizationStateAsync(Guid folderId, bool isSynchronizationEnabled);
Task ChangeFolderShowUnreadCountStateAsync(Guid folderId, bool showUnreadCount);
Task<List<MailItemFolder>> GetSynchronizationFoldersAsync(MailSynchronizationOptions options);
Task<List<MailItemFolder>> GetSynchronizationFoldersAsync(MailSynchronizationOptions options);
/// <summary>
/// Returns the folder - mail mapping for the given mail copy ids.
/// </summary>
Task<List<MailFolderPairMetadata>> GetMailFolderPairMetadatasAsync(IEnumerable<string> mailCopyIds);
/// <summary>
/// Returns the folder - mail mapping for the given mail copy ids.
/// </summary>
Task<List<MailFolderPairMetadata>> GetMailFolderPairMetadatasAsync(IEnumerable<string> mailCopyIds);
/// <summary>
/// Returns the folder - mail mapping for the given mail copy id.
/// </summary>
Task<List<MailFolderPairMetadata>> GetMailFolderPairMetadatasAsync(string mailCopyId);
/// <summary>
/// Returns the folder - mail mapping for the given mail copy id.
/// </summary>
Task<List<MailFolderPairMetadata>> GetMailFolderPairMetadatasAsync(string mailCopyId);
/// <summary>
/// Deletes the folder for the given account by remote folder id.
/// </summary>
/// <param name="accountId">Account to remove from.</param>
/// <param name="remoteFolderId">Remote folder id.</param>
/// <returns></returns>
Task DeleteFolderAsync(Guid accountId, string remoteFolderId);
/// <summary>
/// Deletes the folder for the given account by remote folder id.
/// </summary>
/// <param name="accountId">Account to remove from.</param>
/// <param name="remoteFolderId">Remote folder id.</param>
/// <returns></returns>
Task DeleteFolderAsync(Guid accountId, string remoteFolderId);
/// <summary>
/// Adds a new folder.
/// </summary>
/// <param name="folder">Folder to add.</param>
Task InsertFolderAsync(MailItemFolder folder);
/// <summary>
/// Adds a new folder.
/// </summary>
/// <param name="folder">Folder to add.</param>
Task InsertFolderAsync(MailItemFolder folder);
/// <summary>
/// Returns the known uids for the given folder.
/// Only used for IMAP
/// </summary>
/// <param name="folderId">Folder to get uIds for</param>
Task<IList<uint>> GetKnownUidsForFolderAsync(Guid folderId);
/// <summary>
/// Returns the known uids for the given folder.
/// Only used for IMAP
/// </summary>
/// <param name="folderId">Folder to get uIds for</param>
Task<IList<uint>> GetKnownUidsForFolderAsync(Guid folderId);
/// <summary>
/// Checks if Inbox special folder exists for an account.
/// </summary>
/// <param name="accountId">Account id to check for.</param>
/// <returns>True if Inbox exists, False if not.</returns>
Task<bool> IsInboxAvailableForAccountAsync(Guid accountId);
/// <summary>
/// Checks if Inbox special folder exists for an account.
/// </summary>
/// <param name="accountId">Account id to check for.</param>
/// <returns>True if Inbox exists, False if not.</returns>
Task<bool> IsInboxAvailableForAccountAsync(Guid accountId);
/// <summary>
/// Updates folder's LastSynchronizedDate to now.
/// </summary>
/// <param name="folderId">Folder to update.</param>
Task UpdateFolderLastSyncDateAsync(Guid folderId);
/// <summary>
/// Updates folder's LastSynchronizedDate to now.
/// </summary>
/// <param name="folderId">Folder to update.</param>
Task UpdateFolderLastSyncDateAsync(Guid folderId);
/// <summary>
/// Updates the given folder.
/// </summary>
/// <param name="folder">Folder to update.</param>
Task UpdateFolderAsync(MailItemFolder folder);
/// <summary>
/// Updates the given folder.
/// </summary>
/// <param name="folder">Folder to update.</param>
Task UpdateFolderAsync(MailItemFolder folder);
/// <summary>
/// Returns the active folder menu items for the given account for UI.
/// </summary>
/// <param name="accountMenuItem">Account to get folder menu items for.</param>
Task<IEnumerable<IMenuItem>> GetAccountFoldersForDisplayAsync(IAccountMenuItem accountMenuItem);
/// <summary>
/// Returns the active folder menu items for the given account for UI.
/// </summary>
/// <param name="accountMenuItem">Account to get folder menu items for.</param>
Task<IEnumerable<IMenuItem>> GetAccountFoldersForDisplayAsync(IAccountMenuItem accountMenuItem);
/// <summary>
/// Returns a list of unread item counts for the given account ids.
/// Every folder that is marked as show unread badge is included.
/// </summary>
/// <param name="accountIds">Account ids to get unread folder counts for.</param>
Task<List<UnreadItemCountResult>> GetUnreadItemCountResultsAsync(IEnumerable<Guid> accountIds);
/// <summary>
/// Returns a list of unread item counts for the given account ids.
/// Every folder that is marked as show unread badge is included.
/// </summary>
/// <param name="accountIds">Account ids to get unread folder counts for.</param>
Task<List<UnreadItemCountResult>> GetUnreadItemCountResultsAsync(IEnumerable<Guid> accountIds);
}
}
+10 -9
View File
@@ -1,15 +1,16 @@
using System.Collections.Generic;
namespace Wino.Core.Domain.Interfaces;
/// <summary>
/// Service to access available fonts.
/// </summary>
public interface IFontService
namespace Wino.Core.Domain.Interfaces
{
/// <summary>
/// Get available fonts. Default + installed system fonts.
/// Fonts initialized only once. To refresh fonts, restart the application.
/// Service to access available fonts.
/// </summary>
List<string> GetFonts();
public interface IFontService
{
/// <summary>
/// Get available fonts. Default + installed system fonts.
/// Fonts initialized only once. To refresh fonts, restart the application.
/// </summary>
List<string> GetFonts();
}
}
@@ -1,3 +1,4 @@
namespace Wino.Core.Domain.Interfaces;
public interface IGmailThreadingStrategy : IThreadingStrategy { }
namespace Wino.Core.Domain.Interfaces
{
public interface IGmailThreadingStrategy : IThreadingStrategy { }
}
@@ -1,24 +1,25 @@
using System.Threading.Tasks;
using Wino.Core.Domain.Entities.Shared;
namespace Wino.Core.Domain.Interfaces;
public interface IImapAccountCreationDialog : IAccountCreationDialog
namespace Wino.Core.Domain.Interfaces
{
/// <summary>
/// Returns the custom server information from the dialog..
/// </summary>
/// <returns>Null if canceled.</returns>
Task<CustomServerInformation> GetCustomServerInformationAsync();
public interface IImapAccountCreationDialog : IAccountCreationDialog
{
/// <summary>
/// Returns the custom server information from the dialog..
/// </summary>
/// <returns>Null if canceled.</returns>
Task<CustomServerInformation> GetCustomServerInformationAsync();
/// <summary>
/// Displays preparing folders page.
/// </summary>
void ShowPreparingFolders();
/// <summary>
/// Displays preparing folders page.
/// </summary>
void ShowPreparingFolders();
/// <summary>
/// Updates account properties for the welcome imap setup dialog and starts the setup.
/// </summary>
/// <param name="account">Account properties.</param>
void StartImapConnectionSetup(MailAccount account);
/// <summary>
/// Updates account properties for the welcome imap setup dialog and starts the setup.
/// </summary>
/// <param name="account">Account properties.</param>
void StartImapConnectionSetup(MailAccount account);
}
}
@@ -1,11 +1,12 @@
using MailKit.Net.Imap;
namespace Wino.Core.Domain.Interfaces;
/// <summary>
/// Provides a synchronization strategy for synchronizing IMAP folders based on the server capabilities.
/// </summary>
public interface IImapSynchronizationStrategyProvider
namespace Wino.Core.Domain.Interfaces
{
IImapSynchronizerStrategy GetSynchronizationStrategy(IImapClient client);
/// <summary>
/// Provides a synchronization strategy for synchronizing IMAP folders based on the server capabilities.
/// </summary>
public interface IImapSynchronizationStrategyProvider
{
IImapSynchronizerStrategy GetSynchronizationStrategy(IImapClient client);
}
}
@@ -4,13 +4,14 @@ using System.Threading.Tasks;
using Wino.Core.Domain.Entities.Mail;
using Wino.Core.Domain.Models.MailItem;
namespace Wino.Core.Domain.Interfaces;
public interface IImapSynchronizer
namespace Wino.Core.Domain.Interfaces
{
uint InitialMessageDownloadCountPerFolder { get; }
public interface IImapSynchronizer
{
uint InitialMessageDownloadCountPerFolder { get; }
Task<List<NewMailItemPackage>> CreateNewMailPackagesAsync(ImapMessageCreationPackage message, MailItemFolder assignedFolder, CancellationToken cancellationToken = default);
Task StartIdleClientAsync();
Task StopIdleClientAsync();
Task<List<NewMailItemPackage>> CreateNewMailPackagesAsync(ImapMessageCreationPackage message, MailItemFolder assignedFolder, CancellationToken cancellationToken = default);
Task StartIdleClientAsync();
Task StopIdleClientAsync();
}
}
@@ -4,18 +4,19 @@ using System.Threading.Tasks;
using MailKit.Net.Imap;
using Wino.Core.Domain.Entities.Mail;
namespace Wino.Core.Domain.Interfaces;
public interface IImapSynchronizerStrategy
namespace Wino.Core.Domain.Interfaces
{
/// <summary>
/// Synchronizes given folder with the ImapClient client from the client pool.
/// </summary>
/// <param name="client">Client to perform sync with. I love Mira and Jasminka</param>
/// <param name="folder">Folder to synchronize.</param>
/// <param name="synchronizer">Imap synchronizer that downloads messages.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>List of new downloaded message ids that don't exist locally.</returns>
Task<List<string>> HandleSynchronizationAsync(IImapClient client, MailItemFolder folder, IImapSynchronizer synchronizer, CancellationToken cancellationToken = default);
public interface IImapSynchronizerStrategy
{
/// <summary>
/// Synchronizes given folder with the ImapClient client from the client pool.
/// </summary>
/// <param name="client">Client to perform sync with. I love Mira and Jasminka</param>
/// <param name="folder">Folder to synchronize.</param>
/// <param name="synchronizer">Imap synchronizer that downloads messages.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>List of new downloaded message ids that don't exist locally.</returns>
Task<List<string>> HandleSynchronizationAsync(IImapClient client, MailItemFolder folder, IImapSynchronizer synchronizer, CancellationToken cancellationToken = default);
}
}
@@ -1,9 +1,10 @@
using System.Threading.Tasks;
using Wino.Core.Domain.Entities.Shared;
namespace Wino.Core.Domain.Interfaces;
public interface IImapTestService
namespace Wino.Core.Domain.Interfaces
{
Task TestImapConnectionAsync(CustomServerInformation serverInformation, bool allowSSLHandShake);
public interface IImapTestService
{
Task TestImapConnectionAsync(CustomServerInformation serverInformation, bool allowSSLHandShake);
}
}
@@ -1,3 +1,4 @@
namespace Wino.Core.Domain.Interfaces;
public interface IImapThreadingStrategy : IThreadingStrategy { }
namespace Wino.Core.Domain.Interfaces
{
public interface IImapThreadingStrategy : IThreadingStrategy { }
}
@@ -1,11 +1,12 @@
using System.Threading.Tasks;
namespace Wino.Core.Domain.Interfaces;
/// <summary>
/// An interface that all startup services must implement.
/// </summary>
public interface IInitializeAsync
namespace Wino.Core.Domain.Interfaces
{
Task InitializeAsync();
/// <summary>
/// An interface that all startup services must implement.
/// </summary>
public interface IInitializeAsync
{
Task InitializeAsync();
}
}
@@ -1,7 +1,8 @@
namespace Wino.Core.Domain.Interfaces;
public interface IKeyPressService
namespace Wino.Core.Domain.Interfaces
{
bool IsCtrlKeyPressed();
bool IsShiftKeyPressed();
public interface IKeyPressService
{
bool IsCtrlKeyPressed();
bool IsShiftKeyPressed();
}
}
@@ -1,8 +1,9 @@
namespace Wino.Core.Domain.Interfaces;
public interface ILogInitializer
namespace Wino.Core.Domain.Interfaces
{
void SetupLogger(string fullLogFilePath);
public interface ILogInitializer
{
void SetupLogger(string fullLogFilePath);
void RefreshLoggingLevel();
void RefreshLoggingLevel();
}
}
@@ -7,46 +7,47 @@ using Wino.Core.Domain.Entities.Shared;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.Folders;
namespace Wino.Core.Domain.Interfaces;
public interface IMailDialogService : IDialogServiceBase
namespace Wino.Core.Domain.Interfaces
{
Task<bool> ShowHardDeleteConfirmationAsync();
Task HandleSystemFolderConfigurationDialogAsync(Guid accountId, IFolderService folderService);
public interface IMailDialogService : IDialogServiceBase
{
Task<bool> ShowHardDeleteConfirmationAsync();
Task HandleSystemFolderConfigurationDialogAsync(Guid accountId, IFolderService folderService);
// Custom dialogs
Task<IMailItemFolder> ShowMoveMailFolderDialogAsync(List<IMailItemFolder> availableFolders);
Task<MailAccount> ShowAccountPickerDialogAsync(List<MailAccount> availableAccounts);
// Custom dialogs
Task<IMailItemFolder> ShowMoveMailFolderDialogAsync(List<IMailItemFolder> availableFolders);
Task<MailAccount> ShowAccountPickerDialogAsync(List<MailAccount> availableAccounts);
/// <summary>
/// Displays a dialog to the user for reordering accounts.
/// </summary>
/// <param name="availableAccounts">Available accounts in order.</param>
/// <returns>Result model that has dict of AccountId-AccountOrder.</returns>
Task ShowAccountReorderDialogAsync(ObservableCollection<IAccountProviderDetailViewModel> availableAccounts);
/// <summary>
/// Displays a dialog to the user for reordering accounts.
/// </summary>
/// <param name="availableAccounts">Available accounts in order.</param>
/// <returns>Result model that has dict of AccountId-AccountOrder.</returns>
Task ShowAccountReorderDialogAsync(ObservableCollection<IAccountProviderDetailViewModel> availableAccounts);
/// <summary>
/// Presents a dialog to the user for selecting folder.
/// </summary>
/// <param name="accountId">Account to get folders for.</param>
/// <param name="reason">The reason behind the picking operation
/// <returns>Selected folder structure. Null if none.</returns>
Task<IMailItemFolder> PickFolderAsync(Guid accountId, PickFolderReason reason, IFolderService folderService);
/// <summary>
/// Presents a dialog to the user for selecting folder.
/// </summary>
/// <param name="accountId">Account to get folders for.</param>
/// <param name="reason">The reason behind the picking operation
/// <returns>Selected folder structure. Null if none.</returns>
Task<IMailItemFolder> PickFolderAsync(Guid accountId, PickFolderReason reason, IFolderService folderService);
/// <summary>
/// Presents a dialog to the user for signature creation/modification.
/// </summary>
/// <returns>Signature information. Null if canceled.</returns>
Task<AccountSignature> ShowSignatureEditorDialog(AccountSignature signatureModel = null);
/// <summary>
/// Presents a dialog to the user for signature creation/modification.
/// </summary>
/// <returns>Signature information. Null if canceled.</returns>
Task<AccountSignature> ShowSignatureEditorDialog(AccountSignature signatureModel = null);
/// <summary>
/// Presents a dialog to the user for account alias creation/modification.
/// </summary>
/// <returns>Created alias model if not canceled.</returns>
Task<ICreateAccountAliasDialog> ShowCreateAccountAliasDialogAsync();
/// <summary>
/// Presents a dialog to the user for account alias creation/modification.
/// </summary>
/// <returns>Created alias model if not canceled.</returns>
Task<ICreateAccountAliasDialog> ShowCreateAccountAliasDialogAsync();
/// <summary>
/// Presents a dialog to the user to show email source.
/// </summary>
Task ShowMessageSourceDialogAsync(string messageSource);
/// <summary>
/// Presents a dialog to the user to show email source.
/// </summary>
Task ShowMessageSourceDialogAsync(string messageSource);
}
}
+95 -94
View File
@@ -7,114 +7,115 @@ using Wino.Core.Domain.Entities.Mail;
using Wino.Core.Domain.Entities.Shared;
using Wino.Core.Domain.Models.MailItem;
namespace Wino.Core.Domain.Interfaces;
public interface IMailService
namespace Wino.Core.Domain.Interfaces
{
Task<MailCopy> GetSingleMailItemAsync(string mailCopyId, string remoteFolderId);
Task<MailCopy> GetSingleMailItemAsync(Guid uniqueMailId);
Task<List<IMailItem>> FetchMailsAsync(MailListInitializationOptions options, CancellationToken cancellationToken = default);
public interface IMailService
{
Task<MailCopy> GetSingleMailItemAsync(string mailCopyId, string remoteFolderId);
Task<MailCopy> GetSingleMailItemAsync(Guid uniqueMailId);
Task<List<IMailItem>> FetchMailsAsync(MailListInitializationOptions options, CancellationToken cancellationToken = default);
/// <summary>
/// Deletes all mail copies for all folders.
/// </summary>
/// <param name="accountId">Account to remove from</param>
/// <param name="mailCopyId">Mail copy id to remove.</param>
Task DeleteMailAsync(Guid accountId, string mailCopyId);
/// <summary>
/// Deletes all mail copies for all folders.
/// </summary>
/// <param name="accountId">Account to remove from</param>
/// <param name="mailCopyId">Mail copy id to remove.</param>
Task DeleteMailAsync(Guid accountId, string mailCopyId);
Task ChangeReadStatusAsync(string mailCopyId, bool isRead);
Task ChangeFlagStatusAsync(string mailCopyId, bool isFlagged);
Task ChangeReadStatusAsync(string mailCopyId, bool isRead);
Task ChangeFlagStatusAsync(string mailCopyId, bool isFlagged);
Task CreateAssignmentAsync(Guid accountId, string mailCopyId, string remoteFolderId);
Task DeleteAssignmentAsync(Guid accountId, string mailCopyId, string remoteFolderId);
Task CreateAssignmentAsync(Guid accountId, string mailCopyId, string remoteFolderId);
Task DeleteAssignmentAsync(Guid accountId, string mailCopyId, string remoteFolderId);
Task<bool> CreateMailAsync(Guid accountId, NewMailItemPackage package);
Task<bool> CreateMailAsync(Guid accountId, NewMailItemPackage package);
/// <summary>
/// Maps new mail item with the existing local draft copy.
/// In case of failure, it returns false.
/// Then synchronizers must insert a new mail item.
/// </summary>
/// <param name="accountId">Id of the account. It's important to map to the account since if the user use the same account with different providers, this call must map the correct one.</param>
/// <param name="localDraftCopyUniqueId">UniqueId of the local draft copy.</param>
/// <param name="newMailCopyId">New assigned remote mail item id.</param>
/// <param name="newDraftId">New assigned draft id if exists.</param>
/// <param name="newThreadId">New message's thread/conversation id.</param>
/// <returns>True if mapping is done. False if local copy doesn't exists.</returns>
Task<bool> MapLocalDraftAsync(Guid accountId, Guid localDraftCopyUniqueId, string newMailCopyId, string newDraftId, string newThreadId);
/// <summary>
/// Maps new mail item with the existing local draft copy.
/// In case of failure, it returns false.
/// Then synchronizers must insert a new mail item.
/// </summary>
/// <param name="accountId">Id of the account. It's important to map to the account since if the user use the same account with different providers, this call must map the correct one.</param>
/// <param name="localDraftCopyUniqueId">UniqueId of the local draft copy.</param>
/// <param name="newMailCopyId">New assigned remote mail item id.</param>
/// <param name="newDraftId">New assigned draft id if exists.</param>
/// <param name="newThreadId">New message's thread/conversation id.</param>
/// <returns>True if mapping is done. False if local copy doesn't exists.</returns>
Task<bool> MapLocalDraftAsync(Guid accountId, Guid localDraftCopyUniqueId, string newMailCopyId, string newDraftId, string newThreadId);
/// <summary>
/// Maps new mail item with the existing local draft copy.
/// </summary>
/// <param name="newMailCopyId"></param>
/// <param name="newDraftId"></param>
/// <param name="newThreadId"></param>
Task MapLocalDraftAsync(string newMailCopyId, string newDraftId, string newThreadId);
/// <summary>
/// Maps new mail item with the existing local draft copy.
/// </summary>
/// <param name="newMailCopyId"></param>
/// <param name="newDraftId"></param>
/// <param name="newThreadId"></param>
Task MapLocalDraftAsync(string newMailCopyId, string newDraftId, string newThreadId);
Task UpdateMailAsync(MailCopy mailCopy);
Task UpdateMailAsync(MailCopy mailCopy);
/// <summary>
/// Gets the new inserted unread mails after the synchronization.
/// </summary>
/// <param name="accountId">Account id.</param>
/// <param name="downloadedMailCopyIds">
/// Mail ids that synchronizer tried to download. If there was an issue with the
/// Items that tried and actually downloaded may differ. This function will return only new inserted ones.
/// </param>
/// <returns>Newly inserted unread mails inside the Inbox folder.</returns>
Task<List<MailCopy>> GetDownloadedUnreadMailsAsync(Guid accountId, IEnumerable<string> downloadedMailCopyIds);
/// <summary>
/// Gets the new inserted unread mails after the synchronization.
/// </summary>
/// <param name="accountId">Account id.</param>
/// <param name="downloadedMailCopyIds">
/// Mail ids that synchronizer tried to download. If there was an issue with the
/// Items that tried and actually downloaded may differ. This function will return only new inserted ones.
/// </param>
/// <returns>Newly inserted unread mails inside the Inbox folder.</returns>
Task<List<MailCopy>> GetDownloadedUnreadMailsAsync(Guid accountId, IEnumerable<string> downloadedMailCopyIds);
/// <summary>
/// Returns the account that this mail copy unique id is assigned.
/// Used in toast notification handler.
/// </summary>
/// <param name="uniqueMailId">Unique id of the mail item.</param>
/// <returns>Account that mail belongs to.</returns>
Task<MailAccount> GetMailAccountByUniqueIdAsync(Guid uniqueMailId);
/// <summary>
/// Returns the account that this mail copy unique id is assigned.
/// Used in toast notification handler.
/// </summary>
/// <param name="uniqueMailId">Unique id of the mail item.</param>
/// <returns>Account that mail belongs to.</returns>
Task<MailAccount> GetMailAccountByUniqueIdAsync(Guid uniqueMailId);
/// <summary>
/// Checks whether the given mail copy id exists in the database.
/// Safely used for Outlook to prevent downloading the same mail twice.
/// For Gmail, it should be avoided since one mail may belong to multiple folders.
/// </summary>
/// <param name="mailCopyId">Native mail id of the message.</param>
Task<bool> IsMailExistsAsync(string mailCopyId);
/// <summary>
/// Checks whether the given mail copy id exists in the database.
/// Safely used for Outlook to prevent downloading the same mail twice.
/// For Gmail, it should be avoided since one mail may belong to multiple folders.
/// </summary>
/// <param name="mailCopyId">Native mail id of the message.</param>
Task<bool> IsMailExistsAsync(string mailCopyId);
/// <summary>
/// Returns all mails for given folder id.
/// </summary>
/// <param name="folderId">Folder id to get mails for</param>
Task<List<MailCopy>> GetMailsByFolderIdAsync(Guid folderId);
/// <summary>
/// Returns all mails for given folder id.
/// </summary>
/// <param name="folderId">Folder id to get mails for</param>
Task<List<MailCopy>> GetMailsByFolderIdAsync(Guid folderId);
/// <summary>
/// Returns all unread mails for given folder id.
/// </summary>
/// <param name="folderId">Folder id to get unread mails for.</param>
Task<List<MailCopy>> GetUnreadMailsByFolderIdAsync(Guid folderId);
/// <summary>
/// Returns all unread mails for given folder id.
/// </summary>
/// <param name="folderId">Folder id to get unread mails for.</param>
Task<List<MailCopy>> GetUnreadMailsByFolderIdAsync(Guid folderId);
/// <summary>
/// Checks whether the mail exists in the folder.
/// When deciding Create or Update existing mail, we need to check if the mail exists in the folder.
/// </summary>
/// <param name="mailCopyId">MailCopy id</param>
/// <param name="folderId">Folder's local id.</param>
/// <returns>Whether mail exists in the folder or not.</returns>
Task<bool> IsMailExistsAsync(string mailCopyId, Guid folderId);
/// <summary>
/// Checks whether the mail exists in the folder.
/// When deciding Create or Update existing mail, we need to check if the mail exists in the folder.
/// </summary>
/// <param name="mailCopyId">MailCopy id</param>
/// <param name="folderId">Folder's local id.</param>
/// <returns>Whether mail exists in the folder or not.</returns>
Task<bool> IsMailExistsAsync(string mailCopyId, Guid folderId);
/// <summary>
/// Creates a draft MailCopy and MimeMessage based on the given options.
/// For forward/reply it would include the referenced message.
/// </summary>
/// <param name="accountId">AccountId which should have new draft.</param>
/// <param name="draftCreationOptions">Options like new email/forward/draft.</param>
/// <returns>Draft MailCopy and Draft MimeMessage as base64.</returns>
Task<(MailCopy draftMailCopy, string draftBase64MimeMessage)> CreateDraftAsync(Guid accountId, DraftCreationOptions draftCreationOptions);
/// <summary>
/// Creates a draft MailCopy and MimeMessage based on the given options.
/// For forward/reply it would include the referenced message.
/// </summary>
/// <param name="accountId">AccountId which should have new draft.</param>
/// <param name="draftCreationOptions">Options like new email/forward/draft.</param>
/// <returns>Draft MailCopy and Draft MimeMessage as base64.</returns>
Task<(MailCopy draftMailCopy, string draftBase64MimeMessage)> CreateDraftAsync(Guid accountId, DraftCreationOptions draftCreationOptions);
/// <summary>
/// Returns ids
/// </summary>
/// <param name="folderId"></param>
/// <param name="uniqueIds"></param>
/// <returns></returns>
Task<List<MailCopy>> GetExistingMailsAsync(Guid folderId, IEnumerable<UniqueId> uniqueIds);
/// <summary>
/// Returns ids
/// </summary>
/// <param name="folderId"></param>
/// <param name="uniqueIds"></param>
/// <returns></returns>
Task<List<MailCopy>> GetExistingMailsAsync(Guid folderId, IEnumerable<UniqueId> uniqueIds);
}
}
+32 -31
View File
@@ -1,40 +1,41 @@
using System;
namespace Wino.Core.Domain.Interfaces;
public interface IMenuItem
namespace Wino.Core.Domain.Interfaces
{
/// <summary>
/// An id that this menu item holds.
/// For an account, it's AccountId.
/// For folder, it's FolderId.
/// For merged account, it's MergedAccountId.
/// Null if it's a menu item that doesn't hold any valuable entity.
/// </summary>
Guid? EntityId { get; }
public interface IMenuItem
{
/// <summary>
/// An id that this menu item holds.
/// For an account, it's AccountId.
/// For folder, it's FolderId.
/// For merged account, it's MergedAccountId.
/// Null if it's a menu item that doesn't hold any valuable entity.
/// </summary>
Guid? EntityId { get; }
/// <summary>
/// Is any of the sub items that this menu item contains selected.
/// </summary>
// bool IsChildSelected { get; }
/// <summary>
/// Is any of the sub items that this menu item contains selected.
/// </summary>
// bool IsChildSelected { get; }
/// <summary>
/// Whether the menu item is expanded or not.
/// </summary>
bool IsExpanded { get; set; }
/// <summary>
/// Whether the menu item is expanded or not.
/// </summary>
bool IsExpanded { get; set; }
/// <summary>
/// Whether the menu item is selected or not.
/// </summary>
bool IsSelected { get; set; }
/// <summary>
/// Whether the menu item is selected or not.
/// </summary>
bool IsSelected { get; set; }
/// <summary>
/// Parent menu item that contains this menu item.
/// </summary>
IMenuItem ParentMenuItem { get; }
/// <summary>
/// Parent menu item that contains this menu item.
/// </summary>
IMenuItem ParentMenuItem { get; }
/// <summary>
/// Recursively expand all parent menu items if parent exists, starting from parent.
/// </summary>
void Expand();
/// <summary>
/// Recursively expand all parent menu items if parent exists, starting from parent.
/// </summary>
void Expand();
}
}
@@ -1,7 +1,8 @@
namespace Wino.Core.Domain.Interfaces;
public interface IMenuOperation
namespace Wino.Core.Domain.Interfaces
{
bool IsEnabled { get; }
string Identifier { get; }
public interface IMenuOperation
{
bool IsEnabled { get; }
string Identifier { get; }
}
}
+54 -53
View File
@@ -5,65 +5,66 @@ using MimeKit;
using Wino.Core.Domain.Models.MailItem;
using Wino.Core.Domain.Models.Reader;
namespace Wino.Core.Domain.Interfaces;
public interface IMimeFileService
namespace Wino.Core.Domain.Interfaces
{
/// <summary>
/// Finds the EML file for the given mail id for address, parses and returns MimeMessage.
/// </summary>
/// <param name="cancellationToken">Cancellation token</param>
/// <returns>Mime message information</returns>
Task<MimeMessageInformation> GetMimeMessageInformationAsync(Guid fileId, Guid accountId, CancellationToken cancellationToken = default);
public interface IMimeFileService
{
/// <summary>
/// Finds the EML file for the given mail id for address, parses and returns MimeMessage.
/// </summary>
/// <param name="cancellationToken">Cancellation token</param>
/// <returns>Mime message information</returns>
Task<MimeMessageInformation> GetMimeMessageInformationAsync(Guid fileId, Guid accountId, CancellationToken cancellationToken = default);
/// <summary>
/// Gets the mime message information for the given EML file bytes.
/// This override is used when EML file association launch is used
/// because we may not have the access to the file path.
/// </summary>
/// <param name="fileBytes">Byte array of the file.</param>
/// <param name="cancellationToken">Cancellation token</param>
/// <returns>Mime message information</returns>
Task<MimeMessageInformation> GetMimeMessageInformationAsync(byte[] fileBytes, string emlFilePath, CancellationToken cancellationToken = default);
/// <summary>
/// Gets the mime message information for the given EML file bytes.
/// This override is used when EML file association launch is used
/// because we may not have the access to the file path.
/// </summary>
/// <param name="fileBytes">Byte array of the file.</param>
/// <param name="cancellationToken">Cancellation token</param>
/// <returns>Mime message information</returns>
Task<MimeMessageInformation> GetMimeMessageInformationAsync(byte[] fileBytes, string emlFilePath, CancellationToken cancellationToken = default);
/// <summary>
/// Saves EML file to the disk.
/// </summary>
/// <param name="copy">MailCopy of the native message.</param>
/// <param name="mimeMessage">MimeMessage that is parsed from native message.</param>
/// <param name="accountId">Which account Id to save this file for.</param>
Task<bool> SaveMimeMessageAsync(Guid fileId, MimeMessage mimeMessage, Guid accountId);
/// <summary>
/// Saves EML file to the disk.
/// </summary>
/// <param name="copy">MailCopy of the native message.</param>
/// <param name="mimeMessage">MimeMessage that is parsed from native message.</param>
/// <param name="accountId">Which account Id to save this file for.</param>
Task<bool> SaveMimeMessageAsync(Guid fileId, MimeMessage mimeMessage, Guid accountId);
/// <summary>
/// Returns a path that all Mime resources (including eml) is stored for this MailCopyId
/// This is useful for storing previously rendered attachments as well.
/// </summary>
/// <param name="accountAddress">Account address</param>
/// <param name="mailCopyId">Resource mail copy id</param>
Task<string> GetMimeResourcePathAsync(Guid accountId, Guid fileId);
/// <summary>
/// Returns a path that all Mime resources (including eml) is stored for this MailCopyId
/// This is useful for storing previously rendered attachments as well.
/// </summary>
/// <param name="accountAddress">Account address</param>
/// <param name="mailCopyId">Resource mail copy id</param>
Task<string> GetMimeResourcePathAsync(Guid accountId, Guid fileId);
/// <summary>
/// Returns whether mime file exists locally or not.
/// </summary>
Task<bool> IsMimeExistAsync(Guid accountId, Guid fileId);
/// <summary>
/// Returns whether mime file exists locally or not.
/// </summary>
Task<bool> IsMimeExistAsync(Guid accountId, Guid fileId);
/// <summary>
/// Creates HtmlPreviewVisitor for the given MimeMessage.
/// </summary>
/// <param name="message">Mime</param>
/// <param name="mimeLocalPath">File path that mime is located to load resources.</param>
HtmlPreviewVisitor CreateHTMLPreviewVisitor(MimeMessage message, string mimeLocalPath);
/// <summary>
/// Creates HtmlPreviewVisitor for the given MimeMessage.
/// </summary>
/// <param name="message">Mime</param>
/// <param name="mimeLocalPath">File path that mime is located to load resources.</param>
HtmlPreviewVisitor CreateHTMLPreviewVisitor(MimeMessage message, string mimeLocalPath);
/// <summary>
/// Deletes the given mime file from the disk.
/// </summary>
Task<bool> DeleteMimeMessageAsync(Guid accountId, Guid fileId);
/// <summary>
/// Deletes the given mime file from the disk.
/// </summary>
Task<bool> DeleteMimeMessageAsync(Guid accountId, Guid fileId);
/// <summary>
/// Prepares the final model containing rendering details.
/// </summary>
/// <param name="message">Message to render.</param>
/// <param name="mimeLocalPath">File path that physical MimeMessage is located.</param>
/// <param name="options">Rendering options</param>
MailRenderModel GetMailRenderModel(MimeMessage message, string mimeLocalPath, MailRenderingOptions options = null);
/// <summary>
/// Prepares the final model containing rendering details.
/// </summary>
/// <param name="message">Message to render.</param>
/// <param name="mimeLocalPath">File path that physical MimeMessage is located.</param>
/// <param name="options">Rendering options</param>
MailRenderModel GetMailRenderModel(MimeMessage message, string mimeLocalPath, MailRenderingOptions options = null);
}
}
@@ -1,25 +1,26 @@
using System;
using System.Threading.Tasks;
namespace Wino.Core.Domain.Interfaces;
public interface INativeAppService
namespace Wino.Core.Domain.Interfaces
{
string GetWebAuthenticationBrokerUri();
Task<string> GetMimeMessageStoragePath();
Task<string> GetEditorBundlePathAsync();
Task LaunchFileAsync(string filePath);
Task<bool> LaunchUriAsync(Uri uri);
public interface INativeAppService
{
string GetWebAuthenticationBrokerUri();
Task<string> GetMimeMessageStoragePath();
Task<string> GetEditorBundlePathAsync();
Task LaunchFileAsync(string filePath);
Task<bool> LaunchUriAsync(Uri uri);
bool IsAppRunning();
bool IsAppRunning();
string GetFullAppVersion();
string GetFullAppVersion();
Task PinAppToTaskbarAsync();
Task PinAppToTaskbarAsync();
/// <summary>
/// Gets or sets the function that returns a pointer for main window hwnd for UWP.
/// This is used to display WAM broker dialog on running UWP app called by a windowless server code.
/// </summary>
Func<IntPtr> GetCoreWindowHwnd { get; set; }
/// <summary>
/// Gets or sets the function that returns a pointer for main window hwnd for UWP.
/// This is used to display WAM broker dialog on running UWP app called by a windowless server code.
/// </summary>
Func<IntPtr> GetCoreWindowHwnd { get; set; }
}
}
@@ -1,9 +1,10 @@
using Wino.Core.Domain.Models.Navigation;
namespace Wino.Core.Domain.Interfaces;
public interface INavigationAware
namespace Wino.Core.Domain.Interfaces
{
void OnNavigatedTo(NavigationMode mode, object parameters);
void OnNavigatedFrom(NavigationMode mode, object parameters);
public interface INavigationAware
{
void OnNavigatedTo(NavigationMode mode, object parameters);
void OnNavigatedFrom(NavigationMode mode, object parameters);
}
}
@@ -3,23 +3,24 @@ using System.Collections.Generic;
using System.Threading.Tasks;
using Wino.Core.Domain.Models.MailItem;
namespace Wino.Core.Domain.Interfaces;
public interface INotificationBuilder
namespace Wino.Core.Domain.Interfaces
{
/// <summary>
/// Creates toast notifications for new mails.
/// </summary>
Task CreateNotificationsAsync(Guid inboxFolderId, IEnumerable<IMailItem> newMailItems);
public interface INotificationBuilder
{
/// <summary>
/// Creates toast notifications for new mails.
/// </summary>
Task CreateNotificationsAsync(Guid inboxFolderId, IEnumerable<IMailItem> newMailItems);
/// <summary>
/// Gets the unread Inbox messages for each account and updates the taskbar icon.
/// </summary>
/// <returns></returns>
Task UpdateTaskbarIconBadgeAsync();
/// <summary>
/// Gets the unread Inbox messages for each account and updates the taskbar icon.
/// </summary>
/// <returns></returns>
Task UpdateTaskbarIconBadgeAsync();
/// <summary>
/// Creates test notification for test purposes.
/// </summary>
Task CreateTestNotificationAsync(string title, string message);
/// <summary>
/// Creates test notification for test purposes.
/// </summary>
Task CreateTestNotificationAsync(string title, string message);
}
}
@@ -1,3 +1,4 @@
namespace Wino.Core.Domain.Interfaces;
public interface IOutlookThreadingStrategy : IThreadingStrategy { }
namespace Wino.Core.Domain.Interfaces
{
public interface IOutlookThreadingStrategy : IThreadingStrategy { }
}
+146 -144
View File
@@ -3,192 +3,194 @@ using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.Calendar;
using Wino.Core.Domain.Models.Reader;
namespace Wino.Core.Domain.Interfaces;
public interface IPreferencesService
namespace Wino.Core.Domain.Interfaces
{
/// <summary>
/// When any of the preferences are changed.
/// </summary>
event EventHandler<string> PreferenceChanged;
public interface IPreferencesService
{
/// <summary>
/// When any of the preferences are changed.
/// </summary>
event EventHandler<string> PreferenceChanged;
#region Common
#region Common
/// <summary>
/// Setting: Whether logs are enabled or not.
/// </summary>
bool IsLoggingEnabled { get; set; }
/// <summary>
/// Setting: Whether logs are enabled or not.
/// </summary>
bool IsLoggingEnabled { get; set; }
/// <summary>
/// Setting: Display language for the application.
/// </summary>
AppLanguage CurrentLanguage { get; set; }
/// <summary>
/// Setting: Display language for the application.
/// </summary>
AppLanguage CurrentLanguage { get; set; }
/// <summary>
/// Setting: Whether the navigation pane is opened on the last session or not.
/// </summary>
bool IsNavigationPaneOpened { get; set; }
/// <summary>
/// Setting: Whether the navigation pane is opened on the last session or not.
/// </summary>
bool IsNavigationPaneOpened { get; set; }
/// <summary>
/// Setting: Gets or sets what should happen to server app when the client is terminated.
/// </summary>
ServerBackgroundMode ServerTerminationBehavior { get; set; }
/// <summary>
/// Setting: Gets or sets what should happen to server app when the client is terminated.
/// </summary>
ServerBackgroundMode ServerTerminationBehavior { get; set; }
/// <summary>
/// Setting: Preferred time format for mail or calendar header display.
/// </summary>
bool Prefer24HourTimeFormat { get; set; }
/// <summary>
/// Setting: Preferred time format for mail or calendar header display.
/// </summary>
bool Prefer24HourTimeFormat { get; set; }
#endregion
#endregion
#region Mail
#region Mail
/// <summary>
/// Setting: For changing the mail display container mode.
/// </summary>
MailListDisplayMode MailItemDisplayMode { get; set; }
/// <summary>
/// Setting: For changing the mail display container mode.
/// </summary>
MailListDisplayMode MailItemDisplayMode { get; set; }
/// <summary>
/// Setting: Marking the item as read preference mode.
/// </summary>
MailMarkAsOption MarkAsPreference { get; set; }
/// <summary>
/// Setting: Marking the item as read preference mode.
/// </summary>
MailMarkAsOption MarkAsPreference { get; set; }
/// <summary>
/// Setting: How many seconds should be waited on rendering page to mark item as read.
/// </summary>
int MarkAsDelay { get; set; }
/// <summary>
/// Setting: How many seconds should be waited on rendering page to mark item as read.
/// </summary>
int MarkAsDelay { get; set; }
/// <summary>
/// Setting: Ask comfirmation from the user during permanent delete.
/// </summary>
bool IsHardDeleteProtectionEnabled { get; set; }
/// <summary>
/// Setting: Ask comfirmation from the user during permanent delete.
/// </summary>
bool IsHardDeleteProtectionEnabled { get; set; }
/// <summary>
/// Setting: Thread mails into conversations.
/// </summary>
bool IsThreadingEnabled { get; set; }
/// <summary>
/// Setting: Thread mails into conversations.
/// </summary>
bool IsThreadingEnabled { get; set; }
/// <summary>
/// Setting: Show sender pictures in mail list.
/// </summary>
bool IsShowSenderPicturesEnabled { get; set; }
/// <summary>
/// Setting: Show sender pictures in mail list.
/// </summary>
bool IsShowSenderPicturesEnabled { get; set; }
/// <summary>
/// Setting: Show preview text in mail list.
/// </summary>
bool IsShowPreviewEnabled { get; set; }
/// <summary>
/// Setting: Show preview text in mail list.
/// </summary>
bool IsShowPreviewEnabled { get; set; }
/// <summary>
/// Setting: Enable/disable semantic zoom on clicking date headers.
/// </summary>
bool IsSemanticZoomEnabled { get; set; }
/// <summary>
/// Setting: Enable/disable semantic zoom on clicking date headers.
/// </summary>
bool IsSemanticZoomEnabled { get; set; }
/// <summary>
/// Setting: Set whether 'img' tags in rendered HTMLs should be removed.
/// </summary>
bool RenderImages { get; set; }
/// <summary>
/// Setting: Set whether 'img' tags in rendered HTMLs should be removed.
/// </summary>
bool RenderImages { get; set; }
/// <summary>
/// Setting: Set whether 'style' tags in rendered HTMls should be removed.
/// </summary>
bool RenderStyles { get; set; }
/// <summary>
/// Setting: Set whether 'style' tags in rendered HTMls should be removed.
/// </summary>
bool RenderStyles { get; set; }
/// <summary>
/// Setting: Set whether plaintext links should be automatically converted to clickable links.
/// </summary>
bool RenderPlaintextLinks { get; set; }
/// <summary>
/// Setting: Set whether plaintext links should be automatically converted to clickable links.
/// </summary>
bool RenderPlaintextLinks { get; set; }
/// <summary>
/// Gets the preferred rendering options for HTML rendering.
/// </summary>
MailRenderingOptions GetRenderingOptions();
/// <summary>
/// Gets the preferred rendering options for HTML rendering.
/// </summary>
MailRenderingOptions GetRenderingOptions();
/// <summary>
/// Setting: Swipe mail operation when mails are swiped to right.
/// </summary>
MailOperation RightSwipeOperation { get; set; }
/// <summary>
/// Setting: Swipe mail operation when mails are swiped to right.
/// </summary>
MailOperation RightSwipeOperation { get; set; }
/// <summary>
/// Setting: Swipe mail operation when mails are swiped to left.
/// </summary>
MailOperation LeftSwipeOperation { get; set; }
/// <summary>
/// Setting: Swipe mail operation when mails are swiped to left.
/// </summary>
MailOperation LeftSwipeOperation { get; set; }
/// <summary>
/// Setting: Whether hover actions on mail pointer hover is enabled or not.
/// </summary>
bool IsHoverActionsEnabled { get; set; }
/// <summary>
/// Setting: Whether hover actions on mail pointer hover is enabled or not.
/// </summary>
bool IsHoverActionsEnabled { get; set; }
/// <summary>
/// Setting: Hover action on the left when the mail is hovered over.
/// </summary>
MailOperation LeftHoverAction { get; set; }
/// <summary>
/// Setting: Hover action on the left when the mail is hovered over.
/// </summary>
MailOperation LeftHoverAction { get; set; }
/// <summary>
/// Setting: Hover action on the center when the mail is hovered over.
/// </summary>
MailOperation CenterHoverAction { get; set; }
/// <summary>
/// Setting: Hover action on the center when the mail is hovered over.
/// </summary>
MailOperation CenterHoverAction { get; set; }
/// <summary>
/// Setting: Hover action on the right when the mail is hovered over.
/// </summary>
MailOperation RightHoverAction { get; set; }
/// <summary>
/// Setting: Hover action on the right when the mail is hovered over.
/// </summary>
MailOperation RightHoverAction { get; set; }
/// <summary>
/// Setting: Whether Mailkit Protocol Logger is enabled for ImapTestService or not.
/// </summary>
bool IsMailkitProtocolLoggerEnabled { get; set; }
/// <summary>
/// Setting: Whether Mailkit Protocol Logger is enabled for ImapTestService or not.
/// </summary>
bool IsMailkitProtocolLoggerEnabled { get; set; }
/// <summary>
/// Setting: Which entity id (merged account or folder) should be expanded automatically on startup.
/// </summary>
Guid? StartupEntityId { get; set; }
/// <summary>
/// Setting: Which entity id (merged account or folder) should be expanded automatically on startup.
/// </summary>
Guid? StartupEntityId { get; set; }
/// <summary>
/// Setting: Display font for the mail reader.
/// </summary>
string ReaderFont { get; set; }
/// <summary>
/// Setting: Display font for the mail reader.
/// </summary>
string ReaderFont { get; set; }
/// <summary>
/// Setting: Font size for the mail reader.
/// </summary>
int ReaderFontSize { get; set; }
/// <summary>
/// Setting: Font size for the mail reader.
/// </summary>
int ReaderFontSize { get; set; }
/// <summary>
/// Setting: Display font for the mail composer.
/// </summary>
string ComposerFont { get; set; }
/// <summary>
/// Setting: Display font for the mail composer.
/// </summary>
string ComposerFont { get; set; }
/// <summary>
/// Setting: Font size for the mail composer.
/// </summary>
int ComposerFontSize { get; set; }
/// <summary>
/// Setting: Font size for the mail composer.
/// </summary>
int ComposerFontSize { get; set; }
/// <summary>
/// Setting: Whether the next item should be automatically selected once the current item is moved or removed.
/// </summary>
bool AutoSelectNextItem { get; set; }
/// <summary>
/// Setting: Whether the next item should be automatically selected once the current item is moved or removed.
/// </summary>
bool AutoSelectNextItem { get; set; }
/// <summary>
/// Setting: Whether the mail list action bar is enabled or not.
/// </summary>
bool IsMailListActionBarEnabled { get; set; }
/// <summary>
/// Setting: Whether the mail list action bar is enabled or not.
/// </summary>
bool IsMailListActionBarEnabled { get; set; }
#endregion
#endregion
#region Calendar
#region Calendar
DayOfWeek FirstDayOfWeek { get; set; }
TimeSpan WorkingHourStart { get; set; }
TimeSpan WorkingHourEnd { get; set; }
DayOfWeek WorkingDayStart { get; set; }
DayOfWeek WorkingDayEnd { get; set; }
double HourHeight { get; set; }
DayOfWeek FirstDayOfWeek { get; set; }
TimeSpan WorkingHourStart { get; set; }
TimeSpan WorkingHourEnd { get; set; }
DayOfWeek WorkingDayStart { get; set; }
DayOfWeek WorkingDayEnd { get; set; }
double HourHeight { get; set; }
string DiagnosticId { get; set; }
CalendarSettings GetCurrentCalendarSettings();
CalendarSettings GetCurrentCalendarSettings();
#endregion
#endregion
}
}
+5 -4
View File
@@ -1,9 +1,10 @@
using System.Threading.Tasks;
using Wino.Core.Domain.Enums;
namespace Wino.Core.Domain.Interfaces;
public interface IPrintService
namespace Wino.Core.Domain.Interfaces
{
Task<PrintingResult> PrintPdfFileAsync(string pdfFilePath, string printTitle);
public interface IPrintService
{
Task<PrintingResult> PrintPdfFileAsync(string pdfFilePath, string printTitle);
}
}
+10 -9
View File
@@ -1,13 +1,14 @@
using Wino.Core.Domain.Enums;
namespace Wino.Core.Domain.Interfaces;
public interface IProviderDetail
namespace Wino.Core.Domain.Interfaces
{
MailProviderType Type { get; }
SpecialImapProvider SpecialImapProvider { get; }
string Name { get; }
string Description { get; }
string ProviderImage { get; }
bool IsSupported { get; }
public interface IProviderDetail
{
MailProviderType Type { get; }
SpecialImapProvider SpecialImapProvider { get; }
string Name { get; }
string Description { get; }
string ProviderImage { get; }
bool IsSupported { get; }
}
}
@@ -1,10 +1,11 @@
using System.Collections.Generic;
using Wino.Core.Domain.Enums;
namespace Wino.Core.Domain.Interfaces;
public interface IProviderService
namespace Wino.Core.Domain.Interfaces
{
List<IProviderDetail> GetAvailableProviders();
IProviderDetail GetProviderDetail(MailProviderType type);
public interface IProviderService
{
List<IProviderDetail> GetAvailableProviders();
IProviderDetail GetProviderDetail(MailProviderType type);
}
}
+53 -52
View File
@@ -1,65 +1,66 @@
using Wino.Core.Domain.Entities.Mail;
using Wino.Core.Domain.Enums;
namespace Wino.Core.Domain.Interfaces;
/// <summary>
/// Represents a group of requests.
/// </summary>
public interface IRequestBundle
{
string BundleId { get; set; }
IUIChangeRequest UIChangeRequest { get; }
}
/// <summary>
/// Represents a group of requests with their native response types.
/// </summary>
/// <typeparam name="TRequest">Native request type from each synchronizer to store.</typeparam>
public interface IRequestBundle<TRequest> : IRequestBundle
{
TRequest NativeRequest { get; }
IRequestBase Request { get; }
}
public interface IRequestBase : IClientMessage, IUIChangeRequest
namespace Wino.Core.Domain.Interfaces
{
/// <summary>
/// Whether synchronizations should be delayed after executing this request.
/// Specially Outlook sometimes don't report changes back immidiately after sending the API request.
/// This results following synchronization to miss the changes.
/// We add small delay for the following synchronization after executing current requests to overcome this issue.
/// Default is false.
/// Represents a group of requests.
/// </summary>
int ResynchronizationDelay { get; }
object GroupingKey();
}
public interface IUIChangeRequest
{
/// <summary>
/// UI changes to apply to the item before sending the request to the server.
/// Changes here only affect the UI, not the item itself.
/// Changes here are reverted if the request fails by calling <see cref="RevertUIChanges"/>.
/// </summary>
void ApplyUIChanges();
public interface IRequestBundle
{
string BundleId { get; set; }
IUIChangeRequest UIChangeRequest { get; }
}
/// <summary>
/// Reverts the UI changes applied by <see cref="ApplyUIChanges"/> if the request fails.
/// Represents a group of requests with their native response types.
/// </summary>
void RevertUIChanges();
}
/// <typeparam name="TRequest">Native request type from each synchronizer to store.</typeparam>
public interface IRequestBundle<TRequest> : IRequestBundle
{
TRequest NativeRequest { get; }
IRequestBase Request { get; }
}
public interface IMailActionRequest : IRequestBase
{
MailCopy Item { get; }
MailSynchronizerOperation Operation { get; }
}
public interface IRequestBase : IClientMessage, IUIChangeRequest
{
/// <summary>
/// Whether synchronizations should be delayed after executing this request.
/// Specially Outlook sometimes don't report changes back immidiately after sending the API request.
/// This results following synchronization to miss the changes.
/// We add small delay for the following synchronization after executing current requests to overcome this issue.
/// Default is false.
/// </summary>
int ResynchronizationDelay { get; }
public interface IFolderActionRequest : IRequestBase
{
MailItemFolder Folder { get; }
object GroupingKey();
}
FolderSynchronizerOperation Operation { get; }
public interface IUIChangeRequest
{
/// <summary>
/// UI changes to apply to the item before sending the request to the server.
/// Changes here only affect the UI, not the item itself.
/// Changes here are reverted if the request fails by calling <see cref="RevertUIChanges"/>.
/// </summary>
void ApplyUIChanges();
/// <summary>
/// Reverts the UI changes applied by <see cref="ApplyUIChanges"/> if the request fails.
/// </summary>
void RevertUIChanges();
}
public interface IMailActionRequest : IRequestBase
{
MailCopy Item { get; }
MailSynchronizerOperation Operation { get; }
}
public interface IFolderActionRequest : IRequestBase
{
MailItemFolder Folder { get; }
FolderSynchronizerOperation Operation { get; }
}
}
@@ -1,9 +1,10 @@
using System.Collections.Generic;
using Wino.Core.Domain.Models.Settings;
namespace Wino.Core.Domain.Interfaces;
public interface ISettingsBuilderService
namespace Wino.Core.Domain.Interfaces
{
List<SettingOption> GetSettingItems();
public interface ISettingsBuilderService
{
List<SettingOption> GetSettingItems();
}
}
@@ -3,44 +3,45 @@ using System.Collections.Generic;
using System.Threading.Tasks;
using Wino.Core.Domain.Entities.Mail;
namespace Wino.Core.Domain.Interfaces;
public interface ISignatureService
namespace Wino.Core.Domain.Interfaces
{
/// <summary>
/// Get one signature by Id.
/// </summary>
/// <param name="signatureId">Signature Id.</param>
Task<AccountSignature> GetSignatureAsync(Guid signatureId);
public interface ISignatureService
{
/// <summary>
/// Get one signature by Id.
/// </summary>
/// <param name="signatureId">Signature Id.</param>
Task<AccountSignature> GetSignatureAsync(Guid signatureId);
/// <summary>
/// Returns all signatures for specified account.
/// </summary>
/// <param name="accountId">Account id</param>
Task<List<AccountSignature>> GetSignaturesAsync(Guid accountId);
/// <summary>
/// Returns all signatures for specified account.
/// </summary>
/// <param name="accountId">Account id</param>
Task<List<AccountSignature>> GetSignaturesAsync(Guid accountId);
/// <summary>
/// Creates a new signature for the account.
/// </summary>
/// <param name="signature">Signature that should be created. It should contain ID and account to which it belongs.</param>
Task<AccountSignature> CreateSignatureAsync(AccountSignature signature);
/// <summary>
/// Creates a new signature for the account.
/// </summary>
/// <param name="signature">Signature that should be created. It should contain ID and account to which it belongs.</param>
Task<AccountSignature> CreateSignatureAsync(AccountSignature signature);
/// <summary>
/// Creates a default Wino signature for the account.
/// Needed only for initial account setup.
/// </summary>
/// <param name="accountId">Account Id.</param>
Task<AccountSignature> CreateDefaultSignatureAsync(Guid accountId);
/// <summary>
/// Creates a default Wino signature for the account.
/// Needed only for initial account setup.
/// </summary>
/// <param name="accountId">Account Id.</param>
Task<AccountSignature> CreateDefaultSignatureAsync(Guid accountId);
/// <summary>
/// Updates existing signature.
/// </summary>
/// <param name="signature">Signature that should be updated. It should contain ID and account to which it belongs.</param>
Task<AccountSignature> UpdateSignatureAsync(AccountSignature signature);
/// <summary>
/// Updates existing signature.
/// </summary>
/// <param name="signature">Signature that should be updated. It should contain ID and account to which it belongs.</param>
Task<AccountSignature> UpdateSignatureAsync(AccountSignature signature);
/// <summary>
/// Deletes existing signature.
/// </summary>
/// <param name="signature">Signature that should be deleted.</param>
Task<AccountSignature> DeleteSignatureAsync(AccountSignature signature);
/// <summary>
/// Deletes existing signature.
/// </summary>
/// <param name="signature">Signature that should be deleted.</param>
Task<AccountSignature> DeleteSignatureAsync(AccountSignature signature);
}
}
@@ -1,9 +1,10 @@
using Wino.Core.Domain.Entities.Shared;
using Wino.Core.Domain.Models.Accounts;
namespace Wino.Core.Domain.Interfaces;
public interface ISpecialImapProviderConfigResolver
namespace Wino.Core.Domain.Interfaces
{
CustomServerInformation GetServerInformation(MailAccount account, AccountCreationDialogResult dialogResult);
public interface ISpecialImapProviderConfigResolver
{
CustomServerInformation GetServerInformation(MailAccount account, AccountCreationDialogResult dialogResult);
}
}
@@ -1,19 +1,20 @@
using System.Threading.Tasks;
using Wino.Core.Domain.Enums;
namespace Wino.Core.Domain.Interfaces;
public interface IStartupBehaviorService
namespace Wino.Core.Domain.Interfaces
{
/// <summary>
/// Gets whether Wino Server is set to launch on startup or not.
/// </summary>
Task<StartupBehaviorResult> GetCurrentStartupBehaviorAsync();
public interface IStartupBehaviorService
{
/// <summary>
/// Gets whether Wino Server is set to launch on startup or not.
/// </summary>
Task<StartupBehaviorResult> GetCurrentStartupBehaviorAsync();
/// <summary>
/// Enables/disables the current startup behavior for Wino Server.
/// </summary>
/// <param name="isEnabled">Whether to launch enabled or disabled.</param>
/// <returns>True if operation success, false if not.</returns>
Task<StartupBehaviorResult> ToggleStartupBehavior(bool isEnabled);
/// <summary>
/// Enables/disables the current startup behavior for Wino Server.
/// </summary>
/// <param name="isEnabled">Whether to launch enabled or disabled.</param>
/// <returns>True if operation success, false if not.</returns>
Task<StartupBehaviorResult> ToggleStartupBehavior(bool isEnabled);
}
}
@@ -2,56 +2,57 @@
using System.ComponentModel;
using Wino.Core.Domain.Enums;
namespace Wino.Core.Domain.Interfaces;
public interface IStatePersistanceService : INotifyPropertyChanged
namespace Wino.Core.Domain.Interfaces
{
event EventHandler<string> StatePropertyChanged;
public interface IStatePersistanceService : INotifyPropertyChanged
{
event EventHandler<string> StatePropertyChanged;
/// <summary>
/// True when there is an active renderer for selected mail.
/// </summary>
bool IsReadingMail { get; set; }
/// <summary>
/// True when there is an active renderer for selected mail.
/// </summary>
bool IsReadingMail { get; set; }
/// <summary>
/// Shell's app bar title string.
/// </summary>
string CoreWindowTitle { get; set; }
/// <summary>
/// Shell's app bar title string.
/// </summary>
string CoreWindowTitle { get; set; }
/// <summary>
/// When only reader page is visible in small sized window.
/// </summary>
bool IsReaderNarrowed { get; set; }
/// <summary>
/// When only reader page is visible in small sized window.
/// </summary>
bool IsReaderNarrowed { get; set; }
/// <summary>
/// Should display back button on the shell title bar.
/// </summary>
bool IsBackButtonVisible { get; }
/// <summary>
/// Should display back button on the shell title bar.
/// </summary>
bool IsBackButtonVisible { get; }
/// <summary>
/// Setting: Opened pane length for the navigation view.
/// </summary>
double OpenPaneLength { get; set; }
/// <summary>
/// Setting: Opened pane length for the navigation view.
/// </summary>
double OpenPaneLength { get; set; }
/// <summary>
/// Whether the mail rendering page should be shifted from top to adjust the design
/// for standalone EML viewer or not.
/// </summary>
bool ShouldShiftMailRenderingDesign { get; set; }
/// <summary>
/// Whether the mail rendering page should be shifted from top to adjust the design
/// for standalone EML viewer or not.
/// </summary>
bool ShouldShiftMailRenderingDesign { get; set; }
/// <summary>
/// Setting: Mail list pane length for listing mails.
/// </summary>
double MailListPaneLength { get; set; }
/// <summary>
/// Setting: Mail list pane length for listing mails.
/// </summary>
double MailListPaneLength { get; set; }
/// <summary>
/// Setting: Calendar display type.
/// </summary>
CalendarDisplayType CalendarDisplayType { get; set; }
/// <summary>
/// Setting: Calendar display type.
/// </summary>
CalendarDisplayType CalendarDisplayType { get; set; }
/// <summary>
/// Setting: Calendar display count for the day view.
/// </summary>
int DayDisplayCount { get; set; }
/// <summary>
/// Setting: Calendar display count for the day view.
/// </summary>
int DayDisplayCount { get; set; }
}
}
@@ -2,17 +2,18 @@
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.Store;
namespace Wino.Core.Domain.Interfaces;
public interface IStoreManagementService
namespace Wino.Core.Domain.Interfaces
{
/// <summary>
/// Checks whether user has the type of an add-on purchased.
/// </summary>
Task<bool> HasProductAsync(StoreProductType productType);
public interface IStoreManagementService
{
/// <summary>
/// Checks whether user has the type of an add-on purchased.
/// </summary>
Task<bool> HasProductAsync(StoreProductType productType);
/// <summary>
/// Attempts to purchase the given add-on.
/// </summary>
Task<StorePurchaseResult> PurchaseAsync(StoreProductType productType);
/// <summary>
/// Attempts to purchase the given add-on.
/// </summary>
Task<StorePurchaseResult> PurchaseAsync(StoreProductType productType);
}
}
@@ -1,9 +1,10 @@
using System.Threading.Tasks;
namespace Wino.Core.Domain.Interfaces;
public interface IStoreRatingService
namespace Wino.Core.Domain.Interfaces
{
Task PromptRatingDialogAsync();
Task LaunchStorePageForReviewAsync();
public interface IStoreRatingService
{
Task PromptRatingDialogAsync();
Task LaunchStorePageForReviewAsync();
}
}
@@ -1,11 +1,12 @@
using System;
using System.Threading.Tasks;
namespace Wino.Core.Domain.Interfaces;
public interface ISynchronizerFactory
namespace Wino.Core.Domain.Interfaces
{
Task<IWinoSynchronizerBase> GetAccountSynchronizerAsync(Guid accountId);
Task InitializeAsync();
Task DeleteSynchronizerAsync(Guid accountId);
public interface ISynchronizerFactory
{
Task<IWinoSynchronizerBase> GetAccountSynchronizerAsync(Guid accountId);
Task InitializeAsync();
Task DeleteSynchronizerAsync(Guid accountId);
}
}
+16 -15
View File
@@ -4,23 +4,24 @@ using System.Threading.Tasks;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.Personalization;
namespace Wino.Core.Domain.Interfaces;
public interface IThemeService : IInitializeAsync
namespace Wino.Core.Domain.Interfaces
{
event EventHandler<ApplicationElementTheme> ElementThemeChanged;
event EventHandler<string> AccentColorChanged;
public interface IThemeService : IInitializeAsync
{
event EventHandler<ApplicationElementTheme> ElementThemeChanged;
event EventHandler<string> AccentColorChanged;
Task<List<AppThemeBase>> GetAvailableThemesAsync();
Task<CustomThemeMetadata> CreateNewCustomThemeAsync(string themeName, string accentColor, byte[] wallpaperData);
Task<List<CustomThemeMetadata>> GetCurrentCustomThemesAsync();
Task<List<AppThemeBase>> GetAvailableThemesAsync();
Task<CustomThemeMetadata> CreateNewCustomThemeAsync(string themeName, string accentColor, byte[] wallpaperData);
Task<List<CustomThemeMetadata>> GetCurrentCustomThemesAsync();
Task ApplyCustomThemeAsync(bool isInitializing);
Task ApplyCustomThemeAsync(bool isInitializing);
// Settings
ApplicationElementTheme RootTheme { get; set; }
Guid CurrentApplicationThemeId { get; set; }
string AccentColor { get; set; }
string GetSystemAccentColorHex();
bool IsCustomTheme { get; }
// Settings
ApplicationElementTheme RootTheme { get; set; }
Guid CurrentApplicationThemeId { get; set; }
string AccentColor { get; set; }
string GetSystemAccentColorHex();
bool IsCustomTheme { get; }
}
}
@@ -4,15 +4,16 @@ using Wino.Core.Domain.Entities.Mail;
using Wino.Core.Domain.Models.Folders;
using Wino.Core.Domain.Models.MailItem;
namespace Wino.Core.Domain.Interfaces;
public interface IThreadingStrategy
namespace Wino.Core.Domain.Interfaces
{
/// <summary>
/// Attach thread mails to the list.
/// </summary>
/// <param name="items">Original mails.</param>
/// <returns>Original mails with thread mails.</returns>
Task<List<IMailItem>> ThreadItemsAsync(List<MailCopy> items, IMailItemFolder threadingForFolder);
bool ShouldThreadWithItem(IMailItem originalItem, IMailItem targetItem);
public interface IThreadingStrategy
{
/// <summary>
/// Attach thread mails to the list.
/// </summary>
/// <param name="items">Original mails.</param>
/// <returns>Original mails with thread mails.</returns>
Task<List<IMailItem>> ThreadItemsAsync(List<MailCopy> items, IMailItemFolder threadingForFolder);
bool ShouldThreadWithItem(IMailItem originalItem, IMailItem targetItem);
}
}
@@ -1,12 +1,13 @@
using Wino.Core.Domain.Enums;
namespace Wino.Core.Domain.Interfaces;
public interface IThreadingStrategyProvider
namespace Wino.Core.Domain.Interfaces
{
/// <summary>
/// Returns corresponding threading strategy that applies to given provider type.
/// </summary>
/// <param name="mailProviderType">Provider type.</param>
IThreadingStrategy GetStrategy(MailProviderType mailProviderType);
public interface IThreadingStrategyProvider
{
/// <summary>
/// Returns corresponding threading strategy that applies to given provider type.
/// </summary>
/// <param name="mailProviderType">Provider type.</param>
IThreadingStrategy GetStrategy(MailProviderType mailProviderType);
}
}
@@ -3,10 +3,11 @@ using System.Threading.Tasks;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.Translations;
namespace Wino.Core.Domain.Interfaces;
public interface ITranslationService : IInitializeAsync
namespace Wino.Core.Domain.Interfaces
{
Task InitializeLanguageAsync(AppLanguage language, bool ignoreCurrentLanguageCheck = false);
List<AppLanguageModel> GetAvailableLanguages();
public interface ITranslationService : IInitializeAsync
{
Task InitializeLanguageAsync(AppLanguage language, bool ignoreCurrentLanguageCheck = false);
List<AppLanguageModel> GetAvailableLanguages();
}
}
+10 -9
View File
@@ -1,10 +1,11 @@
namespace Wino.Core.Domain.Interfaces;
namespace Wino.Core.Domain.Interfaces
{
/// <summary>
/// Interface for all messages to report UI changes from synchronizers to UI.
/// None of these messages can't run a code that manipulates database.
/// They are sent either from processor or view models to signal some other
/// parts of the application.
/// </summary>
/// <summary>
/// Interface for all messages to report UI changes from synchronizers to UI.
/// None of these messages can't run a code that manipulates database.
/// They are sent either from processor or view models to signal some other
/// parts of the application.
/// </summary>
public interface IUIMessage;
public interface IUIMessage;
}
@@ -1,6 +1,7 @@
namespace Wino.Core.Domain.Interfaces;
public interface IUnderlyingThemeService
namespace Wino.Core.Domain.Interfaces
{
bool IsUnderlyingThemeDark();
public interface IUnderlyingThemeService
{
bool IsUnderlyingThemeDark();
}
}
@@ -1,14 +1,15 @@
using System.Threading.Tasks;
using Wino.Core.Domain.Models.Reader;
namespace Wino.Core.Domain.Interfaces;
public interface IUnsubscriptionService
namespace Wino.Core.Domain.Interfaces
{
/// <summary>
/// Unsubscribes from the subscription using one-click method.
/// </summary>
/// <param name="info">Unsubscribtion information.</param>
/// <returns>Whether the unsubscription is succeeded or not.</returns>
Task<bool> OneClickUnsubscribeAsync(UnsubscribeInfo info);
public interface IUnsubscriptionService
{
/// <summary>
/// Unsubscribes from the subscription using one-click method.
/// </summary>
/// <param name="info">Unsubscribtion information.</param>
/// <returns>Whether the unsubscription is succeeded or not.</returns>
Task<bool> OneClickUnsubscribeAsync(UnsubscribeInfo info);
}
}
@@ -2,15 +2,16 @@
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.Navigation;
namespace Wino.Core.Domain.Interfaces;
public interface INavigationService
namespace Wino.Core.Domain.Interfaces
{
bool Navigate(WinoPage page,
object parameter = null,
NavigationReferenceFrame frame = NavigationReferenceFrame.ShellFrame,
NavigationTransitionType transition = NavigationTransitionType.None);
public interface INavigationService
{
bool Navigate(WinoPage page,
object parameter = null,
NavigationReferenceFrame frame = NavigationReferenceFrame.ShellFrame,
NavigationTransitionType transition = NavigationTransitionType.None);
Type GetPageType(WinoPage winoPage);
void GoBack();
Type GetPageType(WinoPage winoPage);
void GoBack();
}
}
@@ -2,31 +2,32 @@
using Wino.Core.Domain.Models.Folders;
using Wino.Core.Domain.Models.MailItem;
namespace Wino.Core.Domain.Interfaces;
public interface IWinoRequestDelegator
namespace Wino.Core.Domain.Interfaces
{
/// <summary>
/// Prepares requires IRequest collection for mail actions and executes them via proper synchronizers.
/// </summary>
/// <param name="prerperationRequest">Preperation model that encapsulates action and mail items.</param>
Task ExecuteAsync(MailOperationPreperationRequest prerperationRequest);
public interface IWinoRequestDelegator
{
/// <summary>
/// Prepares requires IRequest collection for mail actions and executes them via proper synchronizers.
/// </summary>
/// <param name="prerperationRequest">Preperation model that encapsulates action and mail items.</param>
Task ExecuteAsync(MailOperationPreperationRequest prerperationRequest);
/// <summary>
/// Queues new draft creation request for synchronizer.
/// </summary>
/// <param name="draftPreperationRequest">A class that holds the parameters for creating a draft.</param>
Task ExecuteAsync(DraftPreparationRequest draftPreperationRequest);
/// <summary>
/// Queues new draft creation request for synchronizer.
/// </summary>
/// <param name="draftPreperationRequest">A class that holds the parameters for creating a draft.</param>
Task ExecuteAsync(DraftPreparationRequest draftPreperationRequest);
/// <summary>
/// Queues a new request for synchronizer to send a draft.
/// </summary>
/// <param name="draftPreperationRequest">Draft sending request.</param>
Task ExecuteAsync(SendDraftPreparationRequest sendDraftPreperationRequest);
/// <summary>
/// Queues a new request for synchronizer to send a draft.
/// </summary>
/// <param name="draftPreperationRequest">Draft sending request.</param>
Task ExecuteAsync(SendDraftPreparationRequest sendDraftPreperationRequest);
/// <summary>
/// Prepares requires IRequest collection for folder actions and executes them via proper synchronizers.
/// </summary>
/// <param name="folderOperationPreperationRequest">Folder prep request.</param>
Task ExecuteAsync(FolderOperationPreperationRequest folderOperationPreperationRequest);
/// <summary>
/// Prepares requires IRequest collection for folder actions and executes them via proper synchronizers.
/// </summary>
/// <param name="folderOperationPreperationRequest">Folder prep request.</param>
Task ExecuteAsync(FolderOperationPreperationRequest folderOperationPreperationRequest);
}
}
@@ -3,23 +3,24 @@ using System.Threading.Tasks;
using Wino.Core.Domain.Models.Folders;
using Wino.Core.Domain.Models.MailItem;
namespace Wino.Core.Domain.Interfaces;
public interface IWinoRequestProcessor
namespace Wino.Core.Domain.Interfaces
{
/// <summary>
/// Prepares proper folder action requests for synchronizers to execute.
/// </summary>
/// <param name="request"></param>
/// <returns>Base request that synchronizer can execute.</returns>
Task<IFolderActionRequest> PrepareFolderRequestAsync(FolderOperationPreperationRequest request);
public interface IWinoRequestProcessor
{
/// <summary>
/// Prepares proper folder action requests for synchronizers to execute.
/// </summary>
/// <param name="request"></param>
/// <returns>Base request that synchronizer can execute.</returns>
Task<IFolderActionRequest> PrepareFolderRequestAsync(FolderOperationPreperationRequest request);
/// <summary>
/// Prepares proper Wino requests for synchronizers to execute categorized by AccountId and FolderId.
/// </summary>
/// <param name="operation">User action</param>
/// <param name="mailCopyIds">Selected mails.</param>
/// <exception cref="UnavailableSpecialFolderException">When required folder target is not available for account.</exception>
/// <returns>Base request that synchronizer can execute.</returns>
Task<List<IMailActionRequest>> PrepareRequestsAsync(MailOperationPreperationRequest request);
/// <summary>
/// Prepares proper Wino requests for synchronizers to execute categorized by AccountId and FolderId.
/// </summary>
/// <param name="operation">User action</param>
/// <param name="mailCopyIds">Selected mails.</param>
/// <exception cref="UnavailableSpecialFolderException">When required folder target is not available for account.</exception>
/// <returns>Base request that synchronizer can execute.</returns>
Task<List<IMailActionRequest>> PrepareRequestsAsync(MailOperationPreperationRequest request);
}
}
@@ -4,58 +4,59 @@ using System.Threading.Tasks;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.Server;
namespace Wino.Core.Domain.Interfaces;
public interface IWinoServerConnectionManager
namespace Wino.Core.Domain.Interfaces
{
/// <summary>
/// When the connection status changes, this event will be triggered.
/// </summary>
event EventHandler<WinoServerConnectionStatus> StatusChanged;
public interface IWinoServerConnectionManager
{
/// <summary>
/// When the connection status changes, this event will be triggered.
/// </summary>
event EventHandler<WinoServerConnectionStatus> StatusChanged;
/// <summary>
/// Gets the connection status.
/// </summary>
WinoServerConnectionStatus Status { get; }
/// <summary>
/// Gets the connection status.
/// </summary>
WinoServerConnectionStatus Status { get; }
/// <summary>
/// Launches Full Trust process (Wino Server) and awaits connection completion.
/// If connection is not established in 10 seconds, it will return false.
/// If the server process is already running, it'll connect to existing one.
/// If the server process is not running, it'll be launched and connection establishment is awaited.
/// </summary>
/// <returns>Whether connection is established or not.</returns>
Task<bool> ConnectAsync();
/// <summary>
/// Launches Full Trust process (Wino Server) and awaits connection completion.
/// If connection is not established in 10 seconds, it will return false.
/// If the server process is already running, it'll connect to existing one.
/// If the server process is not running, it'll be launched and connection establishment is awaited.
/// </summary>
/// <returns>Whether connection is established or not.</returns>
Task<bool> ConnectAsync();
/// <summary>
/// Queues a new user request to be processed by Wino Server.
/// Healthy connection must present before calling this method.
/// </summary>
/// <param name="request">Request to queue for synchronizer in the server.</param>
/// <param name="accountId">Account id to queueu request for.</param>
Task QueueRequestAsync(IRequestBase request, Guid accountId);
/// <summary>
/// Queues a new user request to be processed by Wino Server.
/// Healthy connection must present before calling this method.
/// </summary>
/// <param name="request">Request to queue for synchronizer in the server.</param>
/// <param name="accountId">Account id to queueu request for.</param>
Task QueueRequestAsync(IRequestBase request, Guid accountId);
/// <summary>
/// Returns response from server for the given request.
/// </summary>
/// <typeparam name="TResponse">Response type.</typeparam>
/// <typeparam name="TRequestType">Request type.</typeparam>
/// <param name="clientMessage">Request type.</param>
/// <returns>Response received from the server for the given TResponse type.</returns>
Task<WinoServerResponse<TResponse>> GetResponseAsync<TResponse, TRequestType>(TRequestType clientMessage, CancellationToken cancellationToken = default) where TRequestType : IClientMessage;
/// <summary>
/// Returns response from server for the given request.
/// </summary>
/// <typeparam name="TResponse">Response type.</typeparam>
/// <typeparam name="TRequestType">Request type.</typeparam>
/// <param name="clientMessage">Request type.</param>
/// <returns>Response received from the server for the given TResponse type.</returns>
Task<WinoServerResponse<TResponse>> GetResponseAsync<TResponse, TRequestType>(TRequestType clientMessage, CancellationToken cancellationToken = default) where TRequestType : IClientMessage;
/// <summary>
/// Handle for connecting to the server.
/// If the server is already running, it'll connect to existing one.
/// Callers can await this handle to wait for connection establishment.
/// </summary>
TaskCompletionSource<bool> ConnectingHandle { get; }
}
public interface IWinoServerConnectionManager<TAppServiceConnection> : IWinoServerConnectionManager, IInitializeAsync
{
/// <summary>
/// Existing connection handle to the server of TAppServiceConnection type.
/// </summary>
TAppServiceConnection Connection { get; set; }
/// <summary>
/// Handle for connecting to the server.
/// If the server is already running, it'll connect to existing one.
/// Callers can await this handle to wait for connection establishment.
/// </summary>
TaskCompletionSource<bool> ConnectingHandle { get; }
}
public interface IWinoServerConnectionManager<TAppServiceConnection> : IWinoServerConnectionManager, IInitializeAsync
{
/// <summary>
/// Existing connection handle to the server of TAppServiceConnection type.
/// </summary>
TAppServiceConnection Connection { get; set; }
}
}
@@ -4,35 +4,36 @@ using MailKit;
using Wino.Core.Domain.Models.MailItem;
using Wino.Core.Domain.Models.Synchronization;
namespace Wino.Core.Domain.Interfaces;
public interface IWinoSynchronizerBase : IBaseSynchronizer
namespace Wino.Core.Domain.Interfaces
{
/// <summary>
/// Performs a full synchronization with the server with given options.
/// This will also prepares batch requests for execution.
/// Requests are executed in the order they are queued and happens before the synchronization.
/// Result of the execution queue is processed during the synchronization.
/// </summary>
/// <param name="options">Options for synchronization.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>Result summary of synchronization.</returns>
Task<MailSynchronizationResult> SynchronizeMailsAsync(MailSynchronizationOptions options, CancellationToken cancellationToken = default);
public interface IWinoSynchronizerBase : IBaseSynchronizer
{
/// <summary>
/// Performs a full synchronization with the server with given options.
/// This will also prepares batch requests for execution.
/// Requests are executed in the order they are queued and happens before the synchronization.
/// Result of the execution queue is processed during the synchronization.
/// </summary>
/// <param name="options">Options for synchronization.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>Result summary of synchronization.</returns>
Task<MailSynchronizationResult> SynchronizeMailsAsync(MailSynchronizationOptions options, CancellationToken cancellationToken = default);
Task<CalendarSynchronizationResult> SynchronizeCalendarEventsAsync(CalendarSynchronizationOptions options, CancellationToken cancellationToken = default);
Task<CalendarSynchronizationResult> SynchronizeCalendarEventsAsync(CalendarSynchronizationOptions options, CancellationToken cancellationToken = default);
/// <summary>
/// Downloads a single MIME message from the server and saves it to disk.
/// </summary>
/// <param name="mailItem">Mail item to download from server.</param>
/// <param name="transferProgress">Optional progress reporting for download operation.</param>
/// <param name="cancellationToken">Cancellation token.</param>
Task DownloadMissingMimeMessageAsync(IMailItem mailItem, ITransferProgress transferProgress, CancellationToken cancellationToken = default);
/// <summary>
/// Downloads a single MIME message from the server and saves it to disk.
/// </summary>
/// <param name="mailItem">Mail item to download from server.</param>
/// <param name="transferProgress">Optional progress reporting for download operation.</param>
/// <param name="cancellationToken">Cancellation token.</param>
Task DownloadMissingMimeMessageAsync(IMailItem mailItem, ITransferProgress transferProgress, CancellationToken cancellationToken = default);
/// <summary>
/// 1. Cancel active synchronization.
/// 2. Stop all running tasks.
/// 3. Dispose all resources.
/// </summary>
Task KillSynchronizerAsync();
/// <summary>
/// 1. Cancel active synchronization.
/// 2. Stop all running tasks.
/// 3. Dispose all resources.
/// </summary>
Task KillSynchronizerAsync();
}
}