using System; using System.Collections.Generic; using Artemis.Core.Annotations; using Artemis.Core.Models.Profile.Conditions; using Artemis.Core.Plugins; using Artemis.Core.Plugins.DataModelExpansions; using Newtonsoft.Json; namespace Artemis.Core.Services.Interfaces { public interface IDataModelService : IArtemisService { IReadOnlyCollection RegisteredConditionOperators { get; } IReadOnlyCollection DataModelExpansions { get; } /// /// Add an expansion to the datamodel to be available for use after the next update /// /// void AddExpansion(DataModel baseDataModelExpansion); /// /// Remove a previously added expansion so that it is no longer available and updated /// /// void RemoveExpansion(DataModel baseDataModelExpansion); /// /// If found, returns the data model of the provided plugin /// /// Should be a module with a data model or a data model expansion DataModel GetPluginDataModel(Plugin plugin); /// /// If found, returns the data model of the provided plugin /// /// Should be a module with a data model or a data model expansion DataModel GetPluginDataModelByGuid(Guid pluginGuid); /// /// Determines whether the given plugin expands the main data model /// /// /// bool GetPluginExtendsDataModel(Plugin plugin); /// /// Registers a new condition operator for use in layer conditions /// /// The PluginInfo of the plugin this condition operator belongs to /// The condition operator to register void RegisterConditionOperator([NotNull] PluginInfo pluginInfo, [NotNull] DisplayConditionOperator displayConditionOperator); /// /// Removes a condition operator so it is no longer available for use in layer conditions /// /// The layer condition operator to remove void RemoveConditionOperator([NotNull] DisplayConditionOperator displayConditionOperator); List GetCompatibleConditionOperators(Type type); DisplayConditionOperator GetConditionOperator(Guid operatorPluginGuid, string operatorType); void LogPredicateDeserializationFailure(DisplayConditionPredicate displayConditionPredicate, JsonException exception); void LogListPredicateDeserializationFailure(DisplayConditionListPredicate displayConditionListPredicate, JsonException exception); } }