2024-11-27 03:01:14 +01:00
|
|
|
|
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
|
|
|
|
|
|
{
|
2024-12-24 18:30:25 +01:00
|
|
|
|
public interface IWinoSynchronizerBase : IBaseSynchronizer
|
2024-11-27 03:01:14 +01:00
|
|
|
|
{
|
|
|
|
|
|
/// <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>
|
2024-12-24 18:30:25 +01:00
|
|
|
|
Task<MailSynchronizationResult> SynchronizeMailsAsync(MailSynchronizationOptions options, CancellationToken cancellationToken = default);
|
2024-11-27 03:01:14 +01:00
|
|
|
|
|
2024-12-27 00:18:46 +01:00
|
|
|
|
Task<CalendarSynchronizationResult> SynchronizeCalendarEventsAsync(CalendarSynchronizationOptions options, CancellationToken cancellationToken = default);
|
|
|
|
|
|
|
2024-11-27 03:01:14 +01:00
|
|
|
|
/// <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);
|
2025-02-15 12:53:32 +01:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 1. Cancel active synchronization.
|
|
|
|
|
|
/// 2. Stop all running tasks.
|
|
|
|
|
|
/// 3. Dispose all resources.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
Task KillSynchronizerAsync();
|
2024-11-27 03:01:14 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|