using System;
using Unity.Cloud.Collaborate.Models.Structures;
using JetBrains.Annotations;
namespace Unity.Cloud.Collaborate.Models
{
internal interface IMainModel : IModel
{
///
/// Signal when the local state switches between conflicted or not.
///
event Action ConflictStatusChange;
///
/// Signal when an operation with progress has started or stopped.
///
event Action OperationStatusChange;
///
/// Signal with incremental details of the operation in progress.
///
event Action OperationProgressChange;
///
/// Signal when an error has occurred.
///
event Action ErrorOccurred;
///
/// Signal when the error has cleared.
///
event Action ErrorCleared;
///
/// Signal whether or not the there are remote revisions to be fetched.
///
event Action RemoteRevisionsAvailabilityChange;
///
/// Signal when the state of the back button is updated. For example: clearing it or showing a new one.
/// The string included is the new label for the back navigation button. If that value is null, clear the back
/// navigation.
///
event Action BackButtonStateUpdated;
///
/// Returns true if there are remote revisions available.
///
bool RemoteRevisionsAvailable { get; }
///
/// Returns true if there's a conflict locally.
///
bool Conflicted { get; }
///
/// Returns progress info if there is any.
///
[CanBeNull]
IProgressInfo ProgressInfo { get; }
///
/// Returns error info if there is any.
///
[CanBeNull]
IErrorInfo ErrorInfo { get; }
///
/// Current tab index being displayed.
///
int CurrentTabIndex { get; set; }
///
/// Returns a history model.
///
/// Singleton history model for this main model.
[NotNull]
IHistoryModel ConstructHistoryModel();
///
/// Returns a Changes model.
///
/// Singleton change model for this main model.
[NotNull]
IChangesModel ConstructChangesModel();
///
/// Clears any set error.
///
void ClearError();
///
/// Sync to latest revision.
///
void RequestSync();
///
/// Request cancel current job.
///
void RequestCancelJob();
///
/// Returns the current back navigation. Null if none exists presently.
///
/// Current back navigation id, text, and action.
(string id, string text, Action backAction)? GetBackNavigation();
///
/// Register back navigation to be made available to the user to navigate backwards in the UI.
///
/// Id for the back event.
/// Text for the back label.
/// Action to perform to go back.
void RegisterBackNavigation(string id, string text, Action backAction);
///
/// Unregister back navigation if the given id matches the currently displayed back navigation.
///
/// Id for the back event.
/// True if id matched.
bool UnregisterBackNavigation(string id);
}
}