using MediaBrowser.Common.Events; using MediaBrowser.Common.Plugins; using MediaBrowser.Model.Updates; using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; namespace MediaBrowser.Common.Updates { public interface IInstallationManager : IDisposable { event EventHandler PackageInstalling; event EventHandler PackageInstallationCompleted; event EventHandler PackageInstallationFailed; event EventHandler PackageInstallationCancelled; /// /// The current installations /// List> CurrentInstallations { get; set; } /// /// The completed installations /// ConcurrentBag CompletedInstallations { get; set; } /// /// Occurs when [plugin uninstalled]. /// event EventHandler> PluginUninstalled; /// /// Occurs when [plugin updated]. /// event EventHandler>> PluginUpdated; /// /// Occurs when [plugin updated]. /// event EventHandler> PluginInstalled; /// /// Gets all available packages. /// /// The cancellation token. /// Type of the package. /// The application version. /// Task{List{PackageInfo}}. Task> GetAvailablePackages(CancellationToken cancellationToken, PackageType? packageType = null, Version applicationVersion = null); /// /// Gets all available packages from a static resource. /// /// The cancellation token. /// Task{List{PackageInfo}}. Task> GetAvailablePackagesWithoutRegistrationInfo(CancellationToken cancellationToken); /// /// Gets the package. /// /// The name. /// The classification. /// The version. /// Task{PackageVersionInfo}. Task GetPackage(string name, PackageVersionClass classification, Version version); /// /// Gets the latest compatible version. /// /// The name. /// The current server version. /// The classification. /// Task{PackageVersionInfo}. Task GetLatestCompatibleVersion(string name, Version currentServerVersion, PackageVersionClass classification = PackageVersionClass.Release); /// /// Gets the latest compatible version. /// /// The available packages. /// The name. /// The current server version. /// The classification. /// PackageVersionInfo. PackageVersionInfo GetLatestCompatibleVersion(IEnumerable availablePackages, string name, Version currentServerVersion, PackageVersionClass classification = PackageVersionClass.Release); /// /// Gets the available plugin updates. /// /// The current server version. /// if set to true [with auto update enabled]. /// The cancellation token. /// Task{IEnumerable{PackageVersionInfo}}. Task> GetAvailablePluginUpdates(Version applicationVersion, bool withAutoUpdateEnabled, CancellationToken cancellationToken); /// /// Installs the package. /// /// The package. /// The progress. /// The cancellation token. /// Task. /// package Task InstallPackage(PackageVersionInfo package, IProgress progress, CancellationToken cancellationToken); /// /// Uninstalls a plugin /// /// The plugin. /// void UninstallPlugin(IPlugin plugin); } }