Cleaning up the solution. Separating Shared.WinRT, Services and Synchronization. Removing synchronization from app. Reducing bundle size by 45mb.

This commit is contained in:
Burak Kaan Köse
2024-07-21 05:45:02 +02:00
parent f112f369a7
commit 495885e006
523 changed files with 2254 additions and 2375 deletions

View File

@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
/// <summary>
/// An interface that should force synchronizer to do synchronization for only given folder ids

View File

@@ -1,6 +1,6 @@
using Wino.Core.Domain.Enums;
using Wino.Domain.Enums;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IAccountCreationDialog
{

View File

@@ -1,7 +1,7 @@
using System.Collections.Generic;
using Wino.Core.Domain.Entities;
using Wino.Domain.Entities;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IAccountMenuItem : IMenuItem
{

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IAccountPickerDialog
{

View File

@@ -1,6 +1,6 @@
using System;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IAccountProviderDetailViewModel
{

View File

@@ -1,6 +1,6 @@
using Wino.Core.Domain.Entities;
using Wino.Domain.Entities;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IAccountProviderDetails
{

View File

@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Wino.Core.Domain.Entities;
using Wino.Domain.Entities;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IAccountService
{

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
/// <summary>
/// Singleton object that holds the application data folder path and the publisher shared folder path.

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IApplicationResourceManager<T>
{

View File

@@ -1,6 +1,6 @@
using Wino.Core.Domain.Enums;
using Wino.Domain.Enums;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IAuthenticationProvider
{

View File

@@ -1,9 +1,9 @@
using System;
using System.Threading.Tasks;
using Wino.Core.Domain.Entities;
using Wino.Core.Domain.Enums;
using Wino.Domain.Entities;
using Wino.Domain.Enums;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IAuthenticator
{

View File

@@ -1,7 +1,7 @@
using System.Threading.Tasks;
using Wino.Core.Domain.Models.AutoDiscovery;
using Wino.Domain.Models.AutoDiscovery;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
/// <summary>
/// Searches for Auto Discovery settings for custom mail accounts.

View File

@@ -1,12 +1,12 @@
using System.Threading;
using System.Threading.Tasks;
using MailKit;
using Wino.Core.Domain.Entities;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.MailItem;
using Wino.Core.Domain.Models.Synchronization;
using Wino.Domain.Entities;
using Wino.Domain.Enums;
using Wino.Domain.Models.MailItem;
using Wino.Domain.Models.Synchronization;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IBaseSynchronizer
{

View File

@@ -1,6 +1,6 @@
using System.Threading.Tasks;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IClipboardService
{

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IConfigurationService
{

View File

@@ -1,6 +1,6 @@
using System.Threading.Tasks;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IConfirmationDialog
{

View File

@@ -0,0 +1,12 @@
using MimeKit;
using Wino.Domain.Entities;
namespace Wino.Domain.Interfaces
{
public interface IContactService
{
Task<List<AddressInformation>> GetAddressInformationAsync(string queryText);
Task<AddressInformation> GetAddressInformationByAddressAsync(string address);
Task SaveAddressInformationAsync(MimeMessage message);
}
}

View File

@@ -1,9 +1,9 @@
using System.Collections.Generic;
using Wino.Core.Domain.Models.Folders;
using Wino.Core.Domain.Models.MailItem;
using Wino.Core.Domain.Models.Menus;
using Wino.Domain.Models.Folders;
using Wino.Domain.Models.MailItem;
using Wino.Domain.Models.Menus;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IContextMenuItemService
{

View File

@@ -1,9 +1,9 @@
using System.Collections.Generic;
using Wino.Core.Domain.Models.Folders;
using Wino.Core.Domain.Models.MailItem;
using Wino.Core.Domain.Models.Menus;
using Wino.Domain.Models.Folders;
using Wino.Domain.Models.MailItem;
using Wino.Domain.Models.Menus;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IContextMenuProvider
{

View File

@@ -1,7 +1,7 @@
using System.Threading.Tasks;
using Wino.Core.Domain.Entities;
using Wino.Domain.Entities;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface ICustomServerAccountCreationDialog : IAccountCreationDialog
{

View File

@@ -0,0 +1,9 @@
using SQLite;
namespace Wino.Domain.Interfaces
{
public interface IDatabaseService : IInitializeAsync
{
SQLiteAsyncConnection Connection { get; }
}
}

View File

@@ -0,0 +1,44 @@
using MimeKit;
using Wino.Domain.Entities;
using Wino.Domain.Models.MailItem;
using Wino.Domain.Models.Synchronization;
namespace Wino.Domain.Interfaces
{
/// <summary>
/// Database change processor that handles common operations for all synchronizers.
/// When a synchronizer detects a change, it should call the appropriate method in this class to reflect the change in the database.
/// Different synchronizers might need additional implementations.
/// <see cref="IGmailChangeProcessor"/>, <see cref="IOutlookChangeProcessor"/> and <see cref="IImapChangeProcessor"/>
/// None of the synchronizers can directly change anything in the database.
/// </summary>
public interface IDefaultChangeProcessor
{
Task<string> UpdateAccountDeltaSynchronizationIdentifierAsync(Guid accountId, string deltaSynchronizationIdentifier);
Task CreateAssignmentAsync(Guid accountId, string mailCopyId, string remoteFolderId);
Task DeleteAssignmentAsync(Guid accountId, string mailCopyId, string remoteFolderId);
Task ChangeMailReadStatusAsync(string mailCopyId, bool isRead);
Task ChangeFlagStatusAsync(string mailCopyId, bool isFlagged);
Task<bool> CreateMailAsync(Guid AccountId, NewMailItemPackage package);
Task DeleteMailAsync(Guid accountId, string mailId);
Task<List<MailCopy>> GetDownloadedUnreadMailsAsync(Guid accountId, IEnumerable<string> downloadedMailCopyIds);
Task SaveMimeFileAsync(Guid fileId, MimeMessage mimeMessage, Guid accountId);
Task DeleteFolderAsync(Guid accountId, string remoteFolderId);
Task InsertFolderAsync(MailItemFolder folder);
Task UpdateFolderAsync(MailItemFolder folder);
/// <summary>
/// Returns the list of folders that are available for account.
/// </summary>
/// <param name="accountId">Account id to get folders for.</param>
/// <returns>All folders.</returns>
Task<List<MailItemFolder>> GetLocalFoldersAsync(Guid accountId);
Task<List<MailItemFolder>> GetSynchronizationFoldersAsync(SynchronizationOptions options);
Task<bool> MapLocalDraftAsync(Guid accountId, Guid localDraftCopyUniqueId, string newMailCopyId, string newDraftId, string newThreadId);
Task UpdateFolderLastSyncDateAsync(Guid folderId);
Task<List<MailItemFolder>> GetExistingFoldersAsync(Guid accountId);
}
}

View File

@@ -2,12 +2,12 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Threading.Tasks;
using Wino.Core.Domain.Entities;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.Accounts;
using Wino.Core.Domain.Models.Folders;
using Wino.Domain.Entities;
using Wino.Domain.Enums;
using Wino.Domain.Models.Accounts;
using Wino.Domain.Models.Folders;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IDialogService
{

View File

@@ -1,7 +1,7 @@
using System;
using System.Threading.Tasks;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IDispatcher
{

View File

@@ -1,7 +1,7 @@
using System.IO;
using System.Threading.Tasks;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IFileService
{

View File

@@ -1,9 +1,9 @@
using System.Collections.Generic;
using Wino.Core.Domain.Entities;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.Folders;
using Wino.Domain.Entities;
using Wino.Domain.Enums;
using Wino.Domain.Models.Folders;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IFolderMenuItem : IBaseFolderMenuItem
{

View File

@@ -1,14 +1,11 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Wino.Core.Domain.Entities;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.Accounts;
using Wino.Core.Domain.Models.Folders;
using Wino.Core.Domain.Models.MailItem;
using Wino.Core.Domain.Models.Synchronization;
using Wino.Domain.Entities;
using Wino.Domain.Enums;
using Wino.Domain.Models.Accounts;
using Wino.Domain.Models.Folders;
using Wino.Domain.Models.MailItem;
using Wino.Domain.Models.Synchronization;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IFolderService
{
@@ -82,7 +79,7 @@ namespace Wino.Core.Domain.Interfaces
/// 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);
// Task<IEnumerable<IMenuItem>> GetAccountFoldersForDisplayAsync(IAccountMenuItem accountMenuItem);
/// <summary>
/// Returns a list of unread item counts for the given account ids.
@@ -90,5 +87,13 @@ namespace Wino.Core.Domain.Interfaces
/// </summary>
/// <param name="accountIds">Account ids to get unread folder counts for.</param>
Task<List<UnreadItemCountResult>> GetUnreadItemCountResultsAsync(IEnumerable<Guid> accountIds);
Task<List<MailItemFolder>> GetVisibleFoldersAsync(Guid accountId);
/// <summary>
/// Returns the child folders of the given folder.
/// </summary>
/// <param name="accountId">Account id to get folders for.</param>
/// <param name="parentRemoteFolderId">Parent folder id to get children for.</param>
Task<List<MailItemFolder>> GetChildFoldersAsync(Guid accountId, string parentRemoteFolderId);
}
}

View File

@@ -1,8 +1,8 @@
using System.Collections.Generic;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.Reader;
using Wino.Domain.Enums;
using Wino.Domain.Models.Reader;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IFontService
{

View File

@@ -0,0 +1,4 @@
namespace Wino.Domain.Interfaces
{
public interface IGmailAuthenticator : IAuthenticator { }
}

View File

@@ -0,0 +1,7 @@
namespace Wino.Domain.Interfaces
{
public interface IGmailChangeProcessor : IDefaultChangeProcessor
{
Task MapLocalDraftAsync(string mailCopyId, string newDraftId, string newThreadId);
}
}

View File

@@ -0,0 +1,11 @@
namespace Wino.Domain.Interfaces
{
public interface IHtmlPreviewer
{
/// <summary>
/// Returns a preview of the HTML content.
/// </summary>
/// <param name="htmlContent">HTML content</param>
string GetHtmlPreview(string htmlContent);
}
}

View File

@@ -0,0 +1,11 @@
namespace Wino.Domain.Interfaces
{
public interface IImapChangeProcessor : IDefaultChangeProcessor
{
/// <summary>
/// Returns all known uids for the given folder.
/// </summary>
/// <param name="folderId">Folder id to retrieve uIds for.</param>
Task<IList<uint>> GetKnownUidsForFolderAsync(Guid folderId);
}
}

View File

@@ -1,7 +1,7 @@
using System.Threading.Tasks;
using Wino.Core.Domain.Entities;
using Wino.Domain.Entities;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IImapTestService
{

View File

@@ -1,6 +1,6 @@
using System.Threading.Tasks;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
/// <summary>
/// An interface that all startup services must implement.

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IKeyPressService
{

View File

@@ -1,6 +1,6 @@
using System.Collections.Specialized;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface ILaunchProtocolService
{

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface ILogInitializer
{

View File

@@ -2,10 +2,10 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using MimeKit;
using Wino.Core.Domain.Entities;
using Wino.Core.Domain.Models.MailItem;
using Wino.Domain.Entities;
using Wino.Domain.Models.MailItem;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IMailService
{
@@ -92,5 +92,7 @@ namespace Wino.Core.Domain.Interfaces
/// </summary>
/// <param name="folderId">Folder id to get unread mails for.</param>
Task<List<MailCopy>> GetUnreadMailsByFolderIdAsync(Guid folderId);
Task<MailCopy> GetReplyParentAsync(IMailItem replyItem, Guid accountId, Guid threadingFolderId, Guid sentFolderId, Guid draftFolderId);
Task<MailCopy> GetInReplyToReplyAsync(IMailItem originalItem, Guid accountId, Guid threadingFolderId, Guid sentFolderId, Guid draftFolderId);
}
}

View File

@@ -1,6 +1,6 @@
using System;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IMenuItem
{

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IMenuOperation
{

View File

@@ -0,0 +1,68 @@
using MimeKit;
using Wino.Domain.Models.MailItem;
using Wino.Domain.Models.Mime;
using Wino.Domain.Models.Reader;
namespace Wino.Domain.Interfaces
{
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>
/// 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 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>
/// 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);
}
}

View File

@@ -1,8 +1,8 @@
using System;
using System.Threading.Tasks;
using Wino.Core.Domain.Models.Authorization;
using Wino.Domain.Models.Authorization;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface INativeAppService
{

View File

@@ -1,6 +1,6 @@
using Wino.Core.Domain.Models.Navigation;
using Wino.Domain.Models.Navigation;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface INavigationAware
{

View File

@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Wino.Core.Domain.Models.MailItem;
using Wino.Domain.Models.MailItem;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface INotificationBuilder
{

View File

@@ -0,0 +1,4 @@
namespace Wino.Domain.Interfaces
{
public interface IOutlookAuthenticator : IAuthenticator { }
}

View File

@@ -0,0 +1,22 @@
namespace Wino.Domain.Interfaces
{
public interface IOutlookChangeProcessor : IDefaultChangeProcessor
{
/// <summary>
/// Interrupted initial synchronization may cause downloaded mails to be saved in the database twice.
/// Since downloading mime is costly in Outlook, we need to check if the actual copy of the message has been saved before.
/// </summary>
/// <param name="messageId">MailCopyId of the message.</param>
/// <returns>Whether the mime has b</returns>
Task<bool> IsMailExistsAsync(string messageId);
/// <summary>
/// Updates Folder's delta synchronization identifier.
/// Only used in Outlook since it does per-folder sync.
/// </summary>
/// <param name="folderId">Folder id</param>
/// <param name="synchronizationIdentifier">New synchronization identifier.</param>
/// <returns>New identifier if success.</returns>
Task UpdateFolderDeltaSynchronizationIdentifierAsync(Guid folderId, string deltaSynchronizationIdentifier);
}
}

View File

@@ -1,8 +1,8 @@
using System;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.Reader;
using Wino.Domain.Enums;
using Wino.Domain.Models.Reader;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IPreferencesService
{

View File

@@ -1,6 +1,6 @@
using Wino.Core.Domain.Enums;
using Wino.Domain.Enums;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IProviderDetail
{

View File

@@ -1,7 +1,7 @@
using System.Collections.Generic;
using Wino.Core.Domain.Enums;
using Wino.Domain.Enums;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IProviderService
{

View File

@@ -1,8 +1,8 @@
using System.Collections.Generic;
using Wino.Core.Domain.Entities;
using Wino.Core.Domain.Enums;
using Wino.Domain.Entities;
using Wino.Domain.Enums;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
/// <summary>
/// Represents a group of requests.

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
/// <summary>
/// Interface for all messages to report UI changes from synchronizers to UI.

View File

@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Wino.Core.Domain.Entities;
using Wino.Domain.Entities;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface ISignatureService
{

View File

@@ -1,7 +1,7 @@
using System;
using System.ComponentModel;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IStatePersistanceService : INotifyPropertyChanged
{

View File

@@ -1,8 +1,8 @@
using System.Threading.Tasks;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.Store;
using Wino.Domain.Enums;
using Wino.Domain.Models.Store;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IStoreManagementService
{

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IStoreRatingDialog
{

View File

@@ -1,6 +1,6 @@
using System.Threading.Tasks;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IStoreRatingService
{

View File

@@ -1,6 +1,6 @@
using System;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
/// <summary>
/// An interface for reporting progress of the synchronization.

View File

@@ -1,10 +1,10 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.Personalization;
using Wino.Domain.Enums;
using Wino.Domain.Models.Personalization;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IThemeService : IInitializeAsync
{

View File

@@ -1,9 +1,7 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Wino.Core.Domain.Entities;
using Wino.Core.Domain.Models.MailItem;
using Wino.Domain.Entities;
using Wino.Domain.Models.MailItem;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IThreadingStrategy
{
@@ -15,4 +13,10 @@ namespace Wino.Core.Domain.Interfaces
Task<List<IMailItem>> ThreadItemsAsync(List<MailCopy> items);
bool ShouldThreadWithItem(IMailItem originalItem, IMailItem targetItem);
}
public interface IOutlookThreadingStrategy : IThreadingStrategy { }
public interface IGmailThreadingStrategy : IThreadingStrategy { }
public interface IImapThreadStrategy : IThreadingStrategy { }
}

View File

@@ -1,6 +1,6 @@
using Wino.Core.Domain.Enums;
using Wino.Domain.Enums;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IThreadingStrategyProvider
{

View File

@@ -0,0 +1,10 @@
using Wino.Domain.Entities;
namespace Wino.Domain.Interfaces
{
public interface ITokenService
{
Task<TokenInformation> GetTokenInformationAsync(Guid accountId);
Task SaveTokenInformationAsync(Guid accountId, TokenInformation tokenInformation);
}
}

View File

@@ -1,9 +1,9 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.Translations;
using Wino.Domain.Enums;
using Wino.Domain.Models.Translations;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface ITranslationService : IInitializeAsync
{

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IUnderlyingThemeService
{

View File

@@ -1,7 +1,7 @@
using System.Threading.Tasks;
using Wino.Core.Domain.Models.Reader;
using Wino.Domain.Models.Reader;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IUnsubscriptionService
{

View File

@@ -1,8 +1,8 @@
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.MailItem;
using Wino.Core.Domain.Models.Navigation;
using Wino.Domain.Enums;
using Wino.Domain.Models.MailItem;
using Wino.Domain.Models.Navigation;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IWinoNavigationService
{

View File

@@ -1,33 +1,36 @@
using System.Threading.Tasks;
using Wino.Core.Domain.Models.Folders;
using Wino.Core.Domain.Models.MailItem;
using Wino.Domain.Models.Folders;
using Wino.Domain.Models.MailItem;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
/// <summary>
/// Prepares server requests and delegates them to proper synchronizers.
/// This is the last point for sending the server request.
/// </summary>
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);
Task QueueAsync(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(DraftPreperationRequest draftPreperationRequest);
Task QueueAsync(DraftPreperationRequest draftPreperationRequest);
/// <summary>
/// Queues a new request for synchronizer to send a draft.
/// </summary>
/// <param name="draftPreperationRequest">Draft sending request.</param>
Task ExecuteAsync(SendDraftPreparationRequest sendDraftPreperationRequest);
Task QueueAsync(SendDraftPreparationRequest sendDraftPreperationRequest);
/// <summary>
/// Prepares requires IRequest collection for folder actions and executes them via proper synchronizers.
/// Prepares required IRequest collection for folder actions and executes them via proper synchronizers.
/// </summary>
/// <param name="folderOperationPreperationRequest">Folder prep request.</param>
Task ExecuteAsync(FolderOperationPreperationRequest folderOperationPreperationRequest);
Task QueueAsync(FolderOperationPreperationRequest folderOperationPreperationRequest);
}
}

View File

@@ -1,9 +1,9 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Wino.Core.Domain.Models.Folders;
using Wino.Core.Domain.Models.MailItem;
using Wino.Domain.Models.Folders;
using Wino.Domain.Models.MailItem;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IWinoRequestProcessor
{

View File

@@ -1,8 +1,8 @@
using System;
using System.Threading.Tasks;
using Wino.Core.Domain.Enums;
using Wino.Domain.Enums;
namespace Wino.Core.Domain.Interfaces
namespace Wino.Domain.Interfaces
{
public interface IWinoServerConnectionManager
{