jellyfin-server/MediaBrowser.Controller/Notifications/INotificationsRepository.cs

65 lines
2.4 KiB
C#
Raw Normal View History

2014-04-25 20:15:50 +00:00
using MediaBrowser.Model.Notifications;
2013-07-06 21:23:32 +00:00
using System;
using System.Collections.Generic;
2014-04-25 20:15:50 +00:00
using System.Threading;
2013-07-06 21:23:32 +00:00
using System.Threading.Tasks;
namespace MediaBrowser.Controller.Notifications
{
/// <summary>
/// Interface INotificationsRepository
/// </summary>
public interface INotificationsRepository
{
/// <summary>
/// Occurs when [notification added].
/// </summary>
event EventHandler<NotificationUpdateEventArgs> NotificationAdded;
/// <summary>
/// Occurs when [notifications marked read].
/// </summary>
event EventHandler<NotificationReadEventArgs> NotificationsMarkedRead;
2013-09-26 21:20:26 +00:00
2013-07-06 21:23:32 +00:00
/// <summary>
/// Gets the notifications.
/// </summary>
/// <param name="query">The query.</param>
/// <returns>NotificationResult.</returns>
NotificationResult GetNotifications(NotificationQuery query);
/// <summary>
/// Adds the notification.
/// </summary>
/// <param name="notification">The notification.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task AddNotification(Notification notification, CancellationToken cancellationToken);
/// <summary>
/// Marks the read.
/// </summary>
/// <param name="notificationIdList">The notification id list.</param>
/// <param name="userId">The user id.</param>
/// <param name="isRead">if set to <c>true</c> [is read].</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
2014-04-25 20:15:50 +00:00
Task MarkRead(IEnumerable<string> notificationIdList, string userId, bool isRead, CancellationToken cancellationToken);
2013-07-06 21:23:32 +00:00
2014-10-04 18:05:24 +00:00
/// <summary>
/// Marks all read.
/// </summary>
/// <param name="userId">The user identifier.</param>
/// <param name="isRead">if set to <c>true</c> [is read].</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task MarkAllRead(string userId, bool isRead, CancellationToken cancellationToken);
2013-07-06 21:23:32 +00:00
/// <summary>
/// Gets the notifications summary.
/// </summary>
/// <param name="userId">The user id.</param>
/// <returns>NotificationsSummary.</returns>
2014-04-25 20:15:50 +00:00
NotificationsSummary GetNotificationsSummary(string userId);
2013-07-06 21:23:32 +00:00
}
}