using System.Threading;
using System.Threading.Tasks;
using MailKit;
using Wino.Core.Domain.Models.MailItem;
using Wino.Core.Domain.Models.Synchronization;
namespace Wino.Core.Domain.Interfaces
{
public interface IWinoSynchronizerBase : IBaseSynchronizer
{
///
/// 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 SynchronizeMailsAsync(MailSynchronizationOptions options, CancellationToken cancellationToken = default);
Task SynchronizeCalendarEventsAsync(CalendarSynchronizationOptions options, CancellationToken cancellationToken = default);
///
/// 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);
///
/// 1. Cancel active synchronization.
/// 2. Stop all running tasks.
/// 3. Dispose all resources.
///
Task KillSynchronizerAsync();
}
}