using System.Threading; using System.Threading.Tasks; using MailKit; using Wino.Core.Domain.Entities; using Wino.Core.Domain.Enums; using Wino.Core.Domain.Models.Accounts; using Wino.Core.Domain.Models.MailItem; using Wino.Core.Domain.Models.Synchronization; namespace Wino.Core.Domain.Interfaces { public interface IBaseSynchronizer { /// /// Account that is assigned for this synchronizer. /// MailAccount Account { get; } /// /// Synchronizer state. /// AccountSynchronizerState State { get; } /// /// Queues a single request to be executed in the next synchronization. /// /// Request to queue. void QueueRequest(IRequestBase request); /// /// TODO /// /// Whether active synchronization is stopped or not. bool CancelActiveSynchronization(); /// /// 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. /// /// Options for synchronization. /// Cancellation token. /// Result summary of synchronization. Task SynchronizeAsync(SynchronizationOptions options, CancellationToken cancellationToken = default); /// /// Synchronizes profile information with the server. /// Sender name and /// /// Task SynchronizeProfileInformationAsync(); /// /// Downloads a single MIME message from the server and saves it to disk. /// /// Mail item to download from server. /// Optional progress reporting for download operation. /// Cancellation token. Task DownloadMissingMimeMessageAsync(IMailItem mailItem, ITransferProgress transferProgress, CancellationToken cancellationToken = default); } }