using System; using System.Collections.Generic; using System.Collections.ObjectModel; using Artemis.Core; using Artemis.Core.Modules; using Ninject; namespace Artemis.UI.Shared.Services { public interface IProfileEditorService : IArtemisSharedUIService { Profile SelectedProfile { get; } RenderProfileElement SelectedProfileElement { get; } ILayerProperty SelectedDataBinding { get; } TimeSpan CurrentTime { get; set; } int PixelsPerSecond { get; set; } ReadOnlyCollection RegisteredPropertyEditors { get; } IKernel Kernel { get; } void ChangeSelectedProfile(Profile profile); void UpdateSelectedProfile(); void ChangeSelectedProfileElement(RenderProfileElement profileElement); void UpdateSelectedProfileElement(); void ChangeSelectedDataBinding(ILayerProperty layerProperty); void UpdateProfilePreview(); bool UndoUpdateProfile(); bool RedoUpdateProfile(); ProfileModule GetCurrentModule(); /// /// Occurs when a new profile is selected /// event EventHandler ProfileSelected; /// /// Occurs then the currently selected profile is updated /// event EventHandler SelectedProfileUpdated; /// /// Occurs when a new profile element is selected /// event EventHandler ProfileElementSelected; /// /// Occurs when the currently selected profile element is updated /// event EventHandler SelectedProfileElementUpdated; /// /// Occurs when the currently selected data binding layer property is changed /// event EventHandler SelectedDataBindingChanged; /// /// Occurs when the current editor time is changed /// event EventHandler CurrentTimeChanged; /// /// Occurs when the pixels per second (zoom level) is changed /// event EventHandler PixelsPerSecondChanged; /// /// Occurs when the profile preview has been updated /// event EventHandler ProfilePreviewUpdated; /// /// Registers a new property input view model used in the profile editor for the generic type defined in /// /// Note: Registration will remove itself on plugin disable so you don't have to /// /// /// PropertyInputRegistration RegisterPropertyInput(PluginInfo pluginInfo) where T : PropertyInputViewModel; /// /// Registers a new property input view model used in the profile editor for the generic type defined in /// /// Note: Registration will remove itself on plugin disable so you don't have to /// /// /// /// PropertyInputRegistration RegisterPropertyInput(Type viewModelType, PluginInfo pluginInfo); void RemovePropertyInput(PropertyInputRegistration registration); /// /// Snaps the given time to the closest relevant element in the timeline, this can be the cursor, a keyframe or a /// segment end. /// /// /// How close the time must be to snap /// Enable snapping to timeline segments /// Enable snapping to the current time of the editor /// An optional extra list of times to snap to /// TimeSpan SnapToTimeline(TimeSpan time, TimeSpan tolerance, bool snapToSegments, bool snapToCurrentTime, List snapTimes = null); /// /// If a matching registration is found, creates a new supporting /// PropertyInputViewModel CreatePropertyInputViewModel(LayerProperty layerProperty); } }