Cleaning up the solution. Separating Shared.WinRT, Services and Synchronization. Removing synchronization from app. Reducing bundle size by 45mb.

This commit is contained in:
Burak Kaan Köse
2024-07-21 05:45:02 +02:00
parent f112f369a7
commit 495885e006
523 changed files with 2254 additions and 2375 deletions

View File

@@ -1,4 +1,6 @@
namespace Wino.Core.Domain using Wino.Domain.Enums;
namespace Wino.Domain
{ {
public static class Constants public static class Constants
{ {
@@ -8,8 +10,35 @@
public const string WinoLocalDraftHeader = "X-Wino-Draft-Id"; public const string WinoLocalDraftHeader = "X-Wino-Draft-Id";
public const string LocalDraftStartPrefix = "localDraft_"; public const string LocalDraftStartPrefix = "localDraft_";
// Toast Notification Keys
public const string ToastMailItemIdKey = nameof(ToastMailItemIdKey); public const string ToastMailItemIdKey = nameof(ToastMailItemIdKey);
public const string ToastMailItemRemoteFolderIdKey = nameof(ToastMailItemRemoteFolderIdKey); public const string ToastMailItemRemoteFolderIdKey = nameof(ToastMailItemRemoteFolderIdKey);
public const string ToastActionKey = nameof(ToastActionKey); public const string ToastActionKey = nameof(ToastActionKey);
// App Configuration
public const AppLanguage DefaultAppLanguage = AppLanguage.English;
public const string SharedFolderName = "WinoShared";
public static char MailCopyUidSeparator = '_';
// GMail Category Labels
public const string FORUMS_LABEL_ID = "FORUMS";
public const string UPDATES_LABEL_ID = "UPDATES";
public const string PROMOTIONS_LABEL_ID = "PROMOTIONS";
public const string SOCIAL_LABEL_ID = "SOCIAL";
public const string PERSONAL_LABEL_ID = "PERSONAL";
public static string[] SubCategoryFolderLabelIds =
[
FORUMS_LABEL_ID,
UPDATES_LABEL_ID,
PROMOTIONS_LABEL_ID,
SOCIAL_LABEL_ID,
PERSONAL_LABEL_ID
];
// File Names
public const string ProtocolLogFileName = "ImapProtocolLog.log";
public const string WinoLogFileName = "WinoDiagnostics.log";
} }
} }

View File

