2026-03-01 12:07:15 +01:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2026-02-21 10:53:39 +01:00
|
|
|
using System.Threading.Tasks;
|
2024-11-10 23:28:25 +01:00
|
|
|
using Wino.Core.Domain.Entities.Shared;
|
2024-08-05 00:36:26 +02:00
|
|
|
using Wino.Core.Domain.Enums;
|
2024-08-17 03:43:37 +02:00
|
|
|
using Wino.Core.Domain.Models.Accounts;
|
2024-08-05 00:36:26 +02:00
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
namespace Wino.Core.Domain.Interfaces;
|
|
|
|
|
|
|
|
|
|
public interface IBaseSynchronizer
|
2024-08-05 00:36:26 +02:00
|
|
|
{
|
2025-02-16 11:54:23 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// Account that is assigned for this synchronizer.
|
|
|
|
|
/// </summary>
|
|
|
|
|
MailAccount Account { get; }
|
2024-08-05 00:36:26 +02:00
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// Synchronizer state.
|
|
|
|
|
/// </summary>
|
|
|
|
|
AccountSynchronizerState State { get; }
|
2024-08-05 00:36:26 +02:00
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// Queues a single request to be executed in the next synchronization.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="request">Request to queue.</param>
|
|
|
|
|
void QueueRequest(IRequestBase request);
|
2024-08-05 00:36:26 +02:00
|
|
|
|
2026-02-21 10:53:39 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// Returns whether there is an in-progress (queued or currently executing) operation for the given mail unique id.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="mailUniqueId">Mail unique id to check.</param>
|
|
|
|
|
bool HasPendingOperation(Guid mailUniqueId);
|
|
|
|
|
|
2026-03-01 12:07:15 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// Returns mail unique ids that currently have queued or executing operations.
|
|
|
|
|
/// </summary>
|
|
|
|
|
IReadOnlyCollection<Guid> GetPendingOperationUniqueIds();
|
|
|
|
|
|
2026-02-21 10:53:39 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// Returns whether there is an in-progress (queued or currently executing) operation for the given calendar item id.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="calendarItemId">Calendar item id to check.</param>
|
|
|
|
|
bool HasPendingCalendarOperation(Guid calendarItemId);
|
|
|
|
|
|
2026-04-07 16:48:46 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// Returns calendar item ids that currently have queued or executing operations.
|
|
|
|
|
/// </summary>
|
|
|
|
|
IReadOnlyCollection<Guid> GetPendingCalendarOperationIds();
|
|
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
/// <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();
|
2024-08-05 00:36:26 +02:00
|
|
|
}
|