jellyfin-server/MediaBrowser.Controller/Devices/IDeviceManager.cs

98 lines
3.6 KiB
C#
Raw Normal View History

2014-10-11 20:38:13 +00:00
using MediaBrowser.Model.Devices;
2014-10-13 20:14:53 +00:00
using MediaBrowser.Model.Events;
2014-12-13 03:56:30 +00:00
using MediaBrowser.Model.Querying;
2014-10-11 20:38:13 +00:00
using MediaBrowser.Model.Session;
2014-10-13 20:14:53 +00:00
using System;
2014-10-11 20:38:13 +00:00
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
namespace MediaBrowser.Controller.Devices
{
public interface IDeviceManager
{
2014-10-13 20:14:53 +00:00
/// <summary>
/// Occurs when [device options updated].
/// </summary>
event EventHandler<GenericEventArgs<DeviceInfo>> DeviceOptionsUpdated;
2014-10-11 20:38:13 +00:00
/// <summary>
/// Registers the device.
/// </summary>
/// <param name="reportedId">The reported identifier.</param>
/// <param name="name">The name.</param>
2014-10-12 01:46:02 +00:00
/// <param name="appName">Name of the application.</param>
2014-10-11 20:38:13 +00:00
/// <param name="usedByUserId">The used by user identifier.</param>
/// <returns>Task.</returns>
2014-10-13 20:14:53 +00:00
Task<DeviceInfo> RegisterDevice(string reportedId, string name, string appName, string usedByUserId);
2014-10-11 20:38:13 +00:00
/// <summary>
/// Saves the capabilities.
/// </summary>
/// <param name="reportedId">The reported identifier.</param>
/// <param name="capabilities">The capabilities.</param>
/// <returns>Task.</returns>
Task SaveCapabilities(string reportedId, ClientCapabilities capabilities);
/// <summary>
/// Gets the capabilities.
/// </summary>
/// <param name="reportedId">The reported identifier.</param>
/// <returns>ClientCapabilities.</returns>
ClientCapabilities GetCapabilities(string reportedId);
/// <summary>
/// Gets the device information.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>DeviceInfo.</returns>
DeviceInfo GetDevice(string id);
/// <summary>
2014-10-13 20:14:53 +00:00
/// Updates the device information.
/// </summary>
/// <param name="id">The identifier.</param>
/// <param name="options">The options.</param>
/// <returns>Task.</returns>
Task UpdateDeviceInfo(string id, DeviceOptions options);
/// <summary>
2014-10-11 20:38:13 +00:00
/// Gets the devices.
/// </summary>
2014-12-13 03:56:30 +00:00
/// <param name="query">The query.</param>
2014-10-11 20:38:13 +00:00
/// <returns>IEnumerable&lt;DeviceInfo&gt;.</returns>
2014-12-13 03:56:30 +00:00
QueryResult<DeviceInfo> GetDevices(DeviceQuery query);
2014-10-11 20:38:13 +00:00
/// <summary>
/// Deletes the device.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>Task.</returns>
Task DeleteDevice(string id);
/// <summary>
/// Gets the upload history.
/// </summary>
/// <param name="deviceId">The device identifier.</param>
/// <returns>ContentUploadHistory.</returns>
ContentUploadHistory GetCameraUploadHistory(string deviceId);
/// <summary>
/// Accepts the upload.
/// </summary>
/// <param name="deviceId">The device identifier.</param>
/// <param name="stream">The stream.</param>
/// <param name="file">The file.</param>
/// <returns>Task.</returns>
Task AcceptCameraUpload(string deviceId, Stream stream, LocalFileInfo file);
2014-12-29 20:18:48 +00:00
/// <summary>
/// Determines whether this instance [can access device] the specified user identifier.
/// </summary>
/// <param name="userId">The user identifier.</param>
/// <param name="deviceId">The device identifier.</param>
/// <returns><c>true</c> if this instance [can access device] the specified user identifier; otherwise, <c>false</c>.</returns>
bool CanAccessDevice(string userId, string deviceId);
2014-10-11 20:38:13 +00:00
}
}