using System.Threading.Tasks;
using UnityEngine;

namespace SC.XR.Unity
{
    public interface IProgressIndicator
    {
        /// <summary>
        /// Used to determine whether it's appropriate to use this indicator.
        /// </summary>
        ProgressIndicatorState State { get; }

        /// <summary>
        /// Loading progress value from 0 (just started) to 1 (complete)
        /// </summary>
        float Progress { get; set; }

        /// <summary>
        /// Opens the progress indicator before loading begins. Method is async to allow for animation to begin before loading.
        /// </summary>
        Task OpenAsync();

        /// <summary>
        /// Returns after progress indicator completes its opening or closing transition.
        /// </summary>
        Task AwaitTransitionAsync();

        /// <summary>
        /// Closes the progress indicator after loading is finished. Method is async to allow for animation to complete.
        /// </summary>
        Task CloseAsync();

        /// <summary>
        /// Set the progress value of the progress indicator.
        /// </summary>
        void SetProgress(float progress);
    }
}