// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using osu.Game.Online.API; using osu.Framework.Bindables; namespace osu.Game.Database { /// /// Represents a that can download new models from an external source. /// /// The model type. public interface IModelDownloader : IModelManager where TModel : class { /// /// Fired when a download begins. /// This is NOT run on the update thread and should be scheduled. /// IBindable>> DownloadBegan { get; } /// /// Fired when a download is interrupted, either due to user cancellation or failure. /// This is NOT run on the update thread and should be scheduled. /// IBindable>> DownloadFailed { get; } /// /// Checks whether a given is already available in the local store. /// /// The whose existence needs to be checked. /// Whether the exists. bool IsAvailableLocally(TModel model); /// /// Begin a download for the requested . /// /// The to be downloaded. /// Whether this download should be optimised for slow connections. Generally means extras are not included in the download bundle.. /// Whether the download was started. bool Download(TModel model, bool minimiseDownloadSize); /// /// Gets an existing download request if it exists. /// /// The whose request is wanted. /// The object if it exists, otherwise null. ArchiveDownloadRequest GetExistingDownload(TModel model); } }