@@ -1,7 +1,7 @@
using System; using System;
using SQLite; using SQLite;
namespace Wino.Core.Domain.Entities namespace Wino.Domain.Entities
{ {
public class AccountSignature public class AccountSignature
{ {

View File

@@ -2,7 +2,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace Wino.Core.Domain.Entities namespace Wino.Domain.Entities
{ {
/// <summary> /// <summary>
/// Back storage for simple name-address book. /// Back storage for simple name-address book.

View File

@@ -1,8 +1,8 @@
using System; using System;
using SQLite; using SQLite;
using Wino.Core.Domain.Enums; using Wino.Domain.Enums;
namespace Wino.Core.Domain.Entities namespace Wino.Domain.Entities
{ {
public class CustomServerInformation public class CustomServerInformation
{ {

View File

@@ -1,8 +1,8 @@
using System; using System;
using SQLite; using SQLite;
using Wino.Core.Domain.Enums; using Wino.Domain.Enums;
namespace Wino.Core.Domain.Entities namespace Wino.Domain.Entities
{ {
public class MailAccount public class MailAccount
{ {

View File

@@ -1,7 +1,7 @@
using System; using System;
using SQLite; using SQLite;
namespace Wino.Core.Domain.Entities namespace Wino.Domain.Entities
{ {
public class MailAccountPreferences public class MailAccountPreferences
{ {

View File

@@ -1,10 +1,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using SQLite; using SQLite;
using Wino.Core.Domain.Enums; using Wino.Domain.Enums;
using Wino.Core.Domain.Models.MailItem; using Wino.Domain.Models.MailItem;
namespace Wino.Core.Domain.Entities namespace Wino.Domain.Entities
{ {
/// <summary> /// <summary>
/// Summary of the parsed MIME messages. /// Summary of the parsed MIME messages.

View File

@@ -2,10 +2,11 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using SQLite; using SQLite;
using Wino.Core.Domain.Enums; using Wino.Domain;
using Wino.Core.Domain.Models.Folders; using Wino.Domain.Enums;
using Wino.Domain.Models.Folders;
namespace Wino.Core.Domain.Entities namespace Wino.Domain.Entities
{ {
[DebuggerDisplay("{FolderName} - {SpecialFolderType}")] [DebuggerDisplay("{FolderName} - {SpecialFolderType}")]
public class MailItemFolder : IMailItemFolder public class MailItemFolder : IMailItemFolder

View File

@@ -1,7 +1,7 @@
using System; using System;
using SQLite; using SQLite;
namespace Wino.Core.Domain.Entities namespace Wino.Domain.Entities
{ {
public class MergedInbox public class MergedInbox
{ {

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
namespace Wino.Core.Domain.Entities namespace Wino.Domain.Entities
{ {
public record SystemFolderConfiguration(MailItemFolder SentFolder, public record SystemFolderConfiguration(MailItemFolder SentFolder,
MailItemFolder DraftFolder, MailItemFolder DraftFolder,

View File

@@ -1,8 +1,8 @@
using System; using System;
using SQLite; using SQLite;
using Wino.Core.Domain.Models.Authentication; using Wino.Domain.Models.Authentication;
namespace Wino.Core.Domain.Entities namespace Wino.Domain.Entities
{ {
public class TokenInformation : TokenInformationBase public class TokenInformation : TokenInformationBase
{ {

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
public enum AccountAttentionReason public enum AccountAttentionReason
{ {

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
public enum AccountCreationDialogState public enum AccountCreationDialogState
{ {

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
/// <summary> /// <summary>
/// Indicates the state of synchronizer. /// Indicates the state of synchronizer.

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
public enum AppLanguage public enum AppLanguage
{ {

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
public enum AppThemeType public enum AppThemeType
{ {

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
public enum ApplicationElementTheme public enum ApplicationElementTheme
{ {

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
public enum BackgroundSynchronizationReason public enum BackgroundSynchronizationReason
{ {

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
public enum ChangeRequestType public enum ChangeRequestType
{ {

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
public enum CustomIncomingServerType public enum CustomIncomingServerType
{ {

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
public enum DraftCreationReason public enum DraftCreationReason
{ {

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
public enum EditorToolbarSectionType public enum EditorToolbarSectionType
{ {

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
public enum FilterOptionType public enum FilterOptionType
{ {

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
/// <summary> /// <summary>
/// Defines all possible folder operations that can be done. /// Defines all possible folder operations that can be done.

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
public enum ImapAuthenticationMethod public enum ImapAuthenticationMethod
{ {

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
public enum ImapConnectionSecurity public enum ImapConnectionSecurity
{ {

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
public enum InfoBarAnimationType public enum InfoBarAnimationType
{ {

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
public enum InfoBarMessageType public enum InfoBarMessageType
{ {

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
public enum MailAttachmentType public enum MailAttachmentType
{ {

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
public enum MailImportance public enum MailImportance
{ {

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
public enum MailListDisplayMode public enum MailListDisplayMode
{ {

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
public enum MailMarkAsOption public enum MailMarkAsOption
{ {

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
// Synchronizer requests. // Synchronizer requests.
public enum MailSynchronizerOperation public enum MailSynchronizerOperation

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
public enum MailProviderType public enum MailProviderType
{ {

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
public enum MenuPaneMode public enum MenuPaneMode
{ {

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
public enum NavigationReferenceFrame public enum NavigationReferenceFrame
{ {

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
/// <summary> /// <summary>
/// Defines the potential reasons for picking folder in the folder picking dialog. /// Defines the potential reasons for picking folder in the folder picking dialog.

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
public enum ReaderFont public enum ReaderFont
{ {

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
public enum SortingOptionType public enum SortingOptionType
{ {

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
public enum SpecialFolderType public enum SpecialFolderType
{ {

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
// From the SDK. // From the SDK.
public enum StorePurchaseResult public enum StorePurchaseResult

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
public enum SynchronizationCompletedState public enum SynchronizationCompletedState
{ {

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
public enum SynchronizationType public enum SynchronizationType
{ {

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
/// <summary> /// <summary>
/// All registered views. /// All registered views.

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Enums namespace Wino.Domain.Enums
{ {
public enum WinoServerConnectionStatus public enum WinoServerConnectionStatus
{ {

View File

@@ -1,6 +1,6 @@
namespace Wino.Core.Domain.Exceptions namespace Wino.Domain.Exceptions
{ {
public class AccountSetupCanceledException : System.Exception public class AccountSetupCanceledException : Exception
{ {
} }

View File

@@ -1,7 +1,7 @@
using System; using System;
using Wino.Core.Domain.Entities; using Wino.Domain.Entities;
namespace Wino.Core.Domain.Exceptions namespace Wino.Domain.Exceptions
{ {
/// <summary> /// <summary>
/// Thrown when IAuthenticator requires user interaction to fix authentication issues. /// Thrown when IAuthenticator requires user interaction to fix authentication issues.

View File

@@ -1,6 +1,6 @@
using System; using System;
namespace Wino.Core.Domain.Exceptions namespace Wino.Domain.Exceptions
{ {
/// <summary> /// <summary>
/// All exceptions related to authentication. /// All exceptions related to authentication.

View File

@@ -1,6 +1,6 @@
using System; using System;
namespace Wino.Core.Domain.Exceptions namespace Wino.Domain.Exceptions
{ {
/// <summary> /// <summary>
/// An exception thrown when the background task execution policies are denied for some reason. /// An exception thrown when the background task execution policies are denied for some reason.

View File

@@ -1,6 +1,6 @@
using System; using System;
namespace Wino.Core.Domain.Exceptions namespace Wino.Domain.Exceptions
{ {
/// <summary> /// <summary>
/// An exception thrown when the background task registration is failed. /// An exception thrown when the background task registration is failed.

View File

@@ -1,6 +1,6 @@
using System; using System;
namespace Wino.Core.Domain.Exceptions namespace Wino.Domain.Exceptions
{ {
/// <summary> /// <summary>
/// Thrown when composer cant find the mime to load. /// Thrown when composer cant find the mime to load.

View File

@@ -1,6 +1,6 @@
using System; using System;
namespace Wino.Core.Domain.Exceptions namespace Wino.Domain.Exceptions
{ {
public class CustomThemeCreationFailedException : Exception public class CustomThemeCreationFailedException : Exception
{ {

View File

@@ -1,6 +1,6 @@
namespace Wino.Core.Domain.Exceptions namespace Wino.Domain.Exceptions
{ {
public class GoogleAuthenticationException : System.Exception public class GoogleAuthenticationException : Exception
{ {
public GoogleAuthenticationException(string message) : base(message) { } public GoogleAuthenticationException(string message) : base(message) { }
} }

View File

@@ -1,6 +1,4 @@
using System; namespace Wino.Domain.Exceptions
namespace Wino.Core.Domain.Exceptions
{ {
public class ImapClientPoolException : Exception public class ImapClientPoolException : Exception
{ {

View File

@@ -1,7 +1,7 @@
using System; using System;
using Wino.Core.Domain.Models.AutoDiscovery; using Wino.Domain.Models.AutoDiscovery;
namespace Wino.Core.Domain.Exceptions namespace Wino.Domain.Exceptions
{ {
public class ImapConnectionFailedPackage public class ImapConnectionFailedPackage
{ {

View File

@@ -1,6 +1,6 @@
using System; using System;
namespace Wino.Core.Domain.Exceptions namespace Wino.Domain.Exceptions
{ {
public class InvalidMoveTargetException : Exception { } public class InvalidMoveTargetException : Exception { }
} }

View File

@@ -1,6 +1,6 @@
using System; using System;
namespace Wino.Core.Domain.Exceptions namespace Wino.Domain.Exceptions
{ {
public class SynchronizerEntityNotFoundException : Exception public class SynchronizerEntityNotFoundException : Exception
{ {

View File

@@ -1,6 +1,6 @@
using System; using System;
namespace Wino.Core.Domain.Exceptions namespace Wino.Domain.Exceptions
{ {
public class SynchronizerException : Exception public class SynchronizerException : Exception
{ {

View File

@@ -1,7 +1,7 @@
namespace Wino.Core.Domain.Exceptions namespace Wino.Domain.Exceptions
{ {
/// <summary> /// <summary>
/// When IMAP account's system folder configuration setup is not done yet. /// When IMAP account's system folder configuration setup is not done yet.
/// </summary> /// </summary>
public class SystemFolderConfigurationMissingException : System.Exception { } public class SystemFolderConfigurationMissingException : Exception { }
} }

View File

@@ -1,7 +1,7 @@
using System; using System;
using Wino.Core.Domain.Enums; using Wino.Domain.Enums;
namespace Wino.Core.Domain.Exceptions namespace Wino.Domain.Exceptions
{ {
/// <summary> /// <summary>
/// Emitted when special folder is needed for an operation but it couldn't be found. /// Emitted when special folder is needed for an operation but it couldn't be found.

View File

@@ -1,8 +1,4 @@
using System; namespace Wino.Domain.Extensions
using System.Collections.Generic;
using System.Text;
namespace Wino.Core.Extensions
{ {
public static class LongExtensions public static class LongExtensions
{ {
@@ -11,34 +7,34 @@ namespace Wino.Core.Extensions
public static string GetBytesReadable(this long i) public static string GetBytesReadable(this long i)
{ {
// Get absolute value // Get absolute value
long absolute_i = (i < 0 ? -i : i); long absolute_i = i < 0 ? -i : i;
// Determine the suffix and readable value // Determine the suffix and readable value
string suffix; string suffix;
double readable; double readable;
if (absolute_i >= 0x1000000000000000) // Exabyte if (absolute_i >= 0x1000000000000000) // Exabyte
{ {
suffix = "EB"; suffix = "EB";
readable = (i >> 50); readable = i >> 50;
} }
else if (absolute_i >= 0x4000000000000) // Petabyte else if (absolute_i >= 0x4000000000000) // Petabyte
{ {
suffix = "PB"; suffix = "PB";
readable = (i >> 40); readable = i >> 40;
} }
else if (absolute_i >= 0x10000000000) // Terabyte else if (absolute_i >= 0x10000000000) // Terabyte
{ {
suffix = "TB"; suffix = "TB";
readable = (i >> 30); readable = i >> 30;
} }
else if (absolute_i >= 0x40000000) // Gigabyte else if (absolute_i >= 0x40000000) // Gigabyte
{ {
suffix = "GB"; suffix = "GB";
readable = (i >> 20); readable = i >> 20;
} }
else if (absolute_i >= 0x100000) // Megabyte else if (absolute_i >= 0x100000) // Megabyte
{ {
suffix = "MB"; suffix = "MB";
readable = (i >> 10); readable = i >> 10;
} }
else if (absolute_i >= 0x400) // Kilobyte else if (absolute_i >= 0x400) // Kilobyte
{ {
@@ -50,7 +46,7 @@ namespace Wino.Core.Extensions
return i.ToString("0 B"); // Byte return i.ToString("0 B"); // Byte
} }
// Divide by 1024 to get fractional value // Divide by 1024 to get fractional value
readable = (readable / 1024); readable = readable / 1024;
// Return formatted number with suffix // Return formatted number with suffix
return readable.ToString("0.# ") + suffix; return readable.ToString("0.# ") + suffix;
} }

View File

@@ -0,0 +1,14 @@
namespace Wino.Domain.Extensions
{
public static class MailkitClientExtensions
{
public static uint ResolveUid(string mailCopyId)
{
var splitted = mailCopyId.Split(Constants.MailCopyUidSeparator);
if (splitted.Length > 1 && uint.TryParse(splitted[1], out uint parsedUint)) return parsedUint;
throw new ArgumentOutOfRangeException(nameof(mailCopyId), mailCopyId, "Invalid mailCopyId format.");
}
}
}

View File

@@ -0,0 +1,22 @@
using MimeKit;
using Wino.Domain;
using Wino.Domain.Entities;
namespace Wino.Domain.Extensions
{
public static class MimeExtensions
{
public static AddressInformation ToAddressInformation(this MailboxAddress address)
{
if (address == null)
return new AddressInformation() { Name = Translator.UnknownSender, Address = Translator.UnknownAddress };
if (string.IsNullOrEmpty(address.Name))
address.Name = address.Address;
return new AddressInformation() { Name = address.Name, Address = address.Address };
}
}
}

View File

@@ -1,7 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace Wino.Core.Domain.Interfaces namespace Wino.Domain.Interfaces
{ {
/// <summary> /// <summary>
/// An interface that should force synchronizer to do synchronization for only given folder ids /// An interface that should force synchronizer to do synchronization for only given folder ids

View File

@@ -1,6 +1,6 @@
using Wino.Core.Domain.Enums; using Wino.Domain.Enums;
namespace Wino.Core.Domain.Interfaces namespace Wino.Domain.Interfaces
{ {
public interface IAccountCreationDialog public interface IAccountCreationDialog
{ {

View File

@@ -1,7 +1,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using Wino.Core.Domain.Entities; using Wino.Domain.Entities;
namespace Wino.Core.Domain.Interfaces namespace Wino.Domain.Interfaces
{ {
public interface IAccountMenuItem : IMenuItem public interface IAccountMenuItem : IMenuItem
{ {

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Interfaces namespace Wino.Domain.Interfaces
{ {
public interface IAccountPickerDialog public interface IAccountPickerDialog
{ {

View File

@@ -1,6 +1,6 @@
using System; using System;
namespace Wino.Core.Domain.Interfaces namespace Wino.Domain.Interfaces
{ {
public interface IAccountProviderDetailViewModel public interface IAccountProviderDetailViewModel
{ {

View File

@@ -1,6 +1,6 @@
using Wino.Core.Domain.Entities; using Wino.Domain.Entities;
namespace Wino.Core.Domain.Interfaces namespace Wino.Domain.Interfaces
{ {
public interface IAccountProviderDetails public interface IAccountProviderDetails
{ {

View File

@@ -1,9 +1,9 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Wino.Core.Domain.Entities; using Wino.Domain.Entities;
namespace Wino.Core.Domain.Interfaces namespace Wino.Domain.Interfaces
{ {
public interface IAccountService public interface IAccountService
{ {

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Interfaces namespace Wino.Domain.Interfaces
{ {
/// <summary> /// <summary>
/// Singleton object that holds the application data folder path and the publisher shared folder path. /// Singleton object that holds the application data folder path and the publisher shared folder path.

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Interfaces namespace Wino.Domain.Interfaces
{ {
public interface IApplicationResourceManager<T> public interface IApplicationResourceManager<T>
{ {

View File

@@ -1,6 +1,6 @@
using Wino.Core.Domain.Enums; using Wino.Domain.Enums;
namespace Wino.Core.Domain.Interfaces namespace Wino.Domain.Interfaces
{ {
public interface IAuthenticationProvider public interface IAuthenticationProvider
{ {

View File

@@ -1,9 +1,9 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Wino.Core.Domain.Entities; using Wino.Domain.Entities;
using Wino.Core.Domain.Enums; using Wino.Domain.Enums;
namespace Wino.Core.Domain.Interfaces namespace Wino.Domain.Interfaces
{ {
public interface IAuthenticator public interface IAuthenticator
{ {

View File

@@ -1,7 +1,7 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Wino.Core.Domain.Models.AutoDiscovery; using Wino.Domain.Models.AutoDiscovery;
namespace Wino.Core.Domain.Interfaces namespace Wino.Domain.Interfaces
{ {
/// <summary> /// <summary>
/// Searches for Auto Discovery settings for custom mail accounts. /// Searches for Auto Discovery settings for custom mail accounts.

View File

@@ -1,12 +1,12 @@
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using MailKit; using MailKit;
using Wino.Core.Domain.Entities; using Wino.Domain.Entities;
using Wino.Core.Domain.Enums; using Wino.Domain.Enums;
using Wino.Core.Domain.Models.MailItem; using Wino.Domain.Models.MailItem;
using Wino.Core.Domain.Models.Synchronization; using Wino.Domain.Models.Synchronization;
namespace Wino.Core.Domain.Interfaces namespace Wino.Domain.Interfaces
{ {
public interface IBaseSynchronizer public interface IBaseSynchronizer
{ {

View File

@@ -1,6 +1,6 @@
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Wino.Core.Domain.Interfaces namespace Wino.Domain.Interfaces
{ {
public interface IClipboardService public interface IClipboardService
{ {

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Interfaces namespace Wino.Domain.Interfaces
{ {
public interface IConfigurationService public interface IConfigurationService
{ {

View File

@@ -1,6 +1,6 @@
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Wino.Core.Domain.Interfaces namespace Wino.Domain.Interfaces
{ {
public interface IConfirmationDialog public interface IConfirmationDialog
{ {

View File

@@ -0,0 +1,12 @@
using MimeKit;
using Wino.Domain.Entities;
namespace Wino.Domain.Interfaces
{
public interface IContactService
{
Task<List<AddressInformation>> GetAddressInformationAsync(string queryText);
Task<AddressInformation> GetAddressInformationByAddressAsync(string address);
Task SaveAddressInformationAsync(MimeMessage message);
}
}

View File

@@ -1,9 +1,9 @@
using System.Collections.Generic; using System.Collections.Generic;
using Wino.Core.Domain.Models.Folders; using Wino.Domain.Models.Folders;
using Wino.Core.Domain.Models.MailItem; using Wino.Domain.Models.MailItem;
using Wino.Core.Domain.Models.Menus; using Wino.Domain.Models.Menus;
namespace Wino.Core.Domain.Interfaces namespace Wino.Domain.Interfaces
{ {
public interface IContextMenuItemService public interface IContextMenuItemService
{ {

View File

@@ -1,9 +1,9 @@
using System.Collections.Generic; using System.Collections.Generic;
using Wino.Core.Domain.Models.Folders; using Wino.Domain.Models.Folders;
using Wino.Core.Domain.Models.MailItem; using Wino.Domain.Models.MailItem;
using Wino.Core.Domain.Models.Menus; using Wino.Domain.Models.Menus;
namespace Wino.Core.Domain.Interfaces namespace Wino.Domain.Interfaces
{ {
public interface IContextMenuProvider public interface IContextMenuProvider
{ {

View File

@@ -1,7 +1,7 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Wino.Core.Domain.Entities; using Wino.Domain.Entities;
namespace Wino.Core.Domain.Interfaces namespace Wino.Domain.Interfaces
{ {
public interface ICustomServerAccountCreationDialog : IAccountCreationDialog public interface ICustomServerAccountCreationDialog : IAccountCreationDialog
{ {

View File

@@ -0,0 +1,9 @@
using SQLite;
namespace Wino.Domain.Interfaces
{
public interface IDatabaseService : IInitializeAsync
{
SQLiteAsyncConnection Connection { get; }
}
}

View File

@@ -0,0 +1,44 @@
using MimeKit;
using Wino.Domain.Entities;
using Wino.Domain.Models.MailItem;
using Wino.Domain.Models.Synchronization;
namespace Wino.Domain.Interfaces
{
/// <summary>
/// Database change processor that handles common operations for all synchronizers.
/// When a synchronizer detects a change, it should call the appropriate method in this class to reflect the change in the database.
/// Different synchronizers might need additional implementations.
/// <see cref="IGmailChangeProcessor"/>, <see cref="IOutlookChangeProcessor"/> and <see cref="IImapChangeProcessor"/>
/// None of the synchronizers can directly change anything in the database.
/// </summary>
public interface IDefaultChangeProcessor
{
Task<string> UpdateAccountDeltaSynchronizationIdentifierAsync(Guid accountId, string deltaSynchronizationIdentifier);
Task CreateAssignmentAsync(Guid accountId, string mailCopyId, string remoteFolderId);
Task DeleteAssignmentAsync(Guid accountId, string mailCopyId, string remoteFolderId);
Task ChangeMailReadStatusAsync(string mailCopyId, bool isRead);
Task ChangeFlagStatusAsync(string mailCopyId, bool isFlagged);
Task<bool> CreateMailAsync(Guid AccountId, NewMailItemPackage package);
Task DeleteMailAsync(Guid accountId, string mailId);
Task<List<MailCopy>> GetDownloadedUnreadMailsAsync(Guid accountId, IEnumerable<string> downloadedMailCopyIds);
Task SaveMimeFileAsync(Guid fileId, MimeMessage mimeMessage, Guid accountId);
Task DeleteFolderAsync(Guid accountId, string remoteFolderId);
Task InsertFolderAsync(MailItemFolder folder);
Task UpdateFolderAsync(MailItemFolder folder);
/// <summary>
/// Returns the list of folders that are available for account.
/// </summary>
/// <param name="accountId">Account id to get folders for.</param>
/// <returns>All folders.</returns>
Task<List<MailItemFolder>> GetLocalFoldersAsync(Guid accountId);
Task<List<MailItemFolder>> GetSynchronizationFoldersAsync(SynchronizationOptions options);
Task<bool> MapLocalDraftAsync(Guid accountId, Guid localDraftCopyUniqueId, string newMailCopyId, string newDraftId, string newThreadId);
Task UpdateFolderLastSyncDateAsync(Guid folderId);
Task<List<MailItemFolder>> GetExistingFoldersAsync(Guid accountId);
}
}

View File

@@ -2,12 +2,12 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Threading.Tasks; using System.Threading.Tasks;
using Wino.Core.Domain.Entities; using Wino.Domain.Entities;
using Wino.Core.Domain.Enums; using Wino.Domain.Enums;
using Wino.Core.Domain.Models.Accounts; using Wino.Domain.Models.Accounts;
using Wino.Core.Domain.Models.Folders; using Wino.Domain.Models.Folders;
namespace Wino.Core.Domain.Interfaces namespace Wino.Domain.Interfaces
{ {
public interface IDialogService public interface IDialogService
{ {

View File

@@ -1,7 +1,7 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Wino.Core.Domain.Interfaces namespace Wino.Domain.Interfaces
{ {
public interface IDispatcher public interface IDispatcher
{ {

View File

@@ -1,7 +1,7 @@
using System.IO; using System.IO;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Wino.Core.Domain.Interfaces namespace Wino.Domain.Interfaces
{ {
public interface IFileService public interface IFileService
{ {

View File

@@ -1,9 +1,9 @@
using System.Collections.Generic; using System.Collections.Generic;
using Wino.Core.Domain.Entities; using Wino.Domain.Entities;
using Wino.Core.Domain.Enums; using Wino.Domain.Enums;
using Wino.Core.Domain.Models.Folders; using Wino.Domain.Models.Folders;
namespace Wino.Core.Domain.Interfaces namespace Wino.Domain.Interfaces
{ {
public interface IFolderMenuItem : IBaseFolderMenuItem public interface IFolderMenuItem : IBaseFolderMenuItem
{ {

View File

@@ -1,14 +1,11 @@
using System; using Wino.Domain.Entities;
using System.Collections.Generic; using Wino.Domain.Enums;
using System.Threading.Tasks; using Wino.Domain.Models.Accounts;
using Wino.Core.Domain.Entities; using Wino.Domain.Models.Folders;
using Wino.Core.Domain.Enums; using Wino.Domain.Models.MailItem;
using Wino.Core.Domain.Models.Accounts; using Wino.Domain.Models.Synchronization;
using Wino.Core.Domain.Models.Folders;
using Wino.Core.Domain.Models.MailItem;
using Wino.Core.Domain.Models.Synchronization;
namespace Wino.Core.Domain.Interfaces namespace Wino.Domain.Interfaces
{ {
public interface IFolderService public interface IFolderService
{ {
@@ -82,7 +79,7 @@ namespace Wino.Core.Domain.Interfaces
/// Returns the active folder menu items for the given account for UI. /// Returns the active folder menu items for the given account for UI.
/// </summary> /// </summary>
/// <param name="accountMenuItem">Account to get folder menu items for.</param> /// <param name="accountMenuItem">Account to get folder menu items for.</param>
Task<IEnumerable<IMenuItem>> GetAccountFoldersForDisplayAsync(IAccountMenuItem accountMenuItem); // Task<IEnumerable<IMenuItem>> GetAccountFoldersForDisplayAsync(IAccountMenuItem accountMenuItem);
/// <summary> /// <summary>
/// Returns a list of unread item counts for the given account ids. /// Returns a list of unread item counts for the given account ids.
@@ -90,5 +87,13 @@ namespace Wino.Core.Domain.Interfaces
/// </summary> /// </summary>
/// <param name="accountIds">Account ids to get unread folder counts for.</param> /// <param name="accountIds">Account ids to get unread folder counts for.</param>
Task<List<UnreadItemCountResult>> GetUnreadItemCountResultsAsync(IEnumerable<Guid> accountIds); Task<List<UnreadItemCountResult>> GetUnreadItemCountResultsAsync(IEnumerable<Guid> accountIds);
Task<List<MailItemFolder>> GetVisibleFoldersAsync(Guid accountId);
/// <summary>
/// Returns the child folders of the given folder.
/// </summary>
/// <param name="accountId">Account id to get folders for.</param>
/// <param name="parentRemoteFolderId">Parent folder id to get children for.</param>
Task<List<MailItemFolder>> GetChildFoldersAsync(Guid accountId, string parentRemoteFolderId);
} }
} }

View File

@@ -1,8 +1,8 @@
using System.Collections.Generic; using System.Collections.Generic;
using Wino.Core.Domain.Enums; using Wino.Domain.Enums;
using Wino.Core.Domain.Models.Reader; using Wino.Domain.Models.Reader;
namespace Wino.Core.Domain.Interfaces namespace Wino.Domain.Interfaces
{ {
public interface IFontService public interface IFontService
{ {

View File

@@ -0,0 +1,4 @@
namespace Wino.Domain.Interfaces
{
public interface IGmailAuthenticator : IAuthenticator { }
}

View File

@@ -0,0 +1,7 @@
namespace Wino.Domain.Interfaces
{
public interface IGmailChangeProcessor : IDefaultChangeProcessor
{
Task MapLocalDraftAsync(string mailCopyId, string newDraftId, string newThreadId);
}
}

View File

@@ -0,0 +1,11 @@
namespace Wino.Domain.Interfaces
{
public interface IHtmlPreviewer
{
/// <summary>
/// Returns a preview of the HTML content.
/// </summary>
/// <param name="htmlContent">HTML content</param>
string GetHtmlPreview(string htmlContent);
}
}

View File

@@ -0,0 +1,11 @@
namespace Wino.Domain.Interfaces
{
public interface IImapChangeProcessor : IDefaultChangeProcessor
{
/// <summary>
/// Returns all known uids for the given folder.
/// </summary>
/// <param name="folderId">Folder id to retrieve uIds for.</param>
Task<IList<uint>> GetKnownUidsForFolderAsync(Guid folderId);
}
}

View File

@@ -1,7 +1,7 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Wino.Core.Domain.Entities; using Wino.Domain.Entities;
namespace Wino.Core.Domain.Interfaces namespace Wino.Domain.Interfaces
{ {
public interface IImapTestService public interface IImapTestService
{ {

View File

@@ -1,6 +1,6 @@
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Wino.Core.Domain.Interfaces namespace Wino.Domain.Interfaces
{ {
/// <summary> /// <summary>
/// An interface that all startup services must implement. /// An interface that all startup services must implement.

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Interfaces namespace Wino.Domain.Interfaces
{ {
public interface IKeyPressService public interface IKeyPressService
{ {

View File

@@ -1,6 +1,6 @@
using System.Collections.Specialized; using System.Collections.Specialized;
namespace Wino.Core.Domain.Interfaces namespace Wino.Domain.Interfaces
{ {
public interface ILaunchProtocolService public interface ILaunchProtocolService
{ {

View File

@@ -1,4 +1,4 @@
namespace Wino.Core.Domain.Interfaces namespace Wino.Domain.Interfaces
{ {
public interface ILogInitializer public interface ILogInitializer
{ {

Some files were not shown because too many files have changed in this diff Show More