using MediaBrowser.Common.Events;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Connectivity;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace MediaBrowser.Controller.Library
{
public interface IUserManager
{
///
/// Gets the users.
///
/// The users.
IEnumerable Users { get; }
///
/// Gets the active connections.
///
/// The active connections.
IEnumerable ConnectedUsers { get; }
///
/// Occurs when [playback start].
///
event EventHandler PlaybackStart;
///
/// Occurs when [playback progress].
///
event EventHandler PlaybackProgress;
///
/// Occurs when [playback stopped].
///
event EventHandler PlaybackStopped;
///
/// Occurs when [user updated].
///
event EventHandler> UserUpdated;
///
/// Occurs when [user deleted].
///
event EventHandler> UserDeleted;
///
/// Gets a User by Id
///
/// The id.
/// User.
///
User GetUserById(Guid id);
///
/// Authenticates a User and returns a result indicating whether or not it succeeded
///
/// The user.
/// The password.
/// Task{System.Boolean}.
/// user
Task AuthenticateUser(User user, string password);
///
/// Logs the user activity.
///
/// The user.
/// Type of the client.
/// The device id.
/// Name of the device.
/// Task.
/// user
Task LogUserActivity(User user, ClientType clientType, string deviceId, string deviceName);
///
/// Refreshes metadata for each user
///
/// The cancellation token.
/// if set to true [force].
/// Task.
Task RefreshUsersMetadata(CancellationToken cancellationToken, bool force = false);
///
/// Renames the user.
///
/// The user.
/// The new name.
/// Task.
/// user
///
Task RenameUser(User user, string newName);
///
/// Updates the user.
///
/// The user.
/// user
///
Task UpdateUser(User user);
///
/// Creates the user.
///
/// The name.
/// User.
/// name
///
Task CreateUser(string name);
///
/// Deletes the user.
///
/// The user.
/// Task.
/// user
///
Task DeleteUser(User user);
///
/// Used to report that playback has started for an item
///
/// The user.
/// The item.
/// Type of the client.
/// The device id.
/// Name of the device.
///
void OnPlaybackStart(User user, BaseItem item, ClientType clientType, string deviceId, string deviceName);
///
/// Used to report playback progress for an item
///
/// The user.
/// The item.
/// The position ticks.
/// Type of the client.
/// The device id.
/// Name of the device.
/// Task.
///
Task OnPlaybackProgress(User user, BaseItem item, long? positionTicks, ClientType clientType, string deviceId, string deviceName);
///
/// Used to report that playback has ended for an item
///
/// The user.
/// The item.
/// The position ticks.
/// Type of the client.
/// The device id.
/// Name of the device.
/// Task.
///
Task OnPlaybackStopped(User user, BaseItem item, long? positionTicks, ClientType clientType, string deviceId, string deviceName);
///
/// Saves user data for an item
///
/// The user.
/// The item.
/// The data.
Task SaveUserDataForItem(User user, BaseItem item, UserItemData data);
///
/// Resets the password.
///
/// The user.
/// Task.
Task ResetPassword(User user);
///
/// Changes the password.
///
/// The user.
/// The new password.
/// Task.
Task ChangePassword(User user, string newPassword);
}
}