// Copyright (c) Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
using FlaxEngine;
using FlaxEngine.GUI;
namespace FlaxEditor.GUI
{
///
/// Interface for keyframes/curves editors.
///
[HideInEditor]
public interface IKeyframesEditor
{
///
/// Gets or sets the keyframes editor collection used by this editor.
///
IKeyframesEditorContext KeyframesEditorContext { get; set; }
///
/// Called when keyframes selection should be cleared for editor.
///
/// The source editor.
void OnKeyframesDeselect(IKeyframesEditor editor);
///
/// Called when keyframes selection rectangle gets updated.
///
/// The source editor.
/// The source selection control.
/// The source selection rectangle (in source control local space).
void OnKeyframesSelection(IKeyframesEditor editor, ContainerControl control, Rectangle selection);
///
/// Called to calculate the total amount of selected keyframes in the editor.
///
/// The selected keyframes amount.
int OnKeyframesSelectionCount();
///
/// Called when keyframes selection should be deleted for all editors.
///
/// The source editor.
void OnKeyframesDelete(IKeyframesEditor editor);
///
/// Called when keyframes selection should be moved.
///
/// The source editor.
/// The source movement control.
/// The source movement location (in source control local space).
/// The movement start flag.
/// The movement end flag.
void OnKeyframesMove(IKeyframesEditor editor, ContainerControl control, Float2 location, bool start, bool end);
///
/// Called when keyframes selection should be copied.
///
/// The source editor.
/// The additional time offset to apply to the copied keyframes (optional).
/// The result copy data text stream.
void OnKeyframesCopy(IKeyframesEditor editor, float? timeOffset, System.Text.StringBuilder data);
///
/// Called when keyframes should be pasted (from clipboard).
///
/// The source editor.
/// The additional time offset to apply to the pasted keyframes (optional).
/// The pasted data text.
/// The counter for the current data index. Set to -1 until the calling editor starts paste operation.
void OnKeyframesPaste(IKeyframesEditor editor, float? timeOffset, string[] datas, ref int index);
///
/// Called when collecting keyframes from the context.
///
/// The name of the track.
/// The getter function to call for all keyframes. Args are: track name, keyframe time, keyframe object.
void OnKeyframesGet(string trackName, Action get);
///
/// Called when setting keyframes data (opposite to ).
///
/// The list of keyframes, null for empty list. Keyframe data is: time and keyframe object.
void OnKeyframesSet(List> keyframes);
}
}