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
{
///
/// Interface IUserManager
///
public interface IUserManager
{
///
/// Gets the users.
///
/// The users.
IEnumerable Users { get; }
///
/// Gets the active connections.
///
/// The active connections.
IEnumerable RecentConnections { 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, string 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, string 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, string 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, string clientType, string deviceId, string deviceName);
///
/// 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);
///
/// Saves the user data.
///
/// The user id.
/// The user data id.
/// The user data.
/// The cancellation token.
/// Task.
Task SaveUserData(Guid userId, Guid userDataId, UserItemData userData,
CancellationToken cancellationToken);
///
/// Gets the user data.
///
/// The user id.
/// The user data id.
/// Task{UserItemData}.
Task GetUserData(Guid userId, Guid userDataId);
}
}