using System; using System.Collections.Generic; using Artemis.Storage.Entities.Profile; namespace Artemis.Core { /// /// Represents a property on a layer. Properties are saved in storage and can optionally be modified from the UI. /// /// Note: You cannot initialize layer properties yourself. If properly placed and annotated, the Artemis core will /// initialize these for you. /// /// public interface ILayerProperty : IStorageModel, IDisposable { /// /// Gets the description attribute applied to this property /// PropertyDescriptionAttribute PropertyDescription { get; } /// /// The parent group of this layer property, set after construction /// LayerPropertyGroup LayerPropertyGroup { get; } /// /// Gets the unique path of the property on the layer /// string Path { get; } /// /// Gets the type of the property /// Type PropertyType { get; } /// /// Initializes the layer property /// /// Note: This isn't done in the constructor to keep it parameterless which is easier for implementations of /// /// /// void Initialize(RenderProfileElement profileElement, LayerPropertyGroup group, PropertyEntity entity, bool fromStorage, PropertyDescriptionAttribute description, string path); /// /// Returns a list off all data binding registrations /// List GetAllDataBindingRegistrations(); /// /// Attempts to load and add the provided keyframe entity to the layer property /// /// The entity representing the keyframe to add /// If succeeded the resulting keyframe, otherwise ILayerPropertyKeyframe? AddKeyframeEntity(KeyframeEntity keyframeEntity); /// /// Updates the layer properties internal state /// /// The timeline to apply to the property void Update(Timeline timeline); #region Events /// /// Occurs when the layer property is disposed /// public event EventHandler Disposed; /// /// Occurs once every frame when the layer property is updated /// public event EventHandler? Updated; /// /// Occurs when the current value of the layer property was updated by some form of input /// public event EventHandler? CurrentValueSet; /// /// Occurs when the visibility value of the layer property was updated /// public event EventHandler? VisibilityChanged; /// /// Occurs when keyframes are enabled/disabled /// public event EventHandler? KeyframesToggled; /// /// Occurs when a new keyframe was added to the layer property /// public event EventHandler? KeyframeAdded; /// /// Occurs when a keyframe was removed from the layer property /// public event EventHandler? KeyframeRemoved; /// /// Occurs when a data binding has been enabled /// public event EventHandler? DataBindingEnabled; /// /// Occurs when a data binding has been disabled /// public event EventHandler? DataBindingDisabled; #endregion } }