Calendar attachments.

This commit is contained in:
Burak Kaan Köse
2026-01-03 23:59:37 +01:00
parent c8ef031e7d
commit 4603b1fb14
20 changed files with 758 additions and 21 deletions
@@ -0,0 +1,55 @@
using System;
using SQLite;
using Wino.Core.Domain.Enums;
namespace Wino.Core.Domain.Entities.Calendar;
/// <summary>
/// Represents metadata for calendar event attachments.
/// Actual file content is downloaded on-demand.
/// </summary>
public class CalendarAttachment
{
[PrimaryKey]
public Guid Id { get; set; }
/// <summary>
/// The calendar item this attachment belongs to.
/// </summary>
public Guid CalendarItemId { get; set; }
/// <summary>
/// Remote identifier for the attachment from the provider (Outlook, Gmail, etc.).
/// </summary>
public string RemoteAttachmentId { get; set; }
/// <summary>
/// File name of the attachment.
/// </summary>
public string FileName { get; set; }
/// <summary>
/// Size of the attachment in bytes.
/// </summary>
public long Size { get; set; }
/// <summary>
/// MIME content type (e.g., "application/pdf", "image/png").
/// </summary>
public string ContentType { get; set; }
/// <summary>
/// Whether the attachment has been downloaded to local storage.
/// </summary>
public bool IsDownloaded { get; set; }
/// <summary>
/// Local file path where the attachment is stored (if downloaded).
/// </summary>
public string LocalFilePath { get; set; }
/// <summary>
/// When the attachment was last modified.
/// </summary>
public DateTimeOffset LastModified { get; set; }
}
@@ -54,4 +54,28 @@ public interface ICalendarService
/// Gets predefined reminder options in minutes (1 Hour, 30 Min, 15 Min, 5 Min, 1 Min).
/// </summary>
int[] GetPredefinedReminderMinutes();
#region Attachments
/// <summary>
/// Gets all attachments for a calendar event.
/// </summary>
Task<List<CalendarAttachment>> GetAttachmentsAsync(Guid calendarItemId);
/// <summary>
/// Inserts or updates calendar attachments.
/// </summary>
Task InsertOrReplaceAttachmentsAsync(List<CalendarAttachment> attachments);
/// <summary>
/// Marks an attachment as downloaded and updates its local file path.
/// </summary>
Task MarkAttachmentDownloadedAsync(Guid attachmentId, string localFilePath);
/// <summary>
/// Deletes all attachments for a calendar item.
/// </summary>
Task DeleteAttachmentsAsync(Guid calendarItemId);
#endregion
}
@@ -22,4 +22,9 @@ public interface INativeAppService
/// This is used to display WAM broker dialog on running UWP app called by a windowless server code.
/// </summary>
Func<IntPtr> GetCoreWindowHwnd { get; set; }
/// <summary>
/// Gets the folder path where calendar attachments are stored.
/// </summary>
string GetCalendarAttachmentsFolderPath();
}
@@ -2,6 +2,7 @@
using System.Threading;
using System.Threading.Tasks;
using MailKit;
using Wino.Core.Domain.Entities.Calendar;
using Wino.Core.Domain.Entities.Mail;
using Wino.Core.Domain.Models.Folders;
using Wino.Core.Domain.Models.Synchronization;
@@ -46,4 +47,5 @@ public interface IWinoSynchronizerBase : IBaseSynchronizer
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>Search results after downloading missing mail copies from server.</returns>
Task<List<MailCopy>> OnlineSearchAsync(string queryText, List<IMailItemFolder> folders, CancellationToken cancellationToken = default);
Task DownloadCalendarAttachmentAsync(CalendarItem calendarItem, CalendarAttachment attachment, string localFilePath, CancellationToken cancellationToken);
}
@@ -112,6 +112,13 @@
"CalendarEventDetails_ReadOnlyEvent": "Read-only event",
"CalendarEventDetails_Reminder": "Reminder",
"CalendarEventDetails_ShowAs": "Show as",
"CalendarEventResponse_Accept": "Accept",
"CalendarEventResponse_AcceptedResponse": "Accepted",
"CalendarEventResponse_Decline": "Decline",
"CalendarEventResponse_DeclinedResponse": "Declined",
"CalendarEventResponse_NotResponded": "Not Responded",
"CalendarEventResponse_Tentative": "Tentative",
"CalendarEventResponse_TentativeResponse": "Tentatively Accepted",
"CalendarItem_DetailsPopup_JoinOnline": "Join online",
"CalendarItem_DetailsPopup_ViewEventButton": "View event",
"CalendarItem_DetailsPopup_ViewSeriesButton": "View series",