// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Input
{
///
/// Implements the Gaze Provider for an Input Source.
///
public interface IMixedRealityEyeGazeProvider : IMixedRealityGazeProvider
{
///
/// Whether eye tracking data is currently been used for gaze rather then head pose. Eye Tracking must be both enabled and have valid data.
///
bool IsEyeTrackingEnabledAndValid { get; }
///
/// Whether eye tracking data is available. It may be unavailable due to timeout or lack of tracking hardware or permissions.
///
bool IsEyeTrackingDataValid { get; }
///
/// Whether the user is eye calibrated. It returns 'null', if the value has not yet received data from the eye tracking system.
///
bool? IsEyeCalibrationValid { get; }
///
/// The most recent eye tracking ray
///
Ray LatestEyeGaze { get; }
///
/// If true, eye-based tracking will be used when available.
/// This field does not control whether eye tracking data is provided.
///
///
/// The usage of eye-based tracking depends on having the Gaze Input permission set
/// and user approved, along with proper device eye calibration. This will fallback to head-based
/// gaze when eye-based tracking is not available.
///
bool IsEyeTrackingEnabled { get; set; }
///
/// DateTime in UTC when the signal was last updated.
///
DateTime Timestamp { get; }
///
/// Tells the eye gaze provider that eye gaze has updated.
///
/// The provider raising the event.
///
/// This method is to be called by implementations of the interface, not by application code.
///
void UpdateEyeGaze(IMixedRealityEyeGazeDataProvider provider, Ray eyeRay, DateTime timestamp);
///
/// Tells the eye gaze provider about the eye tracking status (e.g., whether the user is calibrated);
///
/// The provider raising the event.
/// Boolean whether the user is eye calibrated or not.
///
/// Note that this function is not invoked when eye tracking is lost - use IsEyeTrackingAvailable
/// to detect when eye tracking is lost.
///
void UpdateEyeTrackingStatus(IMixedRealityEyeGazeDataProvider provider, bool userIsEyeCalibrated);
}
}