From a5f97dcaa830e672ed1aad65166719f56d3d4495 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 30 Jun 2013 22:27:50 -0400 Subject: move installation manager down to common --- .../Updates/IInstallationManager.cs | 114 +++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 MediaBrowser.Common/Updates/IInstallationManager.cs (limited to 'MediaBrowser.Common/Updates') diff --git a/MediaBrowser.Common/Updates/IInstallationManager.cs b/MediaBrowser.Common/Updates/IInstallationManager.cs new file mode 100644 index 0000000000..72b581325c --- /dev/null +++ b/MediaBrowser.Common/Updates/IInstallationManager.cs @@ -0,0 +1,114 @@ +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 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 classification. + /// Task{PackageVersionInfo}. + Task GetLatestCompatibleVersion(string name, PackageVersionClass classification = PackageVersionClass.Release); + + /// + /// Gets the latest compatible version. + /// + /// The available packages. + /// The name. + /// The classification. + /// PackageVersionInfo. + PackageVersionInfo GetLatestCompatibleVersion(IEnumerable availablePackages, string name, PackageVersionClass classification = PackageVersionClass.Release); + + /// + /// Gets the available plugin updates including registration info. + /// + /// if set to true [with auto update enabled]. + /// The cancellation token. + /// Task{IEnumerable{PackageVersionInfo}}. + Task> GetAvailablePluginUpdates(bool withAutoUpdateEnabled, CancellationToken cancellationToken); + + /// + /// Gets the available plugin updates from a static resource (not including registration info). + /// + /// if set to true [with auto update enabled]. + /// The cancellation token. + /// Task{IEnumerable{PackageVersionInfo}}. + Task> GetAvailablePluginUpdatesWithoutRegistrationInfo(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); + } +} \ No newline at end of file -- cgit v1.2.3