// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Game.Online.API; using System; namespace osu.Game.Database { public interface IModelDownloader : IModelManager where TModel : class { /// /// Fired when a download begins. /// event Action> DownloadBegan; /// /// Fired when a download is interrupted, either due to user cancellation or failure. /// event Action> DownloadFailed; bool IsAvailableLocally(TModel model); /// /// Downloads a . /// This will post notifications tracking progress. /// /// The to be downloaded. /// Whether downloading can happen. bool Download(TModel model); /// /// Downloads a with optional parameters for the download request. /// This will post notifications tracking progress. /// /// The to be downloaded. /// Optional parameters to be used for creating the download request. /// Whether downloading can happen. bool Download(TModel model, params object[] extra); /// /// Gets an existing download request if it exists. /// /// The whose request is wanted. /// The object if it exists, otherwise null. ArchiveDownloadModelRequest GetExistingDownload(TModel model); } }