// 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 System.Collections.Generic; using System.Threading.Tasks; using osu.Game.Overlays.Notifications; namespace osu.Game.Database { /// /// A class which handles importing of associated models to the game store. /// /// The model type. public interface IModelImporter : IPostNotifications, ICanAcceptFiles where TModel : class, IHasGuidPrimaryKey { /// /// Process multiple import tasks, updating a tracking notification with progress. /// /// The notification to update. /// The import tasks. /// Parameters to further configure the import process. /// The imported models. Task>> Import(ProgressNotification notification, ImportTask[] tasks, ImportParameters parameters = default); /// /// Process a single import as an update for an existing model. /// This will still run a full import, but perform any post-processing required to make it feel like an update to the user. /// /// The notification to update. /// The import task. /// The original model which is being updated. /// The imported model. Task?> ImportAsUpdate(ProgressNotification notification, ImportTask task, TModel original); /// /// Mount all files for a to a temporary directory to allow for external editing. /// /// /// When editing is completed, call to begin the import-and-update process. /// /// The to mount. public Task> BeginExternalEditing(TModel model); /// /// A user displayable name for the model type associated with this manager. /// string HumanisedModelName => $"{typeof(TModel).Name.Replace(@"Info", "").ToLowerInvariant()}"; /// /// Fired when the user requests to view the resulting import. /// public Action>>? PresentImport { set; } } }