More abstractions
This commit is contained in:
7
Wino.Core.Domain/Interfaces/IBaseCalendarSynchronizer.cs
Normal file
7
Wino.Core.Domain/Interfaces/IBaseCalendarSynchronizer.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Wino.Core.Domain.Interfaces
|
||||
{
|
||||
public interface IBaseCalendarSynchronizer : IBaseSynchronizer
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
30
Wino.Core.Domain/Interfaces/IBaseMailSynchronizer.cs
Normal file
30
Wino.Core.Domain/Interfaces/IBaseMailSynchronizer.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
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 IBaseMailSynchronizer : IBaseSynchronizer
|
||||
{
|
||||
/// <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>
|
||||
Task<SynchronizationResult> SynchronizeAsync(SynchronizationOptions options, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <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);
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,11 @@
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MailKit;
|
||||
using System.Threading.Tasks;
|
||||
using Wino.Core.Domain.Entities.Shared;
|
||||
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 IBaseMailSynchronizer
|
||||
public interface IBaseSynchronizer
|
||||
{
|
||||
/// <summary>
|
||||
/// Account that is assigned for this synchronizer.
|
||||
@@ -33,30 +29,11 @@ namespace Wino.Core.Domain.Interfaces
|
||||
/// <returns>Whether active synchronization is stopped or not.</returns>
|
||||
bool CancelActiveSynchronization();
|
||||
|
||||
/// <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>
|
||||
Task<SynchronizationResult> SynchronizeAsync(SynchronizationOptions options, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <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();
|
||||
|
||||
/// <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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user